cps-bi-sdk 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -445,7 +445,7 @@ You might need to use a local HTTP server (instead of file://): https://react.de
|
|
|
445
445
|
`,sQ=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],K$={};let ni;function cQ(e,n=!1){const a=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(n&&K$[a])return K$[a];const l=window.getComputedStyle(e),c=l.getPropertyValue("box-sizing")||l.getPropertyValue("-moz-box-sizing")||l.getPropertyValue("-webkit-box-sizing"),u=parseFloat(l.getPropertyValue("padding-bottom"))+parseFloat(l.getPropertyValue("padding-top")),p=parseFloat(l.getPropertyValue("border-bottom-width"))+parseFloat(l.getPropertyValue("border-top-width")),S={sizingStyle:sQ.map(v=>`${v}:${l.getPropertyValue(v)}`).join(";"),paddingSize:u,borderSize:p,boxSizing:c};return n&&a&&(K$[a]=S),S}function uQ(e,n=!1,a=null,l=null){ni||(ni=document.createElement("textarea"),ni.setAttribute("tab-index","-1"),ni.setAttribute("aria-hidden","true"),ni.setAttribute("name","hiddenTextarea"),document.body.appendChild(ni)),e.getAttribute("wrap")?ni.setAttribute("wrap",e.getAttribute("wrap")):ni.removeAttribute("wrap");const{paddingSize:c,borderSize:u,boxSizing:p,sizingStyle:m}=cQ(e,n);ni.setAttribute("style",`${m};${iQ}`),ni.value=e.value||e.placeholder||"";let S,v,C,x=ni.scrollHeight;if(p==="border-box"?x+=u:p==="content-box"&&(x-=c),a!==null||l!==null){ni.value=" ";const M=ni.scrollHeight-c;a!==null&&(S=M*a,p==="border-box"&&(S=S+c+u),x=Math.max(S,x)),l!==null&&(v=M*l,p==="border-box"&&(v=v+c+u),C=x>v?"":"hidden",x=Math.min(v,x))}const w={height:x,overflowY:C,resize:"none"};return S&&(w.minHeight=S),v&&(w.maxHeight=v),w}function PO(){return PO=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},PO.apply(this,arguments)}const Q$=0,Z$=1,J$=2,dQ=y.forwardRef((e,n)=>{const{prefixCls:a,defaultValue:l,value:c,autoSize:u,onResize:p,className:m,style:S,disabled:v,onChange:C,onInternalAutoSize:x,...w}=e,[M,N]=ja(l,c),T=M??"",$=re=>{N(re.target.value),C?.(re)},z=y.useRef();y.useImperativeHandle(n,()=>({textArea:z.current}));const[D,A]=y.useMemo(()=>u&&typeof u=="object"?[u.minRows,u.maxRows]:[],[u]),I=!!u,[j,V]=y.useState(J$),[B,L]=y.useState(),P=()=>{V(Q$),process.env.NODE_ENV==="test"&&x?.()};xo(()=>{I&&P()},[c,D,A,I]),xo(()=>{if(j===Q$)V(Z$);else if(j===Z$){const re=uQ(z.current,!1,D,A);V(J$),L(re)}},[j]);const G=y.useRef(),F=()=>{_n.cancel(G.current)},W=re=>{j===J$&&(p?.(re),u&&(F(),G.current=_n(()=>{P()})))};y.useEffect(()=>F,[]);const ne={...S,...I?B:null};return(j===Q$||j===Z$)&&(ne.overflowY="hidden",ne.overflowX="hidden"),y.createElement(Us,{onResize:W,disabled:!(u||p)},y.createElement("textarea",PO({},w,{ref:z,style:ne,className:me(a,m,{[`${a}-disabled`]:v}),disabled:v,value:T,onChange:$})))});function UO(){return UO=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},UO.apply(this,arguments)}const fQ=_.forwardRef(({defaultValue:e,value:n,onFocus:a,onBlur:l,onChange:c,allowClear:u,maxLength:p,onCompositionStart:m,onCompositionEnd:S,suffix:v,prefixCls:C="rc-textarea",showCount:x,count:w,className:M,style:N,disabled:T,hidden:$,classNames:z,styles:D,onResize:A,onClear:I,onPressEnter:j,readOnly:V,autoSize:B,onKeyDown:L,...P},G)=>{const[F,W]=ja(e,n),k=F==null?"":String(F),[ne,re]=_.useState(!1),q=_.useRef(!1),[K,J]=_.useState(null),ae=_.useRef(null),Z=_.useRef(null),le=()=>Z.current?.textArea,oe=()=>{le().focus()};_.useImperativeHandle(G,()=>({resizableTextArea:Z.current,focus:oe,blur:()=>{le().blur()},nativeElement:ae.current?.nativeElement||le()})),_.useEffect(()=>{re(Ge=>!T&&Ge)},[T]);const[te,ue]=_.useState(null);_.useEffect(()=>{te&&le().setSelectionRange(...te)},[te]);const ce=b7(w,x),fe=ce.max??p,ie=Number(fe)>0,ge=ce.strategy(k),Ce=!!fe&&ge>fe,de=(Ge,it)=>{let nt=it;!q.current&&ce.exceedFormatter&&ce.max&&ce.strategy(it)>ce.max&&(nt=ce.exceedFormatter(it,{max:ce.max}),it!==nt&&ue([le().selectionStart||0,le().selectionEnd||0])),W(nt),aw(Ge.currentTarget,Ge,c,nt)},se=Ge=>{q.current=!0,m?.(Ge)},pe=Ge=>{q.current=!1,de(Ge,Ge.currentTarget.value),S?.(Ge)},Te=Ge=>{de(Ge,Ge.target.value)},we=Ge=>{Ge.key==="Enter"&&j&&!Ge.nativeEvent.isComposing&&j(Ge),L?.(Ge)},be=Ge=>{re(!0),a?.(Ge)},Ne=Ge=>{re(!1),l?.(Ge)},xe=Ge=>{W(""),oe(),aw(le(),Ge,c)};let ze=v,Me;ce.show&&(ce.showFormatter?Me=ce.showFormatter({value:k,count:ge,maxLength:fe}):Me=`${ge}${ie?` / ${fe}`:""}`,ze=_.createElement(_.Fragment,null,ze,_.createElement("span",{className:me(`${C}-data-count`,z?.count),style:D?.count},Me)));const qe=Ge=>{A?.(Ge),le()?.style.height&&J(!0)},Xe=!B&&!x&&!u;return _.createElement(y7,{ref:ae,value:k,allowClear:u,handleReset:xe,suffix:ze,prefixCls:C,classNames:{...z,affixWrapper:me(z?.affixWrapper,{[`${C}-show-count`]:x,[`${C}-textarea-allow-clear`]:u})},disabled:T,focused:ne,className:me(M,Ce&&`${C}-out-of-range`),style:{...N,...K&&!Xe?{height:"auto"}:{}},dataAttrs:{affixWrapper:{"data-count":typeof Me=="string"?Me:void 0}},hidden:$,readOnly:V,onClear:I},_.createElement(dQ,UO({},P,{autoSize:B,maxLength:p,onKeyDown:we,onChange:Te,onFocus:be,onBlur:Ne,onCompositionStart:se,onCompositionEnd:pe,className:me(z?.textarea),style:{resize:N?.resize,...D?.textarea},disabled:T,prefixCls:C,onResize:qe,ref:Z,readOnly:V})))}),pQ=e=>{const{componentCls:n,paddingLG:a}=e,l=`${n}-textarea`;return{[`textarea${n}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${n}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${n}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[l]:{position:"relative","&-show-count":{[`${n}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`
|
|
446
446
|
&-allow-clear > ${n},
|
|
447
447
|
&-affix-wrapper${l}-has-feedback ${n}
|
|
448
|
-
`]:{paddingInlineEnd:a},[`&-affix-wrapper${n}-affix-wrapper`]:{padding:0,[`> textarea${n}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${n}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${n}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${l}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${n}-affix-wrapper-rtl`]:{[`${n}-suffix`]:{[`${n}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${n}-affix-wrapper-sm`]:{[`${n}-suffix`]:{[`${n}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},mQ=po(["Input","TextArea"],e=>{const n=Jn(e,E1(e));return pQ(n)},w1,{resetFont:!1}),hQ=_.forwardRef((e,n)=>{const{prefixCls:a,bordered:l=!0,size:c,disabled:u,status:p,allowClear:m,classNames:S,rootClassName:v,className:C,style:x,styles:w,variant:M,showCount:N,onMouseDown:T,onResize:$,...z}=e;if(process.env.NODE_ENV!=="production"){const{deprecated:be}=jn("TextArea");be(!("bordered"in e),"bordered","variant")}const{getPrefixCls:D,direction:A,allowClear:I,autoComplete:j,className:V,style:B,classNames:L,styles:P}=Ao("textArea"),G=y.useContext(ii),F=u??G,{status:W,hasFeedback:k,feedbackIcon:ne}=y.useContext(_r),re=v1(W,p),[q,K]=_o([L,S],[P,w],{props:e}),J=y.useRef(null);y.useImperativeHandle(n,()=>({resizableTextArea:J.current?.resizableTextArea,focus:be=>{MM(J.current?.resizableTextArea?.textArea,be)},blur:()=>J.current?.blur(),nativeElement:J.current?.nativeElement||null}));const ae=D("input",a),Z=nl(ae),[le,oe]=t7(ae,v);mQ(ae,Z);const{compactSize:te,compactItemClassnames:ue}=ep(ae,A),ce=is(be=>c??te??be),[fe,ie]=Aw("textArea",M,l),ge=v7(m??I),[Ce,de]=y.useState(!1),[se,pe]=y.useState(!1),Te=be=>{de(!0),T?.(be);const Ne=()=>{de(!1),document.removeEventListener("mouseup",Ne)};document.addEventListener("mouseup",Ne)},we=be=>{if($?.(be),Ce&&typeof getComputedStyle=="function"){const Ne=J.current?.nativeElement?.querySelector("textarea");Ne&&getComputedStyle(Ne).resize==="both"&&pe(!0)}};return y.createElement(fQ,{autoComplete:j,...z,style:{...K.root,...B,...x},styles:K,disabled:F,allowClear:ge,className:me(oe,Z,C,v,ue,V,q.root,{[`${ae}-textarea-affix-wrapper-resize-dirty`]:se}),classNames:{...q,textarea:me({[`${ae}-sm`]:ce==="small",[`${ae}-lg`]:ce==="large"},le,q.textarea,Ce&&`${ae}-mouse-active`),variant:me({[`${ae}-${fe}`]:ie},Ky(ae,re)),affixWrapper:me(`${ae}-textarea-affix-wrapper`,{[`${ae}-affix-wrapper-rtl`]:A==="rtl",[`${ae}-affix-wrapper-sm`]:ce==="small",[`${ae}-affix-wrapper-lg`]:ce==="large",[`${ae}-textarea-show-count`]:N||e.count?.show},le)},prefixCls:ae,suffix:k&&y.createElement("span",{className:`${ae}-textarea-suffix`},ne),showCount:N,ref:J,onResize:we,onMouseDown:Te})}),ea=$1;ea.Group=QK;ea.Search=B7;ea.TextArea=hQ;ea.Password=_7;ea.OTP=nQ;const sw=100,H7=sw/5,j7=sw/2-H7/2,eR=j7*2*Math.PI,O8=50,M8=e=>{const{dotClassName:n,style:a,hasCircleCls:l}=e;return y.createElement("circle",{className:me(`${n}-circle`,{[`${n}-circle-bg`]:l}),r:j7,cx:O8,cy:O8,strokeWidth:H7,style:a})},gQ=({percent:e,prefixCls:n})=>{const a=`${n}-dot`,l=`${a}-holder`,c=`${l}-hidden`,[u,p]=y.useState(!1);xo(()=>{e!==0&&p(!0)},[e!==0]);const m=Math.max(Math.min(e,100),0);if(!u)return null;const S={strokeDashoffset:`${eR/4}`,strokeDasharray:`${eR*m/100} ${eR*(100-m)/100}`};return y.createElement("span",{className:me(l,`${a}-progress`,m<=0&&c)},y.createElement("svg",{viewBox:`0 0 ${sw} ${sw}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m},y.createElement(M8,{dotClassName:a,hasCircleCls:!0}),y.createElement(M8,{dotClassName:a,style:S})))};function yQ(e){const{prefixCls:n,percent:a=0,className:l,style:c}=e,u=`${n}-dot`,p=`${u}-holder`,m=`${p}-hidden`;return y.createElement(y.Fragment,null,y.createElement("span",{className:me(p,l,a>0&&m),style:c},y.createElement("span",{className:me(u,`${n}-dot-spin`)},[1,2,3,4].map(S=>y.createElement("i",{className:`${n}-dot-item`,key:S})))),y.createElement(gQ,{prefixCls:n,percent:a}))}function bQ(e){const{prefixCls:n,indicator:a,percent:l,className:c,style:u}=e,p=`${n}-dot`;return a&&y.isValidElement(a)?$l(a,m=>({className:me(m.className,p,c),style:{...m.style,...u},percent:l})):y.createElement(yQ,{prefixCls:n,percent:l,className:c,style:u})}const vQ=new Xn("antSpinMove",{to:{opacity:1}}),SQ=new Xn("antRotate",{to:{transform:"rotate(405deg)"}}),CQ=e=>{const{componentCls:n}=e,a=`${n}-section`;return{[n]:{...ya(e),position:"relative","&-rtl":{direction:"rtl"},[`&${a}, ${a}`]:{display:"flex",alignItems:"center",flexDirection:"column",gap:e.paddingSM,color:e.colorPrimary},[`&${a}`]:{display:"inline-flex"},[a]:{position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)",zIndex:1},[`${n}-description`]:{fontSize:e.fontSize,lineHeight:1},[`${n}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},"&-spinning":{[`${n}-description`]:{textShadow:`0 0px 5px ${e.colorBgContainer}`},[`${n}-container`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-fullscreen":{position:"fixed",inset:0,backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,opacity:0,pointerEvents:"none",transition:`all ${e.motionDurationMid}`,[`&${n}-spinning`]:{opacity:1,pointerEvents:"auto"},[a]:{color:e.colorWhite,[`${n}-description`]:{color:e.colorTextLightSolid}}}}}},xQ=e=>{const{componentCls:n,antCls:a,motionDurationSlow:l}=e,[c,u]=Ia(a,"spin");return{[n]:{[c("dot-holder-size")]:e.dotSize,[c("dot-item-size")]:`calc((${u("dot-holder-size")} - ${e.marginXXS} / 2) / 2)`,[`${n}-dot`]:{"&-holder":{width:"1em",height:"1em",fontSize:u("dot-holder-size"),display:"inline-block",transition:["transform","opacity"].map(p=>`${p} ${l} ease`).join(", "),transformOrigin:"50% 50%",lineHeight:1,"&-hidden":{transform:"scale(0.3)",opacity:0}},position:"relative",display:"inline-block",fontSize:u("dot-holder-size"),width:"1em",height:"1em","&-spin":{transform:"rotate(45deg)",animationName:SQ,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-item":{position:"absolute",display:"block",width:u("dot-item-size"),height:u("dot-item-size"),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:vQ,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-progress":{position:"absolute",left:"50%",top:0,transform:"translateX(-50%)"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(p=>`${p} ${l} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}}}}},EQ=e=>{const{componentCls:n}=e,[a]=Ia(e.antCls,"spin");return{[n]:{"&-sm":{[a("dot-holder-size")]:e.dotSizeSM},"&-lg":{[a("dot-holder-size")]:e.dotSizeLG}}}},wQ=e=>{const{controlHeightLG:n,controlHeight:a}=e;return{contentHeight:400,dotSize:n/2,dotSizeSM:n*.35,dotSizeLG:a}},$Q=po("Spin",e=>{const n=Jn(e,{spinDotDefault:e.colorTextDescription});return[CQ(n),xQ(n),EQ(n)]},wQ),RQ=200,N8=[[30,.05],[70,.03],[96,.01]];function TQ(e,n){const[a,l]=y.useState(0),c=y.useRef(null),u=n==="auto";return y.useEffect(()=>(u&&e&&(l(0),c.current=setInterval(()=>{l(p=>{const m=100-p;for(let S=0;S<N8.length;S+=1){const[v,C]=N8[S];if(p<=v)return p+m*C}return p})},RQ)),()=>{c.current&&(clearInterval(c.current),c.current=null)}),[u,e]),u?a:n}let I7;function OQ(e,n){return!!e&&!!n&&!Number.isNaN(Number(n))}const u4=e=>{const{prefixCls:n,spinning:a=!0,delay:l=0,className:c,rootClassName:u,size:p="default",tip:m,description:S,wrapperClassName:v,style:C,children:x,fullscreen:w=!1,indicator:M,percent:N,classNames:T,styles:$,...z}=e,{getPrefixCls:D,direction:A,indicator:I,className:j,style:V,classNames:B,styles:L}=Ao("spin"),P=D("spin",n),[G,F]=$Q(P),[W,k]=y.useState(()=>a&&!OQ(a,l)),ne=TQ(W,N);y.useEffect(()=>{if(a){const te=AW(l,()=>{k(!0)});return te(),()=>{te?.cancel?.()}}k(!1)},[l,a]);const re=S??m,q={...e,size:p,spinning:W,tip:re,description:re,fullscreen:w,children:x,percent:ne},[K,J]=_o([B,T],[L,$],{props:q});if(process.env.NODE_ENV!=="production"){const te=jn("Spin");te.deprecated(!m,"tip","description"),te.deprecated(!v,"wrapperClassName","classNames.root"),te.deprecated(!(K?.tip||J?.tip),"classNames.tip and styles.tip","classNames.description and styles.description"),te.deprecated(!(K?.mask||J?.mask),"classNames.mask and styles.mask","classNames.root and styles.root")}const ae=M??I??I7,Z=typeof x<"u",le=Z||w,oe=y.createElement(y.Fragment,null,y.createElement(bQ,{className:me(K.indicator),style:J.indicator,prefixCls:P,indicator:ae,percent:ne}),re&&y.createElement("div",{className:me(`${P}-description`,K.tip,K.description),style:{...J.tip,...J.description}},re));return y.createElement("div",{className:me(P,{[`${P}-sm`]:p==="small",[`${P}-lg`]:p==="large",[`${P}-spinning`]:W,[`${P}-rtl`]:A==="rtl",[`${P}-fullscreen`]:w},u,K.root,w&&K.mask,le?v:[`${P}-section`,K.section],j,c,G,F),style:{...J.root,...le?{}:J.section,...w?J.mask:{},...V,...C},"aria-live":"polite","aria-busy":W,...z},W&&(le?y.createElement("div",{className:me(`${P}-section`,K.section),style:J.section},oe):oe),Z&&y.createElement("div",{className:me(`${P}-container`,K.container),style:J.container},x))};u4.setDefaultIndicator=e=>{I7=e};process.env.NODE_ENV!=="production"&&(u4.displayName="Spin");const MQ=e=>{const{prefixCls:n,className:a,closeIcon:l,closable:c,type:u,title:p,children:m,footer:S,classNames:v,styles:C,...x}=e,{getPrefixCls:w}=y.useContext(mn),{className:M,style:N,classNames:T,styles:$}=Ao("modal"),z=w(),D=n||w("modal"),A=nl(z),[I,j]=_5(D,A),[V,B]=_o([T,v],[$,C],{props:e}),L=`${D}-confirm`;let P={};return u?P={closable:c??!1,title:"",footer:"",children:y.createElement(H5,{...e,prefixCls:D,confirmPrefixCls:L,rootPrefixCls:z,content:m})}:P={closable:c??!0,title:p,footer:S!==null&&y.createElement(N5,{...e}),children:m},y.createElement(DM,{prefixCls:D,className:me(I,`${D}-pure-panel`,u&&L,u&&`${L}-${u}`,a,M,j,A,V.root),style:{...N,...B.root},...x,closeIcon:M5(D,l),closable:c,classNames:V,styles:B,...P})},NQ=G5(MQ);function L7(e){return y1(V5(e))}const Cr=B5;Cr.useModal=sY;Cr.info=function(n){return y1(P5(n))};Cr.success=function(n){return y1(U5(n))};Cr.error=function(n){return y1(q5(n))};Cr.warning=L7;Cr.warn=L7;Cr.confirm=function(n){return y1(F5(n))};Cr.destroyAll=function(){for(;Xm.length;){const n=Xm.pop();n&&n()}};Cr.config=rY;Cr._InternalPanelDoNotUseOrYouWillBeFired=NQ;process.env.NODE_ENV!=="production"&&(Cr.displayName="Modal");function qO(){return qO=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},qO.apply(this,arguments)}const V7=y.forwardRef(({prefixCls:e="rc-switch",className:n,checked:a,defaultChecked:l,disabled:c,loadingIcon:u,checkedChildren:p,unCheckedChildren:m,onClick:S,onChange:v,onKeyDown:C,styles:x,classNames:w,...M},N)=>{const[T,$]=ja(l??!1,a);function z(j,V){let B=T;return c||(B=j,$(B),v?.(B,V)),B}function D(j){j.which===Ft.LEFT?z(!1,j):j.which===Ft.RIGHT&&z(!0,j),C?.(j)}function A(j){const V=z(!T,j);S?.(V,j)}const I=me(e,n,{[`${e}-checked`]:T,[`${e}-disabled`]:c});return y.createElement("button",qO({},M,{type:"button",role:"switch","aria-checked":T,disabled:c,className:I,ref:N,onKeyDown:D,onClick:A}),u,y.createElement("span",{className:`${e}-inner`},y.createElement("span",{className:me(`${e}-inner-checked`,w?.content),style:x?.content},p),y.createElement("span",{className:me(`${e}-inner-unchecked`,w?.content),style:x?.content},m)))});V7.displayName="Switch";const zQ=e=>{const{componentCls:n,trackHeightSM:a,trackPadding:l,trackMinWidthSM:c,innerMinMarginSM:u,innerMaxMarginSM:p,handleSizeSM:m,calc:S}=e,v=`${n}-inner`,C=Be(S(m).add(S(l).mul(2)).equal()),x=Be(S(p).mul(2).equal());return{[n]:{[`&${n}-small`]:{minWidth:c,height:a,lineHeight:Be(a),[`${n}-inner`]:{paddingInlineStart:p,paddingInlineEnd:u,[`${v}-checked, ${v}-unchecked`]:{minHeight:a},[`${v}-checked`]:{marginInlineStart:`calc(-100% + ${C} - ${x})`,marginInlineEnd:`calc(100% - ${C} + ${x})`},[`${v}-unchecked`]:{marginTop:S(a).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${n}-handle`]:{width:m,height:m},[`${n}-loading-icon`]:{top:S(S(m).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${n}-checked`]:{[`${n}-inner`]:{paddingInlineStart:u,paddingInlineEnd:p,[`${v}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${v}-unchecked`]:{marginInlineStart:`calc(100% - ${C} + ${x})`,marginInlineEnd:`calc(-100% + ${C} - ${x})`}},[`${n}-handle`]:{insetInlineStart:`calc(100% - ${Be(S(m).add(l).equal())})`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${v}`]:{[`${v}-unchecked`]:{marginInlineStart:S(e.marginXXS).div(2).equal(),marginInlineEnd:S(e.marginXXS).mul(-1).div(2).equal()}},[`&${n}-checked ${v}`]:{[`${v}-checked`]:{marginInlineStart:S(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:S(e.marginXXS).div(2).equal()}}}}}}},DQ=e=>{const{componentCls:n,handleSize:a,calc:l}=e;return{[n]:{[`${n}-loading-icon${e.iconCls}`]:{position:"relative",top:l(l(a).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${n}-checked ${n}-loading-icon`]:{color:e.switchColor}}}},AQ=e=>{const{componentCls:n,trackPadding:a,handleBg:l,handleShadow:c,handleSize:u,calc:p}=e,m=`${n}-handle`;return{[n]:{[m]:{position:"absolute",top:a,insetInlineStart:a,width:u,height:u,transition:`all ${e.switchDuration} ease-in-out`,...Wy(),"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:l,borderRadius:p(u).div(2).equal(),boxShadow:c,transition:`all ${e.switchDuration} ease-in-out`,content:'""',...Wy()}},[`&${n}-checked ${m}`]:{insetInlineStart:`calc(100% - ${Be(p(u).add(a).equal())})`},[`&:not(${n}-disabled):active`]:{[`${m}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${n}-checked ${m}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},_Q=e=>{const{componentCls:n,trackHeight:a,trackPadding:l,innerMinMargin:c,innerMaxMargin:u,handleSize:p,switchDuration:m,calc:S}=e,v=`${n}-inner`,C=Be(S(p).add(S(l).mul(2)).equal()),x=Be(S(u).mul(2).equal());return{[n]:{[v]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:u,paddingInlineEnd:c,transition:["padding-inline-start","padding-inline-end"].map(w=>`${w} ${m} ease-in-out`).join(", "),...Wy(),[`${v}-checked, ${v}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,pointerEvents:"none",minHeight:a,transition:["margin-inline-start","margin-inline-end"].map(w=>`${w} ${m} ease-in-out`).join(", "),...Wy()},[`${v}-checked`]:{marginInlineStart:`calc(-100% + ${C} - ${x})`,marginInlineEnd:`calc(100% - ${C} + ${x})`},[`${v}-unchecked`]:{marginTop:S(a).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${n}-checked ${v}`]:{paddingInlineStart:c,paddingInlineEnd:u,[`${v}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${v}-unchecked`]:{marginInlineStart:`calc(100% - ${C} + ${x})`,marginInlineEnd:`calc(-100% + ${C} - ${x})`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${v}`]:{[`${v}-unchecked`]:{marginInlineStart:S(l).mul(2).equal(),marginInlineEnd:S(l).mul(-1).mul(2).equal()}},[`&${n}-checked ${v}`]:{[`${v}-checked`]:{marginInlineStart:S(l).mul(-1).mul(2).equal(),marginInlineEnd:S(l).mul(2).equal()}}}}}},BQ=e=>{const{componentCls:n,trackHeight:a,trackMinWidth:l}=e;return{[n]:{...ya(e),position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:l,height:a,lineHeight:Be(a),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",...Wy(),[`&:hover:not(${n}-disabled)`]:{background:e.colorTextTertiary},...Yf(e),[`&${n}-checked`]:{background:e.switchColor,[`&:hover:not(${n}-disabled)`]:{background:e.colorPrimaryHover}},[`&${n}-loading, &${n}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${n}-rtl`]:{direction:"rtl"}}}},HQ=e=>{const{fontSize:n,lineHeight:a,controlHeight:l,colorWhite:c}=e,u=n*a,p=l/2,m=2,S=u-m*2,v=p-m*2;return{trackHeight:u,trackHeightSM:p,trackMinWidth:S*2+m*4,trackMinWidthSM:v*2+m*2,trackPadding:m,handleBg:c,handleSize:S,handleSizeSM:v,handleShadow:`0 2px 4px 0 ${new to("#00230b").setA(.2).toRgbString()}`,innerMinMargin:S/2,innerMaxMargin:S+m+m*2,innerMinMarginSM:v/2,innerMaxMarginSM:v+m+m*2}},jQ=po("Switch",e=>{const n=Jn(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[BQ(n),_Q(n),AQ(n),DQ(n),zQ(n)]},HQ),IQ=y.forwardRef((e,n)=>{const{prefixCls:a,size:l,disabled:c,loading:u,className:p,rootClassName:m,style:S,checked:v,value:C,defaultChecked:x,defaultValue:w,onChange:M,styles:N,classNames:T,...$}=e,[z,D]=ja(x??w??!1,v??C),{getPrefixCls:A,direction:I,className:j,style:V,classNames:B,styles:L}=Ao("switch"),P=y.useContext(ii),G=(c??P)||u,F=A("switch",a),[W,k]=jQ(F),ne=is(l),re={...e,size:ne,disabled:G},[q,K]=_o([B,T],[L,N],{props:re}),J=y.createElement("div",{className:me(`${F}-handle`,q.indicator),style:K.indicator},u&&y.createElement(e1,{className:`${F}-loading-icon`})),ae=me(j,{[`${F}-small`]:ne==="small",[`${F}-loading`]:u,[`${F}-rtl`]:I==="rtl"},p,m,q.root,W,k),Z={...K.root,...V,...S},le=(...oe)=>{D(oe[0]),M?.(...oe)};return y.createElement(Mw,{component:"Switch",disabled:G},y.createElement(V7,{...$,classNames:q,styles:K,checked:z,onChange:le,prefixCls:F,className:ae,style:Z,disabled:G,ref:n,loadingIcon:J}))}),Ff=IQ;Ff.__ANT_SWITCH=!0;process.env.NODE_ENV!=="production"&&(Ff.displayName="Switch");const LQ=e=>{const{paddingXXS:n,lineWidth:a,tagPaddingHorizontal:l,componentCls:c,calc:u}=e,p=u(l).sub(a).equal(),m=u(n).sub(a).equal();return{[c]:{...ya(e),display:"inline-block",height:"auto",paddingInline:p,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${Be(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${c}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${c}-close-icon`]:{marginInlineStart:m,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${c}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${c}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${c}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${c}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:p}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${c}-default`]:{color:e.solidTextColor}},[`${c}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${c}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${c}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${c}-solid, &${c}-filled`]:{color:e.colorTextDisabled,[`${c}-close-icon`]:{color:e.colorTextDisabled}},[`${c}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},d4=e=>{const{lineWidth:n,fontSizeIcon:a,calc:l}=e,c=e.fontSizeSM;return Jn(e,{tagFontSize:c,tagLineHeight:Be(l(e.lineHeightSM).mul(c).equal()),tagIconSize:l(a).sub(l(n).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},f4=e=>{const n=s5(new GE(e.colorBgSolid),"#fff")?"#000":"#fff";return{defaultBg:new to(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:n}},p4=po("Tag",e=>{const n=d4(e);return LQ(n)},f4),P7=y.forwardRef((e,n)=>{const{prefixCls:a,style:l,className:c,checked:u,children:p,icon:m,onChange:S,onClick:v,disabled:C,...x}=e,{getPrefixCls:w,tag:M}=y.useContext(mn),N=y.useContext(ii),T=C??N,$=j=>{T||(S?.(!u),v?.(j))},z=w("tag",a),[D,A]=p4(z),I=me(z,`${z}-checkable`,{[`${z}-checkable-checked`]:u,[`${z}-checkable-disabled`]:T},M?.className,c,D,A);return y.createElement("span",{...x,ref:n,style:{...l,...M?.style},className:I,onClick:$},m,y.createElement("span",null,p))}),U7=_.forwardRef((e,n)=>{const{id:a,prefixCls:l,rootClassName:c,className:u,style:p,classNames:m,styles:S,disabled:v,options:C,value:x,defaultValue:w,onChange:M,multiple:N,...T}=e,{getPrefixCls:$,direction:z,className:D,style:A,classNames:I,styles:j}=Ao("tag"),V=$("tag",l),B=`${V}-checkable-group`,L=nl(V),[P,G]=p4(V,L),[F,W]=_o([I,m],[j,S],{props:e}),k=_.useMemo(()=>Array.isArray(C)?C.map(ae=>ae&&typeof ae=="object"?ae:{value:ae,label:ae}):[],[C]),[ne,re]=ja(w,x),q=(ae,Z)=>{let le=null;if(N){const oe=ne||[];le=ae?[].concat(Zn(oe),[Z.value]):oe.filter(te=>te!==Z.value)}else le=ae?Z.value:null;re(le),M?.(le)},K=_.useRef(null);_.useImperativeHandle(n,()=>({nativeElement:K.current}));const J=ls(T,{aria:!0,data:!0});return _.createElement("div",{...J,className:me(B,D,c,{[`${B}-disabled`]:v,[`${B}-rtl`]:z==="rtl"},P,G,u,F.root),style:{...A,...W.root,...p},id:a,ref:K},k.map(ae=>_.createElement(P7,{key:ae.value,className:me(`${B}-item`,F.item),style:W.item,checked:N?(ne||[]).includes(ae.value):ne===ae.value,onChange:Z=>q(Z,ae),disabled:v},ae.label)))});process.env.NODE_ENV!=="production"&&(U7.displayName="CheckableTagGroup");function VQ(e,n){const{color:a,variant:l,bordered:c}=e;return y.useMemo(()=>{const u=a?.endsWith("-inverse");let p;l?p=l:u?p="solid":c===!1?p="filled":p=n||"filled";const m=u?a?.replace("-inverse",""):a,S=CB(a),v=LX(a),C={};if(!S&&!v&&m)if(p==="solid")C.backgroundColor=a;else{const x=new to(m).toHsl();x.l=.95,C.backgroundColor=new to(x).toHexString(),C.color=a,p==="outlined"&&(C.borderColor=a)}return[p,m,S,v,C]},[a,l,c,n])}const PQ=e=>d_(e,(n,{textColor:a,lightBorderColor:l,lightColor:c,darkColor:u})=>({[`${e.componentCls}${e.componentCls}-${n}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:c,borderColor:l,color:a},[`&${e.componentCls}-solid`]:{backgroundColor:u,borderColor:u,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:c,color:a}}})),UQ=l1(["Tag","preset"],e=>{const n=d4(e);return PQ(n)},f4);function qQ(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const mE=(e,n,a)=>{const l=qQ(a);return{[`${e.componentCls}${e.componentCls}-${n}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${l}Bg`],borderColor:e[`color${l}Border`],color:e[`color${a}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${a}`],borderColor:e[`color${a}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${l}Bg`],color:e[`color${a}`]}}}},FQ=l1(["Tag","status"],e=>{const n=d4(e);return[mE(n,"success","Success"),mE(n,"processing","Info"),mE(n,"error","Error"),mE(n,"warning","Warning")]},f4),GQ=y.forwardRef((e,n)=>{const{prefixCls:a,className:l,rootClassName:c,style:u,children:p,icon:m,color:S,variant:v,onClose:C,bordered:x,disabled:w,href:M,target:N,styles:T,classNames:$,...z}=e,{getPrefixCls:D,direction:A,className:I,variant:j,style:V,classNames:B,styles:L}=Ao("tag");if(process.env.NODE_ENV!=="production"){const Ne=jn("Tag");Ne.deprecated(x!==!1,"bordered={false}",'variant="filled"'),Ne.deprecated(!S?.endsWith("-inverse"),'color="xxx-inverse"','variant="solid"')}const[P,G,F,W,k]=VQ(e,j),ne=F||W,re=y.useContext(ii),q=w??re,{tag:K}=y.useContext(mn),[J,ae]=y.useState(!0),Z=Xo(z,["closeIcon","closable"]),le={...e,color:G,variant:P,disabled:q,href:M,target:N,icon:m},[oe,te]=_o([B,$],[L,T],{props:le}),ue=y.useMemo(()=>{let Ne={...te.root,...V,...u};return q||(Ne={...k,...Ne}),Ne},[te.root,V,u,k,q]),ce=D("tag",a),[fe,ie]=p4(ce),ge=me(ce,I,oe.root,`${ce}-${P}`,{[`${ce}-${G}`]:ne,[`${ce}-hidden`]:!J,[`${ce}-rtl`]:A==="rtl",[`${ce}-disabled`]:q},l,c,fe,ie),Ce=Ne=>{q||(Ne.stopPropagation(),C?.(Ne),!Ne.defaultPrevented&&ae(!1))},[,de]=R_(VE(e),VE(K),{closable:!1,closeIconRender:Ne=>{const xe=y.createElement("span",{className:`${ce}-close-icon`,onClick:Ce},Ne);return P_(Ne,xe,ze=>({onClick:Me=>{ze?.onClick?.(Me),Ce(Me)},className:me(ze?.className,`${ce}-close-icon`)}))}}),se=typeof z.onClick=="function"||p&&p.type==="a",pe=$l(m,{className:me(y.isValidElement(m)?m.props?.className:void 0,oe.icon),style:te.icon}),Te=pe?y.createElement(y.Fragment,null,pe,p&&y.createElement("span",{className:oe.content,style:te.content},p)):p,we=M?"a":"span",be=y.createElement(we,{...Z,ref:n,className:ge,style:ue,href:q?void 0:M,target:N,onClick:q?void 0:Z.onClick,...M&&q?{"aria-disabled":!0}:{}},Te,de,F&&y.createElement(UQ,{key:"preset",prefixCls:ce}),W&&y.createElement(FQ,{key:"status",prefixCls:ce}));return se?y.createElement(Mw,{component:"Tag"},be):be}),Zm=GQ;process.env.NODE_ENV!=="production"&&(Zm.displayName="Tag");Zm.CheckableTag=P7;Zm.CheckableTagGroup=U7;const m4="指标",YQ=new Set(["string","number","boolean","date","datetime"]),XQ=new Set(["time","category","name","id","amount","count","number","ratio"]),kQ=new Set(["auto","user"]),WQ=new Set(["sum","avg","count","count_distinct","max","min"]);function as(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function sa(e){return typeof e=="string"&&e.trim().length>0?e:void 0}function Is(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function z8(e,n){return typeof e=="boolean"?e:n}function tR(e){return typeof e=="string"&&kQ.has(e)?e:void 0}function KQ(e){return typeof e=="string"&&YQ.has(e)?e:void 0}function QQ(e){return typeof e=="string"&&XQ.has(e)?e:void 0}function ZQ(e){return typeof e=="string"&&WQ.has(e)?e:void 0}function nR(e,n,a){return sa(e[a])??sa(n[a])}function JQ(e,n){const a=nR(e,n,"categoryField")??"",l=nR(e,n,"valueField")??"",c=nR(e,n,"seriesField"),u=tR(e.categoryFieldSource)??(a?"user":void 0),p=tR(e.valueFieldSource)??(l?"user":void 0),m=tR(e.seriesFieldSource)??(c?"user":void 0);return{categoryField:a,categoryFieldSource:u,valueField:l,valueFieldSource:p,seriesField:c,seriesFieldSource:m}}function h4(){return{categoryField:"",valueField:""}}function eZ(e,n){const a=as(e)?e:{};return{seriesName:sa(a.seriesName)??sa(n.seriesName)??m4,showLegend:z8(a.showLegend,z8(n.showLegend,!0))}}function tZ(e){const n=as(e.dataset)?e.dataset:{},a=as(n.mapping)?n.mapping:{},l=sa(n.datasetKey)??sa(e.datasetId),c=JQ(a,e),u=eZ(n.display,e);if(!(!l&&!c.categoryField&&!c.valueField&&!c.seriesField))return{datasetKey:l??"",mapping:c,display:u}}function nZ(e){const n=as(e.option)?e.option:{},a=as(n.source)?n.source:{},l=sa(a.templateKey)??sa(e.optionPresetKey);if(l)return{source:{type:"template",templateKey:l}}}function oZ(e){if(as(e))return{colors:Array.isArray(e.colors)?e.colors.filter(n=>typeof n=="string"&&n.trim().length>0):void 0,borderRadius:Is(e.borderRadius),enableGradient:typeof e.enableGradient=="boolean"?e.enableGradient:void 0,enableShadow:typeof e.enableShadow=="boolean"?e.enableShadow:void 0,legendSpacing:as(e.legendSpacing)?{top:Is(e.legendSpacing.top),right:Is(e.legendSpacing.right),bottom:Is(e.legendSpacing.bottom),left:Is(e.legendSpacing.left),itemGap:Is(e.legendSpacing.itemGap),padding:Is(e.legendSpacing.padding)}:void 0,gridSpacing:as(e.gridSpacing)?{top:Is(e.gridSpacing.top),right:Is(e.gridSpacing.right),bottom:Is(e.gridSpacing.bottom),left:Is(e.gridSpacing.left)}:void 0,axis:as(e.axis)?{axisLineColor:sa(e.axis.axisLineColor),axisLabelColor:sa(e.axis.axisLabelColor),splitLineColor:sa(e.axis.splitLineColor)}:void 0,tooltip:as(e.tooltip)?{backgroundColor:sa(e.tooltip.backgroundColor),borderColor:sa(e.tooltip.borderColor),textColor:sa(e.tooltip.textColor)}:void 0}}function g4(e){const n=e.chartType,a=sa(e.dataMode)??sa(e.renderMode);return{chartType:n==="bar"||n==="pie"||n==="area"?n:"line",dataMode:a==="option"?"option":"dataset",dataset:tZ(e),option:nZ(e),theme:oZ(e.theme)}}function aZ(e,n){return sa(e.label)??sa(e.key)??`第${n+1}个字段`}function rZ(e,n){if(!as(e))throw new Error(`数据集字段元数据格式不合法,第${n+1}项必须是对象。`);const a=sa(e.key),l=sa(e.label),c=KQ(e.valueType),u=QQ(e.semanticType),p=e.analyticRole==="dimension"||e.analyticRole==="measure"?e.analyticRole:void 0,m=typeof e.groupable=="boolean"?e.groupable:void 0,S=typeof e.aggregatable=="boolean"?e.aggregatable:void 0,v=aZ(e,n);if(!a||!l||!c||!u||!p||typeof m>"u"||typeof S>"u")throw new Error(`字段“${v}”缺少严格模式元数据,请补齐 key、label、valueType、semanticType、analyticRole、groupable、aggregatable。`);return{key:a,label:l,valueType:c,semanticType:u,analyticRole:p,groupable:m,aggregatable:S,defaultAgg:ZQ(e.defaultAgg)}}function lZ(e,n){if(!as(e))throw new Error("宿主返回的数据集 Schema 不合法,请返回对象结构。");const a=sa(e.datasetKey),l=sa(e.label),c=Array.isArray(e.fields)?e.fields.map((u,p)=>rZ(u,p)):null;if(!a||!l||!c)throw new Error("宿主返回的数据集 Schema 不完整,请补齐 datasetKey、label 与 fields。");if(n&&a!==n)throw new Error(`宿主返回的数据集 Schema 标识不匹配,期望 ${n},实际为 ${a}。`);return{datasetKey:a,label:l,fields:c}}function np(e){return{seriesName:e.dataset?.display?.seriesName??m4,showLegend:e.dataset?.display?.showLegend??!0}}function q7(e){return!!(e.dataset?.datasetKey&&e.dataset.mapping.categoryField&&e.dataset.mapping.valueField)}function D8(e){switch(e.semanticType){case"amount":return 0;case"count":return 1;case"number":return 2;case"ratio":return 3;default:return 99}}function A8(e,n){if(n.semanticType==="id")return 999;if(e==="line"||e==="area")switch(n.semanticType){case"time":return 0;case"category":return 1;case"name":return 2;default:return 99}if(e==="bar")switch(n.semanticType){case"category":return 0;case"name":return 1;case"time":return 2;default:return 99}switch(n.semanticType){case"category":return 0;case"name":return 1;default:return 99}}function iZ(e,n){return n.filter(a=>a.analyticRole==="dimension"&&a.groupable&&a.semanticType!=="id").sort((a,l)=>A8(e,a)-A8(e,l))[0]}function sZ(e){return e.filter(n=>n.analyticRole==="measure"&&n.aggregatable).sort((n,a)=>D8(n)-D8(a))[0]}function cZ(e,n){const a=iZ(e,n.fields),l=sZ(n.fields);return{categoryField:a?.key??"",categoryFieldSource:a?"auto":void 0,valueField:l?.key??"",valueFieldSource:l?"auto":void 0}}function y4(e,n,a){return{datasetKey:e,mapping:a,display:n}}function uZ(e,n,a){const l=a??"",c=np(e),u=h4();return{...e,dataset:y4(l,c,u)}}function dZ(e,n){if(e.dataset?.datasetKey&&e.dataset.datasetKey!==n.datasetKey)return e;const a=e.dataset?.mapping??h4(),l=cZ(e.chartType,n),c={...a};let u=!1;return!a.categoryField&&a.categoryFieldSource!=="user"&&l.categoryField&&(c.categoryField=l.categoryField,c.categoryFieldSource="auto",u=!0),!a.valueField&&a.valueFieldSource!=="user"&&l.valueField&&(c.valueField=l.valueField,c.valueFieldSource="auto",u=!0),u?{...e,dataset:y4(n.datasetKey,np(e),c)}:e}function oR(e,n,a){const l=np(e),c=e.dataset?.mapping??h4(),u=typeof a=="string"?a:"",p={...c};return n==="categoryField"&&(p.categoryField=u,p.categoryFieldSource="user"),n==="valueField"&&(p.valueField=u,p.valueFieldSource="user"),n==="seriesField"&&(p.seriesField=u||void 0,p.seriesFieldSource="user"),{...e,dataset:y4(e.dataset?.datasetKey??"",l,p)}}function fZ(e,n){return JSON.stringify(e)===JSON.stringify(n)}function pZ(e){return e.filter(n=>n.analyticRole==="dimension"&&n.groupable)}function mZ(e){return e.filter(n=>n.analyticRole==="measure"&&n.aggregatable)}const cw={vivid:{label:"鲜艳高对比",colors:["#2563eb","#0ea5e9","#10b981","#f59e0b","#f97316","#ef4444"]},morandi:{label:"莫兰迪蓝灰",colors:["#7c8da6","#95a792","#c08f80","#b8a07a","#8f98b3","#9c8f87"]},dark:{label:"暗色霓虹",colors:["#60a5fa","#22d3ee","#34d399","#fbbf24","#fb7185","#a78bfa"]},terracotta:{label:"暖砂陶土",colors:["#b98273","#9a8b7a","#c2a58c","#8f9a92","#a58c94","#7d8d96"]}},Dy={colors:[...cw.vivid.colors],borderRadius:14,enableGradient:!0,enableShadow:!0,legendSpacing:{top:4,right:0,bottom:8,left:0,itemGap:16,padding:0},gridSpacing:{top:34,right:20,bottom:28,left:44},axis:{axisLineColor:"#d7dfeb",axisLabelColor:"#5c6b82",splitLineColor:"#edf2f7"},tooltip:{backgroundColor:"rgba(15, 23, 42, 0.94)",borderColor:"rgba(148, 163, 184, 0.18)",textColor:"#f8fafc"}};function hZ(...e){return e.reduce((n,a)=>a?{colors:Array.isArray(a.colors)&&a.colors.length>0?[...a.colors]:n.colors,borderRadius:typeof a.borderRadius=="number"?a.borderRadius:n.borderRadius,enableGradient:typeof a.enableGradient=="boolean"?a.enableGradient:n.enableGradient,enableShadow:typeof a.enableShadow=="boolean"?a.enableShadow:n.enableShadow,legendSpacing:{...n.legendSpacing,...a.legendSpacing},gridSpacing:{...n.gridSpacing,...a.gridSpacing},axis:{...n.axis,...a.axis},tooltip:{...n.tooltip,...a.tooltip}}:n,{...Dy,colors:[...Dy.colors],legendSpacing:{...Dy.legendSpacing},gridSpacing:{...Dy.gridSpacing},axis:{...Dy.axis},tooltip:{...Dy.tooltip}})}function gZ(e){if(!Array.isArray(e)||e.length===0)return"vivid";const n=e.map(l=>l.toLowerCase());return Object.entries(cw).find(([,l])=>l.colors.length===n.length&&l.colors.every((c,u)=>c.toLowerCase()===n[u]))?.[0]??null}function Zy(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function _8(e){return Array.isArray(e)&&e.every(n=>Zy(n))}function F7(e){return e==="area"?"面积图":e==="bar"?"柱状图":e==="pie"?"饼图":"折线图"}function B8(e){return`${e.label}(${e.semanticType} / ${e.valueType})`}function yZ(e){if(_8(e))return e;if(Zy(e)&&_8(e.rows))return e.rows;throw new Error("内置图表组件收到不支持的数据结构,请返回 rows 数组或 BuiltinChartDataResult。")}function bZ(e){return!Zy(e)||!Zy(e.option)?!1:e.kind==="builtin-chart-option"||e.kind==="option"||typeof e.kind>"u"}function vZ(e){if(bZ(e))return e.option;throw new Error("内置图表组件收到不支持的 option 结构,请返回 { kind: 'builtin-chart-option', option }。")}function SZ(e){return!Zy(e)||!Zy(e.meta)?null:typeof e.meta.summary=="string"?e.meta.summary:null}function Gy(e,n,a){if(!n)return a;const l=e[n];return l===null||typeof l>"u"?a:String(l)}function b4(e,n){if(!n)return null;const a=e[n],l=typeof a=="number"?a:Number(a);return Number.isFinite(l)?l:null}function CZ(e){const n=e.dataset?.datasetKey,a=e.dataset?.mapping.categoryField,l=e.dataset?.mapping.valueField;return n?!a&&!l?"请先完成字段映射":a?l?"请先完成字段映射":"请先选择数值字段":"请先选择类目字段":"请先选择数据集"}function H8(e){return e.dataMode==="option"?"请先选择图表模板":CZ(e)}function xZ(e){const{context:n,onChange:a,services:l,value:c}=e,u=l.dataSourceAdapters?.["builtin-chart"],p=g4(c),[m,S]=_.useState([]),[v,C]=_.useState(null),[x,w]=_.useState([]),[M,N]=_.useState(null);_.useEffect(()=>{let B=!0;async function L(){try{N(null);const P=await u?.getDatasetOptions?.({chartType:p.chartType,dashboardCode:n.dashboardCode})??[];if(!B)return;S(P)}catch{if(!B)return;N("加载数据集失败,请稍后重试。")}}return L(),()=>{B=!1}},[u,n.dashboardCode,p.chartType]),_.useEffect(()=>{let B=!0;async function L(){const P=p.dataset?.datasetKey;if(!P){C(null);return}const G=u?.getDatasetSchema;if(!G){C(null),N("当前宿主未提供严格模式数据集 Schema 服务。");return}C(null);try{N(null);const F=lZ(await G({chartType:p.chartType,datasetKey:P,dashboardCode:n.dashboardCode}),P);if(!B)return;C(F)}catch(F){if(!B)return;N(F instanceof Error?F.message:"加载数据集 Schema 失败,请稍后重试。")}}return L(),()=>{B=!1}},[u,n.dashboardCode,p.chartType,p.dataset?.datasetKey]),_.useEffect(()=>{let B=!0;async function L(){try{N(null);const P=await u?.getOptionTemplates?.({chartType:p.chartType,dashboardCode:n.dashboardCode})??[];if(!B)return;w(P)}catch{if(!B)return;N("加载图表模板失败,请稍后重试。")}}return L(),()=>{B=!1}},[u,n.dashboardCode,p.chartType]),_.useEffect(()=>{if(p.dataMode!=="dataset"||!v)return;const B=dZ(p,v);fZ(p,B)||a(B)},[v,p,a]);const T=v?.fields??[],$=pZ(T).map(B=>({label:B8(B),value:B.key})),z=mZ(T).map(B=>({label:B8(B),value:B.key})),D=p.dataMode==="dataset",A=p.chartType!=="pie",I=np(p),j=gZ(p.theme?.colors);function V(B){a({...p,theme:{...p.theme,...B}})}return X.jsxs(It,{layout:"vertical",children:[M?X.jsx(c1,{className:"cps-bi-builtin-chart__alert",showIcon:!0,title:M,type:"warning"}):null,X.jsx(jw,{className:"cps-bi-builtin-chart__config-tabs",items:[{key:"data",label:"数据配置",children:X.jsxs("div",{className:"cps-bi-builtin-chart__config-pane",children:[X.jsx(It.Item,{label:"数据模式",children:X.jsx(ia,{"aria-label":"数据模式",onChange:B=>{a({...p,dataMode:B})},options:[{label:"字段映射",value:"dataset"},{label:"模板直出",value:"option"}],value:p.dataMode})}),X.jsx(It.Item,{label:"图表类型",children:X.jsx(ea,{"aria-label":"图表类型",disabled:!0,value:F7(p.chartType)})}),D?X.jsxs(X.Fragment,{children:[X.jsx(It.Item,{label:"数据源",children:X.jsx(ia,{allowClear:!0,"aria-label":"数据源",onChange:B=>{a(uZ(p,null,typeof B=="string"?B:void 0))},options:m.map(B=>({label:B.label,value:B.key})),placeholder:"请选择数据源",value:p.dataset?.datasetKey||void 0})}),X.jsx(It.Item,{label:p.chartType==="pie"?"名称字段":"类目字段",children:X.jsx(ia,{allowClear:!0,"aria-label":p.chartType==="pie"?"名称字段":"类目字段",onChange:B=>{a(oR(p,"categoryField",typeof B=="string"?B:void 0))},options:$,placeholder:"请选择类目字段",value:p.dataset?.mapping.categoryField||void 0})}),X.jsx(It.Item,{label:p.chartType==="pie"?"数值字段":"指标字段",children:X.jsx(ia,{allowClear:!0,"aria-label":p.chartType==="pie"?"数值字段":"指标字段",onChange:B=>{a(oR(p,"valueField",typeof B=="string"?B:void 0))},options:z,placeholder:"请选择数值字段",value:p.dataset?.mapping.valueField||void 0})}),A?X.jsx(It.Item,{label:"分组字段",children:X.jsx(ia,{allowClear:!0,"aria-label":"分组字段",onChange:B=>{a(oR(p,"seriesField",typeof B=="string"?B:void 0))},options:$,placeholder:"可选:按字段拆分多系列",value:p.dataset?.mapping.seriesField})}):null]}):X.jsx(It.Item,{label:"图表模板",children:X.jsx(ia,{allowClear:!0,"aria-label":"图表模板",onChange:B=>{a({...p,option:typeof B=="string"?{source:{type:"template",templateKey:B}}:void 0})},optionFilterProp:"label",options:x.map(B=>({label:B.label,value:B.key})),placeholder:"请选择图表模板",value:p.option?.source.templateKey})})]})},{key:"style",label:"图表样式",children:X.jsxs("div",{className:"cps-bi-builtin-chart__config-pane",children:[D?X.jsxs(X.Fragment,{children:[X.jsx(It.Item,{label:"系列名称",children:X.jsx(ea,{"aria-label":"系列名称",onChange:B=>{a({...p,dataset:{datasetKey:p.dataset?.datasetKey??"",mapping:p.dataset?.mapping??{categoryField:"",valueField:""},display:{...I,seriesName:B.target.value||void 0}}})},placeholder:"请输入系列名称",value:I.seriesName})}),X.jsx(It.Item,{label:"显示图例",children:X.jsx(Ff,{checked:I.showLegend??!0,onChange:B=>{a({...p,dataset:{datasetKey:p.dataset?.datasetKey??"",mapping:p.dataset?.mapping??{categoryField:"",valueField:""},display:{...I,showLegend:B}}})}})})]}):null,X.jsx(It.Item,{label:"配色方案",children:X.jsx(ia,{"aria-label":"图表配色方案",onChange:B=>{const L=cw[B];L&&V({colors:[...L.colors]})},options:Object.entries(cw).map(([B,L])=>({label:L.label,value:B})),value:j??void 0})}),X.jsx(It.Item,{label:"圆角",children:X.jsx(ai,{"aria-label":"图表圆角",max:24,min:0,onChange:B=>{V({borderRadius:typeof B=="number"?B:void 0})},style:{width:"100%"},value:p.theme?.borderRadius})}),X.jsx(It.Item,{label:"开启渐变",children:X.jsx(Ff,{"aria-label":"开启渐变",checked:p.theme?.enableGradient??!0,onChange:B=>{V({enableGradient:B})}})}),X.jsx(It.Item,{label:"开启阴影",children:X.jsx(Ff,{"aria-label":"开启阴影",checked:p.theme?.enableShadow??!0,onChange:B=>{V({enableShadow:B})}})}),X.jsx(It.Item,{label:"图例上边距",children:X.jsx(ai,{"aria-label":"图例上边距",max:48,min:0,onChange:B=>{V({legendSpacing:{...p.theme?.legendSpacing,top:typeof B=="number"?B:void 0}})},style:{width:"100%"},value:p.theme?.legendSpacing?.top})}),X.jsx(It.Item,{label:"图表上留白",children:X.jsx(ai,{"aria-label":"图表上留白",max:120,min:16,onChange:B=>{V({gridSpacing:{...p.theme?.gridSpacing,top:typeof B=="number"?B:void 0}})},style:{width:"100%"},value:p.theme?.gridSpacing?.top})})]})}]})]})}function EZ(e){return e==="loading"?X.jsx(u4,{size:"small"}):e==="empty"?X.jsx(pA,{className:"cps-bi-widget-state-card__icon"}):e==="incomplete"?X.jsx(bw,{className:"cps-bi-widget-state-card__icon"}):e==="unauthorized"?X.jsx(oM,{className:"cps-bi-widget-state-card__icon"}):X.jsx(JS,{className:"cps-bi-widget-state-card__icon"})}function Bc(e){const{kind:n,title:a,description:l,visual:c,className:u}=e,p=["cps-bi-widget-state-card",`is-${n}`,u].filter(Boolean).join(" "),m=typeof c>"u"?EZ(n):c;return X.jsx("div",{className:p,"data-state":n,children:X.jsxs("div",{className:"cps-bi-widget-state-card__inner",children:[m?X.jsx("div",{"aria-hidden":n!=="loading",className:"cps-bi-widget-state-card__visual",children:m}):null,X.jsxs("div",{className:"cps-bi-widget-state-card__body",children:[X.jsx("p",{className:"cps-bi-widget-state-card__title",children:X.jsx("span",{children:a})}),l?X.jsx("p",{className:"cps-bi-widget-state-card__description",children:l}):null]})]})})}const wZ="cps-bi",$Z={},G7=_.createContext(null);function RZ(e){const n=e?.trim();return n&&n.length>0?n:wZ}function TZ(e){const n=new Set,a=new Set;for(const l of e){if(a.has(l.widgetCode)){n.add(l.widgetCode);continue}a.add(l.widgetCode)}n.size>0&&console.warn(`[cps-bi-sdk] duplicated widgetCode detected: ${Array.from(n).join(", ")}`)}function OZ(e){const n=new Map;for(const a of[...Q7,...e])n.set(a.widgetCode,a);return Array.from(n.values())}function Y7(e){const{children:n,widgets:a,services:l,prefixCls:c,themeConfig:u,builtinThemeConfig:p}=e,m=RZ(c),S=_.useMemo(()=>{const v=OZ(a);return TZ(v),{widgets:v,widgetMap:new Map(v.map(C=>[C.widgetCode,C])),services:l??$Z,prefixCls:m,themeConfig:u,builtinThemeConfig:p}},[p,m,l,u,a]);return X.jsx(G7.Provider,{value:S,children:n})}function rd(){const e=_.useContext(G7);if(!e)throw new Error("useDashboardConfig must be used within DashboardConfigProvider");return e}function Jm(e,n){const a=e.trim();if(/^#([0-9a-f]{6})$/i.test(a)){const l=a.slice(1),c=Number.parseInt(l.slice(0,2),16),u=Number.parseInt(l.slice(2,4),16),p=Number.parseInt(l.slice(4,6),16);return`rgba(${c}, ${u}, ${p}, ${n})`}if(/^#([0-9a-f]{3})$/i.test(a)){const l=a.slice(1),c=Number.parseInt(`${l[0]}${l[0]}`,16),u=Number.parseInt(`${l[1]}${l[1]}`,16),p=Number.parseInt(`${l[2]}${l[2]}`,16);return`rgba(${c}, ${u}, ${p}, ${n})`}return a}function X7(e,n){return{backgroundColor:e.tooltip.backgroundColor,borderColor:e.tooltip.borderColor,borderWidth:1,confine:!0,renderMode:"richText",textStyle:{color:e.tooltip.textColor},trigger:n}}function v4(e,n){return e.enableShadow?{shadowBlur:16,shadowColor:Jm(n,.18),shadowOffsetY:8}:{}}function MZ(e,n){return n.enableGradient?new LD.graphic.LinearGradient(0,0,0,1,[{offset:0,color:Jm(e,.34)},{offset:1,color:Jm(e,.04)}]):Jm(e,.12)}function k7(e,n){return n.enableGradient?new LD.graphic.LinearGradient(0,0,0,1,[{offset:0,color:Jm(e,.96)},{offset:1,color:Jm(e,.72)}]):e}function W7(e,n,a){const l=np(e),c=a.gridSpacing.top??34,u=a.gridSpacing.right??20,p=a.gridSpacing.bottom??28,m=a.gridSpacing.left??44;return{animationDuration:260,animationEasing:"cubicOut",color:a.colors,grid:{top:l.showLegend?Math.max(c,66):c,right:u,bottom:p,left:m},legend:{show:l.showLegend,top:a.legendSpacing.top??4,right:a.legendSpacing.right??0,left:a.legendSpacing.left??0,bottom:a.legendSpacing.bottom??8,itemGap:a.legendSpacing.itemGap??16,padding:a.legendSpacing.padding??0,textStyle:{color:a.axis.axisLabelColor}},tooltip:X7(a,"axis"),xAxis:{type:"category",boundaryGap:e.chartType==="bar",data:n,axisLine:{lineStyle:{color:a.axis.axisLineColor}},axisTick:{show:!1},axisLabel:{color:a.axis.axisLabelColor,margin:14}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:a.axis.splitLineColor}},axisLabel:{color:a.axis.axisLabelColor,margin:12}}}}function NZ(e,n,a){const l=new Map;return e.forEach((c,u)=>{l.set(Gy(c,n,`类目${u+1}`),b4(c,a)??0)}),l}function K7(e,n,a){return{smooth:e.chartType==="line"||e.chartType==="area",showSymbol:!1,symbol:"circle",symbolSize:7,lineStyle:{width:e.chartType==="area"?3.5:3,color:n},itemStyle:{color:n,borderWidth:2,borderColor:"#ffffff",...v4(a,n)},areaStyle:e.chartType==="area"?{color:MZ(n,a)}:void 0}}function zZ(e,n,a,l){const c=np(e),u=l.colors[0]??"#2563eb",p=NZ(n,e.dataset?.mapping.categoryField,e.dataset?.mapping.valueField),m=e.chartType==="bar"?"bar":"line";return{...W7(e,a,l),series:[{name:c.seriesName,type:m,...m==="line"?K7(e,u,l):{},itemStyle:m==="bar"?{borderRadius:[l.borderRadius,l.borderRadius,6,6],color:k7(u,l),...v4(l,u)}:void 0,barMaxWidth:e.chartType==="bar"?34:void 0,data:a.map(S=>p.get(S)??0)}]}}function DZ(e,n,a,l){const c=np(e),u=e.dataset?.mapping,p=Array.from(new Set(n.map(S=>Gy(S,u?.seriesField,"未分组")).filter(Boolean))),m=e.chartType==="bar"?"bar":"line";return{...W7(e,a,l),series:p.map((S,v)=>{const C=l.colors[v%l.colors.length]??l.colors[0]??"#2563eb",x=new Map;return n.filter(w=>Gy(w,u?.seriesField,"未分组")===S).forEach(w=>{x.set(Gy(w,u?.categoryField,"未命名类目"),b4(w,u?.valueField)??0)}),{name:S||c.seriesName,type:m,...m==="line"?K7(e,C,l):{},itemStyle:m==="bar"?{borderRadius:[l.borderRadius,l.borderRadius,6,6],color:k7(C,l),...v4(l,C)}:void 0,barMaxWidth:e.chartType==="bar"?34:void 0,data:a.map(w=>x.get(w)??0)}})}}function AZ(e,n,a){const l=np(e),c=e.dataset?.mapping;return{animationDuration:260,animationEasing:"cubicOut",color:a.colors,tooltip:X7(a,"item"),legend:{show:l.showLegend,bottom:a.legendSpacing.bottom??8,left:a.legendSpacing.left??0,right:a.legendSpacing.right??0,itemGap:a.legendSpacing.itemGap??16,padding:a.legendSpacing.padding??0,textStyle:{color:a.axis.axisLabelColor}},series:[{name:l.seriesName,type:"pie",radius:["42%","72%"],center:["50%",l.showLegend?"40%":"50%"],label:{color:a.axis.axisLabelColor,formatter:"{b}: {d}%"},itemStyle:{borderRadius:a.borderRadius,borderColor:"#ffffff",borderWidth:2},emphasis:{itemStyle:{shadowBlur:18,shadowColor:Jm(a.colors[0]??"#2563eb",.22)}},data:n.map((u,p)=>({name:Gy(u,c?.categoryField,`类目${p+1}`),value:b4(u,c?.valueField)??0}))}]}}function Ay({description:e,kind:n}){return X.jsx(Bc,{description:n==="loading"?"数据返回后会自动刷新图表预览。":void 0,kind:n,title:e})}function _Z(e){const{config:n,context:a,data:l}=e,{builtinThemeConfig:c}=rd(),u=g4(n),p=hZ(c?.charts,u.theme),m=a.mode==="builder",S=SZ(l);let v=null,C=null;if(u.dataMode==="option"&&!u.option?.source.templateKey)C=X.jsx(Ay,{description:H8(u),kind:"incomplete"});else if(u.dataMode==="dataset"&&!q7(u))C=X.jsx(Ay,{description:H8(u),kind:"incomplete"});else if(typeof l>"u")C=m?X.jsx(Ay,{description:"正在加载数据",kind:"loading"}):X.jsx(Ay,{description:"当前图表暂无可用数据",kind:"empty"});else if(l===null)C=X.jsx(Ay,{description:"当前图表暂无可用数据",kind:"empty"});else if(u.dataMode==="option")v=vZ(l);else{const x=yZ(l);if(x.length===0)C=X.jsx(Ay,{description:"当前图表暂无可用数据",kind:"empty"});else{const w=Array.from(new Set(x.map((M,N)=>Gy(M,u.dataset?.mapping.categoryField,`类目${N+1}`))));v=u.chartType==="pie"?AZ(u,x,p):u.dataset?.mapping.seriesField?DZ(u,x,w,p):zZ(u,x,w,p)}}return v?X.jsxs("div",{className:"cps-bi-builtin-widget cps-bi-builtin-chart",children:[S?X.jsx(c1,{banner:!0,className:"cps-bi-builtin-widget__summary cps-bi-builtin-chart__summary",title:S,type:"info"}):null,X.jsx("div",{className:"cps-bi-builtin-widget__body cps-bi-builtin-chart__canvas",children:X.jsx(uj,{autoResize:!0,className:"cps-bi-builtin-chart__echart",notMerge:!0,option:v,opts:{renderer:"svg"},style:{height:"100%",width:"100%"}})})]}):C}function BZ(e){if(!e)return"";const n=Date.parse(e);if(Number.isNaN(n))return"";const a=new Date(n),l=c=>String(c).padStart(2,"0");return`${a.getFullYear()}-${l(a.getMonth()+1)}-${l(a.getDate())}T${l(a.getHours())}:${l(a.getMinutes())}`}function HZ(e){return{title:typeof e.title=="string"?e.title:"",targetTime:typeof e.targetTime=="string"?e.targetTime:"",format:e.format==="mm:ss"||e.format==="HH:mm:ss"?e.format:"DD:HH:mm:ss",expiredText:typeof e.expiredText=="string"&&e.expiredText.trim().length>0?e.expiredText:"已结束",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function jZ(e){const{onChange:n,value:a}=e,l=HZ(a);return X.jsxs(It,{layout:"vertical",children:[X.jsx(It.Item,{label:"标题",children:X.jsx(ea,{"aria-label":"倒计时标题",onChange:c=>{n({...l,title:c.target.value})},value:l.title})}),X.jsx(It.Item,{label:"目标时间",children:X.jsx(ea,{"aria-label":"倒计时目标时间",onChange:c=>{const u=c.target.value;n({...l,targetTime:u?new Date(u).toISOString():""})},type:"datetime-local",value:BZ(l.targetTime)})}),X.jsx(It.Item,{label:"显示格式",children:X.jsx(ia,{"aria-label":"倒计时显示格式",onChange:c=>{n({...l,format:c})},options:[{label:"天:时:分:秒",value:"DD:HH:mm:ss"},{label:"时:分:秒",value:"HH:mm:ss"},{label:"分:秒",value:"mm:ss"}],value:l.format})}),X.jsx(It.Item,{label:"结束文案",children:X.jsx(ea,{"aria-label":"倒计时结束文案",onChange:c=>{n({...l,expiredText:c.target.value})},value:l.expiredText})}),X.jsx(It.Item,{label:"强调色",children:X.jsx(ea,{"aria-label":"倒计时强调色",onChange:c=>{n({...l,accentColor:c.target.value})},placeholder:"#2563eb",value:l.accentColor})})]})}function IZ(e){return{title:typeof e.title=="string"?e.title:"",targetTime:typeof e.targetTime=="string"?e.targetTime:"",format:e.format==="mm:ss"||e.format==="HH:mm:ss"?e.format:"DD:HH:mm:ss",expiredText:typeof e.expiredText=="string"&&e.expiredText.trim().length>0?e.expiredText:"已结束",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function Fu(e){return String(e).padStart(2,"0")}function LZ(e,n){const a=Math.max(0,Math.floor(e/1e3)),l=Math.floor(a/86400),c=Math.floor(a%86400/3600),u=Math.floor(a%3600/60),p=a%60;if(n==="mm:ss"){const m=Math.floor(a/60);return`${Fu(m)}:${Fu(p)}`}if(n==="HH:mm:ss"){const m=Math.floor(a/3600);return`${Fu(m)}:${Fu(u)}:${Fu(p)}`}return`${Fu(l)}:${Fu(c)}:${Fu(u)}:${Fu(p)}`}function VZ(e){const{config:n}=e,a=IZ(n),l=Date.parse(a.targetTime),[c,u]=_.useState(()=>Date.now());if(_.useEffect(()=>{const S=window.setInterval(()=>{u(Date.now())},1e3);return()=>{window.clearInterval(S)}},[]),!a.targetTime||Number.isNaN(l))return X.jsx(Bc,{kind:"incomplete",title:"请先设置有效的目标时间"});const p=l-c,m=p<=0;return X.jsx("div",{className:"cps-bi-builtin-widget cps-bi-builtin-countdown",style:{"--cps-bi-builtin-accent":a.accentColor},children:X.jsxs("div",{className:"cps-bi-builtin-widget__body",children:[a.title?X.jsx("div",{className:"cps-bi-builtin-countdown__title",children:a.title}):null,X.jsx("div",{className:`cps-bi-builtin-countdown__value${m?" is-expired":""}`,children:m?a.expiredText:LZ(p,a.format)})]})})}function PZ(e){return{title:typeof e.title=="string"?e.title:"",content:typeof e.content=="string"?e.content:"",align:e.align==="center"||e.align==="right"?e.align:"left",level:e.level==="hero"||e.level==="title"?e.level:"body",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function UZ(e){const{onChange:n,value:a}=e,l=PZ(a);return X.jsxs(It,{layout:"vertical",children:[X.jsx(It.Item,{label:"标题",children:X.jsx(ea,{"aria-label":"文本标题",onChange:c=>{n({...l,title:c.target.value})},value:l.title})}),X.jsx(It.Item,{label:"正文",children:X.jsx(ea.TextArea,{"aria-label":"文本正文",autoSize:{minRows:4,maxRows:10},onChange:c=>{n({...l,content:c.target.value})},value:l.content})}),X.jsx(It.Item,{label:"对齐方式",children:X.jsx(ia,{"aria-label":"文本对齐方式",onChange:c=>{n({...l,align:c})},options:[{label:"左对齐",value:"left"},{label:"居中",value:"center"},{label:"右对齐",value:"right"}],value:l.align})}),X.jsx(It.Item,{label:"字号层级",children:X.jsx(ia,{"aria-label":"文本字号层级",onChange:c=>{n({...l,level:c})},options:[{label:"大标题",value:"hero"},{label:"标题",value:"title"},{label:"正文",value:"body"}],value:l.level})}),X.jsx(It.Item,{label:"强调色",children:X.jsx(ea,{"aria-label":"文本强调色",onChange:c=>{n({...l,accentColor:c.target.value})},placeholder:"#2563eb",value:l.accentColor})})]})}function qZ(e){return{title:typeof e.title=="string"?e.title:"",content:typeof e.content=="string"?e.content:"",align:e.align==="center"||e.align==="right"?e.align:"left",level:e.level==="hero"||e.level==="title"?e.level:"body",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function FZ(e){const{config:n}=e,a=qZ(n);return a.content.trim()?X.jsx("div",{className:`cps-bi-builtin-widget cps-bi-builtin-text is-${a.level}`,style:{"--cps-bi-builtin-accent":a.accentColor},children:X.jsxs("div",{className:"cps-bi-builtin-text__body",style:{textAlign:a.align},children:[a.title?X.jsx("div",{className:"cps-bi-builtin-text__title",children:a.title}):null,X.jsx("div",{className:"cps-bi-builtin-text__content",children:a.content})]})}):X.jsx(Bc,{kind:"incomplete",title:"请先输入文本内容"})}const GZ=_Z,YZ=xZ,XZ=FZ,kZ=UZ,WZ=VZ,KZ=jZ;function hE(e){return{name:e.name,icon:e.icon,widgetCode:e.widgetCode,kind:"builtin",description:e.description,category:"charts",keywords:[e.name,F7(e.chartType),"内置图表","echarts"],minWidth:6,minHeight:e.minHeight,defaultBaseConfig:{title:e.name,showTitle:!0},defaultConfig:{chartType:e.chartType,dataMode:"dataset",dataset:{datasetKey:"",mapping:{categoryField:"",valueField:""},display:{seriesName:e.name||m4,showLegend:!0}}},dataBinding:{adapterKey:"builtin-chart",buildQuery:n=>{const a=g4(n.config),l=!!a.option?.source.templateKey;return a.dataMode==="dataset"&&!q7(a)||a.dataMode==="option"&&!l?null:{customConfig:n.config,triggerParams:n.trigger.params,scene:n.scene,triggerType:n.trigger.type,eventName:n.trigger.eventName}}},component:GZ,configComponent:YZ}}function QZ(){return{name:"文本",icon:X.jsx(sA,{}),widgetCode:"builtin-text",kind:"builtin",description:"官方内置文本块,适合说明文案、摘要与强调信息。",category:"view",keywords:["文本","说明","内置组件"],minWidth:6,minHeight:1,defaultBaseConfig:{title:"文本",showTitle:!1},defaultStyleConfig:{showCard:!1},defaultConfig:{title:"",content:"请输入需要展示的文本内容",align:"left",level:"body",accentColor:"#2563eb"},component:XZ,configComponent:kZ}}function ZZ(){return{name:"倒计时",icon:X.jsx(oA,{}),widgetCode:"builtin-countdown",kind:"builtin",description:"官方内置倒计时,适合活动、发布与节点提醒场景。",category:"view",keywords:["倒计时","时间","内置组件"],minWidth:6,minHeight:6,defaultBaseConfig:{title:"倒计时",showTitle:!1},defaultConfig:{title:"活动开始",targetTime:new Date(Date.now()+1440*60*1e3).toISOString(),format:"DD:HH:mm:ss",expiredText:"已结束",accentColor:"#2563eb"},component:WZ,configComponent:KZ}}const Q7=[hE({chartType:"line",description:"官方内置折线图,适合趋势变化与多时点对比。",icon:X.jsx(mA,{}),minHeight:10,name:"折线图",widgetCode:"builtin-line-chart"}),hE({chartType:"bar",description:"官方内置柱状图,适合分类指标对比。",icon:X.jsx(JD,{}),minHeight:10,name:"柱状图",widgetCode:"builtin-bar-chart"}),hE({chartType:"pie",description:"官方内置饼图,适合份额占比分析。",icon:X.jsx(hA,{}),minHeight:10,name:"饼图",widgetCode:"builtin-pie-chart"}),hE({chartType:"area",description:"官方内置面积图,适合展示趋势变化与累计体量。",icon:X.jsx(ZD,{}),minHeight:10,name:"面积图",widgetCode:"builtin-area-chart"}),QZ(),ZZ()];function FO(e,n){return e.x===n.x&&e.y===n.y&&e.w===n.w&&e.h===n.h}function JZ(e,n){return e.by===n.by&&e.values.length===n.values.length&&e.values.every((a,l)=>a===n.values[l])}function eJ(e,n){return e.showCard===n.showCard&&e.cardPadding===n.cardPadding&&e.cardBackgroundColor===n.cardBackgroundColor&&e.cardBorderColor===n.cardBorderColor&&e.cardBorderRadius===n.cardBorderRadius}function tJ(e,n){return e.title===n.title&&e.showTitle===n.showTitle}function j8(e,n){return e.kind===n.kind&&e.widgetCode===n.widgetCode&&e.uniqueCode===n.uniqueCode&&FO(e.layout,n.layout)&&tJ(e.baseConfig,n.baseConfig)&&eJ(e.styleConfig,n.styleConfig)&&JZ(e.linkageConfig.target,n.linkageConfig.target)}function I8(e,n){return e.kind===n.kind&&e.widgetCode===n.widgetCode&&e.uniqueCode===n.uniqueCode&&e.customConfig===n.customConfig}function nJ({getSettings:e,getComponentIds:n,getComponentsById:a}){const l=new Map,c=new Map;let u=null;const p=C=>C?a()[C]??null:null;return{clearSelectorCaches(){l.clear(),c.clear(),u=null},clearRuntimeSelectorCache(C){c.delete(C)},clearShellSelectorCache(C){l.delete(C)},invalidateCanvasLayoutCache(){u=null},selectCanvasLayoutSnapshot:()=>{const C=e(),x=n(),w=a();if(u&&u.settings===C&&u.componentIds===x&&x.every(($,z)=>w[$]?.layout===u?.layoutRefs[z]))return u.snapshot;const M=x.flatMap(T=>{const $=w[T];return $?[{id:$.id,layout:$.layout}]:[]}),N={settings:C,componentIds:x,items:M};return u={settings:C,componentIds:x,layoutRefs:M.map(T=>T.layout),snapshot:N},N},selectComponentById:p,selectComponentRuntimeById:C=>{const x=p(C);if(!x)return null;const w=c.get(x.id);if(w&&w.widgetCode===x.widgetCode&&w.uniqueCode===x.uniqueCode&&w.kind===x.kind&&w.customConfig===x.customConfig)return w.snapshot;const M={id:x.id,kind:x.kind,widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,customConfig:x.customConfig};return c.set(x.id,{widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,kind:x.kind,customConfig:x.customConfig,snapshot:M}),M},selectComponentShellById:C=>{const x=p(C);if(!x)return null;const w=x.linkageConfig.target,M=l.get(x.id);if(M&&M.widgetCode===x.widgetCode&&M.uniqueCode===x.uniqueCode&&M.kind===x.kind&&M.layout===x.layout&&M.baseConfig===x.baseConfig&&M.styleConfig===x.styleConfig&&M.linkageTarget===w)return M.snapshot;const N={id:x.id,kind:x.kind,widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,layout:x.layout,baseConfig:x.baseConfig,styleConfig:x.styleConfig,linkageTarget:w};return l.set(x.id,{widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,kind:x.kind,layout:x.layout,baseConfig:x.baseConfig,styleConfig:x.styleConfig,linkageTarget:w,snapshot:N}),N}}}function Yy(e,n,a=Object.is){const l=_.useRef(n);l.current=n;const c=_.useRef(a);c.current=a;const u=_.useRef(n(e.getSnapshot())),p=_.useCallback(()=>{const m=l.current(e.getSnapshot());return c.current(u.current,m)?u.current:(u.current=m,m)},[e]);return _.useSyncExternalStore(_.useCallback(m=>e.subscribe(S=>{const v=l.current(S);c.current(u.current,v)||(u.current=v,m())}),[e]),p,p)}function L8(e){const{settings:n,components:a,...l}=e;return l}function V8(e){const n={};for(const a of e)n[a.id]=a;return n}function aR(e,n,a,l){return!e||!n?null:{...e,settings:n,components:a.flatMap(c=>{const u=l[c];return u?[u]:[]})}}function P8(e,n,a,l,c){return{schema:e,schemaMeta:n,settings:a,componentIds:l,componentsById:c}}function oJ(e=null){let n=e?L8(e):null,a=e?.settings??null,l=e?.components.map(D=>D.id)??[],c=e?V8(e.components):{},u=e,p=P8(u,n,a,l,c);const m=new Set,S=nJ({getSettings:()=>a,getComponentIds:()=>l,getComponentsById:()=>c}),v=D=>{n=D?L8(D):null,a=D?.settings??null,l=D?.components.map(A=>A.id)??[],c=D?V8(D.components):{},u=D,S.clearSelectorCaches()},C=()=>(u===null&&n&&a&&(u=aR(n,a,l,c)),p=P8(u,n,a,l,c),p),x=()=>{const D=C();for(const A of m)A(D)},w=D=>{v(D),x()};return{get schema(){return u??aR(n,a,l,c)},get schemaMeta(){return n},get settings(){return a},get componentIds(){return l},get componentsById(){return c},getSchema:()=>(u===null&&n&&a&&(u=aR(n,a,l,c)),u),getSnapshot:()=>p,replaceSchema:w,setSchema:w,updateComponent:(D,A)=>{const I=c[D];if(!I)return;const j=A(I);Object.is(j,I)||(c={...c,[D]:j},u=null,j8(I,j)||S.clearShellSelectorCache(D),I8(I,j)||S.clearRuntimeSelectorCache(D),FO(I.layout,j.layout)||S.invalidateCanvasLayoutCache(),x())},updateComponents:(D,A)=>{if(D.length===0)return;let I=!1,j=c,V=!1;for(const B of D){const L=c[B];if(!L)continue;const P=A(L);Object.is(P,L)||(I||(j={...c},I=!0),j[B]=P,j8(L,P)||S.clearShellSelectorCache(B),I8(L,P)||S.clearRuntimeSelectorCache(B),FO(L.layout,P.layout)||(V=!0))}I&&(c=j,u=null,V&&S.invalidateCanvasLayoutCache(),x())},removeComponent:D=>{if(!c[D])return;const A={...c};delete A[D],c=A,l=l.filter(I=>I!==D),u=null,S.clearShellSelectorCache(D),S.clearRuntimeSelectorCache(D),S.invalidateCanvasLayoutCache(),x()},addComponent:D=>{const A=!!c[D.id],I=A?l:[...l,D.id],j={...c,[D.id]:D};(!A||!Object.is(c[D.id],D))&&(c=j,l=I,u=null,S.clearShellSelectorCache(D.id),S.clearRuntimeSelectorCache(D.id),S.invalidateCanvasLayoutCache(),x())},updateSettings:D=>{if(!a)return;let A=!1;for(const I of Object.keys(D))if(!Object.is(a[I],D[I])){A=!0;break}A&&(a={...a,...D},u=null,S.invalidateCanvasLayoutCache(),x())},reset(D=e){v(D),x()},subscribe(D){return m.add(D),()=>{m.delete(D)}},selectComponentById:S.selectComponentById,selectComponentShellById:S.selectComponentShellById,selectComponentRuntimeById:S.selectComponentRuntimeById,selectCanvasLayoutSnapshot:S.selectCanvasLayoutSnapshot}}var lS={},rR={exports:{}},U8;function S4(){return U8||(U8=1,(function(e){function n(a){return a&&a.__esModule?a:{default:a}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(rR)),rR.exports}var iS={},q8;function aJ(){if(q8)return iS;q8=1,Object.defineProperty(iS,"__esModule",{value:!0}),iS.default=void 0;const e={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};return iS.default=e,iS}var sS={},cS={},uS={},dS={},F8;function rJ(){return F8||(F8=1,Object.defineProperty(dS,"__esModule",{value:!0}),dS.commonLocale=void 0,dS.commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),dS}var G8;function lJ(){if(G8)return uS;G8=1,Object.defineProperty(uS,"__esModule",{value:!0}),uS.default=void 0;var e=rJ();function n(S){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},n(S)}function a(S,v){var C=Object.keys(S);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(S);v&&(x=x.filter(function(w){return Object.getOwnPropertyDescriptor(S,w).enumerable})),C.push.apply(C,x)}return C}function l(S){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?a(Object(C),!0).forEach(function(x){c(S,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(C)):a(Object(C)).forEach(function(x){Object.defineProperty(S,x,Object.getOwnPropertyDescriptor(C,x))})}return S}function c(S,v,C){return v=u(v),v in S?Object.defineProperty(S,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[v]=C,S}function u(S){var v=p(S,"string");return n(v)=="symbol"?v:String(v)}function p(S,v){if(n(S)!="object"||!S)return S;var C=S[Symbol.toPrimitive];if(C!==void 0){var x=C.call(S,v);if(n(x)!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(S)}var m=l(l({},e.commonLocale),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});return uS.default=m,uS}var fS={},Y8;function Z7(){if(Y8)return fS;Y8=1,Object.defineProperty(fS,"__esModule",{value:!0}),fS.default=void 0;const e={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};return fS.default=e,fS}var X8;function J7(){if(X8)return cS;X8=1;var e=S4().default;Object.defineProperty(cS,"__esModule",{value:!0}),cS.default=void 0;var n=e(lJ()),a=e(Z7());const l={lang:{placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"],...n.default},timePickerLocale:{...a.default}};return l.lang.ok="确定",cS.default=l,cS}var k8;function iJ(){if(k8)return sS;k8=1;var e=S4().default;Object.defineProperty(sS,"__esModule",{value:!0}),sS.default=void 0;var n=e(J7());return sS.default=n.default,sS}var W8;function sJ(){if(W8)return lS;W8=1;var e=S4().default;Object.defineProperty(lS,"__esModule",{value:!0}),lS.default=void 0;var n=e(aJ()),a=e(iJ()),l=e(J7()),c=e(Z7());const u="${label}不是一个有效的${type}",p={locale:"zh-cn",Pagination:n.default,DatePicker:l.default,TimePicker:c.default,Calendar:a.default,global:{placeholder:"请选择",close:"关闭",sortable:"可排序"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckAll:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:u,method:u,array:u,object:u,number:u,date:u,boolean:u,integer:u,float:u,regexp:u,email:u,url:u,hex:u},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无",transparent:"无色",singleColor:"单色",gradientColor:"渐变色"}};return lS.default=p,lS}var lR,K8;function cJ(){return K8||(K8=1,lR=sJ()),lR}var uJ=cJ();const dJ=xA(uJ);function GO(e){const{children:n,getPopupContainer:a}=e,{prefixCls:l,themeConfig:c}=rd();return X.jsx(Gs,{getPopupContainer:a,locale:dJ,prefixCls:l,theme:c,children:n})}const fJ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Wf=(e=21)=>{let n="",a=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=fJ[a[e]&63];return n};const pJ=120;function eH(e,n){return!e.targets||e.targets.length===0?!0:e.targets.some(a=>a.by==="uniqueCode"?a.value===n.uniqueCode:a.value===n.widgetCode)}function tH(e={}){let n=!1;const a=new Map,l=[],c=e.maxEventsPerSecond??pJ,u=e.now??(()=>Date.now()),p=C=>{const x=a.get(C);if(x)return x;const w=new Set;return a.set(C,w),w},m=C=>{const x=a.get(C);x&&x.size===0&&a.delete(C)},S=C=>{for(;l.length>0&&C-l[0]>=1e3;)l.shift()},v=C=>(S(C),l.length>=c?!0:(l.push(C),!1));return{emit(C){if(n||C.ttl<=0)return;const x=C.timestamp>0?C.timestamp:u();if(v(x))return;const w={...C,timestamp:x},M=a.get(C.eventName);if(M)for(const T of M)T(w);const N=a.get("*");if(N)for(const T of N)T(w)},subscribe(C,x){if(n)return()=>{};const w=p(C);return w.add(x),()=>{w.delete(x),m(C)}},dispose(){n=!0,a.clear(),l.length=0}}}const RS={width:1920,height:1080},mJ={"16:9":RS,"4:3":{width:1600,height:1200},"21:9":{width:2520,height:1080},"9:16":{width:1080,height:1920}};function YO(e){return mJ[e]}function nH(e){return e?e.screenAspectRatio==="custom"?{width:Math.max(320,e.screenWidth??RS.width),height:Math.max(240,e.screenHeight??RS.height)}:e.screenAspectRatio?YO(e.screenAspectRatio):RS:RS}const pS={showCard:!0,cardPadding:16,cardBackgroundColor:"#ffffff",cardBorderColor:"#e8ebf0",cardBorderRadius:8};function Kf(e){return{showCard:e?.showCard??pS.showCard,cardPadding:Math.max(0,e?.cardPadding??pS.cardPadding),cardBackgroundColor:e?.cardBackgroundColor??pS.cardBackgroundColor,cardBorderColor:e?.cardBorderColor??pS.cardBorderColor,cardBorderRadius:Math.max(0,e?.cardBorderRadius??pS.cardBorderRadius)}}function hJ(e){const n=Kf(e.defaultStyleConfig);return{showCard:n.showCard,cardPadding:n.cardPadding,cardBackgroundColor:n.cardBackgroundColor,cardBorderColor:n.cardBorderColor,cardBorderRadius:n.cardBorderRadius}}function ts(e){return e===void 0?"undefined":Array.isArray(e)?`[${e.map(n=>ts(n)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>`${JSON.stringify(n)}:${ts(a)}`).join(",")}}`:JSON.stringify(e)}function oH(e,n){return n instanceof Error?(n.message=`${e}: ${n.message}`,n):new Error(n?`${e}: ${String(n)}`:e)}function gJ(e){return{customConfig:e.config,triggerParams:e.trigger.params,scene:e.scene,triggerType:e.trigger.type,eventName:e.trigger.eventName}}function Q8({dashboardCode:e,component:n,manifest:a,scene:l,trigger:c,services:u,signal:p}){if(!a)return{kind:"inactive"};const m={dashboardCode:e,component:n,config:n.customConfig,scene:l,trigger:c},S=a.dataBinding,v=typeof S?.adapterKey=="function"?S.adapterKey(m):S?.adapterKey??n.widgetCode;if(v===null)return{kind:"inactive"};const C=S?.buildQuery?.(m)??gJ(m);if(C===null)return{kind:"inactive"};const x=u.dataSourceAdapters?.[v];return x?{kind:"execute",adapter:x,adapterKey:v,request:{dashboardCode:e,component:n,scene:l,trigger:c,signal:p,query:C}}:!S&&v===n.widgetCode?{kind:"inactive"}:{kind:"error",error:oH(`未找到数据源 adapter: ${v}`)}}async function yJ(e){try{return await e.adapter.execute(e.request)}catch(n){throw oH(`adapter ${e.adapterKey} 执行失败`,n)}}function bJ(e){return[e.dashboardCode,e.scene,e.widgetCode,e.uniqueCode,ts(e.customConfig)].join("::")}function aH({dashboardCode:e,component:n,widgetCode:a,uniqueCode:l,customConfig:c,scene:u,enabled:p=!0,onRuntimeError:m,onReceiveUpdate:S}){const{services:v,widgetMap:C}=rd(),x=_.useRef(null),w=_.useRef(m),M=_.useRef(n),N=_.useRef(a),T=_.useRef(l),$=C.get(a),z=_.useRef($),D=_.useRef(v),A=_.useMemo(()=>p?Q8({dashboardCode:e,component:n,manifest:$,scene:u,trigger:{type:"initial"},services:v,signal:new AbortController().signal}):{kind:"inactive"},[n,e,p,$,u,v]),[I,j]=_.useState(A.kind==="execute"),[V,B]=_.useState(A.kind==="execute"),[L,P]=_.useState(void 0),[G,F]=_.useState(null),W=bJ({dashboardCode:e,widgetCode:a,uniqueCode:l,customConfig:c,scene:u});_.useEffect(()=>{p||(x.current?.abort(),j(!1),B(!1),P(void 0),F(null))},[p]),_.useEffect(()=>{w.current=m},[m]),_.useEffect(()=>{M.current=n,N.current=a,T.current=l},[n,l,a]),_.useEffect(()=>{z.current=$,D.current=v},[$,v]);const k=_.useCallback(async ne=>{if(!p){x.current?.abort(),j(!1),B(!1),P(void 0),F(null);return}x.current?.abort();const re=new AbortController;x.current=re;const q=Q8({dashboardCode:e,component:M.current,manifest:z.current,scene:u,trigger:{type:ne?.type??"initial",eventName:ne?.eventName,params:ne?.params},services:D.current,signal:re.signal});if(q.kind==="inactive"){j(!1),B(!1),P(void 0),F(null);return}if(q.kind==="error"){j(!0),B(!1),P(void 0),F(q.error),w.current?.({phase:"data-resolve",widgetCode:N.current,uniqueCode:T.current,error:q.error});return}j(!0),B(!0),F(null);try{const K=await yJ(q);return re.signal.aborted?void 0:(P(K),B(!1),K)}catch(K){if(re.signal.aborted)return;F(K),B(!1),w.current?.({phase:"data-resolve",widgetCode:N.current,uniqueCode:T.current,error:K});return}},[e,p,W,u]);return _.useEffect(()=>(k({type:"initial"}),()=>{x.current?.abort()}),[k]),_.useEffect(()=>{const ne=S?.(re=>{k({type:"linkage",eventName:re.eventName,params:re.params})})??(()=>{});return()=>{ne()}},[S,k]),{active:I,loading:V,data:L,error:G,resolve:k}}function By(e){const{state:n,widgetCode:a,uniqueCode:l,phase:c,error:u,emptyRender:p,errorRender:m}=e;if(n==="loading")return X.jsx(Bc,{className:"cps-bi-viewer__fallback cps-bi-viewer__fallback--loading",description:"数据返回后会自动刷新当前组件。",kind:"loading",title:"组件数据加载中"});if(n==="empty")return p?X.jsx(X.Fragment,{children:p({widgetCode:a,uniqueCode:l})}):X.jsx(Bc,{className:"cps-bi-viewer__fallback cps-bi-viewer__fallback--empty",kind:"empty",title:`${a} 暂无数据`});const S={phase:c??"widget-render",widgetCode:a,uniqueCode:l,error:u};return m?X.jsx(X.Fragment,{children:m(S)}):X.jsx(Bc,{className:"cps-bi-viewer__fallback cps-bi-viewer__fallback--error",description:c==="data-resolve"?"数据解析失败,请检查数据接口与返回结构。":"组件渲染失败,请检查组件实现。",kind:"error",title:`运行异常:${a}`})}function uw(e,n=0){if(e===null)return"null";if(typeof e>"u")return"undefined";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return n>=2?`array:${e.length}`:`array:${e.length}:${e.slice(0,3).map(a=>uw(a,n+1)).join("|")}`;if(typeof e=="object"){const a=e,l=Object.keys(a).sort();return n>=2?`object:${l.join(",")}`:`object:${l.slice(0,6).map(c=>`${c}:${uw(a[c],n+1)}`).join("|")}`}return typeof e}let vJ=class extends _.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n){this.props.onError(n)}componentDidUpdate(n){n.resetKey!==this.props.resetKey&&this.state.error&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error):this.props.children}};const SJ=()=>{},CJ=()=>()=>{};function xJ(e){const{dashboardCode:n,component:a,scene:l="viewer",onRuntimeError:c,emptyRender:u,errorRender:p,notifyUpdate:m=SJ,onReceiveUpdate:S=CJ}=e,{widgetMap:v}=rd(),C=v.get(a.widgetCode),x=Kf(a.styleConfig),w=a.baseConfig.title||a.widgetCode,{active:M,loading:N,data:T,error:$}=aH({dashboardCode:n,component:a,customConfig:a.customConfig,onReceiveUpdate:S,scene:l,onRuntimeError:c,uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}),z=[a.uniqueCode,l,uw(a.customConfig),N?"loading":"ready",$?"resolve-error":"resolve-ok",uw(T)].join("::"),D={"--cps-bi-viewer-widget-padding":`${x.showCard?x.cardPadding:0}px`,"--cps-bi-viewer-widget-background":x.cardBackgroundColor,"--cps-bi-viewer-widget-border":x.cardBorderColor,"--cps-bi-viewer-widget-radius":`${x.cardBorderRadius}px`,overflow:"hidden"},A=j=>X.jsxs("article",{className:`cps-bi-viewer__widget${x.showCard?"":" is-card-hidden"}`,"data-widget-code":a.widgetCode,style:D,children:[a.baseConfig.showTitle?X.jsx("header",{className:"cps-bi-viewer__widget-header",children:X.jsx("strong",{className:"cps-bi-text-strong",children:w})}):null,X.jsx("div",{className:"cps-bi-viewer__widget-content",children:j})]});if(!C)return A(X.jsx(By,{emptyRender:u,state:"empty",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));if(M&&N)return A(X.jsx(By,{state:"loading",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));if(M&&$)return A(X.jsx(By,{error:$,errorRender:p,phase:"data-resolve",state:"error",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));if(M&&T===null)return A(X.jsx(By,{emptyRender:u,state:"empty",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));const I=C.component;return X.jsx(vJ,{fallback:j=>X.jsx(By,{error:j,errorRender:p,phase:"widget-render",state:"error",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}),onError:j=>{c?.({phase:"widget-render",widgetCode:a.widgetCode,uniqueCode:a.uniqueCode,error:j})},resetKey:z,children:A(X.jsx(I,{config:a.customConfig,context:{dashboardCode:n,mode:"viewer"},data:M?T:void 0,notifyUpdate:m,onReceiveUpdate:S,uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}))})}const EJ=3;function wJ(e){const n=e.clientWidth,a=e.clientHeight;if(n>0||a>0)return{width:n,height:a};const l=e.getBoundingClientRect();return{width:l.width,height:l.height}}function $J(e){return e.reduce((n,a)=>Math.max(n,a.layout.y+a.layout.h),0)}function RJ(e,n){const[,a]=e.margin,[,l]=e.padding,c=$J(n);return c<=0?l*2:l*2+c*e.rowHeight+Math.max(0,c-1)*a}function TJ(e,n,a){const l=n.cols,[c,u]=n.margin,[p,m]=n.padding,S=(a-p*2-c*(l-1))/l,v=Number.isFinite(S)?Math.max(0,S):0,{x:C,y:x,w,h:M}=e.layout;return{overflow:"hidden",position:"absolute",left:`${p+C*(v+c)}px`,top:`${m+x*(n.rowHeight+u)}px`,width:`${Math.max(1,v*w+c*Math.max(0,w-1))}px`,height:`${Math.max(1,n.rowHeight*M+u*Math.max(0,M-1))}px`}}function rH(e){const{schema:n,onRuntimeError:a,onLinkageFeedback:l,debug:c,emptyRender:u,errorRender:p,scene:m="viewer"}=e,S=_.useMemo(()=>tH(),[]),v=_.useRef(null),C=_.useRef(l),[x,w]=_.useState({width:0,height:0});_.useEffect(()=>{C.current=l},[l]);const M=_.useMemo(()=>{const B=new Map;for(const L of n.components){const P=new Set,G=L.linkageConfig.target.values.length>0?L.linkageConfig.target.values.map(k=>({by:L.linkageConfig.target.by,value:k})):void 0,F=(k,ne,re)=>{S.emit({eventId:Wf(),sourceUniqueCode:L.uniqueCode,sourceWidgetCode:L.widgetCode,eventName:k,params:ne,targets:re?.targets??G,depth:0,ttl:re?.ttl??EJ,timestamp:Date.now()})},W=k=>S.subscribe("*",ne=>{if(ne.sourceUniqueCode!==L.uniqueCode&&eH(ne,{widgetCode:L.widgetCode,uniqueCode:L.uniqueCode})){if(!P.has(ne.eventId)){if(P.add(ne.eventId),P.size>64){const re=P.values().next().value;re&&P.delete(re)}c?.linkage&&console.debug("[cps-bi][linkage]",{eventName:ne.eventName,sourceUniqueCode:ne.sourceUniqueCode,sourceWidgetCode:ne.sourceWidgetCode,targetUniqueCode:L.uniqueCode,targetWidgetCode:L.widgetCode,timestamp:ne.timestamp}),C.current?.({eventName:ne.eventName,sourceWidgetCode:ne.sourceWidgetCode,sourceUniqueCode:ne.sourceUniqueCode,targetWidgetCode:L.widgetCode,targetUniqueCode:L.uniqueCode,timestamp:ne.timestamp})}k({sourceWidgetCode:ne.sourceWidgetCode,sourceUniqueCode:ne.sourceUniqueCode,eventName:ne.eventName,params:ne.params})}});B.set(L.id,{notifyUpdate:F,onReceiveUpdate:W})}return B},[c?.linkage,S,n.components]);_.useEffect(()=>{const B=v.current;if(!B)return;const L=()=>{w(wJ(B))},P=()=>{L()};if(L(),typeof ResizeObserver>"u")return window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)};const G=new ResizeObserver(F=>{const W=F[0];if(Array.isArray(W?.contentBoxSize)?W.contentBoxSize[0]:W?.contentBoxSize){L();return}L()});return G.observe(B),()=>{G.disconnect()}},[]);const N=n.settings,T=N.canvasMode==="screen",$=Math.max(320,N.minWidth),z=Math.max(0,x.width),D=Math.max(0,x.height),A=_.useMemo(()=>N.bgImageUrl?{backgroundColor:N.bgColor,backgroundImage:`url("${N.bgImageUrl}")`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}:{backgroundColor:N.bgColor},[N.bgColor,N.bgImageUrl]),I=_.useMemo(()=>RJ(N,n.components),[n.components,N]),j=_.useMemo(()=>nH(N),[N]),V=_.useMemo(()=>{if(T){const G=j.width,F=j.height,W=z>0&&z<$,k=W?$:Math.max(z,$),ne=Math.max(D,1),re=Math.min(k/G,ne/F),q=G*re,K=F*re,J=(k-q)/2,ae=(ne-K)/2;return{modeClassName:"is-screen-mode",needHorizontalScroll:W,surfaceStyle:{width:`${k}px`,height:`${ne}px`},stageStyle:{width:`${G}px`,height:`${F}px`,transform:`translate(${J}px, ${ae}px) scale(${re})`,transformOrigin:"0 0"},itemWidthBase:G}}const B=Math.max(z,$),L=Math.max(D,I);return{modeClassName:"is-responsive-mode",needHorizontalScroll:z>0&&z<$,surfaceStyle:{width:`${B}px`,height:`${L}px`},stageStyle:{width:`${B}px`,height:`${L}px`,...A},itemWidthBase:B}},[T,I,$,A,j.height,j.width,D,z]);return n.components.length===0?X.jsx(GO,{getPopupContainer:()=>v.current??document.body,children:X.jsx("section",{className:"cps-bi-viewer",ref:v,children:X.jsx(By,{emptyRender:u,state:"empty",uniqueCode:"dashboard-empty",widgetCode:"dashboard"})})}):X.jsx(GO,{getPopupContainer:()=>v.current??document.body,children:X.jsx("section",{className:["cps-bi-viewer",V.modeClassName,V.needHorizontalScroll?"is-scrollable-runtime":""].filter(Boolean).join(" "),"data-testid":"viewer-runtime-viewport",ref:v,style:T?A:void 0,children:X.jsx("div",{className:"cps-bi-viewer__stage-surface","data-testid":"viewer-runtime-surface",style:V.surfaceStyle,children:X.jsx("div",{className:"cps-bi-viewer__stage","data-testid":"viewer-runtime-stage",style:V.stageStyle,children:n.components.map(B=>{const L=M.get(B.id);return L?X.jsx("div",{className:"cps-bi-viewer__item",style:TJ(B,N,V.itemWidthBase),children:X.jsx(xJ,{component:B,dashboardCode:n.code,emptyRender:u,errorRender:p,notifyUpdate:L.notifyUpdate,onReceiveUpdate:L.onReceiveUpdate,onRuntimeError:a,scene:m})},B.id):null})})})})})}function OJ(e){const{getContainer:n,modifierLabel:a,onClose:l,open:c}=e;return X.jsx(Cr,{cancelButtonProps:{style:{display:"none"}},footer:[X.jsx(Pn,{onClick:l,type:"primary",children:"知道了"},"ok")],getContainer:n,onCancel:l,open:c,title:"操作提示",width:680,children:X.jsxs("div",{className:"cps-bi-builder__help-panel",children:[X.jsxs("section",{children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"导航与保存"}),X.jsxs("div",{className:"cps-bi-builder__help-list",children:[X.jsxs("p",{children:[X.jsx("kbd",{children:a}),X.jsx("span",{children:"+"}),X.jsx("kbd",{children:"S"}),X.jsx("span",{children:"保存当前仪表盘"})]}),X.jsxs("p",{children:[X.jsx("kbd",{children:a}),X.jsx("span",{children:"+"}),X.jsx("kbd",{children:"Z"}),X.jsxs("span",{children:["撤销,",a," + Y 或 ",a," + Shift + Z 重做"]})]})]})]}),X.jsxs("section",{children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"组件编辑"}),X.jsx("div",{className:"cps-bi-builder__help-list",children:X.jsxs("p",{children:[X.jsx("kbd",{children:"Delete"}),X.jsx("span",{children:"/"}),X.jsx("kbd",{children:"Backspace"}),X.jsx("span",{children:"删除选中组件"})]})})]}),X.jsxs("section",{children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"画布操作"}),X.jsxs("div",{className:"cps-bi-builder__help-list",children:[X.jsxs("p",{children:[X.jsx("kbd",{children:a}),X.jsx("span",{children:"+"}),X.jsx("kbd",{children:"滚轮"}),X.jsx("span",{children:"按 5% 步进缩放(仅大屏模式)"})]}),X.jsxs("p",{children:[X.jsx("kbd",{children:"Space"}),X.jsx("span",{children:"按住切换抓手拖动画布(仅大屏模式)"})]}),X.jsxs("p",{children:[X.jsx("kbd",{children:"拖拽主体"}),X.jsx("span",{children:"移动组件;边和角可调整大小"})]})]})]})]})})}class MJ extends _.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}render(){return this.state.error?X.jsx(c1,{showIcon:!0,title:"组件预览失败",type:"warning"}):this.props.children}}function NJ(e){return e==="charts"?"图表":e==="view"?"视图":e==="other"?"其他":"插件"}function zJ(e,n){const a=n.trim().toLowerCase();return a?[e.name,e.widgetCode,e.description,...e.keywords??[]].filter(Boolean).join(" ").toLowerCase().includes(a):!0}function DJ(e){return{keyword:e.keyword.trim()||void 0,filters:Object.keys(e.filters).length>0?e.filters:void 0}}function AJ(e,n,a){if(!(a.keyword.trim().length===0&&Object.keys(a.filters).length===0))return e;const c=e.filter(p=>p.kind==="builtin"),u=e.filter(p=>p.kind==="extension");return n?[...c,...u.slice(0,5)]:u.slice(0,20)}function _J(e){const n=new Map;for(const a of e){const l=a.kind==="extension"?"插件":a.category==="charts"?"图表":a.category==="view"?"视图":"其他",c=n.get(l)??[];c.push(a),n.set(l,c)}return Array.from(n.entries()).map(([a,l])=>({title:a,items:l}))}function BJ({widget:e}){const n=e.component;return X.jsx(MJ,{children:X.jsx(n,{config:{...e.defaultConfig},context:{dashboardCode:"widget_market_preview",mode:"builder"},data:void 0,notifyUpdate:()=>{},onReceiveUpdate:()=>()=>{},uniqueCode:"widget_market_preview",widgetCode:e.widgetCode})})}function HJ(){return X.jsx("div",{className:"cps-bi-widget-catalog__market-skeleton","data-testid":"widget-market-skeleton",children:Array.from({length:6}).map((e,n)=>X.jsx("div",{className:"cps-bi-widget-catalog__market-skeleton-item",children:X.jsx(tp,{active:!0,avatar:!0,paragraph:{rows:3},title:!0})},n))})}function jJ(e){const{widgets:n,readonly:a,modalContainer:l,allowUseBuiltInWidgets:c,widgetCatalogFilterRender:u,onAddWidget:p,onAddWidgets:m}=e,{services:S}=rd(),[v,C]=_.useState(!1),[x,w]=_.useState(!1),[M,N]=_.useState(null),[T,$]=_.useState({keyword:"",filters:{}}),[z,D]=_.useState(new Set),[A,I]=_.useState(null),[j,V]=_.useState(!1),B=_.useRef(null);_.useEffect(()=>{let oe=!0;async function te(){if(!S.getAuthorizedWidgetCodes){I(null);return}V(!0);try{const ue=await S.getAuthorizedWidgetCodes(DJ(T));if(!oe)return;I(new Set(ue))}finally{if(!oe)return;V(!1)}}return te(),()=>{oe=!1}},[T,S]);const L=_.useMemo(()=>n.filter(oe=>!(!c&&oe.kind==="builtin"||!zJ(oe,T.keyword)||oe.kind==="extension"&&A&&!A.has(oe.widgetCode))),[c,A,T.keyword,n]),P=_.useMemo(()=>AJ(L,c,T),[c,T,L]),G=_.useMemo(()=>_J(P),[P]),F=_.useMemo(()=>L.filter(oe=>oe.kind==="extension"),[L]),W=_.useMemo(()=>L.filter(oe=>z.has(oe.widgetCode)),[z,L]),k=_.useMemo(()=>F.find(oe=>oe.widgetCode===M)??null,[M,F]),ne=!!u,re=!ne,q=()=>{D(oe=>oe.size===0?oe:new Set)},K=oe=>{a||D(te=>{const ue=new Set(te);return ue.has(oe)?ue.delete(oe):ue.add(oe),ue})},J=()=>{W.length!==0&&(m(W),q(),N(null),w(!1),C(!1))},ae=oe=>{p(oe),q(),N(null),w(!1),C(!1)},Z=X.jsx("section",{className:"cps-bi-widget-catalog__popover",children:X.jsxs(T7,{className:"cps-bi-widget-catalog__popover-layout",gap:12,vertical:!0,children:[X.jsx(ea,{allowClear:!0,onChange:oe=>{$(te=>({...te,keyword:oe.target.value}))},placeholder:"搜索组件",prefix:X.jsx(IS,{}),value:T.keyword}),X.jsx("div",{className:"cps-bi-widget-catalog__quick-list",children:G.length===0?X.jsx(os,{description:"暂无可用组件",image:os.PRESENTED_IMAGE_SIMPLE}):G.map(oe=>X.jsxs("section",{className:"cps-bi-widget-catalog__quick-group",children:[X.jsx("span",{className:"cps-bi-widget-catalog__quick-group-title cps-bi-text-secondary",children:oe.title}),X.jsxs("div",{className:"cps-bi-widget-catalog__quick-grid",children:[oe.items.map(te=>{const ue=z.has(te.widgetCode);return X.jsxs("div",{"aria-disabled":a,"aria-label":te.name,className:`cps-bi-widget-catalog__quick-item${ue?" is-selected":""}${a?" is-disabled":""}`,onClick:()=>{K(te.widgetCode)},onKeyDown:ce=>{ce.key!=="Enter"&&ce.key!==" "||(ce.preventDefault(),K(te.widgetCode))},role:"button",tabIndex:a?-1:0,title:te.name,children:[X.jsx("span",{"aria-hidden":!0,className:"cps-bi-widget-catalog__quick-item-icon",children:te.icon??X.jsx(CS,{})}),X.jsx("span",{className:"cps-bi-widget-catalog__quick-item-name",children:te.name})]},te.widgetCode)}),oe.title==="插件"&&F.length>0?X.jsxs("div",{"aria-disabled":a,"aria-label":"更多",className:`cps-bi-widget-catalog__quick-item cps-bi-widget-catalog__quick-item--more${a?" is-disabled":""}`,onClick:()=>{a||(C(!1),w(!0))},onKeyDown:te=>{a||te.key!=="Enter"&&te.key!==" "||(te.preventDefault(),C(!1),w(!0))},role:"button",tabIndex:a?-1:0,children:[X.jsx("span",{"aria-hidden":!0,className:"cps-bi-widget-catalog__quick-item-icon",children:X.jsx(ob,{})}),X.jsx("span",{className:"cps-bi-widget-catalog__quick-item-name",children:"更多"})]}):null]})]},oe.title))}),X.jsxs("div",{className:"cps-bi-widget-catalog__quick-actions",children:[X.jsxs("span",{className:"cps-bi-text-secondary",children:["已选 ",W.length]}),X.jsxs(_c,{size:8,children:[X.jsx(Pn,{onClick:q,children:"清空"}),X.jsx(Pn,{disabled:a||W.length===0,onClick:J,type:"primary",children:"添加"})]})]})]})}),le=k?X.jsxs("div",{className:"cps-bi-widget-catalog__modal-footer",children:[X.jsx(Pn,{onClick:()=>{N(null)},children:"返回列表"}),X.jsx(Pn,{disabled:a,onClick:()=>ae(k),type:"primary",children:"添加组件"})]}):X.jsxs("div",{className:"cps-bi-widget-catalog__modal-footer",children:[X.jsxs("span",{className:"cps-bi-widget-catalog__modal-footer-count cps-bi-text-secondary",children:["已选 ",W.length]}),X.jsx(Pn,{onClick:q,children:"清空"}),X.jsx(Pn,{disabled:a||W.length===0,onClick:J,type:"primary",children:"添加"})]});return X.jsxs("div",{ref:B,children:[X.jsx(kM,{content:Z,getPopupContainer:()=>B.current||document.body,onOpenChange:oe=>{C(oe),oe||q()},open:v&&!x,placement:"bottomRight",trigger:"click",children:X.jsx(Pn,{disabled:a,icon:X.jsx(CS,{}),children:"新增组件"})}),X.jsx(Cr,{footer:le,getContainer:l??void 0,onCancel:()=>{w(!1),N(null)},open:x,title:"插件市场",width:1220,children:X.jsxs("section",{className:`cps-bi-widget-catalog__modal${ne?"":" is-filter-hidden"}${k?" is-detail-mode":""}`,children:[ne&&!k?X.jsxs("aside",{className:"cps-bi-widget-catalog__modal-filter",children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"筛选"}),u?.({keyword:T.keyword,filters:T.filters,onKeywordChange:oe=>{$(te=>({...te,keyword:oe}))},onFilterChange:oe=>{$(te=>({...te,filters:oe}))}})]}):null,X.jsxs("section",{className:"cps-bi-widget-catalog__modal-list",children:[re&&!k?X.jsx("div",{className:"cps-bi-widget-catalog__filter",children:X.jsx(ea,{allowClear:!0,onChange:oe=>{$(te=>({...te,keyword:oe.target.value}))},placeholder:"搜索外部组件",prefix:X.jsx(IS,{}),value:T.keyword})}):null,k?X.jsxs("section",{className:"cps-bi-widget-catalog__detail",children:[X.jsxs("header",{className:"cps-bi-widget-catalog__detail-header",children:[X.jsx("div",{className:"cps-bi-widget-catalog__detail-icon",children:k.icon??X.jsx(CS,{})}),X.jsxs("div",{className:"cps-bi-widget-catalog__detail-meta",children:[X.jsxs("div",{className:"cps-bi-widget-catalog__detail-title-row",children:[X.jsx("h3",{className:"cps-bi-text-heading-lg",children:k.name}),X.jsx(Zm,{children:k.widgetCode})]}),X.jsx("p",{className:"cps-bi-widget-catalog__detail-desc cps-bi-text-secondary",children:k.description??"暂无描述"}),X.jsxs(_c,{size:[8,8],wrap:!0,children:[X.jsx(Zm,{children:NJ(k.category)}),X.jsxs(Zm,{color:"blue",children:["开发者:",k.developer?.name??"未提供"]})]})]})]}),X.jsx("section",{className:"cps-bi-widget-catalog__detail-preview",children:X.jsx("div",{className:"cps-bi-widget-catalog__detail-preview-shell",children:X.jsx(BJ,{widget:k})})})]}):j?X.jsx(HJ,{}):X.jsx("div",{className:"cps-bi-widget-catalog__market-wrapper",children:X.jsx("div",{className:"cps-bi-widget-catalog__market-list",children:F.length===0?X.jsx(os,{description:"没有匹配的外部组件"}):F.map(oe=>{const te=z.has(oe.widgetCode);return X.jsxs("article",{className:`cps-bi-widget-catalog__market-item${te?" is-selected":""}`,onClick:()=>{K(oe.widgetCode)},title:oe.description??oe.name,children:[X.jsx("div",{className:"cps-bi-widget-catalog__market-item-icon",children:oe.icon??X.jsx(CS,{})}),X.jsxs("div",{className:"cps-bi-widget-catalog__market-item-body",children:[X.jsx("h4",{className:"cps-bi-widget-catalog__market-item-title cps-bi-text-heading-sm",children:oe.name}),X.jsx("p",{className:"cps-bi-widget-catalog__market-item-desc cps-bi-text-secondary",children:oe.description??"暂无描述"})]}),X.jsx("div",{className:"cps-bi-widget-catalog__market-item-actions",children:X.jsx(Pn,{onClick:ue=>{ue.stopPropagation(),N(oe.widgetCode)},type:"default",children:"详情"})})]},oe.widgetCode)})})})]})]})})]})}function IJ(e){const{readonly:n,mode:a,title:l,version:c,status:u,hasComponents:p,canUndo:m,canRedo:S,titleRender:v,schema:C,modalContainer:x,widgets:w,allowUseBuiltInWidgets:M,widgetCatalogFilterRender:N,saving:T,publishing:$,persistenceDisabled:z,persistenceDisabledReason:D,onOpenCanvasSettings:A,onToggleFullscreen:I,onImportJson:j,onExportJson:V,onAutoAlign:B,onUndo:L,onRedo:P,onClearCanvas:G,onAddWidget:F,onAddWidgets:W,onSave:k,onPublish:ne,onHelp:re,onOpenVersionHistory:q,onEdit:K,onDuplicate:J,onDelete:ae}=e,Z=!n,le=n||T||$||z,oe=D??"保存",te=D??"发布",ue={draft:"草稿",published:"已发布"},ce=[{key:"import",icon:X.jsx(fA,{}),label:"导入",disabled:n||T||$,onClick:j},{key:"export",icon:X.jsx(aA,{}),label:"导出",onClick:V},{type:"divider"},{key:"edit",icon:X.jsx(rA,{}),label:"编辑",disabled:n,onClick:K},{key:"duplicate",icon:X.jsx(eM,{}),label:"复制",disabled:n,onClick:J},{key:"delete",icon:X.jsx(tM,{}),danger:!0,label:"删除",disabled:n,onClick:ae}];return X.jsxs("header",{className:"cps-bi-builder__topbar",children:[X.jsxs("section",{className:"cps-bi-builder__topbar-left",children:[X.jsxs("div",{className:"cps-bi-builder__topbar-title-block",children:[X.jsx("h4",{className:"cps-bi-builder__topbar-title",children:v?v({schema:C,mode:a}):l??"仪表盘编辑器"}),X.jsxs(_c,{size:6,children:[u?X.jsx(Zm,{color:u==="published"?"success":"processing",children:ue[u]}):null,c?X.jsx(Pn,{icon:X.jsx(dA,{}),onClick:q,size:"small",type:"text",children:c}):null]})]}),X.jsxs(_c,{children:[X.jsx(xl,{title:"自动对齐",children:X.jsx(Pn,{"aria-label":"自动对齐",disabled:!Z||!p,icon:X.jsx(QD,{}),onClick:B})}),X.jsx(xl,{title:"撤销",children:X.jsx(Pn,{"aria-label":"撤销",disabled:!Z||!m,icon:X.jsx(vA,{}),onClick:L})}),X.jsx(xl,{title:"重做",children:X.jsx(Pn,{"aria-label":"重做",disabled:!Z||!S,icon:X.jsx(gA,{}),onClick:P})}),X.jsx(xl,{title:"清空画布",children:X.jsx(Pn,{"aria-label":"清空画布",disabled:!Z||!p,icon:X.jsx(nA,{}),onClick:G})}),X.jsx(xl,{title:"帮助",children:X.jsx(Pn,{"aria-label":"帮助",icon:X.jsx(rM,{}),onClick:re})})]})]}),X.jsx("section",{className:"cps-bi-builder__topbar-right",children:X.jsxs(_c,{size:8,wrap:!0,children:[X.jsx(jJ,{allowUseBuiltInWidgets:M,modalContainer:x,onAddWidget:F,onAddWidgets:W,readonly:n,widgetCatalogFilterRender:N,widgets:w}),X.jsx(xl,{title:"画布设置",children:X.jsx(Pn,{"aria-label":"画布设置",disabled:n,icon:X.jsx(lM,{}),onClick:A,type:"default",children:"画布设置"})}),X.jsx(Pn,{"aria-label":"全屏",disabled:!C,icon:X.jsx(uA,{"aria-hidden":!0}),onClick:I,type:"default",children:"全屏"}),X.jsx(xl,{title:oe,children:X.jsx("span",{children:X.jsx(Pn,{disabled:le,icon:X.jsx(bA,{}),loading:T,onClick:k,type:"default",children:"保存"})})}),X.jsx(xl,{title:te,children:X.jsx("span",{children:X.jsx(Pn,{disabled:le,icon:X.jsx(CA,{}),loading:$,onClick:ne,type:"primary",children:"发布"})})}),X.jsx(d7,{orientation:"vertical"}),X.jsx(E7,{menu:{items:ce},trigger:["click"],children:X.jsx(Pn,{"aria-label":"更多",icon:X.jsx(ob,{}),type:"text"})})]})})]})}const iR={canvasMode:"responsive",cols:24,rowHeight:10,collisionReflowMode:"push",bgColor:"#ffffff",bgImageUrl:"",showGrid:!0,minWidth:960,defaultComponentCols:8,defaultComponentRows:16,screenAspectRatio:"16:9",screenWidth:1920,screenHeight:1080};function LJ(e){const{open:n,settings:a,getContainer:l,onCancel:c,onApply:u}=e,[p,m]=_.useState(iR);_.useEffect(()=>{n&&m({canvasMode:a.canvasMode,cols:a.cols,rowHeight:a.rowHeight,collisionReflowMode:a.collisionReflowMode==="block"?"block":"push",bgColor:a.bgColor,bgImageUrl:a.bgImageUrl??"",showGrid:a.showGrid,minWidth:a.minWidth,defaultComponentCols:a.defaultComponentCols??Math.floor(a.cols/3),defaultComponentRows:a.defaultComponentRows??16,screenAspectRatio:a.screenAspectRatio??"16:9",screenWidth:a.screenWidth??iR.screenWidth,screenHeight:a.screenHeight??iR.screenHeight})},[n,a]);const S=()=>{const v=p.cols===12?12:24,C=Math.max(8,p.rowHeight),x=Math.max(320,p.minWidth),w=Math.max(1,Math.min(v,Math.round(p.defaultComponentCols))),M=Math.max(1,Math.round(p.defaultComponentRows)),N=p.screenAspectRatio,T=N==="custom"?{width:Math.max(320,p.screenWidth),height:Math.max(240,p.screenHeight)}:YO(N);u({canvasMode:p.canvasMode,cols:v,rowHeight:C,collisionReflowMode:p.collisionReflowMode,bgColor:p.bgColor,bgImageUrl:p.bgImageUrl.trim()?p.bgImageUrl.trim():void 0,showGrid:p.showGrid,minWidth:x,defaultComponentCols:w,defaultComponentRows:M,screenAspectRatio:N,screenWidth:T.width,screenHeight:T.height}),c()};return X.jsx(Cr,{cancelText:"取消",getContainer:l,okText:"应用",onCancel:c,onOk:S,open:n,title:"画布设置",width:860,children:X.jsx(It,{layout:"vertical",children:X.jsxs(l4,{className:"cps-bi-canvas-settings__row",gutter:[16,0],children:[X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"画布模式",children:X.jsx(ia,{onChange:v=>{m(C=>({...C,canvasMode:v}))},options:[{label:"响应式画布",value:"responsive"},{label:"大屏画布",value:"screen"}],value:p.canvasMode})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"最小宽度",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:4096,min:320,onChange:v=>{m(C=>({...C,minWidth:Number(v??C.minWidth)}))},value:p.minWidth})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"列数",children:X.jsx(ia,{onChange:v=>{m(C=>({...C,cols:v}))},options:[{label:"12 列",value:12},{label:"24 列",value:24}],value:p.cols})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"行高(像素)",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:240,min:8,onChange:v=>{m(C=>({...C,rowHeight:Number(v??C.rowHeight)}))},value:p.rowHeight})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"新增组件默认宽度(列)",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:p.cols,min:1,onChange:v=>{m(C=>({...C,defaultComponentCols:Number(v??C.defaultComponentCols)}))},value:p.defaultComponentCols})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"新增组件默认高度(行)",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:4096,min:1,onChange:v=>{m(C=>({...C,defaultComponentRows:Number(v??C.defaultComponentRows)}))},value:p.defaultComponentRows})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"碰撞策略",children:X.jsx(ia,{onChange:v=>{m(C=>({...C,collisionReflowMode:v}))},options:[{label:"自动推挤(push)",value:"push"},{label:"阻止重排(block)",value:"block"}],value:p.collisionReflowMode})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"背景色",children:X.jsx(ea,{onChange:v=>{m(C=>({...C,bgColor:v.target.value||C.bgColor}))},type:"color",value:p.bgColor})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"显示网格线",children:X.jsx(Ff,{checked:p.showGrid,onChange:v=>{m(C=>({...C,showGrid:v}))}})})}),p.canvasMode==="screen"?X.jsxs(X.Fragment,{children:[X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"大屏比例",children:X.jsx(ia,{onChange:v=>{const C=v;if(C==="custom"){m(w=>({...w,screenAspectRatio:"custom"}));return}const x=YO(C);m(w=>({...w,screenAspectRatio:C,screenWidth:x.width,screenHeight:x.height}))},options:[{label:"16:9",value:"16:9"},{label:"4:3",value:"4:3"},{label:"21:9",value:"21:9"},{label:"9:16",value:"9:16"},{label:"自定义",value:"custom"}],value:p.screenAspectRatio})})}),p.screenAspectRatio==="custom"?X.jsxs(X.Fragment,{children:[X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"宽度",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:7680,min:320,onChange:v=>{m(C=>({...C,screenWidth:Number(v??C.screenWidth)}))},value:p.screenWidth})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"高度",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:4320,min:240,onChange:v=>{m(C=>({...C,screenHeight:Number(v??C.screenHeight)}))},value:p.screenHeight})})})]}):null]}):null,X.jsx(zr,{span:24,children:X.jsx(It.Item,{label:"背景图片 URL",children:X.jsx(ea,{onChange:v=>{m(C=>({...C,bgImageUrl:v.target.value}))},placeholder:"请输入背景图地址,例如:https://example.com/background.png",value:p.bgImageUrl})})})]})})})}function cb(e){const{margin:n,containerPadding:a,containerWidth:l,cols:c}=e;return(l-n[0]*(c-1)-a[0]*2)/c}function Jy(e,n,a){return Number.isFinite(e)?Math.round(n*e+Math.max(0,e-1)*a):e}function mS(e,n,a,l,c,u,p){const{margin:m,containerPadding:S,rowHeight:v}=e,C=cb(e);let x,w,M,N;if(p?(x=Math.round(p.width),w=Math.round(p.height)):(x=Jy(l,C,m[0]),w=Jy(c,v,m[1])),u?(M=Math.round(u.top),N=Math.round(u.left)):p?(M=Math.round(p.top),N=Math.round(p.left)):(M=Math.round((v+m[1])*a+S[1]),N=Math.round((C+m[0])*n+S[0])),!u&&!p){if(Number.isFinite(l)){const $=Math.round((C+m[0])*(n+l)+S[0])-N-x;$!==m[0]&&(x+=$-m[0])}if(Number.isFinite(c)){const $=Math.round((v+m[1])*(a+c)+S[1])-M-w;$!==m[1]&&(w+=$-m[1])}}return{top:M,left:N,width:x,height:w}}function VJ(e,n,a,l,c){const{margin:u,containerPadding:p,cols:m,rowHeight:S,maxRows:v}=e,C=cb(e);let x=Math.round((a-p[0])/(C+u[0])),w=Math.round((n-p[1])/(S+u[1]));return x=dw(x,0,m-l),w=dw(w,0,v-c),{x,y:w}}function gE(e,n,a){const{margin:l,containerPadding:c,rowHeight:u}=e,p=cb(e),m=Math.round((a-c[0])/(p+l[0])),S=Math.round((n-c[1])/(u+l[1]));return{x:m,y:S}}function PJ(e,n,a){const{margin:l,rowHeight:c}=e,u=cb(e),p=Math.max(1,Math.round((n+l[0])/(u+l[0]))),m=Math.max(1,Math.round((a+l[1])/(c+l[1])));return{w:p,h:m}}function dw(e,n,a){return Math.max(Math.min(e,a),n)}function C4(e,n){return!(e.i===n.i||e.x+e.w<=n.x||e.x>=n.x+n.w||e.y+e.h<=n.y||e.y>=n.y+n.h)}function fw(e,n){for(let a=0;a<e.length;a++){const l=e[a];if(l!==void 0&&C4(l,n))return l}}function lH(e,n){return e.filter(a=>C4(a,n))}function UJ(e,n){return n==="horizontal"?qJ(e):n==="vertical"||n==="wrap"?XO(e):[...e]}function XO(e){return[...e].sort((n,a)=>n.y!==a.y?n.y-a.y:n.x-a.x)}function qJ(e){return[...e].sort((n,a)=>n.x!==a.x?n.x-a.x:n.y-a.y)}function x4(e){let n=0;for(let a=0;a<e.length;a++){const l=e[a];if(l!==void 0){const c=l.y+l.h;c>n&&(n=c)}}return n}function Pm(e,n){for(let a=0;a<e.length;a++){const l=e[a];if(l!==void 0&&l.i===n)return l}}function E4(e){return e.filter(n=>n.static===!0)}function eb(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function w4(e){const n=new Array(e.length);for(let a=0;a<e.length;a++){const l=e[a];l!==void 0&&(n[a]=eb(l))}return n}function FJ(e,n){const a=new Array(e.length);for(let l=0;l<e.length;l++){const c=e[l];c!==void 0&&(n.i===c.i?a[l]=n:a[l]=c)}return a}function GJ(e,n,a){let l=Pm(e,n);return l?(l=a(eb(l)),[FJ(e,l),l]):[[...e],null]}function YJ(e,n){const a=E4(e);for(let l=0;l<e.length;l++){const c=e[l];if(c!==void 0)if(c.x+c.w>n.cols&&(c.x=n.cols-c.w),c.x<0&&(c.x=0,c.w=n.cols),!c.static)a.push(c);else for(;fw(a,c);)c.y++}return e}function Wm(e,n,a,l,c,u,p,m,S){if(n.static&&n.isDraggable!==!0)return[...e];if(n.y===l&&n.x===a)return[...e];const v=n.x,C=n.y;typeof a=="number"&&(n.x=a),typeof l=="number"&&(n.y=l),n.moved=!0;let x=UJ(e,p);(p==="vertical"&&typeof l=="number"?C>=l:p==="horizontal"&&typeof a=="number"&&v>=a)&&(x=x.reverse());const M=lH(x,n),N=M.length>0;if(N&&S)return w4(e);if(N&&u)return n.x=v,n.y=C,n.moved=!1,e;let T=[...e];for(let $=0;$<M.length;$++){const z=M[$];z!==void 0&&(z.moved||(z.static?T=Z8(T,z,n,c,p):T=Z8(T,n,z,c,p)))}return T}function Z8(e,n,a,l,c,u){const p=c==="horizontal",m=c==="vertical",S=n.static;if(l){l=!1;const x={x:p?Math.max(n.x-a.w,0):a.x,y:m?Math.max(n.y-a.h,0):a.y,w:a.w,h:a.h,i:"-1"},w=fw(e,x),M=w!==void 0&&w.y+w.h>n.y,N=w!==void 0&&n.x+n.w>w.x;if(!w)return Wm(e,a,p?x.x:void 0,m?x.y:void 0,l,S,c);if(M&&m)return Wm(e,a,void 0,a.y+1,l,S,c);if(M&&c===null)return n.y=a.y,a.y=a.y+a.h,[...e];if(N&&p)return Wm(e,n,a.x,void 0,l,S,c)}const v=p?a.x+1:void 0,C=m?a.y+1:void 0;return v===void 0&&C===void 0?[...e]:Wm(e,a,v,C,l,S,c)}function Ly(e,n,a){return Math.max(n,Math.min(a,e))}var XJ={name:"gridBounds",constrainPosition(e,n,a,{cols:l,maxRows:c}){return{x:Ly(n,0,Math.max(0,l-e.w)),y:Ly(a,0,Math.max(0,c-e.h))}},constrainSize(e,n,a,l,{cols:c,maxRows:u}){const p=l==="w"||l==="nw"||l==="sw"?e.x+e.w:c-e.x,m=l==="n"||l==="nw"||l==="ne"?e.y+e.h:u-e.y;return{w:Ly(n,1,Math.max(1,p)),h:Ly(a,1,Math.max(1,m))}}},kJ={name:"minMaxSize",constrainSize(e,n,a){return{w:Ly(n,e.minW??1,e.maxW??1/0),h:Ly(a,e.minH??1,e.maxH??1/0)}}},iH=[XJ,kJ];function yE(e,n,a,l,c){let u={x:a,y:l};for(const p of e)p.constrainPosition&&(u=p.constrainPosition(n,u.x,u.y,c));if(n.constraints)for(const p of n.constraints)p.constrainPosition&&(u=p.constrainPosition(n,u.x,u.y,c));return u}function WJ(e,n,a,l,c,u){let p={w:a,h:l};for(const m of e)m.constrainSize&&(p=m.constrainSize(n,p.w,p.h,c,u));if(n.constraints)for(const m of n.constraints)m.constrainSize&&(p=m.constrainSize(n,p.w,p.h,c,u));return p}function sH({top:e,left:n,width:a,height:l}){const c=`translate(${n}px,${e}px)`;return{transform:c,WebkitTransform:c,MozTransform:c,msTransform:c,OTransform:c,width:`${a}px`,height:`${l}px`,position:"absolute"}}function KJ({top:e,left:n,width:a,height:l}){return{top:`${e}px`,left:`${n}px`,width:`${a}px`,height:`${l}px`,position:"absolute"}}function J8(e){return e*100+"%"}function QJ(e,n,a,l){return e+a>l?n:a}function cH(e,n,a){return e<0?n:a}function ZJ(e){return Math.max(0,e)}function pw(e){return Math.max(0,e)}var $4=(e,n,a)=>{const{left:l,height:c,width:u}=n,p=e.top-(c-e.height);return{left:l,width:u,height:cH(p,e.height,c),top:pw(p)}},R4=(e,n,a)=>{const{top:l,left:c,height:u,width:p}=n;return{top:l,height:u,width:QJ(e.left,e.width,p,a),left:ZJ(c)}},T4=(e,n,a)=>{const{top:l,height:c,width:u}=n,p=e.left+e.width-u;return p<0?{height:c,width:e.left+e.width,top:pw(l),left:0}:{height:c,width:u,top:pw(l),left:p}},O4=(e,n,a)=>{const{top:l,left:c,height:u,width:p}=n;return{width:p,left:c,height:cH(l,e.height,u),top:pw(l)}},JJ=(e,n,a)=>$4(e,R4(e,n,a)),eee=(e,n,a)=>$4(e,T4(e,n)),tee=(e,n,a)=>O4(e,R4(e,n,a)),nee=(e,n,a)=>O4(e,T4(e,n)),oee={n:$4,ne:JJ,e:R4,se:tee,s:O4,sw:nee,w:T4,nw:eee};function aee(e,n,a,l){const c=oee[e];return c?c(n,{...n,...a},l):a}var kO={type:"transform",scale:1,calcStyle(e){return sH(e)}},ree=kO,lee={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},iee={enabled:!0,bounded:!1,threshold:3},see={enabled:!0,handles:["se"]},cee={enabled:!1,defaultItem:{w:1,h:1}};function uH(e,n,a,l,c){n[l]+=1;const p=e.findIndex(S=>S.i===n.i),m=c??E4(e).length>0;for(let S=p+1;S<e.length;S++){const v=e[S];if(v!==void 0&&!v.static){if(!m&&v.y>n.y+n.h)break;C4(n,v)&&uH(e,v,a+n.h,l,m)}}n[l]=a}function uee(e,n,a,l){for(n.x=Math.max(n.x,0),n.y=Math.max(n.y,0),n.y=Math.min(l,n.y);n.y>0&&!fw(e,n);)n.y--;let c;for(;(c=fw(e,n))!==void 0;)uH(a,n,c.y+c.h,"y");return n.y=Math.max(n.y,0),n}var M4={type:"vertical",allowOverlap:!1,compact(e,n){const a=E4(e);let l=x4(a);const c=XO(e),u=new Array(e.length);for(let p=0;p<c.length;p++){const m=c[p];if(m===void 0)continue;let S=eb(m);S.static||(S=uee(a,S,c,l),l=Math.max(l,S.y+S.h),a.push(S));const v=e.indexOf(m);u[v]=S,S.moved=!1}return u}},dee={type:null,allowOverlap:!1,compact(e,n){return w4(e)}},fee={...M4,allowOverlap:!0,compact(e,n){return w4(e)}};function pee(e,n=!1,a=!1){let l;return n?l=fee:l=M4,a?{...l,preventCollision:a}:l}const mee=48,hee=6,gee=18;function yee(e){const n=e.edgePx??mee,a=e.minStep??hee,l=e.maxStep??gee,c=e.viewportBottom-e.pointerClientY;if(c>n)return 0;const p=1-Math.max(0,Math.min(n,c))/n;return Math.round(a+(l-a)*p)}function bee(e){const n=_.useRef(!1),a=_.useRef(null),l=_.useRef(null),c=_.useCallback(()=>{n.current=!1,a.current=null,l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),u=_.useCallback(()=>{if(l.current=null,!e.enabled||!n.current||a.current===null)return;const v=e.scrollerRef.current;if(!v)return;const C=v.getBoundingClientRect(),x=yee({viewportBottom:C.bottom,pointerClientY:a.current});if(x<=0)return;const w=v.scrollTop;v.scrollTop+=x,v.scrollTop!==w&&(l.current=window.requestAnimationFrame(u))},[e.enabled,e.scrollerRef]),p=_.useCallback(()=>{!e.enabled||!n.current||l.current!==null||(l.current=window.requestAnimationFrame(u))},[e.enabled,u]),m=_.useCallback(v=>{!e.enabled||v===null||(a.current=v,p())},[p,e.enabled]),S=_.useCallback(v=>{e.enabled&&(n.current=!0,a.current=v,p())},[p,e.enabled]);return _.useEffect(()=>{if(!e.enabled){c();return}const v=x=>{n.current&&m(x.clientY)},C=()=>{c()};return window.addEventListener("mousemove",v,!0),window.addEventListener("mouseup",C,!0),()=>{window.removeEventListener("mousemove",v,!0),window.removeEventListener("mouseup",C,!0),c()}},[e.enabled,c,m]),{startAutoPan:S,stopAutoPan:c,updatePointerClientY:m}}const vee=50,See=200,WO=5,Cee=2e3,xee=2,sR=120,Eee=90;function wee(e){return Math.max(vee,Math.min(See,e))}function eD(e){return wee(Math.round(e/WO)*WO)}function $ee(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable||e.closest('[contenteditable="true"]'))return!0;const n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||n==="select"}function tD(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function Ree(e){const[n,a]=_.useState(100),[l,c]=_.useState(!1),[u,p]=_.useState(!1),[m,S]=_.useState(!1),v=_.useRef(null),C=_.useRef(0),x=_.useRef(null),w=_.useRef(0),M=_.useRef({clientX:0,clientY:0,scrollLeft:0,scrollTop:0}),N=n/100,T=e.isScreenMode&&(u||m);_.useEffect(()=>()=>{v.current&&window.clearTimeout(v.current),C.current=0,x.current=null,w.current=0},[]),_.useEffect(()=>{e.isScreenMode||(c(!1),p(!1),S(!1))},[e.isScreenMode]),_.useEffect(()=>{if(e.isScreenMode){if(v.current&&(window.clearTimeout(v.current),v.current=null),n!==100){c(!0);return}v.current=window.setTimeout(()=>{c(!1),v.current=null},Cee)}},[e.isScreenMode,n]),_.useEffect(()=>{const I=B=>{if(!e.isScreenMode||!tD(B)||B.repeat||$ee(B.target))return;B.preventDefault(),p(!0);const L=document.activeElement;L instanceof HTMLElement&&L.closest(".cps-bi-builder__canvas")&&L.blur()},j=B=>{!e.isScreenMode||!tD(B)||(B.preventDefault(),p(!1),S(!1))},V=()=>{e.isScreenMode&&(p(!1),S(!1))};return window.addEventListener("keydown",I,!0),window.addEventListener("keyup",j,!0),window.addEventListener("blur",V),()=>{window.removeEventListener("keydown",I,!0),window.removeEventListener("keyup",j,!0),window.removeEventListener("blur",V)}},[e.isScreenMode]),_.useEffect(()=>{if(!m)return;const I=V=>{const B=e.scrollerRef.current;if(!B)return;const L=V.clientX-M.current.clientX,P=V.clientY-M.current.clientY;B.scrollLeft=M.current.scrollLeft-L,B.scrollTop=M.current.scrollTop-P},j=()=>{S(!1)};return window.addEventListener("mousemove",I),window.addEventListener("mouseup",j),()=>{window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",j)}},[m,e.scrollerRef]);const $=_.useCallback(()=>{v.current&&(window.clearTimeout(v.current),v.current=null),c(!0)},[]);_.useEffect(()=>{const I=e.scrollerRef.current;if(!I||!e.isScreenMode)return;const j=V=>{if(!V.ctrlKey&&!V.metaKey||(V.preventDefault(),Math.abs(V.deltaY)<xee)||(C.current+=V.deltaY,Math.abs(C.current)<sR))return;const B=C.current<0?1:-1,L=Date.now();if(x.current!==null&&x.current!==B&&L-w.current<Eee){C.current=0;return}const G=Math.max(1,Math.trunc(Math.abs(C.current)/sR));C.current-=G*sR*(B===1?-1:1),$(),a(F=>{const W=eD(F+B*WO*G);if(W===F)return F;const k=I.getBoundingClientRect(),ne=V.clientX-k.left,re=V.clientY-k.top,q=(I.scrollLeft+ne)/(F/100),K=(I.scrollTop+re)/(F/100),J=W/100;return window.requestAnimationFrame(()=>{I.scrollLeft=q*J-ne,I.scrollTop=K*J-re}),x.current=B,w.current=L,W})};return I.addEventListener("wheel",j,{passive:!1}),()=>{I.removeEventListener("wheel",j)}},[e.isScreenMode,e.scrollerRef,$]);const z=_.useCallback(I=>{$(),a(eD(I))},[$]),D=_.useCallback(I=>{if(!e.isScreenMode||!u||I.button!==0)return;I.preventDefault();const j=e.scrollerRef.current;j&&(S(!0),M.current={clientX:I.clientX,clientY:I.clientY,scrollLeft:j.scrollLeft,scrollTop:j.scrollTop})},[e.isScreenMode,e.scrollerRef,u]),A=_.useMemo(()=>({minWidth:"100%",minHeight:"100%",width:`${e.canvasWidth*N}px`,height:`${e.canvasHeight*N}px`}),[e.canvasHeight,e.canvasWidth,N]);return{zoomPercent:n,zoomScale:N,showZoomOverlay:l,spacePressed:u,panning:m,handMode:T,zoomLayerStyle:A,applyZoomValue:z,handleScrollerMouseDown:D}}const nD=12;function Tee(e,n,a,l){const c=e.reduce((u,p)=>Math.max(u,p.y+p.h),0);return c<=0?l*2:l*2+c*n+Math.max(0,c-1)*a}function dH(e){return Math.max(Tee(e.layout,e.rowHeight,e.marginY,e.paddingY),e.viewportInnerHeight)}function Oee(e){const[n,a]=_.useState({width:0,height:0});return _.useEffect(()=>{const l=e.current;if(!l)return;const c=m=>{if(m){a(m);return}const S=l.getBoundingClientRect();a({width:S.width,height:S.height})},u=()=>{c()};if(c(),typeof ResizeObserver>"u")return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)};const p=new ResizeObserver(m=>{const S=m[0],v=Array.isArray(S?.borderBoxSize)?S.borderBoxSize[0]:S?.borderBoxSize;if(v){c({width:v.inlineSize,height:v.blockSize});return}c()});return p.observe(l),()=>{p.disconnect()}},[e]),n}function Mee(e){const[n,a]=e.settings.margin,[l,c]=e.settings.padding,u=Math.max(0,e.viewportSize.width-nD*2),p=Math.max(0,e.viewportSize.height-nD*2),m=!e.isScreenMode&&u>=e.settings.minWidth&&u>0,S=m?u:Math.max(320,Math.max(u,e.settings.minWidth)),v=e.isScreenMode?e.screenSize.width:S,C=dH({layout:e.layout,rowHeight:e.settings.rowHeight,marginY:a,paddingY:c,viewportInnerHeight:p}),x=e.isScreenMode?e.screenSize.height:C,w=(v-l*2-n*(e.settings.cols-1))/e.settings.cols,M=Number.isFinite(w)?Math.max(1,w):1;return{viewportInnerWidth:u,viewportInnerHeight:p,responsiveFluid:m,canvasWidth:v,canvasHeight:x,gridStepX:M+n,gridStepY:e.settings.rowHeight+a}}const Nee=3;function oD(e,n){const a=e.componentsById[n];return a?{uniqueCode:a.uniqueCode,widgetCode:a.widgetCode,defaultTargets:a.linkageConfig.target.values.length>0?a.linkageConfig.target.values.map(l=>({by:a.linkageConfig.target.by,value:l})):void 0}:null}function zee(e,n){const a=_.useMemo(()=>tH(),[]),l=_.useRef(new Map),c=_.useRef(n);return _.useEffect(()=>{c.current=n},[n]),_.useEffect(()=>{const u=l.current,p=new Set;for(const m of n){p.add(m);const S=oD(e.getSnapshot(),m);if(!S)continue;let v=u.get(m);if(v)v.metaRef.current=S;else{const C={current:S};v={metaRef:C,notifyUpdate:(x,w,M)=>{const N=C.current;a.emit({eventId:Wf(),sourceUniqueCode:N.uniqueCode,sourceWidgetCode:N.widgetCode,eventName:x,params:w,targets:M?.targets??N.defaultTargets,depth:0,ttl:M?.ttl??Nee,timestamp:Date.now()})},onReceiveUpdate:x=>a.subscribe("*",w=>{const M=C.current;w.sourceUniqueCode!==M.uniqueCode&&eH(w,{widgetCode:M.widgetCode,uniqueCode:M.uniqueCode})&&x({sourceWidgetCode:w.sourceWidgetCode,sourceUniqueCode:w.sourceUniqueCode,eventName:w.eventName,params:w.params})})},u.set(m,v)}}for(const m of Array.from(u.keys()))p.has(m)||u.delete(m)},[n,a,e]),_.useEffect(()=>e.subscribe(u=>{const p=l.current,m=new Set(c.current);for(const S of c.current){const v=oD(u,S);if(!v){p.delete(S);continue}const C=p.get(S);C&&(C.metaRef.current=v)}for(const S of Array.from(p.keys()))m.has(S)||p.delete(S)}),[e]),_.useEffect(()=>()=>{a.dispose()},[a]),_.useCallback(u=>l.current.get(u)??null,[])}function fH(e){return function(a,l,c,u,p,m,S){return e(a,l,S)}}function Lw(e){return function(a,l,c,u){if(!a||!l||typeof a!="object"||typeof l!="object")return e(a,l,c,u);var p=u.get(a),m=u.get(l);if(p&&m)return p===l&&m===a;u.set(a,l),u.set(l,a);var S=e(a,l,c,u);return u.delete(a),u.delete(l),S}}function pH(e,n){var a={};for(var l in e)a[l]=e[l];for(var l in n)a[l]=n[l];return a}function aD(e){return e.constructor===Object||e.constructor==null}function rD(e){return typeof e.then=="function"}function Vw(e,n){return e===n||e!==e&&n!==n}var Dee="[object Arguments]",Aee="[object Boolean]",_ee="[object Date]",Bee="[object RegExp]",Hee="[object Map]",jee="[object Number]",Iee="[object Object]",Lee="[object Set]",Vee="[object String]",lD=Object.prototype.toString;function Pw(e){var n=e.areArraysEqual,a=e.areDatesEqual,l=e.areMapsEqual,c=e.areObjectsEqual,u=e.areRegExpsEqual,p=e.areSetsEqual,m=e.createIsNestedEqual,S=m(v);function v(C,x,w){if(C===x)return!0;if(!C||!x||typeof C!="object"||typeof x!="object")return C!==C&&x!==x;if(aD(C)&&aD(x))return c(C,x,S,w);var M=Array.isArray(C),N=Array.isArray(x);if(M||N)return M===N&&n(C,x,S,w);var T=lD.call(C);return T!==lD.call(x)?!1:T===_ee?a(C,x,S,w):T===Bee?u(C,x,S,w):T===Hee?l(C,x,S,w):T===Lee?p(C,x,S,w):T===Iee||T===Dee?rD(C)||rD(x)?!1:c(C,x,S,w):T===Aee||T===jee||T===Vee?Vw(C.valueOf(),x.valueOf()):!1}return v}function mH(e,n,a,l){var c=e.length;if(n.length!==c)return!1;for(;c-- >0;)if(!a(e[c],n[c],c,c,e,n,l))return!1;return!0}var Pee=Lw(mH);function hH(e,n){return Vw(e.valueOf(),n.valueOf())}function gH(e,n,a,l){var c=e.size===n.size;if(!c)return!1;if(!e.size)return!0;var u={},p=0;return e.forEach(function(m,S){if(c){var v=!1,C=0;n.forEach(function(x,w){!v&&!u[C]&&(v=a(S,w,p,C,e,n,l)&&a(m,x,S,w,e,n,l))&&(u[C]=!0),C++}),p++,c=v}}),c}var Uee=Lw(gH),qee="_owner",Fee=Object.prototype.hasOwnProperty;function yH(e,n,a,l){var c=Object.keys(e),u=c.length;if(Object.keys(n).length!==u)return!1;for(var p;u-- >0;){if(p=c[u],p===qee){var m=!!e.$$typeof,S=!!n.$$typeof;if((m||S)&&m!==S)return!1}if(!Fee.call(n,p)||!a(e[p],n[p],p,p,e,n,l))return!1}return!0}var Gee=Lw(yH);function bH(e,n){return e.source===n.source&&e.flags===n.flags}function vH(e,n,a,l){var c=e.size===n.size;if(!c)return!1;if(!e.size)return!0;var u={};return e.forEach(function(p,m){if(c){var S=!1,v=0;n.forEach(function(C,x){!S&&!u[v]&&(S=a(p,C,m,x,e,n,l))&&(u[v]=!0),v++}),c=S}}),c}var Yee=Lw(vH),SH=Object.freeze({areArraysEqual:mH,areDatesEqual:hH,areMapsEqual:gH,areObjectsEqual:yH,areRegExpsEqual:bH,areSetsEqual:vH,createIsNestedEqual:fH}),CH=Object.freeze({areArraysEqual:Pee,areDatesEqual:hH,areMapsEqual:Uee,areObjectsEqual:Gee,areRegExpsEqual:bH,areSetsEqual:Yee,createIsNestedEqual:fH}),Xee=Pw(SH);function _y(e,n){return Xee(e,n,void 0)}Pw(pH(SH,{createIsNestedEqual:function(){return Vw}}));Pw(CH);Pw(pH(CH,{createIsNestedEqual:function(){return Vw}}));var hS={exports:{}},cR={},bE={exports:{}},vE={exports:{}},uo={};var iD;function kee(){if(iD)return uo;iD=1;var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,c=e?Symbol.for("react.strict_mode"):60108,u=e?Symbol.for("react.profiler"):60114,p=e?Symbol.for("react.provider"):60109,m=e?Symbol.for("react.context"):60110,S=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,C=e?Symbol.for("react.forward_ref"):60112,x=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,M=e?Symbol.for("react.memo"):60115,N=e?Symbol.for("react.lazy"):60116,T=e?Symbol.for("react.block"):60121,$=e?Symbol.for("react.fundamental"):60117,z=e?Symbol.for("react.responder"):60118,D=e?Symbol.for("react.scope"):60119;function A(j){if(typeof j=="object"&&j!==null){var V=j.$$typeof;switch(V){case n:switch(j=j.type,j){case S:case v:case l:case u:case c:case x:return j;default:switch(j=j&&j.$$typeof,j){case m:case C:case N:case M:case p:return j;default:return V}}case a:return V}}}function I(j){return A(j)===v}return uo.AsyncMode=S,uo.ConcurrentMode=v,uo.ContextConsumer=m,uo.ContextProvider=p,uo.Element=n,uo.ForwardRef=C,uo.Fragment=l,uo.Lazy=N,uo.Memo=M,uo.Portal=a,uo.Profiler=u,uo.StrictMode=c,uo.Suspense=x,uo.isAsyncMode=function(j){return I(j)||A(j)===S},uo.isConcurrentMode=I,uo.isContextConsumer=function(j){return A(j)===m},uo.isContextProvider=function(j){return A(j)===p},uo.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===n},uo.isForwardRef=function(j){return A(j)===C},uo.isFragment=function(j){return A(j)===l},uo.isLazy=function(j){return A(j)===N},uo.isMemo=function(j){return A(j)===M},uo.isPortal=function(j){return A(j)===a},uo.isProfiler=function(j){return A(j)===u},uo.isStrictMode=function(j){return A(j)===c},uo.isSuspense=function(j){return A(j)===x},uo.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===l||j===v||j===u||j===c||j===x||j===w||typeof j=="object"&&j!==null&&(j.$$typeof===N||j.$$typeof===M||j.$$typeof===p||j.$$typeof===m||j.$$typeof===C||j.$$typeof===$||j.$$typeof===z||j.$$typeof===D||j.$$typeof===T)},uo.typeOf=A,uo}var fo={};var sD;function Wee(){return sD||(sD=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,c=e?Symbol.for("react.strict_mode"):60108,u=e?Symbol.for("react.profiler"):60114,p=e?Symbol.for("react.provider"):60109,m=e?Symbol.for("react.context"):60110,S=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,C=e?Symbol.for("react.forward_ref"):60112,x=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,M=e?Symbol.for("react.memo"):60115,N=e?Symbol.for("react.lazy"):60116,T=e?Symbol.for("react.block"):60121,$=e?Symbol.for("react.fundamental"):60117,z=e?Symbol.for("react.responder"):60118,D=e?Symbol.for("react.scope"):60119;function A(pe){return typeof pe=="string"||typeof pe=="function"||pe===l||pe===v||pe===u||pe===c||pe===x||pe===w||typeof pe=="object"&&pe!==null&&(pe.$$typeof===N||pe.$$typeof===M||pe.$$typeof===p||pe.$$typeof===m||pe.$$typeof===C||pe.$$typeof===$||pe.$$typeof===z||pe.$$typeof===D||pe.$$typeof===T)}function I(pe){if(typeof pe=="object"&&pe!==null){var Te=pe.$$typeof;switch(Te){case n:var we=pe.type;switch(we){case S:case v:case l:case u:case c:case x:return we;default:var be=we&&we.$$typeof;switch(be){case m:case C:case N:case M:case p:return be;default:return Te}}case a:return Te}}}var j=S,V=v,B=m,L=p,P=n,G=C,F=l,W=N,k=M,ne=a,re=u,q=c,K=x,J=!1;function ae(pe){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Z(pe)||I(pe)===S}function Z(pe){return I(pe)===v}function le(pe){return I(pe)===m}function oe(pe){return I(pe)===p}function te(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===n}function ue(pe){return I(pe)===C}function ce(pe){return I(pe)===l}function fe(pe){return I(pe)===N}function ie(pe){return I(pe)===M}function ge(pe){return I(pe)===a}function Ce(pe){return I(pe)===u}function de(pe){return I(pe)===c}function se(pe){return I(pe)===x}fo.AsyncMode=j,fo.ConcurrentMode=V,fo.ContextConsumer=B,fo.ContextProvider=L,fo.Element=P,fo.ForwardRef=G,fo.Fragment=F,fo.Lazy=W,fo.Memo=k,fo.Portal=ne,fo.Profiler=re,fo.StrictMode=q,fo.Suspense=K,fo.isAsyncMode=ae,fo.isConcurrentMode=Z,fo.isContextConsumer=le,fo.isContextProvider=oe,fo.isElement=te,fo.isForwardRef=ue,fo.isFragment=ce,fo.isLazy=fe,fo.isMemo=ie,fo.isPortal=ge,fo.isProfiler=Ce,fo.isStrictMode=de,fo.isSuspense=se,fo.isValidElementType=A,fo.typeOf=I})()),fo}var cD;function xH(){return cD||(cD=1,process.env.NODE_ENV==="production"?vE.exports=kee():vE.exports=Wee()),vE.exports}var uR,uD;function Kee(){if(uD)return uR;uD=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function l(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function c(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var p={},m=0;m<10;m++)p["_"+String.fromCharCode(m)]=m;var S=Object.getOwnPropertyNames(p).map(function(C){return p[C]});if(S.join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(C){v[C]=C}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return uR=c()?Object.assign:function(u,p){for(var m,S=l(u),v,C=1;C<arguments.length;C++){m=Object(arguments[C]);for(var x in m)n.call(m,x)&&(S[x]=m[x]);if(e){v=e(m);for(var w=0;w<v.length;w++)a.call(m,v[w])&&(S[v[w]]=m[v[w]])}}return S},uR}var dR,dD;function N4(){if(dD)return dR;dD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dR=e,dR}var fR,fD;function EH(){return fD||(fD=1,fR=Function.call.bind(Object.prototype.hasOwnProperty)),fR}var pR,pD;function Qee(){if(pD)return pR;pD=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var n=N4(),a={},l=EH();e=function(u){var p="Warning: "+u;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}}}function c(u,p,m,S,v){if(process.env.NODE_ENV!=="production"){for(var C in u)if(l(u,C)){var x;try{if(typeof u[C]!="function"){var w=Error((S||"React class")+": "+m+" type `"+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[C]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}x=u[C](p,C,S,m,null,n)}catch(N){x=N}if(x&&!(x instanceof Error)&&e((S||"React class")+": type specification of "+m+" `"+C+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof x+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),x instanceof Error&&!(x.message in a)){a[x.message]=!0;var M=v?v():"";e("Failed "+m+" type: "+x.message+(M??""))}}}}return c.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},pR=c,pR}var mR,mD;function Zee(){if(mD)return mR;mD=1;var e=xH(),n=Kee(),a=N4(),l=EH(),c=Qee(),u=function(){};process.env.NODE_ENV!=="production"&&(u=function(m){var S="Warning: "+m;typeof console<"u"&&console.error(S);try{throw new Error(S)}catch{}});function p(){return null}return mR=function(m,S){var v=typeof Symbol=="function"&&Symbol.iterator,C="@@iterator";function x(Z){var le=Z&&(v&&Z[v]||Z[C]);if(typeof le=="function")return le}var w="<<anonymous>>",M={array:z("array"),bigint:z("bigint"),bool:z("boolean"),func:z("function"),number:z("number"),object:z("object"),string:z("string"),symbol:z("symbol"),any:D(),arrayOf:A,element:I(),elementType:j(),instanceOf:V,node:G(),objectOf:L,oneOf:B,oneOfType:P,shape:W,exact:k};function N(Z,le){return Z===le?Z!==0||1/Z===1/le:Z!==Z&&le!==le}function T(Z,le){this.message=Z,this.data=le&&typeof le=="object"?le:{},this.stack=""}T.prototype=Error.prototype;function $(Z){if(process.env.NODE_ENV!=="production")var le={},oe=0;function te(ce,fe,ie,ge,Ce,de,se){if(ge=ge||w,de=de||ie,se!==a){if(S){var pe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw pe.name="Invariant Violation",pe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Te=ge+":"+ie;!le[Te]&&oe<3&&(u("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+ge+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),le[Te]=!0,oe++)}}return fe[ie]==null?ce?fe[ie]===null?new T("The "+Ce+" `"+de+"` is marked as required "+("in `"+ge+"`, but its value is `null`.")):new T("The "+Ce+" `"+de+"` is marked as required in "+("`"+ge+"`, but its value is `undefined`.")):null:Z(fe,ie,ge,Ce,de)}var ue=te.bind(null,!1);return ue.isRequired=te.bind(null,!0),ue}function z(Z){function le(oe,te,ue,ce,fe,ie){var ge=oe[te],Ce=q(ge);if(Ce!==Z){var de=K(ge);return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+de+"` supplied to `"+ue+"`, expected ")+("`"+Z+"`."),{expectedType:Z})}return null}return $(le)}function D(){return $(p)}function A(Z){function le(oe,te,ue,ce,fe){if(typeof Z!="function")return new T("Property `"+fe+"` of component `"+ue+"` has invalid PropType notation inside arrayOf.");var ie=oe[te];if(!Array.isArray(ie)){var ge=q(ie);return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+ge+"` supplied to `"+ue+"`, expected an array."))}for(var Ce=0;Ce<ie.length;Ce++){var de=Z(ie,Ce,ue,ce,fe+"["+Ce+"]",a);if(de instanceof Error)return de}return null}return $(le)}function I(){function Z(le,oe,te,ue,ce){var fe=le[oe];if(!m(fe)){var ie=q(fe);return new T("Invalid "+ue+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected a single ReactElement."))}return null}return $(Z)}function j(){function Z(le,oe,te,ue,ce){var fe=le[oe];if(!e.isValidElementType(fe)){var ie=q(fe);return new T("Invalid "+ue+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected a single ReactElement type."))}return null}return $(Z)}function V(Z){function le(oe,te,ue,ce,fe){if(!(oe[te]instanceof Z)){var ie=Z.name||w,ge=ae(oe[te]);return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+ge+"` supplied to `"+ue+"`, expected ")+("instance of `"+ie+"`."))}return null}return $(le)}function B(Z){if(!Array.isArray(Z))return process.env.NODE_ENV!=="production"&&(arguments.length>1?u("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):u("Invalid argument supplied to oneOf, expected an array.")),p;function le(oe,te,ue,ce,fe){for(var ie=oe[te],ge=0;ge<Z.length;ge++)if(N(ie,Z[ge]))return null;var Ce=JSON.stringify(Z,function(se,pe){var Te=K(pe);return Te==="symbol"?String(pe):pe});return new T("Invalid "+ce+" `"+fe+"` of value `"+String(ie)+"` "+("supplied to `"+ue+"`, expected one of "+Ce+"."))}return $(le)}function L(Z){function le(oe,te,ue,ce,fe){if(typeof Z!="function")return new T("Property `"+fe+"` of component `"+ue+"` has invalid PropType notation inside objectOf.");var ie=oe[te],ge=q(ie);if(ge!=="object")return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+ge+"` supplied to `"+ue+"`, expected an object."));for(var Ce in ie)if(l(ie,Ce)){var de=Z(ie,Ce,ue,ce,fe+"."+Ce,a);if(de instanceof Error)return de}return null}return $(le)}function P(Z){if(!Array.isArray(Z))return process.env.NODE_ENV!=="production"&&u("Invalid argument supplied to oneOfType, expected an instance of array."),p;for(var le=0;le<Z.length;le++){var oe=Z[le];if(typeof oe!="function")return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(oe)+" at index "+le+"."),p}function te(ue,ce,fe,ie,ge){for(var Ce=[],de=0;de<Z.length;de++){var se=Z[de],pe=se(ue,ce,fe,ie,ge,a);if(pe==null)return null;pe.data&&l(pe.data,"expectedType")&&Ce.push(pe.data.expectedType)}var Te=Ce.length>0?", expected one of type ["+Ce.join(", ")+"]":"";return new T("Invalid "+ie+" `"+ge+"` supplied to "+("`"+fe+"`"+Te+"."))}return $(te)}function G(){function Z(le,oe,te,ue,ce){return ne(le[oe])?null:new T("Invalid "+ue+" `"+ce+"` supplied to "+("`"+te+"`, expected a ReactNode."))}return $(Z)}function F(Z,le,oe,te,ue){return new T((Z||"React class")+": "+le+" type `"+oe+"."+te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ue+"`.")}function W(Z){function le(oe,te,ue,ce,fe){var ie=oe[te],ge=q(ie);if(ge!=="object")return new T("Invalid "+ce+" `"+fe+"` of type `"+ge+"` "+("supplied to `"+ue+"`, expected `object`."));for(var Ce in Z){var de=Z[Ce];if(typeof de!="function")return F(ue,ce,fe,Ce,K(de));var se=de(ie,Ce,ue,ce,fe+"."+Ce,a);if(se)return se}return null}return $(le)}function k(Z){function le(oe,te,ue,ce,fe){var ie=oe[te],ge=q(ie);if(ge!=="object")return new T("Invalid "+ce+" `"+fe+"` of type `"+ge+"` "+("supplied to `"+ue+"`, expected `object`."));var Ce=n({},oe[te],Z);for(var de in Ce){var se=Z[de];if(l(Z,de)&&typeof se!="function")return F(ue,ce,fe,de,K(se));if(!se)return new T("Invalid "+ce+" `"+fe+"` key `"+de+"` supplied to `"+ue+"`.\nBad object: "+JSON.stringify(oe[te],null," ")+`
|
|
448
|
+
`]:{paddingInlineEnd:a},[`&-affix-wrapper${n}-affix-wrapper`]:{padding:0,[`> textarea${n}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${n}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${n}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${l}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${n}-affix-wrapper-rtl`]:{[`${n}-suffix`]:{[`${n}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${n}-affix-wrapper-sm`]:{[`${n}-suffix`]:{[`${n}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},mQ=po(["Input","TextArea"],e=>{const n=Jn(e,E1(e));return pQ(n)},w1,{resetFont:!1}),hQ=_.forwardRef((e,n)=>{const{prefixCls:a,bordered:l=!0,size:c,disabled:u,status:p,allowClear:m,classNames:S,rootClassName:v,className:C,style:x,styles:w,variant:M,showCount:N,onMouseDown:T,onResize:$,...z}=e;if(process.env.NODE_ENV!=="production"){const{deprecated:be}=jn("TextArea");be(!("bordered"in e),"bordered","variant")}const{getPrefixCls:D,direction:A,allowClear:I,autoComplete:j,className:V,style:B,classNames:L,styles:P}=Ao("textArea"),G=y.useContext(ii),F=u??G,{status:W,hasFeedback:k,feedbackIcon:ne}=y.useContext(_r),re=v1(W,p),[q,K]=_o([L,S],[P,w],{props:e}),J=y.useRef(null);y.useImperativeHandle(n,()=>({resizableTextArea:J.current?.resizableTextArea,focus:be=>{MM(J.current?.resizableTextArea?.textArea,be)},blur:()=>J.current?.blur(),nativeElement:J.current?.nativeElement||null}));const ae=D("input",a),Z=nl(ae),[le,oe]=t7(ae,v);mQ(ae,Z);const{compactSize:te,compactItemClassnames:ue}=ep(ae,A),ce=is(be=>c??te??be),[fe,ie]=Aw("textArea",M,l),ge=v7(m??I),[Ce,de]=y.useState(!1),[se,pe]=y.useState(!1),Te=be=>{de(!0),T?.(be);const Ne=()=>{de(!1),document.removeEventListener("mouseup",Ne)};document.addEventListener("mouseup",Ne)},we=be=>{if($?.(be),Ce&&typeof getComputedStyle=="function"){const Ne=J.current?.nativeElement?.querySelector("textarea");Ne&&getComputedStyle(Ne).resize==="both"&&pe(!0)}};return y.createElement(fQ,{autoComplete:j,...z,style:{...K.root,...B,...x},styles:K,disabled:F,allowClear:ge,className:me(oe,Z,C,v,ue,V,q.root,{[`${ae}-textarea-affix-wrapper-resize-dirty`]:se}),classNames:{...q,textarea:me({[`${ae}-sm`]:ce==="small",[`${ae}-lg`]:ce==="large"},le,q.textarea,Ce&&`${ae}-mouse-active`),variant:me({[`${ae}-${fe}`]:ie},Ky(ae,re)),affixWrapper:me(`${ae}-textarea-affix-wrapper`,{[`${ae}-affix-wrapper-rtl`]:A==="rtl",[`${ae}-affix-wrapper-sm`]:ce==="small",[`${ae}-affix-wrapper-lg`]:ce==="large",[`${ae}-textarea-show-count`]:N||e.count?.show},le)},prefixCls:ae,suffix:k&&y.createElement("span",{className:`${ae}-textarea-suffix`},ne),showCount:N,ref:J,onResize:we,onMouseDown:Te})}),ea=$1;ea.Group=QK;ea.Search=B7;ea.TextArea=hQ;ea.Password=_7;ea.OTP=nQ;const sw=100,H7=sw/5,j7=sw/2-H7/2,eR=j7*2*Math.PI,O8=50,M8=e=>{const{dotClassName:n,style:a,hasCircleCls:l}=e;return y.createElement("circle",{className:me(`${n}-circle`,{[`${n}-circle-bg`]:l}),r:j7,cx:O8,cy:O8,strokeWidth:H7,style:a})},gQ=({percent:e,prefixCls:n})=>{const a=`${n}-dot`,l=`${a}-holder`,c=`${l}-hidden`,[u,p]=y.useState(!1);xo(()=>{e!==0&&p(!0)},[e!==0]);const m=Math.max(Math.min(e,100),0);if(!u)return null;const S={strokeDashoffset:`${eR/4}`,strokeDasharray:`${eR*m/100} ${eR*(100-m)/100}`};return y.createElement("span",{className:me(l,`${a}-progress`,m<=0&&c)},y.createElement("svg",{viewBox:`0 0 ${sw} ${sw}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m},y.createElement(M8,{dotClassName:a,hasCircleCls:!0}),y.createElement(M8,{dotClassName:a,style:S})))};function yQ(e){const{prefixCls:n,percent:a=0,className:l,style:c}=e,u=`${n}-dot`,p=`${u}-holder`,m=`${p}-hidden`;return y.createElement(y.Fragment,null,y.createElement("span",{className:me(p,l,a>0&&m),style:c},y.createElement("span",{className:me(u,`${n}-dot-spin`)},[1,2,3,4].map(S=>y.createElement("i",{className:`${n}-dot-item`,key:S})))),y.createElement(gQ,{prefixCls:n,percent:a}))}function bQ(e){const{prefixCls:n,indicator:a,percent:l,className:c,style:u}=e,p=`${n}-dot`;return a&&y.isValidElement(a)?$l(a,m=>({className:me(m.className,p,c),style:{...m.style,...u},percent:l})):y.createElement(yQ,{prefixCls:n,percent:l,className:c,style:u})}const vQ=new Xn("antSpinMove",{to:{opacity:1}}),SQ=new Xn("antRotate",{to:{transform:"rotate(405deg)"}}),CQ=e=>{const{componentCls:n}=e,a=`${n}-section`;return{[n]:{...ya(e),position:"relative","&-rtl":{direction:"rtl"},[`&${a}, ${a}`]:{display:"flex",alignItems:"center",flexDirection:"column",gap:e.paddingSM,color:e.colorPrimary},[`&${a}`]:{display:"inline-flex"},[a]:{position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)",zIndex:1},[`${n}-description`]:{fontSize:e.fontSize,lineHeight:1},[`${n}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},"&-spinning":{[`${n}-description`]:{textShadow:`0 0px 5px ${e.colorBgContainer}`},[`${n}-container`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-fullscreen":{position:"fixed",inset:0,backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,opacity:0,pointerEvents:"none",transition:`all ${e.motionDurationMid}`,[`&${n}-spinning`]:{opacity:1,pointerEvents:"auto"},[a]:{color:e.colorWhite,[`${n}-description`]:{color:e.colorTextLightSolid}}}}}},xQ=e=>{const{componentCls:n,antCls:a,motionDurationSlow:l}=e,[c,u]=Ia(a,"spin");return{[n]:{[c("dot-holder-size")]:e.dotSize,[c("dot-item-size")]:`calc((${u("dot-holder-size")} - ${e.marginXXS} / 2) / 2)`,[`${n}-dot`]:{"&-holder":{width:"1em",height:"1em",fontSize:u("dot-holder-size"),display:"inline-block",transition:["transform","opacity"].map(p=>`${p} ${l} ease`).join(", "),transformOrigin:"50% 50%",lineHeight:1,"&-hidden":{transform:"scale(0.3)",opacity:0}},position:"relative",display:"inline-block",fontSize:u("dot-holder-size"),width:"1em",height:"1em","&-spin":{transform:"rotate(45deg)",animationName:SQ,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-item":{position:"absolute",display:"block",width:u("dot-item-size"),height:u("dot-item-size"),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:vQ,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-progress":{position:"absolute",left:"50%",top:0,transform:"translateX(-50%)"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(p=>`${p} ${l} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}}}}},EQ=e=>{const{componentCls:n}=e,[a]=Ia(e.antCls,"spin");return{[n]:{"&-sm":{[a("dot-holder-size")]:e.dotSizeSM},"&-lg":{[a("dot-holder-size")]:e.dotSizeLG}}}},wQ=e=>{const{controlHeightLG:n,controlHeight:a}=e;return{contentHeight:400,dotSize:n/2,dotSizeSM:n*.35,dotSizeLG:a}},$Q=po("Spin",e=>{const n=Jn(e,{spinDotDefault:e.colorTextDescription});return[CQ(n),xQ(n),EQ(n)]},wQ),RQ=200,N8=[[30,.05],[70,.03],[96,.01]];function TQ(e,n){const[a,l]=y.useState(0),c=y.useRef(null),u=n==="auto";return y.useEffect(()=>(u&&e&&(l(0),c.current=setInterval(()=>{l(p=>{const m=100-p;for(let S=0;S<N8.length;S+=1){const[v,C]=N8[S];if(p<=v)return p+m*C}return p})},RQ)),()=>{c.current&&(clearInterval(c.current),c.current=null)}),[u,e]),u?a:n}let I7;function OQ(e,n){return!!e&&!!n&&!Number.isNaN(Number(n))}const u4=e=>{const{prefixCls:n,spinning:a=!0,delay:l=0,className:c,rootClassName:u,size:p="default",tip:m,description:S,wrapperClassName:v,style:C,children:x,fullscreen:w=!1,indicator:M,percent:N,classNames:T,styles:$,...z}=e,{getPrefixCls:D,direction:A,indicator:I,className:j,style:V,classNames:B,styles:L}=Ao("spin"),P=D("spin",n),[G,F]=$Q(P),[W,k]=y.useState(()=>a&&!OQ(a,l)),ne=TQ(W,N);y.useEffect(()=>{if(a){const te=AW(l,()=>{k(!0)});return te(),()=>{te?.cancel?.()}}k(!1)},[l,a]);const re=S??m,q={...e,size:p,spinning:W,tip:re,description:re,fullscreen:w,children:x,percent:ne},[K,J]=_o([B,T],[L,$],{props:q});if(process.env.NODE_ENV!=="production"){const te=jn("Spin");te.deprecated(!m,"tip","description"),te.deprecated(!v,"wrapperClassName","classNames.root"),te.deprecated(!(K?.tip||J?.tip),"classNames.tip and styles.tip","classNames.description and styles.description"),te.deprecated(!(K?.mask||J?.mask),"classNames.mask and styles.mask","classNames.root and styles.root")}const ae=M??I??I7,Z=typeof x<"u",le=Z||w,oe=y.createElement(y.Fragment,null,y.createElement(bQ,{className:me(K.indicator),style:J.indicator,prefixCls:P,indicator:ae,percent:ne}),re&&y.createElement("div",{className:me(`${P}-description`,K.tip,K.description),style:{...J.tip,...J.description}},re));return y.createElement("div",{className:me(P,{[`${P}-sm`]:p==="small",[`${P}-lg`]:p==="large",[`${P}-spinning`]:W,[`${P}-rtl`]:A==="rtl",[`${P}-fullscreen`]:w},u,K.root,w&&K.mask,le?v:[`${P}-section`,K.section],j,c,G,F),style:{...J.root,...le?{}:J.section,...w?J.mask:{},...V,...C},"aria-live":"polite","aria-busy":W,...z},W&&(le?y.createElement("div",{className:me(`${P}-section`,K.section),style:J.section},oe):oe),Z&&y.createElement("div",{className:me(`${P}-container`,K.container),style:J.container},x))};u4.setDefaultIndicator=e=>{I7=e};process.env.NODE_ENV!=="production"&&(u4.displayName="Spin");const MQ=e=>{const{prefixCls:n,className:a,closeIcon:l,closable:c,type:u,title:p,children:m,footer:S,classNames:v,styles:C,...x}=e,{getPrefixCls:w}=y.useContext(mn),{className:M,style:N,classNames:T,styles:$}=Ao("modal"),z=w(),D=n||w("modal"),A=nl(z),[I,j]=_5(D,A),[V,B]=_o([T,v],[$,C],{props:e}),L=`${D}-confirm`;let P={};return u?P={closable:c??!1,title:"",footer:"",children:y.createElement(H5,{...e,prefixCls:D,confirmPrefixCls:L,rootPrefixCls:z,content:m})}:P={closable:c??!0,title:p,footer:S!==null&&y.createElement(N5,{...e}),children:m},y.createElement(DM,{prefixCls:D,className:me(I,`${D}-pure-panel`,u&&L,u&&`${L}-${u}`,a,M,j,A,V.root),style:{...N,...B.root},...x,closeIcon:M5(D,l),closable:c,classNames:V,styles:B,...P})},NQ=G5(MQ);function L7(e){return y1(V5(e))}const Cr=B5;Cr.useModal=sY;Cr.info=function(n){return y1(P5(n))};Cr.success=function(n){return y1(U5(n))};Cr.error=function(n){return y1(q5(n))};Cr.warning=L7;Cr.warn=L7;Cr.confirm=function(n){return y1(F5(n))};Cr.destroyAll=function(){for(;Xm.length;){const n=Xm.pop();n&&n()}};Cr.config=rY;Cr._InternalPanelDoNotUseOrYouWillBeFired=NQ;process.env.NODE_ENV!=="production"&&(Cr.displayName="Modal");function qO(){return qO=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},qO.apply(this,arguments)}const V7=y.forwardRef(({prefixCls:e="rc-switch",className:n,checked:a,defaultChecked:l,disabled:c,loadingIcon:u,checkedChildren:p,unCheckedChildren:m,onClick:S,onChange:v,onKeyDown:C,styles:x,classNames:w,...M},N)=>{const[T,$]=ja(l??!1,a);function z(j,V){let B=T;return c||(B=j,$(B),v?.(B,V)),B}function D(j){j.which===Ft.LEFT?z(!1,j):j.which===Ft.RIGHT&&z(!0,j),C?.(j)}function A(j){const V=z(!T,j);S?.(V,j)}const I=me(e,n,{[`${e}-checked`]:T,[`${e}-disabled`]:c});return y.createElement("button",qO({},M,{type:"button",role:"switch","aria-checked":T,disabled:c,className:I,ref:N,onKeyDown:D,onClick:A}),u,y.createElement("span",{className:`${e}-inner`},y.createElement("span",{className:me(`${e}-inner-checked`,w?.content),style:x?.content},p),y.createElement("span",{className:me(`${e}-inner-unchecked`,w?.content),style:x?.content},m)))});V7.displayName="Switch";const zQ=e=>{const{componentCls:n,trackHeightSM:a,trackPadding:l,trackMinWidthSM:c,innerMinMarginSM:u,innerMaxMarginSM:p,handleSizeSM:m,calc:S}=e,v=`${n}-inner`,C=Be(S(m).add(S(l).mul(2)).equal()),x=Be(S(p).mul(2).equal());return{[n]:{[`&${n}-small`]:{minWidth:c,height:a,lineHeight:Be(a),[`${n}-inner`]:{paddingInlineStart:p,paddingInlineEnd:u,[`${v}-checked, ${v}-unchecked`]:{minHeight:a},[`${v}-checked`]:{marginInlineStart:`calc(-100% + ${C} - ${x})`,marginInlineEnd:`calc(100% - ${C} + ${x})`},[`${v}-unchecked`]:{marginTop:S(a).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${n}-handle`]:{width:m,height:m},[`${n}-loading-icon`]:{top:S(S(m).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${n}-checked`]:{[`${n}-inner`]:{paddingInlineStart:u,paddingInlineEnd:p,[`${v}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${v}-unchecked`]:{marginInlineStart:`calc(100% - ${C} + ${x})`,marginInlineEnd:`calc(-100% + ${C} - ${x})`}},[`${n}-handle`]:{insetInlineStart:`calc(100% - ${Be(S(m).add(l).equal())})`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${v}`]:{[`${v}-unchecked`]:{marginInlineStart:S(e.marginXXS).div(2).equal(),marginInlineEnd:S(e.marginXXS).mul(-1).div(2).equal()}},[`&${n}-checked ${v}`]:{[`${v}-checked`]:{marginInlineStart:S(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:S(e.marginXXS).div(2).equal()}}}}}}},DQ=e=>{const{componentCls:n,handleSize:a,calc:l}=e;return{[n]:{[`${n}-loading-icon${e.iconCls}`]:{position:"relative",top:l(l(a).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${n}-checked ${n}-loading-icon`]:{color:e.switchColor}}}},AQ=e=>{const{componentCls:n,trackPadding:a,handleBg:l,handleShadow:c,handleSize:u,calc:p}=e,m=`${n}-handle`;return{[n]:{[m]:{position:"absolute",top:a,insetInlineStart:a,width:u,height:u,transition:`all ${e.switchDuration} ease-in-out`,...Wy(),"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:l,borderRadius:p(u).div(2).equal(),boxShadow:c,transition:`all ${e.switchDuration} ease-in-out`,content:'""',...Wy()}},[`&${n}-checked ${m}`]:{insetInlineStart:`calc(100% - ${Be(p(u).add(a).equal())})`},[`&:not(${n}-disabled):active`]:{[`${m}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${n}-checked ${m}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},_Q=e=>{const{componentCls:n,trackHeight:a,trackPadding:l,innerMinMargin:c,innerMaxMargin:u,handleSize:p,switchDuration:m,calc:S}=e,v=`${n}-inner`,C=Be(S(p).add(S(l).mul(2)).equal()),x=Be(S(u).mul(2).equal());return{[n]:{[v]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:u,paddingInlineEnd:c,transition:["padding-inline-start","padding-inline-end"].map(w=>`${w} ${m} ease-in-out`).join(", "),...Wy(),[`${v}-checked, ${v}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,pointerEvents:"none",minHeight:a,transition:["margin-inline-start","margin-inline-end"].map(w=>`${w} ${m} ease-in-out`).join(", "),...Wy()},[`${v}-checked`]:{marginInlineStart:`calc(-100% + ${C} - ${x})`,marginInlineEnd:`calc(100% - ${C} + ${x})`},[`${v}-unchecked`]:{marginTop:S(a).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${n}-checked ${v}`]:{paddingInlineStart:c,paddingInlineEnd:u,[`${v}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${v}-unchecked`]:{marginInlineStart:`calc(100% - ${C} + ${x})`,marginInlineEnd:`calc(-100% + ${C} - ${x})`}},[`&:not(${n}-disabled):active`]:{[`&:not(${n}-checked) ${v}`]:{[`${v}-unchecked`]:{marginInlineStart:S(l).mul(2).equal(),marginInlineEnd:S(l).mul(-1).mul(2).equal()}},[`&${n}-checked ${v}`]:{[`${v}-checked`]:{marginInlineStart:S(l).mul(-1).mul(2).equal(),marginInlineEnd:S(l).mul(2).equal()}}}}}},BQ=e=>{const{componentCls:n,trackHeight:a,trackMinWidth:l}=e;return{[n]:{...ya(e),position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:l,height:a,lineHeight:Be(a),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",...Wy(),[`&:hover:not(${n}-disabled)`]:{background:e.colorTextTertiary},...Yf(e),[`&${n}-checked`]:{background:e.switchColor,[`&:hover:not(${n}-disabled)`]:{background:e.colorPrimaryHover}},[`&${n}-loading, &${n}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${n}-rtl`]:{direction:"rtl"}}}},HQ=e=>{const{fontSize:n,lineHeight:a,controlHeight:l,colorWhite:c}=e,u=n*a,p=l/2,m=2,S=u-m*2,v=p-m*2;return{trackHeight:u,trackHeightSM:p,trackMinWidth:S*2+m*4,trackMinWidthSM:v*2+m*2,trackPadding:m,handleBg:c,handleSize:S,handleSizeSM:v,handleShadow:`0 2px 4px 0 ${new to("#00230b").setA(.2).toRgbString()}`,innerMinMargin:S/2,innerMaxMargin:S+m+m*2,innerMinMarginSM:v/2,innerMaxMarginSM:v+m+m*2}},jQ=po("Switch",e=>{const n=Jn(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[BQ(n),_Q(n),AQ(n),DQ(n),zQ(n)]},HQ),IQ=y.forwardRef((e,n)=>{const{prefixCls:a,size:l,disabled:c,loading:u,className:p,rootClassName:m,style:S,checked:v,value:C,defaultChecked:x,defaultValue:w,onChange:M,styles:N,classNames:T,...$}=e,[z,D]=ja(x??w??!1,v??C),{getPrefixCls:A,direction:I,className:j,style:V,classNames:B,styles:L}=Ao("switch"),P=y.useContext(ii),G=(c??P)||u,F=A("switch",a),[W,k]=jQ(F),ne=is(l),re={...e,size:ne,disabled:G},[q,K]=_o([B,T],[L,N],{props:re}),J=y.createElement("div",{className:me(`${F}-handle`,q.indicator),style:K.indicator},u&&y.createElement(e1,{className:`${F}-loading-icon`})),ae=me(j,{[`${F}-small`]:ne==="small",[`${F}-loading`]:u,[`${F}-rtl`]:I==="rtl"},p,m,q.root,W,k),Z={...K.root,...V,...S},le=(...oe)=>{D(oe[0]),M?.(...oe)};return y.createElement(Mw,{component:"Switch",disabled:G},y.createElement(V7,{...$,classNames:q,styles:K,checked:z,onChange:le,prefixCls:F,className:ae,style:Z,disabled:G,ref:n,loadingIcon:J}))}),Ff=IQ;Ff.__ANT_SWITCH=!0;process.env.NODE_ENV!=="production"&&(Ff.displayName="Switch");const LQ=e=>{const{paddingXXS:n,lineWidth:a,tagPaddingHorizontal:l,componentCls:c,calc:u}=e,p=u(l).sub(a).equal(),m=u(n).sub(a).equal();return{[c]:{...ya(e),display:"inline-block",height:"auto",paddingInline:p,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${Be(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${c}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${c}-close-icon`]:{marginInlineStart:m,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${c}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${c}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${c}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${c}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:p}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${c}-default`]:{color:e.solidTextColor}},[`${c}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${c}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${c}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${c}-solid, &${c}-filled`]:{color:e.colorTextDisabled,[`${c}-close-icon`]:{color:e.colorTextDisabled}},[`${c}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},d4=e=>{const{lineWidth:n,fontSizeIcon:a,calc:l}=e,c=e.fontSizeSM;return Jn(e,{tagFontSize:c,tagLineHeight:Be(l(e.lineHeightSM).mul(c).equal()),tagIconSize:l(a).sub(l(n).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},f4=e=>{const n=s5(new GE(e.colorBgSolid),"#fff")?"#000":"#fff";return{defaultBg:new to(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:n}},p4=po("Tag",e=>{const n=d4(e);return LQ(n)},f4),P7=y.forwardRef((e,n)=>{const{prefixCls:a,style:l,className:c,checked:u,children:p,icon:m,onChange:S,onClick:v,disabled:C,...x}=e,{getPrefixCls:w,tag:M}=y.useContext(mn),N=y.useContext(ii),T=C??N,$=j=>{T||(S?.(!u),v?.(j))},z=w("tag",a),[D,A]=p4(z),I=me(z,`${z}-checkable`,{[`${z}-checkable-checked`]:u,[`${z}-checkable-disabled`]:T},M?.className,c,D,A);return y.createElement("span",{...x,ref:n,style:{...l,...M?.style},className:I,onClick:$},m,y.createElement("span",null,p))}),U7=_.forwardRef((e,n)=>{const{id:a,prefixCls:l,rootClassName:c,className:u,style:p,classNames:m,styles:S,disabled:v,options:C,value:x,defaultValue:w,onChange:M,multiple:N,...T}=e,{getPrefixCls:$,direction:z,className:D,style:A,classNames:I,styles:j}=Ao("tag"),V=$("tag",l),B=`${V}-checkable-group`,L=nl(V),[P,G]=p4(V,L),[F,W]=_o([I,m],[j,S],{props:e}),k=_.useMemo(()=>Array.isArray(C)?C.map(ae=>ae&&typeof ae=="object"?ae:{value:ae,label:ae}):[],[C]),[ne,re]=ja(w,x),q=(ae,Z)=>{let le=null;if(N){const oe=ne||[];le=ae?[].concat(Zn(oe),[Z.value]):oe.filter(te=>te!==Z.value)}else le=ae?Z.value:null;re(le),M?.(le)},K=_.useRef(null);_.useImperativeHandle(n,()=>({nativeElement:K.current}));const J=ls(T,{aria:!0,data:!0});return _.createElement("div",{...J,className:me(B,D,c,{[`${B}-disabled`]:v,[`${B}-rtl`]:z==="rtl"},P,G,u,F.root),style:{...A,...W.root,...p},id:a,ref:K},k.map(ae=>_.createElement(P7,{key:ae.value,className:me(`${B}-item`,F.item),style:W.item,checked:N?(ne||[]).includes(ae.value):ne===ae.value,onChange:Z=>q(Z,ae),disabled:v},ae.label)))});process.env.NODE_ENV!=="production"&&(U7.displayName="CheckableTagGroup");function VQ(e,n){const{color:a,variant:l,bordered:c}=e;return y.useMemo(()=>{const u=a?.endsWith("-inverse");let p;l?p=l:u?p="solid":c===!1?p="filled":p=n||"filled";const m=u?a?.replace("-inverse",""):a,S=CB(a),v=LX(a),C={};if(!S&&!v&&m)if(p==="solid")C.backgroundColor=a;else{const x=new to(m).toHsl();x.l=.95,C.backgroundColor=new to(x).toHexString(),C.color=a,p==="outlined"&&(C.borderColor=a)}return[p,m,S,v,C]},[a,l,c,n])}const PQ=e=>d_(e,(n,{textColor:a,lightBorderColor:l,lightColor:c,darkColor:u})=>({[`${e.componentCls}${e.componentCls}-${n}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:c,borderColor:l,color:a},[`&${e.componentCls}-solid`]:{backgroundColor:u,borderColor:u,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:c,color:a}}})),UQ=l1(["Tag","preset"],e=>{const n=d4(e);return PQ(n)},f4);function qQ(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const mE=(e,n,a)=>{const l=qQ(a);return{[`${e.componentCls}${e.componentCls}-${n}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${l}Bg`],borderColor:e[`color${l}Border`],color:e[`color${a}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${a}`],borderColor:e[`color${a}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${l}Bg`],color:e[`color${a}`]}}}},FQ=l1(["Tag","status"],e=>{const n=d4(e);return[mE(n,"success","Success"),mE(n,"processing","Info"),mE(n,"error","Error"),mE(n,"warning","Warning")]},f4),GQ=y.forwardRef((e,n)=>{const{prefixCls:a,className:l,rootClassName:c,style:u,children:p,icon:m,color:S,variant:v,onClose:C,bordered:x,disabled:w,href:M,target:N,styles:T,classNames:$,...z}=e,{getPrefixCls:D,direction:A,className:I,variant:j,style:V,classNames:B,styles:L}=Ao("tag");if(process.env.NODE_ENV!=="production"){const Ne=jn("Tag");Ne.deprecated(x!==!1,"bordered={false}",'variant="filled"'),Ne.deprecated(!S?.endsWith("-inverse"),'color="xxx-inverse"','variant="solid"')}const[P,G,F,W,k]=VQ(e,j),ne=F||W,re=y.useContext(ii),q=w??re,{tag:K}=y.useContext(mn),[J,ae]=y.useState(!0),Z=Xo(z,["closeIcon","closable"]),le={...e,color:G,variant:P,disabled:q,href:M,target:N,icon:m},[oe,te]=_o([B,$],[L,T],{props:le}),ue=y.useMemo(()=>{let Ne={...te.root,...V,...u};return q||(Ne={...k,...Ne}),Ne},[te.root,V,u,k,q]),ce=D("tag",a),[fe,ie]=p4(ce),ge=me(ce,I,oe.root,`${ce}-${P}`,{[`${ce}-${G}`]:ne,[`${ce}-hidden`]:!J,[`${ce}-rtl`]:A==="rtl",[`${ce}-disabled`]:q},l,c,fe,ie),Ce=Ne=>{q||(Ne.stopPropagation(),C?.(Ne),!Ne.defaultPrevented&&ae(!1))},[,de]=R_(VE(e),VE(K),{closable:!1,closeIconRender:Ne=>{const xe=y.createElement("span",{className:`${ce}-close-icon`,onClick:Ce},Ne);return P_(Ne,xe,ze=>({onClick:Me=>{ze?.onClick?.(Me),Ce(Me)},className:me(ze?.className,`${ce}-close-icon`)}))}}),se=typeof z.onClick=="function"||p&&p.type==="a",pe=$l(m,{className:me(y.isValidElement(m)?m.props?.className:void 0,oe.icon),style:te.icon}),Te=pe?y.createElement(y.Fragment,null,pe,p&&y.createElement("span",{className:oe.content,style:te.content},p)):p,we=M?"a":"span",be=y.createElement(we,{...Z,ref:n,className:ge,style:ue,href:q?void 0:M,target:N,onClick:q?void 0:Z.onClick,...M&&q?{"aria-disabled":!0}:{}},Te,de,F&&y.createElement(UQ,{key:"preset",prefixCls:ce}),W&&y.createElement(FQ,{key:"status",prefixCls:ce}));return se?y.createElement(Mw,{component:"Tag"},be):be}),Zm=GQ;process.env.NODE_ENV!=="production"&&(Zm.displayName="Tag");Zm.CheckableTag=P7;Zm.CheckableTagGroup=U7;const m4="指标",YQ=new Set(["string","number","boolean","date","datetime"]),XQ=new Set(["time","category","name","id","amount","count","number","ratio"]),kQ=new Set(["auto","user"]),WQ=new Set(["sum","avg","count","count_distinct","max","min"]);function as(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function sa(e){return typeof e=="string"&&e.trim().length>0?e:void 0}function Is(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function z8(e,n){return typeof e=="boolean"?e:n}function tR(e){return typeof e=="string"&&kQ.has(e)?e:void 0}function KQ(e){return typeof e=="string"&&YQ.has(e)?e:void 0}function QQ(e){return typeof e=="string"&&XQ.has(e)?e:void 0}function ZQ(e){return typeof e=="string"&&WQ.has(e)?e:void 0}function nR(e,n,a){return sa(e[a])??sa(n[a])}function JQ(e,n){const a=nR(e,n,"categoryField")??"",l=nR(e,n,"valueField")??"",c=nR(e,n,"seriesField"),u=tR(e.categoryFieldSource)??(a?"user":void 0),p=tR(e.valueFieldSource)??(l?"user":void 0),m=tR(e.seriesFieldSource)??(c?"user":void 0);return{categoryField:a,categoryFieldSource:u,valueField:l,valueFieldSource:p,seriesField:c,seriesFieldSource:m}}function h4(){return{categoryField:"",valueField:""}}function eZ(e,n){const a=as(e)?e:{};return{seriesName:sa(a.seriesName)??sa(n.seriesName)??m4,showLegend:z8(a.showLegend,z8(n.showLegend,!0))}}function tZ(e){const n=as(e.dataset)?e.dataset:{},a=as(n.mapping)?n.mapping:{},l=sa(n.datasetKey)??sa(e.datasetId),c=JQ(a,e),u=eZ(n.display,e);if(!(!l&&!c.categoryField&&!c.valueField&&!c.seriesField))return{datasetKey:l??"",mapping:c,display:u}}function nZ(e){const n=as(e.option)?e.option:{},a=as(n.source)?n.source:{},l=sa(a.templateKey)??sa(e.optionPresetKey);if(l)return{source:{type:"template",templateKey:l}}}function oZ(e){if(as(e))return{colors:Array.isArray(e.colors)?e.colors.filter(n=>typeof n=="string"&&n.trim().length>0):void 0,borderRadius:Is(e.borderRadius),enableGradient:typeof e.enableGradient=="boolean"?e.enableGradient:void 0,enableShadow:typeof e.enableShadow=="boolean"?e.enableShadow:void 0,legendSpacing:as(e.legendSpacing)?{top:Is(e.legendSpacing.top),right:Is(e.legendSpacing.right),bottom:Is(e.legendSpacing.bottom),left:Is(e.legendSpacing.left),itemGap:Is(e.legendSpacing.itemGap),padding:Is(e.legendSpacing.padding)}:void 0,gridSpacing:as(e.gridSpacing)?{top:Is(e.gridSpacing.top),right:Is(e.gridSpacing.right),bottom:Is(e.gridSpacing.bottom),left:Is(e.gridSpacing.left)}:void 0,axis:as(e.axis)?{axisLineColor:sa(e.axis.axisLineColor),axisLabelColor:sa(e.axis.axisLabelColor),splitLineColor:sa(e.axis.splitLineColor)}:void 0,tooltip:as(e.tooltip)?{backgroundColor:sa(e.tooltip.backgroundColor),borderColor:sa(e.tooltip.borderColor),textColor:sa(e.tooltip.textColor)}:void 0}}function g4(e){const n=e.chartType,a=sa(e.dataMode)??sa(e.renderMode);return{chartType:n==="bar"||n==="pie"||n==="area"?n:"line",dataMode:a==="option"?"option":"dataset",dataset:tZ(e),option:nZ(e),theme:oZ(e.theme)}}function aZ(e,n){return sa(e.label)??sa(e.key)??`第${n+1}个字段`}function rZ(e,n){if(!as(e))throw new Error(`数据集字段元数据格式不合法,第${n+1}项必须是对象。`);const a=sa(e.key),l=sa(e.label),c=KQ(e.valueType),u=QQ(e.semanticType),p=e.analyticRole==="dimension"||e.analyticRole==="measure"?e.analyticRole:void 0,m=typeof e.groupable=="boolean"?e.groupable:void 0,S=typeof e.aggregatable=="boolean"?e.aggregatable:void 0,v=aZ(e,n);if(!a||!l||!c||!u||!p||typeof m>"u"||typeof S>"u")throw new Error(`字段“${v}”缺少严格模式元数据,请补齐 key、label、valueType、semanticType、analyticRole、groupable、aggregatable。`);return{key:a,label:l,valueType:c,semanticType:u,analyticRole:p,groupable:m,aggregatable:S,defaultAgg:ZQ(e.defaultAgg)}}function lZ(e,n){if(!as(e))throw new Error("宿主返回的数据集 Schema 不合法,请返回对象结构。");const a=sa(e.datasetKey),l=sa(e.label),c=Array.isArray(e.fields)?e.fields.map((u,p)=>rZ(u,p)):null;if(!a||!l||!c)throw new Error("宿主返回的数据集 Schema 不完整,请补齐 datasetKey、label 与 fields。");if(n&&a!==n)throw new Error(`宿主返回的数据集 Schema 标识不匹配,期望 ${n},实际为 ${a}。`);return{datasetKey:a,label:l,fields:c}}function np(e){return{seriesName:e.dataset?.display?.seriesName??m4,showLegend:e.dataset?.display?.showLegend??!0}}function q7(e){return!!(e.dataset?.datasetKey&&e.dataset.mapping.categoryField&&e.dataset.mapping.valueField)}function D8(e){switch(e.semanticType){case"amount":return 0;case"count":return 1;case"number":return 2;case"ratio":return 3;default:return 99}}function A8(e,n){if(n.semanticType==="id")return 999;if(e==="line"||e==="area")switch(n.semanticType){case"time":return 0;case"category":return 1;case"name":return 2;default:return 99}if(e==="bar")switch(n.semanticType){case"category":return 0;case"name":return 1;case"time":return 2;default:return 99}switch(n.semanticType){case"category":return 0;case"name":return 1;default:return 99}}function iZ(e,n){return n.filter(a=>a.analyticRole==="dimension"&&a.groupable&&a.semanticType!=="id").sort((a,l)=>A8(e,a)-A8(e,l))[0]}function sZ(e){return e.filter(n=>n.analyticRole==="measure"&&n.aggregatable).sort((n,a)=>D8(n)-D8(a))[0]}function cZ(e,n){const a=iZ(e,n.fields),l=sZ(n.fields);return{categoryField:a?.key??"",categoryFieldSource:a?"auto":void 0,valueField:l?.key??"",valueFieldSource:l?"auto":void 0}}function y4(e,n,a){return{datasetKey:e,mapping:a,display:n}}function uZ(e,n,a){const l=a??"",c=np(e),u=h4();return{...e,dataset:y4(l,c,u)}}function dZ(e,n){if(e.dataset?.datasetKey&&e.dataset.datasetKey!==n.datasetKey)return e;const a=e.dataset?.mapping??h4(),l=cZ(e.chartType,n),c={...a};let u=!1;return!a.categoryField&&a.categoryFieldSource!=="user"&&l.categoryField&&(c.categoryField=l.categoryField,c.categoryFieldSource="auto",u=!0),!a.valueField&&a.valueFieldSource!=="user"&&l.valueField&&(c.valueField=l.valueField,c.valueFieldSource="auto",u=!0),u?{...e,dataset:y4(n.datasetKey,np(e),c)}:e}function oR(e,n,a){const l=np(e),c=e.dataset?.mapping??h4(),u=typeof a=="string"?a:"",p={...c};return n==="categoryField"&&(p.categoryField=u,p.categoryFieldSource="user"),n==="valueField"&&(p.valueField=u,p.valueFieldSource="user"),n==="seriesField"&&(p.seriesField=u||void 0,p.seriesFieldSource="user"),{...e,dataset:y4(e.dataset?.datasetKey??"",l,p)}}function fZ(e,n){return JSON.stringify(e)===JSON.stringify(n)}function pZ(e){return e.filter(n=>n.analyticRole==="dimension"&&n.groupable)}function mZ(e){return e.filter(n=>n.analyticRole==="measure"&&n.aggregatable)}const cw={vivid:{label:"鲜艳高对比",colors:["#2563eb","#0ea5e9","#10b981","#f59e0b","#f97316","#ef4444"]},morandi:{label:"莫兰迪蓝灰",colors:["#7c8da6","#95a792","#c08f80","#b8a07a","#8f98b3","#9c8f87"]},dark:{label:"暗色霓虹",colors:["#60a5fa","#22d3ee","#34d399","#fbbf24","#fb7185","#a78bfa"]},terracotta:{label:"暖砂陶土",colors:["#b98273","#9a8b7a","#c2a58c","#8f9a92","#a58c94","#7d8d96"]}},Dy={colors:[...cw.vivid.colors],borderRadius:14,enableGradient:!0,enableShadow:!0,legendSpacing:{top:4,right:0,bottom:8,left:0,itemGap:16,padding:0},gridSpacing:{top:34,right:20,bottom:28,left:44},axis:{axisLineColor:"#d7dfeb",axisLabelColor:"#5c6b82",splitLineColor:"#edf2f7"},tooltip:{backgroundColor:"rgba(15, 23, 42, 0.94)",borderColor:"rgba(148, 163, 184, 0.18)",textColor:"#f8fafc"}};function hZ(...e){return e.reduce((n,a)=>a?{colors:Array.isArray(a.colors)&&a.colors.length>0?[...a.colors]:n.colors,borderRadius:typeof a.borderRadius=="number"?a.borderRadius:n.borderRadius,enableGradient:typeof a.enableGradient=="boolean"?a.enableGradient:n.enableGradient,enableShadow:typeof a.enableShadow=="boolean"?a.enableShadow:n.enableShadow,legendSpacing:{...n.legendSpacing,...a.legendSpacing},gridSpacing:{...n.gridSpacing,...a.gridSpacing},axis:{...n.axis,...a.axis},tooltip:{...n.tooltip,...a.tooltip}}:n,{...Dy,colors:[...Dy.colors],legendSpacing:{...Dy.legendSpacing},gridSpacing:{...Dy.gridSpacing},axis:{...Dy.axis},tooltip:{...Dy.tooltip}})}function gZ(e){if(!Array.isArray(e)||e.length===0)return"vivid";const n=e.map(l=>l.toLowerCase());return Object.entries(cw).find(([,l])=>l.colors.length===n.length&&l.colors.every((c,u)=>c.toLowerCase()===n[u]))?.[0]??null}function Zy(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function _8(e){return Array.isArray(e)&&e.every(n=>Zy(n))}function F7(e){return e==="area"?"面积图":e==="bar"?"柱状图":e==="pie"?"饼图":"折线图"}function B8(e){return`${e.label}(${e.semanticType} / ${e.valueType})`}function yZ(e){if(_8(e))return e;if(Zy(e)&&_8(e.rows))return e.rows;throw new Error("内置图表组件收到不支持的数据结构,请返回 rows 数组或 BuiltinChartDataResult。")}function bZ(e){return!Zy(e)||!Zy(e.option)?!1:e.kind==="builtin-chart-option"||e.kind==="option"||typeof e.kind>"u"}function vZ(e){if(bZ(e))return e.option;throw new Error("内置图表组件收到不支持的 option 结构,请返回 { kind: 'builtin-chart-option', option }。")}function SZ(e){return!Zy(e)||!Zy(e.meta)?null:typeof e.meta.summary=="string"?e.meta.summary:null}function Gy(e,n,a){if(!n)return a;const l=e[n];return l===null||typeof l>"u"?a:String(l)}function b4(e,n){if(!n)return null;const a=e[n],l=typeof a=="number"?a:Number(a);return Number.isFinite(l)?l:null}function CZ(e){const n=e.dataset?.datasetKey,a=e.dataset?.mapping.categoryField,l=e.dataset?.mapping.valueField;return n?!a&&!l?"请先完成字段映射":a?l?"请先完成字段映射":"请先选择数值字段":"请先选择类目字段":"请先选择数据集"}function H8(e){return e.dataMode==="option"?"请先选择图表模板":CZ(e)}function xZ(e){const{context:n,onChange:a,services:l,value:c}=e,u=l.dataSourceAdapters?.["builtin-chart"],p=g4(c),[m,S]=_.useState([]),[v,C]=_.useState(null),[x,w]=_.useState([]),[M,N]=_.useState(null);_.useEffect(()=>{let B=!0;async function L(){try{N(null);const P=await u?.getDatasetOptions?.({chartType:p.chartType,dashboardCode:n.dashboardCode})??[];if(!B)return;S(P)}catch{if(!B)return;N("加载数据集失败,请稍后重试。")}}return L(),()=>{B=!1}},[u,n.dashboardCode,p.chartType]),_.useEffect(()=>{let B=!0;async function L(){const P=p.dataset?.datasetKey;if(!P){C(null);return}const G=u?.getDatasetSchema;if(!G){C(null),N("当前宿主未提供严格模式数据集 Schema 服务。");return}C(null);try{N(null);const F=lZ(await G({chartType:p.chartType,datasetKey:P,dashboardCode:n.dashboardCode}),P);if(!B)return;C(F)}catch(F){if(!B)return;N(F instanceof Error?F.message:"加载数据集 Schema 失败,请稍后重试。")}}return L(),()=>{B=!1}},[u,n.dashboardCode,p.chartType,p.dataset?.datasetKey]),_.useEffect(()=>{let B=!0;async function L(){try{N(null);const P=await u?.getOptionTemplates?.({chartType:p.chartType,dashboardCode:n.dashboardCode})??[];if(!B)return;w(P)}catch{if(!B)return;N("加载图表模板失败,请稍后重试。")}}return L(),()=>{B=!1}},[u,n.dashboardCode,p.chartType]),_.useEffect(()=>{if(p.dataMode!=="dataset"||!v)return;const B=dZ(p,v);fZ(p,B)||a(B)},[v,p,a]);const T=v?.fields??[],$=pZ(T).map(B=>({label:B8(B),value:B.key})),z=mZ(T).map(B=>({label:B8(B),value:B.key})),D=p.dataMode==="dataset",A=p.chartType!=="pie",I=np(p),j=gZ(p.theme?.colors);function V(B){a({...p,theme:{...p.theme,...B}})}return X.jsxs(It,{layout:"vertical",children:[M?X.jsx(c1,{className:"cps-bi-builtin-chart__alert",showIcon:!0,title:M,type:"warning"}):null,X.jsx(jw,{className:"cps-bi-builtin-chart__config-tabs",items:[{key:"data",label:"数据配置",children:X.jsxs("div",{className:"cps-bi-builtin-chart__config-pane",children:[X.jsx(It.Item,{label:"数据模式",children:X.jsx(ia,{"aria-label":"数据模式",onChange:B=>{a({...p,dataMode:B})},options:[{label:"字段映射",value:"dataset"},{label:"模板直出",value:"option"}],value:p.dataMode})}),X.jsx(It.Item,{label:"图表类型",children:X.jsx(ea,{"aria-label":"图表类型",disabled:!0,value:F7(p.chartType)})}),D?X.jsxs(X.Fragment,{children:[X.jsx(It.Item,{label:"数据源",children:X.jsx(ia,{allowClear:!0,"aria-label":"数据源",onChange:B=>{a(uZ(p,null,typeof B=="string"?B:void 0))},options:m.map(B=>({label:B.label,value:B.key})),placeholder:"请选择数据源",value:p.dataset?.datasetKey||void 0})}),X.jsx(It.Item,{label:p.chartType==="pie"?"名称字段":"类目字段",children:X.jsx(ia,{allowClear:!0,"aria-label":p.chartType==="pie"?"名称字段":"类目字段",onChange:B=>{a(oR(p,"categoryField",typeof B=="string"?B:void 0))},options:$,placeholder:"请选择类目字段",value:p.dataset?.mapping.categoryField||void 0})}),X.jsx(It.Item,{label:p.chartType==="pie"?"数值字段":"指标字段",children:X.jsx(ia,{allowClear:!0,"aria-label":p.chartType==="pie"?"数值字段":"指标字段",onChange:B=>{a(oR(p,"valueField",typeof B=="string"?B:void 0))},options:z,placeholder:"请选择数值字段",value:p.dataset?.mapping.valueField||void 0})}),A?X.jsx(It.Item,{label:"分组字段",children:X.jsx(ia,{allowClear:!0,"aria-label":"分组字段",onChange:B=>{a(oR(p,"seriesField",typeof B=="string"?B:void 0))},options:$,placeholder:"可选:按字段拆分多系列",value:p.dataset?.mapping.seriesField})}):null]}):X.jsx(It.Item,{label:"图表模板",children:X.jsx(ia,{allowClear:!0,"aria-label":"图表模板",onChange:B=>{a({...p,option:typeof B=="string"?{source:{type:"template",templateKey:B}}:void 0})},optionFilterProp:"label",options:x.map(B=>({label:B.label,value:B.key})),placeholder:"请选择图表模板",value:p.option?.source.templateKey})})]})},{key:"style",label:"图表样式",children:X.jsxs("div",{className:"cps-bi-builtin-chart__config-pane",children:[D?X.jsxs(X.Fragment,{children:[X.jsx(It.Item,{label:"系列名称",children:X.jsx(ea,{"aria-label":"系列名称",onChange:B=>{a({...p,dataset:{datasetKey:p.dataset?.datasetKey??"",mapping:p.dataset?.mapping??{categoryField:"",valueField:""},display:{...I,seriesName:B.target.value||void 0}}})},placeholder:"请输入系列名称",value:I.seriesName})}),X.jsx(It.Item,{label:"显示图例",children:X.jsx(Ff,{checked:I.showLegend??!0,onChange:B=>{a({...p,dataset:{datasetKey:p.dataset?.datasetKey??"",mapping:p.dataset?.mapping??{categoryField:"",valueField:""},display:{...I,showLegend:B}}})}})})]}):null,X.jsx(It.Item,{label:"配色方案",children:X.jsx(ia,{"aria-label":"图表配色方案",onChange:B=>{const L=cw[B];L&&V({colors:[...L.colors]})},options:Object.entries(cw).map(([B,L])=>({label:L.label,value:B})),value:j??void 0})}),X.jsx(It.Item,{label:"圆角",children:X.jsx(ai,{"aria-label":"图表圆角",max:24,min:0,onChange:B=>{V({borderRadius:typeof B=="number"?B:void 0})},style:{width:"100%"},value:p.theme?.borderRadius})}),X.jsx(It.Item,{label:"开启渐变",children:X.jsx(Ff,{"aria-label":"开启渐变",checked:p.theme?.enableGradient??!0,onChange:B=>{V({enableGradient:B})}})}),X.jsx(It.Item,{label:"开启阴影",children:X.jsx(Ff,{"aria-label":"开启阴影",checked:p.theme?.enableShadow??!0,onChange:B=>{V({enableShadow:B})}})}),X.jsx(It.Item,{label:"图例上边距",children:X.jsx(ai,{"aria-label":"图例上边距",max:48,min:0,onChange:B=>{V({legendSpacing:{...p.theme?.legendSpacing,top:typeof B=="number"?B:void 0}})},style:{width:"100%"},value:p.theme?.legendSpacing?.top})}),X.jsx(It.Item,{label:"图表上留白",children:X.jsx(ai,{"aria-label":"图表上留白",max:120,min:16,onChange:B=>{V({gridSpacing:{...p.theme?.gridSpacing,top:typeof B=="number"?B:void 0}})},style:{width:"100%"},value:p.theme?.gridSpacing?.top})})]})}]})]})}function EZ(e){return e==="loading"?X.jsx(u4,{size:"small"}):e==="empty"?X.jsx(pA,{className:"cps-bi-widget-state-card__icon"}):e==="incomplete"?X.jsx(bw,{className:"cps-bi-widget-state-card__icon"}):e==="unauthorized"?X.jsx(oM,{className:"cps-bi-widget-state-card__icon"}):X.jsx(JS,{className:"cps-bi-widget-state-card__icon"})}function Bc(e){const{kind:n,title:a,description:l,visual:c,className:u}=e,p=["cps-bi-widget-state-card",`is-${n}`,u].filter(Boolean).join(" "),m=typeof c>"u"?EZ(n):c;return X.jsx("div",{className:p,"data-state":n,children:X.jsxs("div",{className:"cps-bi-widget-state-card__inner",children:[m?X.jsx("div",{"aria-hidden":n!=="loading",className:"cps-bi-widget-state-card__visual",children:m}):null,X.jsxs("div",{className:"cps-bi-widget-state-card__body",children:[X.jsx("p",{className:"cps-bi-widget-state-card__title",children:X.jsx("span",{children:a})}),l?X.jsx("p",{className:"cps-bi-widget-state-card__description",children:l}):null]})]})})}const wZ="cps-bi",$Z={},G7=_.createContext(null);function RZ(e){const n=e?.trim();return n&&n.length>0?n:wZ}function TZ(e){const n=new Set,a=new Set;for(const l of e){if(a.has(l.widgetCode)){n.add(l.widgetCode);continue}a.add(l.widgetCode)}n.size>0&&console.warn(`[cps-bi-sdk] duplicated widgetCode detected: ${Array.from(n).join(", ")}`)}function OZ(e){const n=new Map;for(const a of[...Q7,...e])n.set(a.widgetCode,a);return Array.from(n.values())}function Y7(e){const{children:n,widgets:a,services:l,prefixCls:c,themeConfig:u,builtinThemeConfig:p}=e,m=RZ(c),S=_.useMemo(()=>{const v=OZ(a);return TZ(v),{widgets:v,widgetMap:new Map(v.map(C=>[C.widgetCode,C])),services:l??$Z,prefixCls:m,themeConfig:u,builtinThemeConfig:p}},[p,m,l,u,a]);return X.jsx(G7.Provider,{value:S,children:n})}function rd(){const e=_.useContext(G7);if(!e)throw new Error("useDashboardConfig must be used within DashboardConfigProvider");return e}function Jm(e,n){const a=e.trim();if(/^#([0-9a-f]{6})$/i.test(a)){const l=a.slice(1),c=Number.parseInt(l.slice(0,2),16),u=Number.parseInt(l.slice(2,4),16),p=Number.parseInt(l.slice(4,6),16);return`rgba(${c}, ${u}, ${p}, ${n})`}if(/^#([0-9a-f]{3})$/i.test(a)){const l=a.slice(1),c=Number.parseInt(`${l[0]}${l[0]}`,16),u=Number.parseInt(`${l[1]}${l[1]}`,16),p=Number.parseInt(`${l[2]}${l[2]}`,16);return`rgba(${c}, ${u}, ${p}, ${n})`}return a}function X7(e,n){return{backgroundColor:e.tooltip.backgroundColor,borderColor:e.tooltip.borderColor,borderWidth:1,confine:!0,renderMode:"richText",textStyle:{color:e.tooltip.textColor},trigger:n}}function v4(e,n){return e.enableShadow?{shadowBlur:16,shadowColor:Jm(n,.18),shadowOffsetY:8}:{}}function MZ(e,n){return n.enableGradient?new LD.graphic.LinearGradient(0,0,0,1,[{offset:0,color:Jm(e,.34)},{offset:1,color:Jm(e,.04)}]):Jm(e,.12)}function k7(e,n){return n.enableGradient?new LD.graphic.LinearGradient(0,0,0,1,[{offset:0,color:Jm(e,.96)},{offset:1,color:Jm(e,.72)}]):e}function W7(e,n,a){const l=np(e),c=a.gridSpacing.top??34,u=a.gridSpacing.right??20,p=a.gridSpacing.bottom??28,m=a.gridSpacing.left??44;return{animationDuration:260,animationEasing:"cubicOut",color:a.colors,grid:{top:l.showLegend?Math.max(c,66):c,right:u,bottom:p,left:m},legend:{show:l.showLegend,top:a.legendSpacing.top??4,right:a.legendSpacing.right??0,left:a.legendSpacing.left??0,bottom:a.legendSpacing.bottom??8,itemGap:a.legendSpacing.itemGap??16,padding:a.legendSpacing.padding??0,textStyle:{color:a.axis.axisLabelColor}},tooltip:X7(a,"axis"),xAxis:{type:"category",boundaryGap:e.chartType==="bar",data:n,axisLine:{lineStyle:{color:a.axis.axisLineColor}},axisTick:{show:!1},axisLabel:{color:a.axis.axisLabelColor,margin:14}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:a.axis.splitLineColor}},axisLabel:{color:a.axis.axisLabelColor,margin:12}}}}function NZ(e,n,a){const l=new Map;return e.forEach((c,u)=>{l.set(Gy(c,n,`类目${u+1}`),b4(c,a)??0)}),l}function K7(e,n,a){return{smooth:e.chartType==="line"||e.chartType==="area",showSymbol:!1,symbol:"circle",symbolSize:7,lineStyle:{width:e.chartType==="area"?3.5:3,color:n},itemStyle:{color:n,borderWidth:2,borderColor:"#ffffff",...v4(a,n)},areaStyle:e.chartType==="area"?{color:MZ(n,a)}:void 0}}function zZ(e,n,a,l){const c=np(e),u=l.colors[0]??"#2563eb",p=NZ(n,e.dataset?.mapping.categoryField,e.dataset?.mapping.valueField),m=e.chartType==="bar"?"bar":"line";return{...W7(e,a,l),series:[{name:c.seriesName,type:m,...m==="line"?K7(e,u,l):{},itemStyle:m==="bar"?{borderRadius:[l.borderRadius,l.borderRadius,6,6],color:k7(u,l),...v4(l,u)}:void 0,barMaxWidth:e.chartType==="bar"?34:void 0,data:a.map(S=>p.get(S)??0)}]}}function DZ(e,n,a,l){const c=np(e),u=e.dataset?.mapping,p=Array.from(new Set(n.map(S=>Gy(S,u?.seriesField,"未分组")).filter(Boolean))),m=e.chartType==="bar"?"bar":"line";return{...W7(e,a,l),series:p.map((S,v)=>{const C=l.colors[v%l.colors.length]??l.colors[0]??"#2563eb",x=new Map;return n.filter(w=>Gy(w,u?.seriesField,"未分组")===S).forEach(w=>{x.set(Gy(w,u?.categoryField,"未命名类目"),b4(w,u?.valueField)??0)}),{name:S||c.seriesName,type:m,...m==="line"?K7(e,C,l):{},itemStyle:m==="bar"?{borderRadius:[l.borderRadius,l.borderRadius,6,6],color:k7(C,l),...v4(l,C)}:void 0,barMaxWidth:e.chartType==="bar"?34:void 0,data:a.map(w=>x.get(w)??0)}})}}function AZ(e,n,a){const l=np(e),c=e.dataset?.mapping;return{animationDuration:260,animationEasing:"cubicOut",color:a.colors,tooltip:X7(a,"item"),legend:{show:l.showLegend,bottom:a.legendSpacing.bottom??8,left:a.legendSpacing.left??0,right:a.legendSpacing.right??0,itemGap:a.legendSpacing.itemGap??16,padding:a.legendSpacing.padding??0,textStyle:{color:a.axis.axisLabelColor}},series:[{name:l.seriesName,type:"pie",radius:["42%","72%"],center:["50%",l.showLegend?"40%":"50%"],label:{color:a.axis.axisLabelColor,formatter:"{b}: {d}%"},itemStyle:{borderRadius:a.borderRadius,borderColor:"#ffffff",borderWidth:2},emphasis:{itemStyle:{shadowBlur:18,shadowColor:Jm(a.colors[0]??"#2563eb",.22)}},data:n.map((u,p)=>({name:Gy(u,c?.categoryField,`类目${p+1}`),value:b4(u,c?.valueField)??0}))}]}}function Ay({description:e,kind:n}){return X.jsx(Bc,{description:n==="loading"?"数据返回后会自动刷新图表预览。":void 0,kind:n,title:e})}function _Z(e){const{config:n,context:a,data:l}=e,{builtinThemeConfig:c}=rd(),u=g4(n),p=hZ(c?.charts,u.theme),m=a.mode==="builder",S=SZ(l);let v=null,C=null;if(u.dataMode==="option"&&!u.option?.source.templateKey)C=X.jsx(Ay,{description:H8(u),kind:"incomplete"});else if(u.dataMode==="dataset"&&!q7(u))C=X.jsx(Ay,{description:H8(u),kind:"incomplete"});else if(typeof l>"u")C=m?X.jsx(Ay,{description:"正在加载数据",kind:"loading"}):X.jsx(Ay,{description:"当前图表暂无可用数据",kind:"empty"});else if(l===null)C=X.jsx(Ay,{description:"当前图表暂无可用数据",kind:"empty"});else if(u.dataMode==="option")v=vZ(l);else{const x=yZ(l);if(x.length===0)C=X.jsx(Ay,{description:"当前图表暂无可用数据",kind:"empty"});else{const w=Array.from(new Set(x.map((M,N)=>Gy(M,u.dataset?.mapping.categoryField,`类目${N+1}`))));v=u.chartType==="pie"?AZ(u,x,p):u.dataset?.mapping.seriesField?DZ(u,x,w,p):zZ(u,x,w,p)}}return v?X.jsxs("div",{className:"cps-bi-builtin-widget cps-bi-builtin-chart",children:[S?X.jsx(c1,{banner:!0,className:"cps-bi-builtin-widget__summary cps-bi-builtin-chart__summary",title:S,type:"info"}):null,X.jsx("div",{className:"cps-bi-builtin-widget__body cps-bi-builtin-chart__canvas",children:X.jsx(uj,{autoResize:!0,className:"cps-bi-builtin-chart__echart",notMerge:!0,option:v,opts:{renderer:"svg"},style:{height:"100%",width:"100%"}})})]}):C}function BZ(e){if(!e)return"";const n=Date.parse(e);if(Number.isNaN(n))return"";const a=new Date(n),l=c=>String(c).padStart(2,"0");return`${a.getFullYear()}-${l(a.getMonth()+1)}-${l(a.getDate())}T${l(a.getHours())}:${l(a.getMinutes())}`}function HZ(e){return{title:typeof e.title=="string"?e.title:"",targetTime:typeof e.targetTime=="string"?e.targetTime:"",format:e.format==="mm:ss"||e.format==="HH:mm:ss"?e.format:"DD:HH:mm:ss",expiredText:typeof e.expiredText=="string"&&e.expiredText.trim().length>0?e.expiredText:"已结束",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function jZ(e){const{onChange:n,value:a}=e,l=HZ(a);return X.jsxs(It,{layout:"vertical",children:[X.jsx(It.Item,{label:"标题",children:X.jsx(ea,{"aria-label":"倒计时标题",onChange:c=>{n({...l,title:c.target.value})},value:l.title})}),X.jsx(It.Item,{label:"目标时间",children:X.jsx(ea,{"aria-label":"倒计时目标时间",onChange:c=>{const u=c.target.value;n({...l,targetTime:u?new Date(u).toISOString():""})},type:"datetime-local",value:BZ(l.targetTime)})}),X.jsx(It.Item,{label:"显示格式",children:X.jsx(ia,{"aria-label":"倒计时显示格式",onChange:c=>{n({...l,format:c})},options:[{label:"天:时:分:秒",value:"DD:HH:mm:ss"},{label:"时:分:秒",value:"HH:mm:ss"},{label:"分:秒",value:"mm:ss"}],value:l.format})}),X.jsx(It.Item,{label:"结束文案",children:X.jsx(ea,{"aria-label":"倒计时结束文案",onChange:c=>{n({...l,expiredText:c.target.value})},value:l.expiredText})}),X.jsx(It.Item,{label:"强调色",children:X.jsx(ea,{"aria-label":"倒计时强调色",onChange:c=>{n({...l,accentColor:c.target.value})},placeholder:"#2563eb",value:l.accentColor})})]})}function IZ(e){return{title:typeof e.title=="string"?e.title:"",targetTime:typeof e.targetTime=="string"?e.targetTime:"",format:e.format==="mm:ss"||e.format==="HH:mm:ss"?e.format:"DD:HH:mm:ss",expiredText:typeof e.expiredText=="string"&&e.expiredText.trim().length>0?e.expiredText:"已结束",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function Fu(e){return String(e).padStart(2,"0")}function LZ(e,n){const a=Math.max(0,Math.floor(e/1e3)),l=Math.floor(a/86400),c=Math.floor(a%86400/3600),u=Math.floor(a%3600/60),p=a%60;if(n==="mm:ss"){const m=Math.floor(a/60);return`${Fu(m)}:${Fu(p)}`}if(n==="HH:mm:ss"){const m=Math.floor(a/3600);return`${Fu(m)}:${Fu(u)}:${Fu(p)}`}return`${Fu(l)}:${Fu(c)}:${Fu(u)}:${Fu(p)}`}function VZ(e){const{config:n}=e,a=IZ(n),l=Date.parse(a.targetTime),[c,u]=_.useState(()=>Date.now());if(_.useEffect(()=>{const S=window.setInterval(()=>{u(Date.now())},1e3);return()=>{window.clearInterval(S)}},[]),!a.targetTime||Number.isNaN(l))return X.jsx(Bc,{kind:"incomplete",title:"请先设置有效的目标时间"});const p=l-c,m=p<=0;return X.jsx("div",{className:"cps-bi-builtin-widget cps-bi-builtin-countdown",style:{"--cps-bi-builtin-accent":a.accentColor},children:X.jsxs("div",{className:"cps-bi-builtin-widget__body",children:[a.title?X.jsx("div",{className:"cps-bi-builtin-countdown__title",children:a.title}):null,X.jsx("div",{className:`cps-bi-builtin-countdown__value${m?" is-expired":""}`,children:m?a.expiredText:LZ(p,a.format)})]})})}function PZ(e){return{title:typeof e.title=="string"?e.title:"",content:typeof e.content=="string"?e.content:"",align:e.align==="center"||e.align==="right"?e.align:"left",level:e.level==="hero"||e.level==="title"?e.level:"body",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function UZ(e){const{onChange:n,value:a}=e,l=PZ(a);return X.jsxs(It,{layout:"vertical",children:[X.jsx(It.Item,{label:"标题",children:X.jsx(ea,{"aria-label":"文本标题",onChange:c=>{n({...l,title:c.target.value})},value:l.title})}),X.jsx(It.Item,{label:"正文",children:X.jsx(ea.TextArea,{"aria-label":"文本正文",autoSize:{minRows:4,maxRows:10},onChange:c=>{n({...l,content:c.target.value})},value:l.content})}),X.jsx(It.Item,{label:"对齐方式",children:X.jsx(ia,{"aria-label":"文本对齐方式",onChange:c=>{n({...l,align:c})},options:[{label:"左对齐",value:"left"},{label:"居中",value:"center"},{label:"右对齐",value:"right"}],value:l.align})}),X.jsx(It.Item,{label:"字号层级",children:X.jsx(ia,{"aria-label":"文本字号层级",onChange:c=>{n({...l,level:c})},options:[{label:"大标题",value:"hero"},{label:"标题",value:"title"},{label:"正文",value:"body"}],value:l.level})}),X.jsx(It.Item,{label:"强调色",children:X.jsx(ea,{"aria-label":"文本强调色",onChange:c=>{n({...l,accentColor:c.target.value})},placeholder:"#2563eb",value:l.accentColor})})]})}function qZ(e){return{title:typeof e.title=="string"?e.title:"",content:typeof e.content=="string"?e.content:"",align:e.align==="center"||e.align==="right"?e.align:"left",level:e.level==="hero"||e.level==="title"?e.level:"body",accentColor:typeof e.accentColor=="string"?e.accentColor:"#2563eb"}}function FZ(e){const{config:n}=e,a=qZ(n);return a.content.trim()?X.jsx("div",{className:`cps-bi-builtin-widget cps-bi-builtin-text is-${a.level}`,style:{"--cps-bi-builtin-accent":a.accentColor},children:X.jsxs("div",{className:"cps-bi-builtin-text__body",style:{textAlign:a.align},children:[a.title?X.jsx("div",{className:"cps-bi-builtin-text__title",children:a.title}):null,X.jsx("div",{className:"cps-bi-builtin-text__content",children:a.content})]})}):X.jsx(Bc,{kind:"incomplete",title:"请先输入文本内容"})}const GZ=_Z,YZ=xZ,XZ=FZ,kZ=UZ,WZ=VZ,KZ=jZ;function hE(e){return{name:e.name,icon:e.icon,widgetCode:e.widgetCode,kind:"builtin",description:e.description,category:"charts",keywords:[e.name,F7(e.chartType),"内置图表","echarts"],minWidth:6,minHeight:e.minHeight,defaultBaseConfig:{title:e.name,showTitle:!0},defaultConfig:{chartType:e.chartType,dataMode:"dataset",dataset:{datasetKey:"",mapping:{categoryField:"",valueField:""},display:{seriesName:e.name||m4,showLegend:!0}}},dataBinding:{adapterKey:"builtin-chart",buildQuery:n=>{const a=g4(n.config),l=!!a.option?.source.templateKey;return a.dataMode==="dataset"&&!q7(a)||a.dataMode==="option"&&!l?null:{customConfig:n.config,triggerParams:n.trigger.params,scene:n.scene,triggerType:n.trigger.type,eventName:n.trigger.eventName}}},component:GZ,configComponent:YZ}}function QZ(){return{name:"文本",icon:X.jsx(sA,{}),widgetCode:"builtin-text",kind:"builtin",description:"官方内置文本块,适合说明文案、摘要与强调信息。",category:"view",keywords:["文本","说明","内置组件"],minWidth:6,minHeight:1,defaultBaseConfig:{title:"文本",showTitle:!1},defaultStyleConfig:{showCard:!1},defaultConfig:{title:"",content:"请输入需要展示的文本内容",align:"left",level:"body",accentColor:"#2563eb"},component:XZ,configComponent:kZ}}function ZZ(){return{name:"倒计时",icon:X.jsx(oA,{}),widgetCode:"builtin-countdown",kind:"builtin",description:"官方内置倒计时,适合活动、发布与节点提醒场景。",category:"view",keywords:["倒计时","时间","内置组件"],minWidth:6,minHeight:2,defaultBaseConfig:{title:"倒计时",showTitle:!1},defaultConfig:{title:"活动开始",targetTime:new Date(Date.now()+1440*60*1e3).toISOString(),format:"DD:HH:mm:ss",expiredText:"已结束",accentColor:"#2563eb"},component:WZ,configComponent:KZ}}const Q7=[hE({chartType:"line",description:"官方内置折线图,适合趋势变化与多时点对比。",icon:X.jsx(mA,{}),minHeight:8,name:"折线图",widgetCode:"builtin-line-chart"}),hE({chartType:"bar",description:"官方内置柱状图,适合分类指标对比。",icon:X.jsx(JD,{}),minHeight:8,name:"柱状图",widgetCode:"builtin-bar-chart"}),hE({chartType:"pie",description:"官方内置饼图,适合份额占比分析。",icon:X.jsx(hA,{}),minHeight:8,name:"饼图",widgetCode:"builtin-pie-chart"}),hE({chartType:"area",description:"官方内置面积图,适合展示趋势变化与累计体量。",icon:X.jsx(ZD,{}),minHeight:8,name:"面积图",widgetCode:"builtin-area-chart"}),QZ(),ZZ()];function FO(e,n){return e.x===n.x&&e.y===n.y&&e.w===n.w&&e.h===n.h}function JZ(e,n){return e.by===n.by&&e.values.length===n.values.length&&e.values.every((a,l)=>a===n.values[l])}function eJ(e,n){return e.showCard===n.showCard&&e.cardPadding===n.cardPadding&&e.cardBackgroundColor===n.cardBackgroundColor&&e.cardBorderColor===n.cardBorderColor&&e.cardBorderRadius===n.cardBorderRadius}function tJ(e,n){return e.title===n.title&&e.showTitle===n.showTitle}function j8(e,n){return e.kind===n.kind&&e.widgetCode===n.widgetCode&&e.uniqueCode===n.uniqueCode&&FO(e.layout,n.layout)&&tJ(e.baseConfig,n.baseConfig)&&eJ(e.styleConfig,n.styleConfig)&&JZ(e.linkageConfig.target,n.linkageConfig.target)}function I8(e,n){return e.kind===n.kind&&e.widgetCode===n.widgetCode&&e.uniqueCode===n.uniqueCode&&e.customConfig===n.customConfig}function nJ({getSettings:e,getComponentIds:n,getComponentsById:a}){const l=new Map,c=new Map;let u=null;const p=C=>C?a()[C]??null:null;return{clearSelectorCaches(){l.clear(),c.clear(),u=null},clearRuntimeSelectorCache(C){c.delete(C)},clearShellSelectorCache(C){l.delete(C)},invalidateCanvasLayoutCache(){u=null},selectCanvasLayoutSnapshot:()=>{const C=e(),x=n(),w=a();if(u&&u.settings===C&&u.componentIds===x&&x.every(($,z)=>w[$]?.layout===u?.layoutRefs[z]))return u.snapshot;const M=x.flatMap(T=>{const $=w[T];return $?[{id:$.id,layout:$.layout}]:[]}),N={settings:C,componentIds:x,items:M};return u={settings:C,componentIds:x,layoutRefs:M.map(T=>T.layout),snapshot:N},N},selectComponentById:p,selectComponentRuntimeById:C=>{const x=p(C);if(!x)return null;const w=c.get(x.id);if(w&&w.widgetCode===x.widgetCode&&w.uniqueCode===x.uniqueCode&&w.kind===x.kind&&w.customConfig===x.customConfig)return w.snapshot;const M={id:x.id,kind:x.kind,widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,customConfig:x.customConfig};return c.set(x.id,{widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,kind:x.kind,customConfig:x.customConfig,snapshot:M}),M},selectComponentShellById:C=>{const x=p(C);if(!x)return null;const w=x.linkageConfig.target,M=l.get(x.id);if(M&&M.widgetCode===x.widgetCode&&M.uniqueCode===x.uniqueCode&&M.kind===x.kind&&M.layout===x.layout&&M.baseConfig===x.baseConfig&&M.styleConfig===x.styleConfig&&M.linkageTarget===w)return M.snapshot;const N={id:x.id,kind:x.kind,widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,layout:x.layout,baseConfig:x.baseConfig,styleConfig:x.styleConfig,linkageTarget:w};return l.set(x.id,{widgetCode:x.widgetCode,uniqueCode:x.uniqueCode,kind:x.kind,layout:x.layout,baseConfig:x.baseConfig,styleConfig:x.styleConfig,linkageTarget:w,snapshot:N}),N}}}function Yy(e,n,a=Object.is){const l=_.useRef(n);l.current=n;const c=_.useRef(a);c.current=a;const u=_.useRef(n(e.getSnapshot())),p=_.useCallback(()=>{const m=l.current(e.getSnapshot());return c.current(u.current,m)?u.current:(u.current=m,m)},[e]);return _.useSyncExternalStore(_.useCallback(m=>e.subscribe(S=>{const v=l.current(S);c.current(u.current,v)||(u.current=v,m())}),[e]),p,p)}function L8(e){const{settings:n,components:a,...l}=e;return l}function V8(e){const n={};for(const a of e)n[a.id]=a;return n}function aR(e,n,a,l){return!e||!n?null:{...e,settings:n,components:a.flatMap(c=>{const u=l[c];return u?[u]:[]})}}function P8(e,n,a,l,c){return{schema:e,schemaMeta:n,settings:a,componentIds:l,componentsById:c}}function oJ(e=null){let n=e?L8(e):null,a=e?.settings??null,l=e?.components.map(D=>D.id)??[],c=e?V8(e.components):{},u=e,p=P8(u,n,a,l,c);const m=new Set,S=nJ({getSettings:()=>a,getComponentIds:()=>l,getComponentsById:()=>c}),v=D=>{n=D?L8(D):null,a=D?.settings??null,l=D?.components.map(A=>A.id)??[],c=D?V8(D.components):{},u=D,S.clearSelectorCaches()},C=()=>(u===null&&n&&a&&(u=aR(n,a,l,c)),p=P8(u,n,a,l,c),p),x=()=>{const D=C();for(const A of m)A(D)},w=D=>{v(D),x()};return{get schema(){return u??aR(n,a,l,c)},get schemaMeta(){return n},get settings(){return a},get componentIds(){return l},get componentsById(){return c},getSchema:()=>(u===null&&n&&a&&(u=aR(n,a,l,c)),u),getSnapshot:()=>p,replaceSchema:w,setSchema:w,updateComponent:(D,A)=>{const I=c[D];if(!I)return;const j=A(I);Object.is(j,I)||(c={...c,[D]:j},u=null,j8(I,j)||S.clearShellSelectorCache(D),I8(I,j)||S.clearRuntimeSelectorCache(D),FO(I.layout,j.layout)||S.invalidateCanvasLayoutCache(),x())},updateComponents:(D,A)=>{if(D.length===0)return;let I=!1,j=c,V=!1;for(const B of D){const L=c[B];if(!L)continue;const P=A(L);Object.is(P,L)||(I||(j={...c},I=!0),j[B]=P,j8(L,P)||S.clearShellSelectorCache(B),I8(L,P)||S.clearRuntimeSelectorCache(B),FO(L.layout,P.layout)||(V=!0))}I&&(c=j,u=null,V&&S.invalidateCanvasLayoutCache(),x())},removeComponent:D=>{if(!c[D])return;const A={...c};delete A[D],c=A,l=l.filter(I=>I!==D),u=null,S.clearShellSelectorCache(D),S.clearRuntimeSelectorCache(D),S.invalidateCanvasLayoutCache(),x()},addComponent:D=>{const A=!!c[D.id],I=A?l:[...l,D.id],j={...c,[D.id]:D};(!A||!Object.is(c[D.id],D))&&(c=j,l=I,u=null,S.clearShellSelectorCache(D.id),S.clearRuntimeSelectorCache(D.id),S.invalidateCanvasLayoutCache(),x())},updateSettings:D=>{if(!a)return;let A=!1;for(const I of Object.keys(D))if(!Object.is(a[I],D[I])){A=!0;break}A&&(a={...a,...D},u=null,S.invalidateCanvasLayoutCache(),x())},reset(D=e){v(D),x()},subscribe(D){return m.add(D),()=>{m.delete(D)}},selectComponentById:S.selectComponentById,selectComponentShellById:S.selectComponentShellById,selectComponentRuntimeById:S.selectComponentRuntimeById,selectCanvasLayoutSnapshot:S.selectCanvasLayoutSnapshot}}var lS={},rR={exports:{}},U8;function S4(){return U8||(U8=1,(function(e){function n(a){return a&&a.__esModule?a:{default:a}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(rR)),rR.exports}var iS={},q8;function aJ(){if(q8)return iS;q8=1,Object.defineProperty(iS,"__esModule",{value:!0}),iS.default=void 0;const e={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};return iS.default=e,iS}var sS={},cS={},uS={},dS={},F8;function rJ(){return F8||(F8=1,Object.defineProperty(dS,"__esModule",{value:!0}),dS.commonLocale=void 0,dS.commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),dS}var G8;function lJ(){if(G8)return uS;G8=1,Object.defineProperty(uS,"__esModule",{value:!0}),uS.default=void 0;var e=rJ();function n(S){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},n(S)}function a(S,v){var C=Object.keys(S);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(S);v&&(x=x.filter(function(w){return Object.getOwnPropertyDescriptor(S,w).enumerable})),C.push.apply(C,x)}return C}function l(S){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?a(Object(C),!0).forEach(function(x){c(S,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(C)):a(Object(C)).forEach(function(x){Object.defineProperty(S,x,Object.getOwnPropertyDescriptor(C,x))})}return S}function c(S,v,C){return v=u(v),v in S?Object.defineProperty(S,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[v]=C,S}function u(S){var v=p(S,"string");return n(v)=="symbol"?v:String(v)}function p(S,v){if(n(S)!="object"||!S)return S;var C=S[Symbol.toPrimitive];if(C!==void 0){var x=C.call(S,v);if(n(x)!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(S)}var m=l(l({},e.commonLocale),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});return uS.default=m,uS}var fS={},Y8;function Z7(){if(Y8)return fS;Y8=1,Object.defineProperty(fS,"__esModule",{value:!0}),fS.default=void 0;const e={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};return fS.default=e,fS}var X8;function J7(){if(X8)return cS;X8=1;var e=S4().default;Object.defineProperty(cS,"__esModule",{value:!0}),cS.default=void 0;var n=e(lJ()),a=e(Z7());const l={lang:{placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"],...n.default},timePickerLocale:{...a.default}};return l.lang.ok="确定",cS.default=l,cS}var k8;function iJ(){if(k8)return sS;k8=1;var e=S4().default;Object.defineProperty(sS,"__esModule",{value:!0}),sS.default=void 0;var n=e(J7());return sS.default=n.default,sS}var W8;function sJ(){if(W8)return lS;W8=1;var e=S4().default;Object.defineProperty(lS,"__esModule",{value:!0}),lS.default=void 0;var n=e(aJ()),a=e(iJ()),l=e(J7()),c=e(Z7());const u="${label}不是一个有效的${type}",p={locale:"zh-cn",Pagination:n.default,DatePicker:l.default,TimePicker:c.default,Calendar:a.default,global:{placeholder:"请选择",close:"关闭",sortable:"可排序"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckAll:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:u,method:u,array:u,object:u,number:u,date:u,boolean:u,integer:u,float:u,regexp:u,email:u,url:u,hex:u},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无",transparent:"无色",singleColor:"单色",gradientColor:"渐变色"}};return lS.default=p,lS}var lR,K8;function cJ(){return K8||(K8=1,lR=sJ()),lR}var uJ=cJ();const dJ=xA(uJ);function GO(e){const{children:n,getPopupContainer:a}=e,{prefixCls:l,themeConfig:c}=rd();return X.jsx(Gs,{getPopupContainer:a,locale:dJ,prefixCls:l,theme:c,children:n})}const fJ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Wf=(e=21)=>{let n="",a=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=fJ[a[e]&63];return n};const pJ=120;function eH(e,n){return!e.targets||e.targets.length===0?!0:e.targets.some(a=>a.by==="uniqueCode"?a.value===n.uniqueCode:a.value===n.widgetCode)}function tH(e={}){let n=!1;const a=new Map,l=[],c=e.maxEventsPerSecond??pJ,u=e.now??(()=>Date.now()),p=C=>{const x=a.get(C);if(x)return x;const w=new Set;return a.set(C,w),w},m=C=>{const x=a.get(C);x&&x.size===0&&a.delete(C)},S=C=>{for(;l.length>0&&C-l[0]>=1e3;)l.shift()},v=C=>(S(C),l.length>=c?!0:(l.push(C),!1));return{emit(C){if(n||C.ttl<=0)return;const x=C.timestamp>0?C.timestamp:u();if(v(x))return;const w={...C,timestamp:x},M=a.get(C.eventName);if(M)for(const T of M)T(w);const N=a.get("*");if(N)for(const T of N)T(w)},subscribe(C,x){if(n)return()=>{};const w=p(C);return w.add(x),()=>{w.delete(x),m(C)}},dispose(){n=!0,a.clear(),l.length=0}}}const RS={width:1920,height:1080},mJ={"16:9":RS,"4:3":{width:1600,height:1200},"21:9":{width:2520,height:1080},"9:16":{width:1080,height:1920}};function YO(e){return mJ[e]}function nH(e){return e?e.screenAspectRatio==="custom"?{width:Math.max(320,e.screenWidth??RS.width),height:Math.max(240,e.screenHeight??RS.height)}:e.screenAspectRatio?YO(e.screenAspectRatio):RS:RS}const pS={showCard:!0,cardPadding:16,cardBackgroundColor:"#ffffff",cardBorderColor:"#e8ebf0",cardBorderRadius:8};function Kf(e){return{showCard:e?.showCard??pS.showCard,cardPadding:Math.max(0,e?.cardPadding??pS.cardPadding),cardBackgroundColor:e?.cardBackgroundColor??pS.cardBackgroundColor,cardBorderColor:e?.cardBorderColor??pS.cardBorderColor,cardBorderRadius:Math.max(0,e?.cardBorderRadius??pS.cardBorderRadius)}}function hJ(e){const n=Kf(e.defaultStyleConfig);return{showCard:n.showCard,cardPadding:n.cardPadding,cardBackgroundColor:n.cardBackgroundColor,cardBorderColor:n.cardBorderColor,cardBorderRadius:n.cardBorderRadius}}function ts(e){return e===void 0?"undefined":Array.isArray(e)?`[${e.map(n=>ts(n)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>`${JSON.stringify(n)}:${ts(a)}`).join(",")}}`:JSON.stringify(e)}function oH(e,n){return n instanceof Error?(n.message=`${e}: ${n.message}`,n):new Error(n?`${e}: ${String(n)}`:e)}function gJ(e){return{customConfig:e.config,triggerParams:e.trigger.params,scene:e.scene,triggerType:e.trigger.type,eventName:e.trigger.eventName}}function Q8({dashboardCode:e,component:n,manifest:a,scene:l,trigger:c,services:u,signal:p}){if(!a)return{kind:"inactive"};const m={dashboardCode:e,component:n,config:n.customConfig,scene:l,trigger:c},S=a.dataBinding,v=typeof S?.adapterKey=="function"?S.adapterKey(m):S?.adapterKey??n.widgetCode;if(v===null)return{kind:"inactive"};const C=S?.buildQuery?.(m)??gJ(m);if(C===null)return{kind:"inactive"};const x=u.dataSourceAdapters?.[v];return x?{kind:"execute",adapter:x,adapterKey:v,request:{dashboardCode:e,component:n,scene:l,trigger:c,signal:p,query:C}}:!S&&v===n.widgetCode?{kind:"inactive"}:{kind:"error",error:oH(`未找到数据源 adapter: ${v}`)}}async function yJ(e){try{return await e.adapter.execute(e.request)}catch(n){throw oH(`adapter ${e.adapterKey} 执行失败`,n)}}function bJ(e){return[e.dashboardCode,e.scene,e.widgetCode,e.uniqueCode,ts(e.customConfig)].join("::")}function aH({dashboardCode:e,component:n,widgetCode:a,uniqueCode:l,customConfig:c,scene:u,enabled:p=!0,onRuntimeError:m,onReceiveUpdate:S}){const{services:v,widgetMap:C}=rd(),x=_.useRef(null),w=_.useRef(m),M=_.useRef(n),N=_.useRef(a),T=_.useRef(l),$=C.get(a),z=_.useRef($),D=_.useRef(v),A=_.useMemo(()=>p?Q8({dashboardCode:e,component:n,manifest:$,scene:u,trigger:{type:"initial"},services:v,signal:new AbortController().signal}):{kind:"inactive"},[n,e,p,$,u,v]),[I,j]=_.useState(A.kind==="execute"),[V,B]=_.useState(A.kind==="execute"),[L,P]=_.useState(void 0),[G,F]=_.useState(null),W=bJ({dashboardCode:e,widgetCode:a,uniqueCode:l,customConfig:c,scene:u});_.useEffect(()=>{p||(x.current?.abort(),j(!1),B(!1),P(void 0),F(null))},[p]),_.useEffect(()=>{w.current=m},[m]),_.useEffect(()=>{M.current=n,N.current=a,T.current=l},[n,l,a]),_.useEffect(()=>{z.current=$,D.current=v},[$,v]);const k=_.useCallback(async ne=>{if(!p){x.current?.abort(),j(!1),B(!1),P(void 0),F(null);return}x.current?.abort();const re=new AbortController;x.current=re;const q=Q8({dashboardCode:e,component:M.current,manifest:z.current,scene:u,trigger:{type:ne?.type??"initial",eventName:ne?.eventName,params:ne?.params},services:D.current,signal:re.signal});if(q.kind==="inactive"){j(!1),B(!1),P(void 0),F(null);return}if(q.kind==="error"){j(!0),B(!1),P(void 0),F(q.error),w.current?.({phase:"data-resolve",widgetCode:N.current,uniqueCode:T.current,error:q.error});return}j(!0),B(!0),F(null);try{const K=await yJ(q);return re.signal.aborted?void 0:(P(K),B(!1),K)}catch(K){if(re.signal.aborted)return;F(K),B(!1),w.current?.({phase:"data-resolve",widgetCode:N.current,uniqueCode:T.current,error:K});return}},[e,p,W,u]);return _.useEffect(()=>(k({type:"initial"}),()=>{x.current?.abort()}),[k]),_.useEffect(()=>{const ne=S?.(re=>{k({type:"linkage",eventName:re.eventName,params:re.params})})??(()=>{});return()=>{ne()}},[S,k]),{active:I,loading:V,data:L,error:G,resolve:k}}function By(e){const{state:n,widgetCode:a,uniqueCode:l,phase:c,error:u,emptyRender:p,errorRender:m}=e;if(n==="loading")return X.jsx(Bc,{className:"cps-bi-viewer__fallback cps-bi-viewer__fallback--loading",description:"数据返回后会自动刷新当前组件。",kind:"loading",title:"组件数据加载中"});if(n==="empty")return p?X.jsx(X.Fragment,{children:p({widgetCode:a,uniqueCode:l})}):X.jsx(Bc,{className:"cps-bi-viewer__fallback cps-bi-viewer__fallback--empty",kind:"empty",title:`${a} 暂无数据`});const S={phase:c??"widget-render",widgetCode:a,uniqueCode:l,error:u};return m?X.jsx(X.Fragment,{children:m(S)}):X.jsx(Bc,{className:"cps-bi-viewer__fallback cps-bi-viewer__fallback--error",description:c==="data-resolve"?"数据解析失败,请检查数据接口与返回结构。":"组件渲染失败,请检查组件实现。",kind:"error",title:`运行异常:${a}`})}function uw(e,n=0){if(e===null)return"null";if(typeof e>"u")return"undefined";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return n>=2?`array:${e.length}`:`array:${e.length}:${e.slice(0,3).map(a=>uw(a,n+1)).join("|")}`;if(typeof e=="object"){const a=e,l=Object.keys(a).sort();return n>=2?`object:${l.join(",")}`:`object:${l.slice(0,6).map(c=>`${c}:${uw(a[c],n+1)}`).join("|")}`}return typeof e}let vJ=class extends _.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n){this.props.onError(n)}componentDidUpdate(n){n.resetKey!==this.props.resetKey&&this.state.error&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error):this.props.children}};const SJ=()=>{},CJ=()=>()=>{};function xJ(e){const{dashboardCode:n,component:a,scene:l="viewer",onRuntimeError:c,emptyRender:u,errorRender:p,notifyUpdate:m=SJ,onReceiveUpdate:S=CJ}=e,{widgetMap:v}=rd(),C=v.get(a.widgetCode),x=Kf(a.styleConfig),w=a.baseConfig.title||a.widgetCode,{active:M,loading:N,data:T,error:$}=aH({dashboardCode:n,component:a,customConfig:a.customConfig,onReceiveUpdate:S,scene:l,onRuntimeError:c,uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}),z=[a.uniqueCode,l,uw(a.customConfig),N?"loading":"ready",$?"resolve-error":"resolve-ok",uw(T)].join("::"),D={"--cps-bi-viewer-widget-padding":`${x.showCard?x.cardPadding:0}px`,"--cps-bi-viewer-widget-background":x.cardBackgroundColor,"--cps-bi-viewer-widget-border":x.cardBorderColor,"--cps-bi-viewer-widget-radius":`${x.cardBorderRadius}px`,overflow:"hidden"},A=j=>X.jsxs("article",{className:`cps-bi-viewer__widget${x.showCard?"":" is-card-hidden"}`,"data-widget-code":a.widgetCode,style:D,children:[a.baseConfig.showTitle?X.jsx("header",{className:"cps-bi-viewer__widget-header",children:X.jsx("strong",{className:"cps-bi-text-strong",children:w})}):null,X.jsx("div",{className:"cps-bi-viewer__widget-content",children:j})]});if(!C)return A(X.jsx(By,{emptyRender:u,state:"empty",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));if(M&&N)return A(X.jsx(By,{state:"loading",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));if(M&&$)return A(X.jsx(By,{error:$,errorRender:p,phase:"data-resolve",state:"error",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));if(M&&T===null)return A(X.jsx(By,{emptyRender:u,state:"empty",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}));const I=C.component;return X.jsx(vJ,{fallback:j=>X.jsx(By,{error:j,errorRender:p,phase:"widget-render",state:"error",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}),onError:j=>{c?.({phase:"widget-render",widgetCode:a.widgetCode,uniqueCode:a.uniqueCode,error:j})},resetKey:z,children:A(X.jsx(I,{config:a.customConfig,context:{dashboardCode:n,mode:"viewer"},data:M?T:void 0,notifyUpdate:m,onReceiveUpdate:S,uniqueCode:a.uniqueCode,widgetCode:a.widgetCode}))})}const EJ=3;function wJ(e){const n=e.clientWidth,a=e.clientHeight;if(n>0||a>0)return{width:n,height:a};const l=e.getBoundingClientRect();return{width:l.width,height:l.height}}function $J(e){return e.reduce((n,a)=>Math.max(n,a.layout.y+a.layout.h),0)}function RJ(e,n){const[,a]=e.margin,[,l]=e.padding,c=$J(n);return c<=0?l*2:l*2+c*e.rowHeight+Math.max(0,c-1)*a}function TJ(e,n,a){const l=n.cols,[c,u]=n.margin,[p,m]=n.padding,S=(a-p*2-c*(l-1))/l,v=Number.isFinite(S)?Math.max(0,S):0,{x:C,y:x,w,h:M}=e.layout;return{overflow:"hidden",position:"absolute",left:`${p+C*(v+c)}px`,top:`${m+x*(n.rowHeight+u)}px`,width:`${Math.max(1,v*w+c*Math.max(0,w-1))}px`,height:`${Math.max(1,n.rowHeight*M+u*Math.max(0,M-1))}px`}}function rH(e){const{schema:n,onRuntimeError:a,onLinkageFeedback:l,debug:c,emptyRender:u,errorRender:p,scene:m="viewer"}=e,S=_.useMemo(()=>tH(),[]),v=_.useRef(null),C=_.useRef(l),[x,w]=_.useState({width:0,height:0});_.useEffect(()=>{C.current=l},[l]);const M=_.useMemo(()=>{const B=new Map;for(const L of n.components){const P=new Set,G=L.linkageConfig.target.values.length>0?L.linkageConfig.target.values.map(k=>({by:L.linkageConfig.target.by,value:k})):void 0,F=(k,ne,re)=>{S.emit({eventId:Wf(),sourceUniqueCode:L.uniqueCode,sourceWidgetCode:L.widgetCode,eventName:k,params:ne,targets:re?.targets??G,depth:0,ttl:re?.ttl??EJ,timestamp:Date.now()})},W=k=>S.subscribe("*",ne=>{if(ne.sourceUniqueCode!==L.uniqueCode&&eH(ne,{widgetCode:L.widgetCode,uniqueCode:L.uniqueCode})){if(!P.has(ne.eventId)){if(P.add(ne.eventId),P.size>64){const re=P.values().next().value;re&&P.delete(re)}c?.linkage&&console.debug("[cps-bi][linkage]",{eventName:ne.eventName,sourceUniqueCode:ne.sourceUniqueCode,sourceWidgetCode:ne.sourceWidgetCode,targetUniqueCode:L.uniqueCode,targetWidgetCode:L.widgetCode,timestamp:ne.timestamp}),C.current?.({eventName:ne.eventName,sourceWidgetCode:ne.sourceWidgetCode,sourceUniqueCode:ne.sourceUniqueCode,targetWidgetCode:L.widgetCode,targetUniqueCode:L.uniqueCode,timestamp:ne.timestamp})}k({sourceWidgetCode:ne.sourceWidgetCode,sourceUniqueCode:ne.sourceUniqueCode,eventName:ne.eventName,params:ne.params})}});B.set(L.id,{notifyUpdate:F,onReceiveUpdate:W})}return B},[c?.linkage,S,n.components]);_.useEffect(()=>{const B=v.current;if(!B)return;const L=()=>{w(wJ(B))},P=()=>{L()};if(L(),typeof ResizeObserver>"u")return window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)};const G=new ResizeObserver(F=>{const W=F[0];if(Array.isArray(W?.contentBoxSize)?W.contentBoxSize[0]:W?.contentBoxSize){L();return}L()});return G.observe(B),()=>{G.disconnect()}},[]);const N=n.settings,T=N.canvasMode==="screen",$=Math.max(320,N.minWidth),z=Math.max(0,x.width),D=Math.max(0,x.height),A=_.useMemo(()=>N.bgImageUrl?{backgroundColor:N.bgColor,backgroundImage:`url("${N.bgImageUrl}")`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}:{backgroundColor:N.bgColor},[N.bgColor,N.bgImageUrl]),I=_.useMemo(()=>RJ(N,n.components),[n.components,N]),j=_.useMemo(()=>nH(N),[N]),V=_.useMemo(()=>{if(T){const G=j.width,F=j.height,W=z>0&&z<$,k=W?$:Math.max(z,$),ne=Math.max(D,1),re=Math.min(k/G,ne/F),q=G*re,K=F*re,J=(k-q)/2,ae=(ne-K)/2;return{modeClassName:"is-screen-mode",needHorizontalScroll:W,surfaceStyle:{width:`${k}px`,height:`${ne}px`},stageStyle:{width:`${G}px`,height:`${F}px`,transform:`translate(${J}px, ${ae}px) scale(${re})`,transformOrigin:"0 0"},itemWidthBase:G}}const B=Math.max(z,$),L=Math.max(D,I);return{modeClassName:"is-responsive-mode",needHorizontalScroll:z>0&&z<$,surfaceStyle:{width:`${B}px`,height:`${L}px`},stageStyle:{width:`${B}px`,height:`${L}px`,...A},itemWidthBase:B}},[T,I,$,A,j.height,j.width,D,z]);return n.components.length===0?X.jsx(GO,{getPopupContainer:()=>v.current??document.body,children:X.jsx("section",{className:"cps-bi-viewer",ref:v,children:X.jsx(By,{emptyRender:u,state:"empty",uniqueCode:"dashboard-empty",widgetCode:"dashboard"})})}):X.jsx(GO,{getPopupContainer:()=>v.current??document.body,children:X.jsx("section",{className:["cps-bi-viewer",V.modeClassName,V.needHorizontalScroll?"is-scrollable-runtime":""].filter(Boolean).join(" "),"data-testid":"viewer-runtime-viewport",ref:v,style:T?A:void 0,children:X.jsx("div",{className:"cps-bi-viewer__stage-surface","data-testid":"viewer-runtime-surface",style:V.surfaceStyle,children:X.jsx("div",{className:"cps-bi-viewer__stage","data-testid":"viewer-runtime-stage",style:V.stageStyle,children:n.components.map(B=>{const L=M.get(B.id);return L?X.jsx("div",{className:"cps-bi-viewer__item",style:TJ(B,N,V.itemWidthBase),children:X.jsx(xJ,{component:B,dashboardCode:n.code,emptyRender:u,errorRender:p,notifyUpdate:L.notifyUpdate,onReceiveUpdate:L.onReceiveUpdate,onRuntimeError:a,scene:m})},B.id):null})})})})})}function OJ(e){const{getContainer:n,modifierLabel:a,onClose:l,open:c}=e;return X.jsx(Cr,{cancelButtonProps:{style:{display:"none"}},footer:[X.jsx(Pn,{onClick:l,type:"primary",children:"知道了"},"ok")],getContainer:n,onCancel:l,open:c,title:"操作提示",width:680,children:X.jsxs("div",{className:"cps-bi-builder__help-panel",children:[X.jsxs("section",{children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"导航与保存"}),X.jsxs("div",{className:"cps-bi-builder__help-list",children:[X.jsxs("p",{children:[X.jsx("kbd",{children:a}),X.jsx("span",{children:"+"}),X.jsx("kbd",{children:"S"}),X.jsx("span",{children:"保存当前仪表盘"})]}),X.jsxs("p",{children:[X.jsx("kbd",{children:a}),X.jsx("span",{children:"+"}),X.jsx("kbd",{children:"Z"}),X.jsxs("span",{children:["撤销,",a," + Y 或 ",a," + Shift + Z 重做"]})]})]})]}),X.jsxs("section",{children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"组件编辑"}),X.jsx("div",{className:"cps-bi-builder__help-list",children:X.jsxs("p",{children:[X.jsx("kbd",{children:"Delete"}),X.jsx("span",{children:"/"}),X.jsx("kbd",{children:"Backspace"}),X.jsx("span",{children:"删除选中组件"})]})})]}),X.jsxs("section",{children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"画布操作"}),X.jsxs("div",{className:"cps-bi-builder__help-list",children:[X.jsxs("p",{children:[X.jsx("kbd",{children:a}),X.jsx("span",{children:"+"}),X.jsx("kbd",{children:"滚轮"}),X.jsx("span",{children:"按 5% 步进缩放(仅大屏模式)"})]}),X.jsxs("p",{children:[X.jsx("kbd",{children:"Space"}),X.jsx("span",{children:"按住切换抓手拖动画布(仅大屏模式)"})]}),X.jsxs("p",{children:[X.jsx("kbd",{children:"拖拽主体"}),X.jsx("span",{children:"移动组件;边和角可调整大小"})]})]})]})]})})}class MJ extends _.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}render(){return this.state.error?X.jsx(c1,{showIcon:!0,title:"组件预览失败",type:"warning"}):this.props.children}}function NJ(e){return e==="charts"?"图表":e==="view"?"视图":e==="other"?"其他":"插件"}function zJ(e,n){const a=n.trim().toLowerCase();return a?[e.name,e.widgetCode,e.description,...e.keywords??[]].filter(Boolean).join(" ").toLowerCase().includes(a):!0}function DJ(e){return{keyword:e.keyword.trim()||void 0,filters:Object.keys(e.filters).length>0?e.filters:void 0}}function AJ(e,n,a){if(!(a.keyword.trim().length===0&&Object.keys(a.filters).length===0))return e;const c=e.filter(p=>p.kind==="builtin"),u=e.filter(p=>p.kind==="extension");return n?[...c,...u.slice(0,5)]:u.slice(0,20)}function _J(e){const n=new Map;for(const a of e){const l=a.kind==="extension"?"插件":a.category==="charts"?"图表":a.category==="view"?"视图":"其他",c=n.get(l)??[];c.push(a),n.set(l,c)}return Array.from(n.entries()).map(([a,l])=>({title:a,items:l}))}function BJ({widget:e}){const n=e.component;return X.jsx(MJ,{children:X.jsx(n,{config:{...e.defaultConfig},context:{dashboardCode:"widget_market_preview",mode:"builder"},data:void 0,notifyUpdate:()=>{},onReceiveUpdate:()=>()=>{},uniqueCode:"widget_market_preview",widgetCode:e.widgetCode})})}function HJ(){return X.jsx("div",{className:"cps-bi-widget-catalog__market-skeleton","data-testid":"widget-market-skeleton",children:Array.from({length:6}).map((e,n)=>X.jsx("div",{className:"cps-bi-widget-catalog__market-skeleton-item",children:X.jsx(tp,{active:!0,avatar:!0,paragraph:{rows:3},title:!0})},n))})}function jJ(e){const{widgets:n,readonly:a,modalContainer:l,allowUseBuiltInWidgets:c,widgetCatalogFilterRender:u,onAddWidget:p,onAddWidgets:m}=e,{services:S}=rd(),[v,C]=_.useState(!1),[x,w]=_.useState(!1),[M,N]=_.useState(null),[T,$]=_.useState({keyword:"",filters:{}}),[z,D]=_.useState(new Set),[A,I]=_.useState(null),[j,V]=_.useState(!1),B=_.useRef(null);_.useEffect(()=>{let oe=!0;async function te(){if(!S.getAuthorizedWidgetCodes){I(null);return}V(!0);try{const ue=await S.getAuthorizedWidgetCodes(DJ(T));if(!oe)return;I(new Set(ue))}finally{if(!oe)return;V(!1)}}return te(),()=>{oe=!1}},[T,S]);const L=_.useMemo(()=>n.filter(oe=>!(!c&&oe.kind==="builtin"||!zJ(oe,T.keyword)||oe.kind==="extension"&&A&&!A.has(oe.widgetCode))),[c,A,T.keyword,n]),P=_.useMemo(()=>AJ(L,c,T),[c,T,L]),G=_.useMemo(()=>_J(P),[P]),F=_.useMemo(()=>L.filter(oe=>oe.kind==="extension"),[L]),W=_.useMemo(()=>L.filter(oe=>z.has(oe.widgetCode)),[z,L]),k=_.useMemo(()=>F.find(oe=>oe.widgetCode===M)??null,[M,F]),ne=!!u,re=!ne,q=()=>{D(oe=>oe.size===0?oe:new Set)},K=oe=>{a||D(te=>{const ue=new Set(te);return ue.has(oe)?ue.delete(oe):ue.add(oe),ue})},J=()=>{W.length!==0&&(m(W),q(),N(null),w(!1),C(!1))},ae=oe=>{p(oe),q(),N(null),w(!1),C(!1)},Z=X.jsx("section",{className:"cps-bi-widget-catalog__popover",children:X.jsxs(T7,{className:"cps-bi-widget-catalog__popover-layout",gap:12,vertical:!0,children:[X.jsx(ea,{allowClear:!0,onChange:oe=>{$(te=>({...te,keyword:oe.target.value}))},placeholder:"搜索组件",prefix:X.jsx(IS,{}),value:T.keyword}),X.jsx("div",{className:"cps-bi-widget-catalog__quick-list",children:G.length===0?X.jsx(os,{description:"暂无可用组件",image:os.PRESENTED_IMAGE_SIMPLE}):G.map(oe=>X.jsxs("section",{className:"cps-bi-widget-catalog__quick-group",children:[X.jsx("span",{className:"cps-bi-widget-catalog__quick-group-title cps-bi-text-secondary",children:oe.title}),X.jsxs("div",{className:"cps-bi-widget-catalog__quick-grid",children:[oe.items.map(te=>{const ue=z.has(te.widgetCode);return X.jsxs("div",{"aria-disabled":a,"aria-label":te.name,className:`cps-bi-widget-catalog__quick-item${ue?" is-selected":""}${a?" is-disabled":""}`,onClick:()=>{K(te.widgetCode)},onKeyDown:ce=>{ce.key!=="Enter"&&ce.key!==" "||(ce.preventDefault(),K(te.widgetCode))},role:"button",tabIndex:a?-1:0,title:te.name,children:[X.jsx("span",{"aria-hidden":!0,className:"cps-bi-widget-catalog__quick-item-icon",children:te.icon??X.jsx(CS,{})}),X.jsx("span",{className:"cps-bi-widget-catalog__quick-item-name",children:te.name})]},te.widgetCode)}),oe.title==="插件"&&F.length>0?X.jsxs("div",{"aria-disabled":a,"aria-label":"更多",className:`cps-bi-widget-catalog__quick-item cps-bi-widget-catalog__quick-item--more${a?" is-disabled":""}`,onClick:()=>{a||(C(!1),w(!0))},onKeyDown:te=>{a||te.key!=="Enter"&&te.key!==" "||(te.preventDefault(),C(!1),w(!0))},role:"button",tabIndex:a?-1:0,children:[X.jsx("span",{"aria-hidden":!0,className:"cps-bi-widget-catalog__quick-item-icon",children:X.jsx(ob,{})}),X.jsx("span",{className:"cps-bi-widget-catalog__quick-item-name",children:"更多"})]}):null]})]},oe.title))}),X.jsxs("div",{className:"cps-bi-widget-catalog__quick-actions",children:[X.jsxs("span",{className:"cps-bi-text-secondary",children:["已选 ",W.length]}),X.jsxs(_c,{size:8,children:[X.jsx(Pn,{onClick:q,children:"清空"}),X.jsx(Pn,{disabled:a||W.length===0,onClick:J,type:"primary",children:"添加"})]})]})]})}),le=k?X.jsxs("div",{className:"cps-bi-widget-catalog__modal-footer",children:[X.jsx(Pn,{onClick:()=>{N(null)},children:"返回列表"}),X.jsx(Pn,{disabled:a,onClick:()=>ae(k),type:"primary",children:"添加组件"})]}):X.jsxs("div",{className:"cps-bi-widget-catalog__modal-footer",children:[X.jsxs("span",{className:"cps-bi-widget-catalog__modal-footer-count cps-bi-text-secondary",children:["已选 ",W.length]}),X.jsx(Pn,{onClick:q,children:"清空"}),X.jsx(Pn,{disabled:a||W.length===0,onClick:J,type:"primary",children:"添加"})]});return X.jsxs("div",{ref:B,children:[X.jsx(kM,{content:Z,getPopupContainer:()=>B.current||document.body,onOpenChange:oe=>{C(oe),oe||q()},open:v&&!x,placement:"bottomRight",trigger:"click",children:X.jsx(Pn,{disabled:a,icon:X.jsx(CS,{}),children:"新增组件"})}),X.jsx(Cr,{footer:le,getContainer:l??void 0,onCancel:()=>{w(!1),N(null)},open:x,title:"插件市场",width:1220,children:X.jsxs("section",{className:`cps-bi-widget-catalog__modal${ne?"":" is-filter-hidden"}${k?" is-detail-mode":""}`,children:[ne&&!k?X.jsxs("aside",{className:"cps-bi-widget-catalog__modal-filter",children:[X.jsx("h5",{className:"cps-bi-text-heading-sm",children:"筛选"}),u?.({keyword:T.keyword,filters:T.filters,onKeywordChange:oe=>{$(te=>({...te,keyword:oe}))},onFilterChange:oe=>{$(te=>({...te,filters:oe}))}})]}):null,X.jsxs("section",{className:"cps-bi-widget-catalog__modal-list",children:[re&&!k?X.jsx("div",{className:"cps-bi-widget-catalog__filter",children:X.jsx(ea,{allowClear:!0,onChange:oe=>{$(te=>({...te,keyword:oe.target.value}))},placeholder:"搜索外部组件",prefix:X.jsx(IS,{}),value:T.keyword})}):null,k?X.jsxs("section",{className:"cps-bi-widget-catalog__detail",children:[X.jsxs("header",{className:"cps-bi-widget-catalog__detail-header",children:[X.jsx("div",{className:"cps-bi-widget-catalog__detail-icon",children:k.icon??X.jsx(CS,{})}),X.jsxs("div",{className:"cps-bi-widget-catalog__detail-meta",children:[X.jsxs("div",{className:"cps-bi-widget-catalog__detail-title-row",children:[X.jsx("h3",{className:"cps-bi-text-heading-lg",children:k.name}),X.jsx(Zm,{children:k.widgetCode})]}),X.jsx("p",{className:"cps-bi-widget-catalog__detail-desc cps-bi-text-secondary",children:k.description??"暂无描述"}),X.jsxs(_c,{size:[8,8],wrap:!0,children:[X.jsx(Zm,{children:NJ(k.category)}),X.jsxs(Zm,{color:"blue",children:["开发者:",k.developer?.name??"未提供"]})]})]})]}),X.jsx("section",{className:"cps-bi-widget-catalog__detail-preview",children:X.jsx("div",{className:"cps-bi-widget-catalog__detail-preview-shell",children:X.jsx(BJ,{widget:k})})})]}):j?X.jsx(HJ,{}):X.jsx("div",{className:"cps-bi-widget-catalog__market-wrapper",children:X.jsx("div",{className:"cps-bi-widget-catalog__market-list",children:F.length===0?X.jsx(os,{description:"没有匹配的外部组件"}):F.map(oe=>{const te=z.has(oe.widgetCode);return X.jsxs("article",{className:`cps-bi-widget-catalog__market-item${te?" is-selected":""}`,onClick:()=>{K(oe.widgetCode)},title:oe.description??oe.name,children:[X.jsx("div",{className:"cps-bi-widget-catalog__market-item-icon",children:oe.icon??X.jsx(CS,{})}),X.jsxs("div",{className:"cps-bi-widget-catalog__market-item-body",children:[X.jsx("h4",{className:"cps-bi-widget-catalog__market-item-title cps-bi-text-heading-sm",children:oe.name}),X.jsx("p",{className:"cps-bi-widget-catalog__market-item-desc cps-bi-text-secondary",children:oe.description??"暂无描述"})]}),X.jsx("div",{className:"cps-bi-widget-catalog__market-item-actions",children:X.jsx(Pn,{onClick:ue=>{ue.stopPropagation(),N(oe.widgetCode)},type:"default",children:"详情"})})]},oe.widgetCode)})})})]})]})})]})}function IJ(e){const{readonly:n,mode:a,title:l,version:c,status:u,hasComponents:p,canUndo:m,canRedo:S,titleRender:v,schema:C,modalContainer:x,widgets:w,allowUseBuiltInWidgets:M,widgetCatalogFilterRender:N,saving:T,publishing:$,persistenceDisabled:z,persistenceDisabledReason:D,onOpenCanvasSettings:A,onToggleFullscreen:I,onImportJson:j,onExportJson:V,onAutoAlign:B,onUndo:L,onRedo:P,onClearCanvas:G,onAddWidget:F,onAddWidgets:W,onSave:k,onPublish:ne,onHelp:re,onOpenVersionHistory:q,onEdit:K,onDuplicate:J,onDelete:ae}=e,Z=!n,le=n||T||$||z,oe=D??"保存",te=D??"发布",ue={draft:"草稿",published:"已发布"},ce=[{key:"import",icon:X.jsx(fA,{}),label:"导入",disabled:n||T||$,onClick:j},{key:"export",icon:X.jsx(aA,{}),label:"导出",onClick:V},{type:"divider"},{key:"edit",icon:X.jsx(rA,{}),label:"编辑",disabled:n,onClick:K},{key:"duplicate",icon:X.jsx(eM,{}),label:"复制",disabled:n,onClick:J},{key:"delete",icon:X.jsx(tM,{}),danger:!0,label:"删除",disabled:n,onClick:ae}];return X.jsxs("header",{className:"cps-bi-builder__topbar",children:[X.jsxs("section",{className:"cps-bi-builder__topbar-left",children:[X.jsxs("div",{className:"cps-bi-builder__topbar-title-block",children:[X.jsx("h4",{className:"cps-bi-builder__topbar-title",children:v?v({schema:C,mode:a}):l??"仪表盘编辑器"}),X.jsxs(_c,{size:6,children:[u?X.jsx(Zm,{color:u==="published"?"success":"processing",children:ue[u]}):null,c?X.jsx(Pn,{icon:X.jsx(dA,{}),onClick:q,size:"small",type:"text",children:c}):null]})]}),X.jsxs(_c,{children:[X.jsx(xl,{title:"自动对齐",children:X.jsx(Pn,{"aria-label":"自动对齐",disabled:!Z||!p,icon:X.jsx(QD,{}),onClick:B})}),X.jsx(xl,{title:"撤销",children:X.jsx(Pn,{"aria-label":"撤销",disabled:!Z||!m,icon:X.jsx(vA,{}),onClick:L})}),X.jsx(xl,{title:"重做",children:X.jsx(Pn,{"aria-label":"重做",disabled:!Z||!S,icon:X.jsx(gA,{}),onClick:P})}),X.jsx(xl,{title:"清空画布",children:X.jsx(Pn,{"aria-label":"清空画布",disabled:!Z||!p,icon:X.jsx(nA,{}),onClick:G})}),X.jsx(xl,{title:"帮助",children:X.jsx(Pn,{"aria-label":"帮助",icon:X.jsx(rM,{}),onClick:re})})]})]}),X.jsx("section",{className:"cps-bi-builder__topbar-right",children:X.jsxs(_c,{size:8,wrap:!0,children:[X.jsx(jJ,{allowUseBuiltInWidgets:M,modalContainer:x,onAddWidget:F,onAddWidgets:W,readonly:n,widgetCatalogFilterRender:N,widgets:w}),X.jsx(xl,{title:"画布设置",children:X.jsx(Pn,{"aria-label":"画布设置",disabled:n,icon:X.jsx(lM,{}),onClick:A,type:"default",children:"画布设置"})}),X.jsx(Pn,{"aria-label":"全屏",disabled:!C,icon:X.jsx(uA,{"aria-hidden":!0}),onClick:I,type:"default",children:"全屏"}),X.jsx(xl,{title:oe,children:X.jsx("span",{children:X.jsx(Pn,{disabled:le,icon:X.jsx(bA,{}),loading:T,onClick:k,type:"default",children:"保存"})})}),X.jsx(xl,{title:te,children:X.jsx("span",{children:X.jsx(Pn,{disabled:le,icon:X.jsx(CA,{}),loading:$,onClick:ne,type:"primary",children:"发布"})})}),X.jsx(d7,{orientation:"vertical"}),X.jsx(E7,{menu:{items:ce},trigger:["click"],children:X.jsx(Pn,{"aria-label":"更多",icon:X.jsx(ob,{}),type:"text"})})]})})]})}const iR={canvasMode:"responsive",cols:24,rowHeight:10,collisionReflowMode:"push",bgColor:"#ffffff",bgImageUrl:"",showGrid:!0,minWidth:960,defaultComponentCols:8,defaultComponentRows:16,screenAspectRatio:"16:9",screenWidth:1920,screenHeight:1080};function LJ(e){const{open:n,settings:a,getContainer:l,onCancel:c,onApply:u}=e,[p,m]=_.useState(iR);_.useEffect(()=>{n&&m({canvasMode:a.canvasMode,cols:a.cols,rowHeight:a.rowHeight,collisionReflowMode:a.collisionReflowMode==="block"?"block":"push",bgColor:a.bgColor,bgImageUrl:a.bgImageUrl??"",showGrid:a.showGrid,minWidth:a.minWidth,defaultComponentCols:a.defaultComponentCols??Math.floor(a.cols/3),defaultComponentRows:a.defaultComponentRows??16,screenAspectRatio:a.screenAspectRatio??"16:9",screenWidth:a.screenWidth??iR.screenWidth,screenHeight:a.screenHeight??iR.screenHeight})},[n,a]);const S=()=>{const v=p.cols===12?12:24,C=Math.max(8,p.rowHeight),x=Math.max(320,p.minWidth),w=Math.max(1,Math.min(v,Math.round(p.defaultComponentCols))),M=Math.max(1,Math.round(p.defaultComponentRows)),N=p.screenAspectRatio,T=N==="custom"?{width:Math.max(320,p.screenWidth),height:Math.max(240,p.screenHeight)}:YO(N);u({canvasMode:p.canvasMode,cols:v,rowHeight:C,collisionReflowMode:p.collisionReflowMode,bgColor:p.bgColor,bgImageUrl:p.bgImageUrl.trim()?p.bgImageUrl.trim():void 0,showGrid:p.showGrid,minWidth:x,defaultComponentCols:w,defaultComponentRows:M,screenAspectRatio:N,screenWidth:T.width,screenHeight:T.height}),c()};return X.jsx(Cr,{cancelText:"取消",getContainer:l,okText:"应用",onCancel:c,onOk:S,open:n,title:"画布设置",width:860,children:X.jsx(It,{layout:"vertical",children:X.jsxs(l4,{className:"cps-bi-canvas-settings__row",gutter:[16,0],children:[X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"画布模式",children:X.jsx(ia,{onChange:v=>{m(C=>({...C,canvasMode:v}))},options:[{label:"响应式画布",value:"responsive"},{label:"大屏画布",value:"screen"}],value:p.canvasMode})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"最小宽度",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:4096,min:320,onChange:v=>{m(C=>({...C,minWidth:Number(v??C.minWidth)}))},value:p.minWidth})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"列数",children:X.jsx(ia,{onChange:v=>{m(C=>({...C,cols:v}))},options:[{label:"12 列",value:12},{label:"24 列",value:24}],value:p.cols})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"行高(像素)",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:240,min:8,onChange:v=>{m(C=>({...C,rowHeight:Number(v??C.rowHeight)}))},value:p.rowHeight})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"新增组件默认宽度(列)",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:p.cols,min:1,onChange:v=>{m(C=>({...C,defaultComponentCols:Number(v??C.defaultComponentCols)}))},value:p.defaultComponentCols})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"新增组件默认高度(行)",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:4096,min:1,onChange:v=>{m(C=>({...C,defaultComponentRows:Number(v??C.defaultComponentRows)}))},value:p.defaultComponentRows})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"碰撞策略",children:X.jsx(ia,{onChange:v=>{m(C=>({...C,collisionReflowMode:v}))},options:[{label:"自动推挤(push)",value:"push"},{label:"阻止重排(block)",value:"block"}],value:p.collisionReflowMode})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"背景色",children:X.jsx(ea,{onChange:v=>{m(C=>({...C,bgColor:v.target.value||C.bgColor}))},type:"color",value:p.bgColor})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"显示网格线",children:X.jsx(Ff,{checked:p.showGrid,onChange:v=>{m(C=>({...C,showGrid:v}))}})})}),p.canvasMode==="screen"?X.jsxs(X.Fragment,{children:[X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"大屏比例",children:X.jsx(ia,{onChange:v=>{const C=v;if(C==="custom"){m(w=>({...w,screenAspectRatio:"custom"}));return}const x=YO(C);m(w=>({...w,screenAspectRatio:C,screenWidth:x.width,screenHeight:x.height}))},options:[{label:"16:9",value:"16:9"},{label:"4:3",value:"4:3"},{label:"21:9",value:"21:9"},{label:"9:16",value:"9:16"},{label:"自定义",value:"custom"}],value:p.screenAspectRatio})})}),p.screenAspectRatio==="custom"?X.jsxs(X.Fragment,{children:[X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"宽度",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:7680,min:320,onChange:v=>{m(C=>({...C,screenWidth:Number(v??C.screenWidth)}))},value:p.screenWidth})})}),X.jsx(zr,{md:12,sm:24,xs:24,children:X.jsx(It.Item,{label:"高度",children:X.jsx(ai,{className:"cps-bi-builder__field-control",max:4320,min:240,onChange:v=>{m(C=>({...C,screenHeight:Number(v??C.screenHeight)}))},value:p.screenHeight})})})]}):null]}):null,X.jsx(zr,{span:24,children:X.jsx(It.Item,{label:"背景图片 URL",children:X.jsx(ea,{onChange:v=>{m(C=>({...C,bgImageUrl:v.target.value}))},placeholder:"请输入背景图地址,例如:https://example.com/background.png",value:p.bgImageUrl})})})]})})})}function cb(e){const{margin:n,containerPadding:a,containerWidth:l,cols:c}=e;return(l-n[0]*(c-1)-a[0]*2)/c}function Jy(e,n,a){return Number.isFinite(e)?Math.round(n*e+Math.max(0,e-1)*a):e}function mS(e,n,a,l,c,u,p){const{margin:m,containerPadding:S,rowHeight:v}=e,C=cb(e);let x,w,M,N;if(p?(x=Math.round(p.width),w=Math.round(p.height)):(x=Jy(l,C,m[0]),w=Jy(c,v,m[1])),u?(M=Math.round(u.top),N=Math.round(u.left)):p?(M=Math.round(p.top),N=Math.round(p.left)):(M=Math.round((v+m[1])*a+S[1]),N=Math.round((C+m[0])*n+S[0])),!u&&!p){if(Number.isFinite(l)){const $=Math.round((C+m[0])*(n+l)+S[0])-N-x;$!==m[0]&&(x+=$-m[0])}if(Number.isFinite(c)){const $=Math.round((v+m[1])*(a+c)+S[1])-M-w;$!==m[1]&&(w+=$-m[1])}}return{top:M,left:N,width:x,height:w}}function VJ(e,n,a,l,c){const{margin:u,containerPadding:p,cols:m,rowHeight:S,maxRows:v}=e,C=cb(e);let x=Math.round((a-p[0])/(C+u[0])),w=Math.round((n-p[1])/(S+u[1]));return x=dw(x,0,m-l),w=dw(w,0,v-c),{x,y:w}}function gE(e,n,a){const{margin:l,containerPadding:c,rowHeight:u}=e,p=cb(e),m=Math.round((a-c[0])/(p+l[0])),S=Math.round((n-c[1])/(u+l[1]));return{x:m,y:S}}function PJ(e,n,a){const{margin:l,rowHeight:c}=e,u=cb(e),p=Math.max(1,Math.round((n+l[0])/(u+l[0]))),m=Math.max(1,Math.round((a+l[1])/(c+l[1])));return{w:p,h:m}}function dw(e,n,a){return Math.max(Math.min(e,a),n)}function C4(e,n){return!(e.i===n.i||e.x+e.w<=n.x||e.x>=n.x+n.w||e.y+e.h<=n.y||e.y>=n.y+n.h)}function fw(e,n){for(let a=0;a<e.length;a++){const l=e[a];if(l!==void 0&&C4(l,n))return l}}function lH(e,n){return e.filter(a=>C4(a,n))}function UJ(e,n){return n==="horizontal"?qJ(e):n==="vertical"||n==="wrap"?XO(e):[...e]}function XO(e){return[...e].sort((n,a)=>n.y!==a.y?n.y-a.y:n.x-a.x)}function qJ(e){return[...e].sort((n,a)=>n.x!==a.x?n.x-a.x:n.y-a.y)}function x4(e){let n=0;for(let a=0;a<e.length;a++){const l=e[a];if(l!==void 0){const c=l.y+l.h;c>n&&(n=c)}}return n}function Pm(e,n){for(let a=0;a<e.length;a++){const l=e[a];if(l!==void 0&&l.i===n)return l}}function E4(e){return e.filter(n=>n.static===!0)}function eb(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function w4(e){const n=new Array(e.length);for(let a=0;a<e.length;a++){const l=e[a];l!==void 0&&(n[a]=eb(l))}return n}function FJ(e,n){const a=new Array(e.length);for(let l=0;l<e.length;l++){const c=e[l];c!==void 0&&(n.i===c.i?a[l]=n:a[l]=c)}return a}function GJ(e,n,a){let l=Pm(e,n);return l?(l=a(eb(l)),[FJ(e,l),l]):[[...e],null]}function YJ(e,n){const a=E4(e);for(let l=0;l<e.length;l++){const c=e[l];if(c!==void 0)if(c.x+c.w>n.cols&&(c.x=n.cols-c.w),c.x<0&&(c.x=0,c.w=n.cols),!c.static)a.push(c);else for(;fw(a,c);)c.y++}return e}function Wm(e,n,a,l,c,u,p,m,S){if(n.static&&n.isDraggable!==!0)return[...e];if(n.y===l&&n.x===a)return[...e];const v=n.x,C=n.y;typeof a=="number"&&(n.x=a),typeof l=="number"&&(n.y=l),n.moved=!0;let x=UJ(e,p);(p==="vertical"&&typeof l=="number"?C>=l:p==="horizontal"&&typeof a=="number"&&v>=a)&&(x=x.reverse());const M=lH(x,n),N=M.length>0;if(N&&S)return w4(e);if(N&&u)return n.x=v,n.y=C,n.moved=!1,e;let T=[...e];for(let $=0;$<M.length;$++){const z=M[$];z!==void 0&&(z.moved||(z.static?T=Z8(T,z,n,c,p):T=Z8(T,n,z,c,p)))}return T}function Z8(e,n,a,l,c,u){const p=c==="horizontal",m=c==="vertical",S=n.static;if(l){l=!1;const x={x:p?Math.max(n.x-a.w,0):a.x,y:m?Math.max(n.y-a.h,0):a.y,w:a.w,h:a.h,i:"-1"},w=fw(e,x),M=w!==void 0&&w.y+w.h>n.y,N=w!==void 0&&n.x+n.w>w.x;if(!w)return Wm(e,a,p?x.x:void 0,m?x.y:void 0,l,S,c);if(M&&m)return Wm(e,a,void 0,a.y+1,l,S,c);if(M&&c===null)return n.y=a.y,a.y=a.y+a.h,[...e];if(N&&p)return Wm(e,n,a.x,void 0,l,S,c)}const v=p?a.x+1:void 0,C=m?a.y+1:void 0;return v===void 0&&C===void 0?[...e]:Wm(e,a,v,C,l,S,c)}function Ly(e,n,a){return Math.max(n,Math.min(a,e))}var XJ={name:"gridBounds",constrainPosition(e,n,a,{cols:l,maxRows:c}){return{x:Ly(n,0,Math.max(0,l-e.w)),y:Ly(a,0,Math.max(0,c-e.h))}},constrainSize(e,n,a,l,{cols:c,maxRows:u}){const p=l==="w"||l==="nw"||l==="sw"?e.x+e.w:c-e.x,m=l==="n"||l==="nw"||l==="ne"?e.y+e.h:u-e.y;return{w:Ly(n,1,Math.max(1,p)),h:Ly(a,1,Math.max(1,m))}}},kJ={name:"minMaxSize",constrainSize(e,n,a){return{w:Ly(n,e.minW??1,e.maxW??1/0),h:Ly(a,e.minH??1,e.maxH??1/0)}}},iH=[XJ,kJ];function yE(e,n,a,l,c){let u={x:a,y:l};for(const p of e)p.constrainPosition&&(u=p.constrainPosition(n,u.x,u.y,c));if(n.constraints)for(const p of n.constraints)p.constrainPosition&&(u=p.constrainPosition(n,u.x,u.y,c));return u}function WJ(e,n,a,l,c,u){let p={w:a,h:l};for(const m of e)m.constrainSize&&(p=m.constrainSize(n,p.w,p.h,c,u));if(n.constraints)for(const m of n.constraints)m.constrainSize&&(p=m.constrainSize(n,p.w,p.h,c,u));return p}function sH({top:e,left:n,width:a,height:l}){const c=`translate(${n}px,${e}px)`;return{transform:c,WebkitTransform:c,MozTransform:c,msTransform:c,OTransform:c,width:`${a}px`,height:`${l}px`,position:"absolute"}}function KJ({top:e,left:n,width:a,height:l}){return{top:`${e}px`,left:`${n}px`,width:`${a}px`,height:`${l}px`,position:"absolute"}}function J8(e){return e*100+"%"}function QJ(e,n,a,l){return e+a>l?n:a}function cH(e,n,a){return e<0?n:a}function ZJ(e){return Math.max(0,e)}function pw(e){return Math.max(0,e)}var $4=(e,n,a)=>{const{left:l,height:c,width:u}=n,p=e.top-(c-e.height);return{left:l,width:u,height:cH(p,e.height,c),top:pw(p)}},R4=(e,n,a)=>{const{top:l,left:c,height:u,width:p}=n;return{top:l,height:u,width:QJ(e.left,e.width,p,a),left:ZJ(c)}},T4=(e,n,a)=>{const{top:l,height:c,width:u}=n,p=e.left+e.width-u;return p<0?{height:c,width:e.left+e.width,top:pw(l),left:0}:{height:c,width:u,top:pw(l),left:p}},O4=(e,n,a)=>{const{top:l,left:c,height:u,width:p}=n;return{width:p,left:c,height:cH(l,e.height,u),top:pw(l)}},JJ=(e,n,a)=>$4(e,R4(e,n,a)),eee=(e,n,a)=>$4(e,T4(e,n)),tee=(e,n,a)=>O4(e,R4(e,n,a)),nee=(e,n,a)=>O4(e,T4(e,n)),oee={n:$4,ne:JJ,e:R4,se:tee,s:O4,sw:nee,w:T4,nw:eee};function aee(e,n,a,l){const c=oee[e];return c?c(n,{...n,...a},l):a}var kO={type:"transform",scale:1,calcStyle(e){return sH(e)}},ree=kO,lee={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},iee={enabled:!0,bounded:!1,threshold:3},see={enabled:!0,handles:["se"]},cee={enabled:!1,defaultItem:{w:1,h:1}};function uH(e,n,a,l,c){n[l]+=1;const p=e.findIndex(S=>S.i===n.i),m=c??E4(e).length>0;for(let S=p+1;S<e.length;S++){const v=e[S];if(v!==void 0&&!v.static){if(!m&&v.y>n.y+n.h)break;C4(n,v)&&uH(e,v,a+n.h,l,m)}}n[l]=a}function uee(e,n,a,l){for(n.x=Math.max(n.x,0),n.y=Math.max(n.y,0),n.y=Math.min(l,n.y);n.y>0&&!fw(e,n);)n.y--;let c;for(;(c=fw(e,n))!==void 0;)uH(a,n,c.y+c.h,"y");return n.y=Math.max(n.y,0),n}var M4={type:"vertical",allowOverlap:!1,compact(e,n){const a=E4(e);let l=x4(a);const c=XO(e),u=new Array(e.length);for(let p=0;p<c.length;p++){const m=c[p];if(m===void 0)continue;let S=eb(m);S.static||(S=uee(a,S,c,l),l=Math.max(l,S.y+S.h),a.push(S));const v=e.indexOf(m);u[v]=S,S.moved=!1}return u}},dee={type:null,allowOverlap:!1,compact(e,n){return w4(e)}},fee={...M4,allowOverlap:!0,compact(e,n){return w4(e)}};function pee(e,n=!1,a=!1){let l;return n?l=fee:l=M4,a?{...l,preventCollision:a}:l}const mee=48,hee=6,gee=18;function yee(e){const n=e.edgePx??mee,a=e.minStep??hee,l=e.maxStep??gee,c=e.viewportBottom-e.pointerClientY;if(c>n)return 0;const p=1-Math.max(0,Math.min(n,c))/n;return Math.round(a+(l-a)*p)}function bee(e){const n=_.useRef(!1),a=_.useRef(null),l=_.useRef(null),c=_.useCallback(()=>{n.current=!1,a.current=null,l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),u=_.useCallback(()=>{if(l.current=null,!e.enabled||!n.current||a.current===null)return;const v=e.scrollerRef.current;if(!v)return;const C=v.getBoundingClientRect(),x=yee({viewportBottom:C.bottom,pointerClientY:a.current});if(x<=0)return;const w=v.scrollTop;v.scrollTop+=x,v.scrollTop!==w&&(l.current=window.requestAnimationFrame(u))},[e.enabled,e.scrollerRef]),p=_.useCallback(()=>{!e.enabled||!n.current||l.current!==null||(l.current=window.requestAnimationFrame(u))},[e.enabled,u]),m=_.useCallback(v=>{!e.enabled||v===null||(a.current=v,p())},[p,e.enabled]),S=_.useCallback(v=>{e.enabled&&(n.current=!0,a.current=v,p())},[p,e.enabled]);return _.useEffect(()=>{if(!e.enabled){c();return}const v=x=>{n.current&&m(x.clientY)},C=()=>{c()};return window.addEventListener("mousemove",v,!0),window.addEventListener("mouseup",C,!0),()=>{window.removeEventListener("mousemove",v,!0),window.removeEventListener("mouseup",C,!0),c()}},[e.enabled,c,m]),{startAutoPan:S,stopAutoPan:c,updatePointerClientY:m}}const vee=50,See=200,WO=5,Cee=2e3,xee=2,sR=120,Eee=90;function wee(e){return Math.max(vee,Math.min(See,e))}function eD(e){return wee(Math.round(e/WO)*WO)}function $ee(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable||e.closest('[contenteditable="true"]'))return!0;const n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||n==="select"}function tD(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function Ree(e){const[n,a]=_.useState(100),[l,c]=_.useState(!1),[u,p]=_.useState(!1),[m,S]=_.useState(!1),v=_.useRef(null),C=_.useRef(0),x=_.useRef(null),w=_.useRef(0),M=_.useRef({clientX:0,clientY:0,scrollLeft:0,scrollTop:0}),N=n/100,T=e.isScreenMode&&(u||m);_.useEffect(()=>()=>{v.current&&window.clearTimeout(v.current),C.current=0,x.current=null,w.current=0},[]),_.useEffect(()=>{e.isScreenMode||(c(!1),p(!1),S(!1))},[e.isScreenMode]),_.useEffect(()=>{if(e.isScreenMode){if(v.current&&(window.clearTimeout(v.current),v.current=null),n!==100){c(!0);return}v.current=window.setTimeout(()=>{c(!1),v.current=null},Cee)}},[e.isScreenMode,n]),_.useEffect(()=>{const I=B=>{if(!e.isScreenMode||!tD(B)||B.repeat||$ee(B.target))return;B.preventDefault(),p(!0);const L=document.activeElement;L instanceof HTMLElement&&L.closest(".cps-bi-builder__canvas")&&L.blur()},j=B=>{!e.isScreenMode||!tD(B)||(B.preventDefault(),p(!1),S(!1))},V=()=>{e.isScreenMode&&(p(!1),S(!1))};return window.addEventListener("keydown",I,!0),window.addEventListener("keyup",j,!0),window.addEventListener("blur",V),()=>{window.removeEventListener("keydown",I,!0),window.removeEventListener("keyup",j,!0),window.removeEventListener("blur",V)}},[e.isScreenMode]),_.useEffect(()=>{if(!m)return;const I=V=>{const B=e.scrollerRef.current;if(!B)return;const L=V.clientX-M.current.clientX,P=V.clientY-M.current.clientY;B.scrollLeft=M.current.scrollLeft-L,B.scrollTop=M.current.scrollTop-P},j=()=>{S(!1)};return window.addEventListener("mousemove",I),window.addEventListener("mouseup",j),()=>{window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",j)}},[m,e.scrollerRef]);const $=_.useCallback(()=>{v.current&&(window.clearTimeout(v.current),v.current=null),c(!0)},[]);_.useEffect(()=>{const I=e.scrollerRef.current;if(!I||!e.isScreenMode)return;const j=V=>{if(!V.ctrlKey&&!V.metaKey||(V.preventDefault(),Math.abs(V.deltaY)<xee)||(C.current+=V.deltaY,Math.abs(C.current)<sR))return;const B=C.current<0?1:-1,L=Date.now();if(x.current!==null&&x.current!==B&&L-w.current<Eee){C.current=0;return}const G=Math.max(1,Math.trunc(Math.abs(C.current)/sR));C.current-=G*sR*(B===1?-1:1),$(),a(F=>{const W=eD(F+B*WO*G);if(W===F)return F;const k=I.getBoundingClientRect(),ne=V.clientX-k.left,re=V.clientY-k.top,q=(I.scrollLeft+ne)/(F/100),K=(I.scrollTop+re)/(F/100),J=W/100;return window.requestAnimationFrame(()=>{I.scrollLeft=q*J-ne,I.scrollTop=K*J-re}),x.current=B,w.current=L,W})};return I.addEventListener("wheel",j,{passive:!1}),()=>{I.removeEventListener("wheel",j)}},[e.isScreenMode,e.scrollerRef,$]);const z=_.useCallback(I=>{$(),a(eD(I))},[$]),D=_.useCallback(I=>{if(!e.isScreenMode||!u||I.button!==0)return;I.preventDefault();const j=e.scrollerRef.current;j&&(S(!0),M.current={clientX:I.clientX,clientY:I.clientY,scrollLeft:j.scrollLeft,scrollTop:j.scrollTop})},[e.isScreenMode,e.scrollerRef,u]),A=_.useMemo(()=>({minWidth:"100%",minHeight:"100%",width:`${e.canvasWidth*N}px`,height:`${e.canvasHeight*N}px`}),[e.canvasHeight,e.canvasWidth,N]);return{zoomPercent:n,zoomScale:N,showZoomOverlay:l,spacePressed:u,panning:m,handMode:T,zoomLayerStyle:A,applyZoomValue:z,handleScrollerMouseDown:D}}const nD=12;function Tee(e,n,a,l){const c=e.reduce((u,p)=>Math.max(u,p.y+p.h),0);return c<=0?l*2:l*2+c*n+Math.max(0,c-1)*a}function dH(e){return Math.max(Tee(e.layout,e.rowHeight,e.marginY,e.paddingY),e.viewportInnerHeight)}function Oee(e){const[n,a]=_.useState({width:0,height:0});return _.useEffect(()=>{const l=e.current;if(!l)return;const c=m=>{if(m){a(m);return}const S=l.getBoundingClientRect();a({width:S.width,height:S.height})},u=()=>{c()};if(c(),typeof ResizeObserver>"u")return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)};const p=new ResizeObserver(m=>{const S=m[0],v=Array.isArray(S?.borderBoxSize)?S.borderBoxSize[0]:S?.borderBoxSize;if(v){c({width:v.inlineSize,height:v.blockSize});return}c()});return p.observe(l),()=>{p.disconnect()}},[e]),n}function Mee(e){const[n,a]=e.settings.margin,[l,c]=e.settings.padding,u=Math.max(0,e.viewportSize.width-nD*2),p=Math.max(0,e.viewportSize.height-nD*2),m=!e.isScreenMode&&u>=e.settings.minWidth&&u>0,S=m?u:Math.max(320,Math.max(u,e.settings.minWidth)),v=e.isScreenMode?e.screenSize.width:S,C=dH({layout:e.layout,rowHeight:e.settings.rowHeight,marginY:a,paddingY:c,viewportInnerHeight:p}),x=e.isScreenMode?e.screenSize.height:C,w=(v-l*2-n*(e.settings.cols-1))/e.settings.cols,M=Number.isFinite(w)?Math.max(1,w):1;return{viewportInnerWidth:u,viewportInnerHeight:p,responsiveFluid:m,canvasWidth:v,canvasHeight:x,gridStepX:M+n,gridStepY:e.settings.rowHeight+a}}const Nee=3;function oD(e,n){const a=e.componentsById[n];return a?{uniqueCode:a.uniqueCode,widgetCode:a.widgetCode,defaultTargets:a.linkageConfig.target.values.length>0?a.linkageConfig.target.values.map(l=>({by:a.linkageConfig.target.by,value:l})):void 0}:null}function zee(e,n){const a=_.useMemo(()=>tH(),[]),l=_.useRef(new Map),c=_.useRef(n);return _.useEffect(()=>{c.current=n},[n]),_.useEffect(()=>{const u=l.current,p=new Set;for(const m of n){p.add(m);const S=oD(e.getSnapshot(),m);if(!S)continue;let v=u.get(m);if(v)v.metaRef.current=S;else{const C={current:S};v={metaRef:C,notifyUpdate:(x,w,M)=>{const N=C.current;a.emit({eventId:Wf(),sourceUniqueCode:N.uniqueCode,sourceWidgetCode:N.widgetCode,eventName:x,params:w,targets:M?.targets??N.defaultTargets,depth:0,ttl:M?.ttl??Nee,timestamp:Date.now()})},onReceiveUpdate:x=>a.subscribe("*",w=>{const M=C.current;w.sourceUniqueCode!==M.uniqueCode&&eH(w,{widgetCode:M.widgetCode,uniqueCode:M.uniqueCode})&&x({sourceWidgetCode:w.sourceWidgetCode,sourceUniqueCode:w.sourceUniqueCode,eventName:w.eventName,params:w.params})})},u.set(m,v)}}for(const m of Array.from(u.keys()))p.has(m)||u.delete(m)},[n,a,e]),_.useEffect(()=>e.subscribe(u=>{const p=l.current,m=new Set(c.current);for(const S of c.current){const v=oD(u,S);if(!v){p.delete(S);continue}const C=p.get(S);C&&(C.metaRef.current=v)}for(const S of Array.from(p.keys()))m.has(S)||p.delete(S)}),[e]),_.useEffect(()=>()=>{a.dispose()},[a]),_.useCallback(u=>l.current.get(u)??null,[])}function fH(e){return function(a,l,c,u,p,m,S){return e(a,l,S)}}function Lw(e){return function(a,l,c,u){if(!a||!l||typeof a!="object"||typeof l!="object")return e(a,l,c,u);var p=u.get(a),m=u.get(l);if(p&&m)return p===l&&m===a;u.set(a,l),u.set(l,a);var S=e(a,l,c,u);return u.delete(a),u.delete(l),S}}function pH(e,n){var a={};for(var l in e)a[l]=e[l];for(var l in n)a[l]=n[l];return a}function aD(e){return e.constructor===Object||e.constructor==null}function rD(e){return typeof e.then=="function"}function Vw(e,n){return e===n||e!==e&&n!==n}var Dee="[object Arguments]",Aee="[object Boolean]",_ee="[object Date]",Bee="[object RegExp]",Hee="[object Map]",jee="[object Number]",Iee="[object Object]",Lee="[object Set]",Vee="[object String]",lD=Object.prototype.toString;function Pw(e){var n=e.areArraysEqual,a=e.areDatesEqual,l=e.areMapsEqual,c=e.areObjectsEqual,u=e.areRegExpsEqual,p=e.areSetsEqual,m=e.createIsNestedEqual,S=m(v);function v(C,x,w){if(C===x)return!0;if(!C||!x||typeof C!="object"||typeof x!="object")return C!==C&&x!==x;if(aD(C)&&aD(x))return c(C,x,S,w);var M=Array.isArray(C),N=Array.isArray(x);if(M||N)return M===N&&n(C,x,S,w);var T=lD.call(C);return T!==lD.call(x)?!1:T===_ee?a(C,x,S,w):T===Bee?u(C,x,S,w):T===Hee?l(C,x,S,w):T===Lee?p(C,x,S,w):T===Iee||T===Dee?rD(C)||rD(x)?!1:c(C,x,S,w):T===Aee||T===jee||T===Vee?Vw(C.valueOf(),x.valueOf()):!1}return v}function mH(e,n,a,l){var c=e.length;if(n.length!==c)return!1;for(;c-- >0;)if(!a(e[c],n[c],c,c,e,n,l))return!1;return!0}var Pee=Lw(mH);function hH(e,n){return Vw(e.valueOf(),n.valueOf())}function gH(e,n,a,l){var c=e.size===n.size;if(!c)return!1;if(!e.size)return!0;var u={},p=0;return e.forEach(function(m,S){if(c){var v=!1,C=0;n.forEach(function(x,w){!v&&!u[C]&&(v=a(S,w,p,C,e,n,l)&&a(m,x,S,w,e,n,l))&&(u[C]=!0),C++}),p++,c=v}}),c}var Uee=Lw(gH),qee="_owner",Fee=Object.prototype.hasOwnProperty;function yH(e,n,a,l){var c=Object.keys(e),u=c.length;if(Object.keys(n).length!==u)return!1;for(var p;u-- >0;){if(p=c[u],p===qee){var m=!!e.$$typeof,S=!!n.$$typeof;if((m||S)&&m!==S)return!1}if(!Fee.call(n,p)||!a(e[p],n[p],p,p,e,n,l))return!1}return!0}var Gee=Lw(yH);function bH(e,n){return e.source===n.source&&e.flags===n.flags}function vH(e,n,a,l){var c=e.size===n.size;if(!c)return!1;if(!e.size)return!0;var u={};return e.forEach(function(p,m){if(c){var S=!1,v=0;n.forEach(function(C,x){!S&&!u[v]&&(S=a(p,C,m,x,e,n,l))&&(u[v]=!0),v++}),c=S}}),c}var Yee=Lw(vH),SH=Object.freeze({areArraysEqual:mH,areDatesEqual:hH,areMapsEqual:gH,areObjectsEqual:yH,areRegExpsEqual:bH,areSetsEqual:vH,createIsNestedEqual:fH}),CH=Object.freeze({areArraysEqual:Pee,areDatesEqual:hH,areMapsEqual:Uee,areObjectsEqual:Gee,areRegExpsEqual:bH,areSetsEqual:Yee,createIsNestedEqual:fH}),Xee=Pw(SH);function _y(e,n){return Xee(e,n,void 0)}Pw(pH(SH,{createIsNestedEqual:function(){return Vw}}));Pw(CH);Pw(pH(CH,{createIsNestedEqual:function(){return Vw}}));var hS={exports:{}},cR={},bE={exports:{}},vE={exports:{}},uo={};var iD;function kee(){if(iD)return uo;iD=1;var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,c=e?Symbol.for("react.strict_mode"):60108,u=e?Symbol.for("react.profiler"):60114,p=e?Symbol.for("react.provider"):60109,m=e?Symbol.for("react.context"):60110,S=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,C=e?Symbol.for("react.forward_ref"):60112,x=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,M=e?Symbol.for("react.memo"):60115,N=e?Symbol.for("react.lazy"):60116,T=e?Symbol.for("react.block"):60121,$=e?Symbol.for("react.fundamental"):60117,z=e?Symbol.for("react.responder"):60118,D=e?Symbol.for("react.scope"):60119;function A(j){if(typeof j=="object"&&j!==null){var V=j.$$typeof;switch(V){case n:switch(j=j.type,j){case S:case v:case l:case u:case c:case x:return j;default:switch(j=j&&j.$$typeof,j){case m:case C:case N:case M:case p:return j;default:return V}}case a:return V}}}function I(j){return A(j)===v}return uo.AsyncMode=S,uo.ConcurrentMode=v,uo.ContextConsumer=m,uo.ContextProvider=p,uo.Element=n,uo.ForwardRef=C,uo.Fragment=l,uo.Lazy=N,uo.Memo=M,uo.Portal=a,uo.Profiler=u,uo.StrictMode=c,uo.Suspense=x,uo.isAsyncMode=function(j){return I(j)||A(j)===S},uo.isConcurrentMode=I,uo.isContextConsumer=function(j){return A(j)===m},uo.isContextProvider=function(j){return A(j)===p},uo.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===n},uo.isForwardRef=function(j){return A(j)===C},uo.isFragment=function(j){return A(j)===l},uo.isLazy=function(j){return A(j)===N},uo.isMemo=function(j){return A(j)===M},uo.isPortal=function(j){return A(j)===a},uo.isProfiler=function(j){return A(j)===u},uo.isStrictMode=function(j){return A(j)===c},uo.isSuspense=function(j){return A(j)===x},uo.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===l||j===v||j===u||j===c||j===x||j===w||typeof j=="object"&&j!==null&&(j.$$typeof===N||j.$$typeof===M||j.$$typeof===p||j.$$typeof===m||j.$$typeof===C||j.$$typeof===$||j.$$typeof===z||j.$$typeof===D||j.$$typeof===T)},uo.typeOf=A,uo}var fo={};var sD;function Wee(){return sD||(sD=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,c=e?Symbol.for("react.strict_mode"):60108,u=e?Symbol.for("react.profiler"):60114,p=e?Symbol.for("react.provider"):60109,m=e?Symbol.for("react.context"):60110,S=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,C=e?Symbol.for("react.forward_ref"):60112,x=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,M=e?Symbol.for("react.memo"):60115,N=e?Symbol.for("react.lazy"):60116,T=e?Symbol.for("react.block"):60121,$=e?Symbol.for("react.fundamental"):60117,z=e?Symbol.for("react.responder"):60118,D=e?Symbol.for("react.scope"):60119;function A(pe){return typeof pe=="string"||typeof pe=="function"||pe===l||pe===v||pe===u||pe===c||pe===x||pe===w||typeof pe=="object"&&pe!==null&&(pe.$$typeof===N||pe.$$typeof===M||pe.$$typeof===p||pe.$$typeof===m||pe.$$typeof===C||pe.$$typeof===$||pe.$$typeof===z||pe.$$typeof===D||pe.$$typeof===T)}function I(pe){if(typeof pe=="object"&&pe!==null){var Te=pe.$$typeof;switch(Te){case n:var we=pe.type;switch(we){case S:case v:case l:case u:case c:case x:return we;default:var be=we&&we.$$typeof;switch(be){case m:case C:case N:case M:case p:return be;default:return Te}}case a:return Te}}}var j=S,V=v,B=m,L=p,P=n,G=C,F=l,W=N,k=M,ne=a,re=u,q=c,K=x,J=!1;function ae(pe){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Z(pe)||I(pe)===S}function Z(pe){return I(pe)===v}function le(pe){return I(pe)===m}function oe(pe){return I(pe)===p}function te(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===n}function ue(pe){return I(pe)===C}function ce(pe){return I(pe)===l}function fe(pe){return I(pe)===N}function ie(pe){return I(pe)===M}function ge(pe){return I(pe)===a}function Ce(pe){return I(pe)===u}function de(pe){return I(pe)===c}function se(pe){return I(pe)===x}fo.AsyncMode=j,fo.ConcurrentMode=V,fo.ContextConsumer=B,fo.ContextProvider=L,fo.Element=P,fo.ForwardRef=G,fo.Fragment=F,fo.Lazy=W,fo.Memo=k,fo.Portal=ne,fo.Profiler=re,fo.StrictMode=q,fo.Suspense=K,fo.isAsyncMode=ae,fo.isConcurrentMode=Z,fo.isContextConsumer=le,fo.isContextProvider=oe,fo.isElement=te,fo.isForwardRef=ue,fo.isFragment=ce,fo.isLazy=fe,fo.isMemo=ie,fo.isPortal=ge,fo.isProfiler=Ce,fo.isStrictMode=de,fo.isSuspense=se,fo.isValidElementType=A,fo.typeOf=I})()),fo}var cD;function xH(){return cD||(cD=1,process.env.NODE_ENV==="production"?vE.exports=kee():vE.exports=Wee()),vE.exports}var uR,uD;function Kee(){if(uD)return uR;uD=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function l(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function c(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var p={},m=0;m<10;m++)p["_"+String.fromCharCode(m)]=m;var S=Object.getOwnPropertyNames(p).map(function(C){return p[C]});if(S.join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(C){v[C]=C}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return uR=c()?Object.assign:function(u,p){for(var m,S=l(u),v,C=1;C<arguments.length;C++){m=Object(arguments[C]);for(var x in m)n.call(m,x)&&(S[x]=m[x]);if(e){v=e(m);for(var w=0;w<v.length;w++)a.call(m,v[w])&&(S[v[w]]=m[v[w]])}}return S},uR}var dR,dD;function N4(){if(dD)return dR;dD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dR=e,dR}var fR,fD;function EH(){return fD||(fD=1,fR=Function.call.bind(Object.prototype.hasOwnProperty)),fR}var pR,pD;function Qee(){if(pD)return pR;pD=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var n=N4(),a={},l=EH();e=function(u){var p="Warning: "+u;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}}}function c(u,p,m,S,v){if(process.env.NODE_ENV!=="production"){for(var C in u)if(l(u,C)){var x;try{if(typeof u[C]!="function"){var w=Error((S||"React class")+": "+m+" type `"+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[C]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}x=u[C](p,C,S,m,null,n)}catch(N){x=N}if(x&&!(x instanceof Error)&&e((S||"React class")+": type specification of "+m+" `"+C+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof x+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),x instanceof Error&&!(x.message in a)){a[x.message]=!0;var M=v?v():"";e("Failed "+m+" type: "+x.message+(M??""))}}}}return c.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},pR=c,pR}var mR,mD;function Zee(){if(mD)return mR;mD=1;var e=xH(),n=Kee(),a=N4(),l=EH(),c=Qee(),u=function(){};process.env.NODE_ENV!=="production"&&(u=function(m){var S="Warning: "+m;typeof console<"u"&&console.error(S);try{throw new Error(S)}catch{}});function p(){return null}return mR=function(m,S){var v=typeof Symbol=="function"&&Symbol.iterator,C="@@iterator";function x(Z){var le=Z&&(v&&Z[v]||Z[C]);if(typeof le=="function")return le}var w="<<anonymous>>",M={array:z("array"),bigint:z("bigint"),bool:z("boolean"),func:z("function"),number:z("number"),object:z("object"),string:z("string"),symbol:z("symbol"),any:D(),arrayOf:A,element:I(),elementType:j(),instanceOf:V,node:G(),objectOf:L,oneOf:B,oneOfType:P,shape:W,exact:k};function N(Z,le){return Z===le?Z!==0||1/Z===1/le:Z!==Z&&le!==le}function T(Z,le){this.message=Z,this.data=le&&typeof le=="object"?le:{},this.stack=""}T.prototype=Error.prototype;function $(Z){if(process.env.NODE_ENV!=="production")var le={},oe=0;function te(ce,fe,ie,ge,Ce,de,se){if(ge=ge||w,de=de||ie,se!==a){if(S){var pe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw pe.name="Invariant Violation",pe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Te=ge+":"+ie;!le[Te]&&oe<3&&(u("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+ge+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),le[Te]=!0,oe++)}}return fe[ie]==null?ce?fe[ie]===null?new T("The "+Ce+" `"+de+"` is marked as required "+("in `"+ge+"`, but its value is `null`.")):new T("The "+Ce+" `"+de+"` is marked as required in "+("`"+ge+"`, but its value is `undefined`.")):null:Z(fe,ie,ge,Ce,de)}var ue=te.bind(null,!1);return ue.isRequired=te.bind(null,!0),ue}function z(Z){function le(oe,te,ue,ce,fe,ie){var ge=oe[te],Ce=q(ge);if(Ce!==Z){var de=K(ge);return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+de+"` supplied to `"+ue+"`, expected ")+("`"+Z+"`."),{expectedType:Z})}return null}return $(le)}function D(){return $(p)}function A(Z){function le(oe,te,ue,ce,fe){if(typeof Z!="function")return new T("Property `"+fe+"` of component `"+ue+"` has invalid PropType notation inside arrayOf.");var ie=oe[te];if(!Array.isArray(ie)){var ge=q(ie);return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+ge+"` supplied to `"+ue+"`, expected an array."))}for(var Ce=0;Ce<ie.length;Ce++){var de=Z(ie,Ce,ue,ce,fe+"["+Ce+"]",a);if(de instanceof Error)return de}return null}return $(le)}function I(){function Z(le,oe,te,ue,ce){var fe=le[oe];if(!m(fe)){var ie=q(fe);return new T("Invalid "+ue+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected a single ReactElement."))}return null}return $(Z)}function j(){function Z(le,oe,te,ue,ce){var fe=le[oe];if(!e.isValidElementType(fe)){var ie=q(fe);return new T("Invalid "+ue+" `"+ce+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected a single ReactElement type."))}return null}return $(Z)}function V(Z){function le(oe,te,ue,ce,fe){if(!(oe[te]instanceof Z)){var ie=Z.name||w,ge=ae(oe[te]);return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+ge+"` supplied to `"+ue+"`, expected ")+("instance of `"+ie+"`."))}return null}return $(le)}function B(Z){if(!Array.isArray(Z))return process.env.NODE_ENV!=="production"&&(arguments.length>1?u("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):u("Invalid argument supplied to oneOf, expected an array.")),p;function le(oe,te,ue,ce,fe){for(var ie=oe[te],ge=0;ge<Z.length;ge++)if(N(ie,Z[ge]))return null;var Ce=JSON.stringify(Z,function(se,pe){var Te=K(pe);return Te==="symbol"?String(pe):pe});return new T("Invalid "+ce+" `"+fe+"` of value `"+String(ie)+"` "+("supplied to `"+ue+"`, expected one of "+Ce+"."))}return $(le)}function L(Z){function le(oe,te,ue,ce,fe){if(typeof Z!="function")return new T("Property `"+fe+"` of component `"+ue+"` has invalid PropType notation inside objectOf.");var ie=oe[te],ge=q(ie);if(ge!=="object")return new T("Invalid "+ce+" `"+fe+"` of type "+("`"+ge+"` supplied to `"+ue+"`, expected an object."));for(var Ce in ie)if(l(ie,Ce)){var de=Z(ie,Ce,ue,ce,fe+"."+Ce,a);if(de instanceof Error)return de}return null}return $(le)}function P(Z){if(!Array.isArray(Z))return process.env.NODE_ENV!=="production"&&u("Invalid argument supplied to oneOfType, expected an instance of array."),p;for(var le=0;le<Z.length;le++){var oe=Z[le];if(typeof oe!="function")return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(oe)+" at index "+le+"."),p}function te(ue,ce,fe,ie,ge){for(var Ce=[],de=0;de<Z.length;de++){var se=Z[de],pe=se(ue,ce,fe,ie,ge,a);if(pe==null)return null;pe.data&&l(pe.data,"expectedType")&&Ce.push(pe.data.expectedType)}var Te=Ce.length>0?", expected one of type ["+Ce.join(", ")+"]":"";return new T("Invalid "+ie+" `"+ge+"` supplied to "+("`"+fe+"`"+Te+"."))}return $(te)}function G(){function Z(le,oe,te,ue,ce){return ne(le[oe])?null:new T("Invalid "+ue+" `"+ce+"` supplied to "+("`"+te+"`, expected a ReactNode."))}return $(Z)}function F(Z,le,oe,te,ue){return new T((Z||"React class")+": "+le+" type `"+oe+"."+te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ue+"`.")}function W(Z){function le(oe,te,ue,ce,fe){var ie=oe[te],ge=q(ie);if(ge!=="object")return new T("Invalid "+ce+" `"+fe+"` of type `"+ge+"` "+("supplied to `"+ue+"`, expected `object`."));for(var Ce in Z){var de=Z[Ce];if(typeof de!="function")return F(ue,ce,fe,Ce,K(de));var se=de(ie,Ce,ue,ce,fe+"."+Ce,a);if(se)return se}return null}return $(le)}function k(Z){function le(oe,te,ue,ce,fe){var ie=oe[te],ge=q(ie);if(ge!=="object")return new T("Invalid "+ce+" `"+fe+"` of type `"+ge+"` "+("supplied to `"+ue+"`, expected `object`."));var Ce=n({},oe[te],Z);for(var de in Ce){var se=Z[de];if(l(Z,de)&&typeof se!="function")return F(ue,ce,fe,de,K(se));if(!se)return new T("Invalid "+ce+" `"+fe+"` key `"+de+"` supplied to `"+ue+"`.\nBad object: "+JSON.stringify(oe[te],null," ")+`
|
|
449
449
|
Valid keys: `+JSON.stringify(Object.keys(Z),null," "));var pe=se(ie,de,ue,ce,fe+"."+de,a);if(pe)return pe}return null}return $(le)}function ne(Z){switch(typeof Z){case"number":case"string":case"undefined":return!0;case"boolean":return!Z;case"object":if(Array.isArray(Z))return Z.every(ne);if(Z===null||m(Z))return!0;var le=x(Z);if(le){var oe=le.call(Z),te;if(le!==Z.entries){for(;!(te=oe.next()).done;)if(!ne(te.value))return!1}else for(;!(te=oe.next()).done;){var ue=te.value;if(ue&&!ne(ue[1]))return!1}}else return!1;return!0;default:return!1}}function re(Z,le){return Z==="symbol"?!0:le?le["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&le instanceof Symbol:!1}function q(Z){var le=typeof Z;return Array.isArray(Z)?"array":Z instanceof RegExp?"object":re(le,Z)?"symbol":le}function K(Z){if(typeof Z>"u"||Z===null)return""+Z;var le=q(Z);if(le==="object"){if(Z instanceof Date)return"date";if(Z instanceof RegExp)return"regexp"}return le}function J(Z){var le=K(Z);switch(le){case"array":case"object":return"an "+le;case"boolean":case"date":case"regexp":return"a "+le;default:return le}}function ae(Z){return!Z.constructor||!Z.constructor.name?w:Z.constructor.name}return M.checkPropTypes=c,M.resetWarningCache=c.resetWarningCache,M.PropTypes=M,M},mR}var hR,hD;function Jee(){if(hD)return hR;hD=1;var e=N4();function n(){}function a(){}return a.resetWarningCache=n,hR=function(){function l(p,m,S,v,C,x){if(x!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}l.isRequired=l;function c(){return l}var u={array:l,bigint:l,bool:l,func:l,number:l,object:l,string:l,symbol:l,any:l,arrayOf:c,element:l,elementType:l,instanceOf:c,node:l,objectOf:c,oneOf:c,oneOfType:c,shape:c,exact:c,checkPropTypes:a,resetWarningCache:n};return u.PropTypes=u,u},hR}var gD;function Uw(){if(gD)return bE.exports;if(gD=1,process.env.NODE_ENV!=="production"){var e=xH(),n=!0;bE.exports=Zee()(e.isElement,n)}else bE.exports=Jee()();return bE.exports}var SE={exports:{}},yD;function ete(){if(yD)return SE.exports;yD=1;function e(a){var l,c,u="";if(typeof a=="string"||typeof a=="number")u+=a;else if(typeof a=="object")if(Array.isArray(a)){var p=a.length;for(l=0;l<p;l++)a[l]&&(c=e(a[l]))&&(u&&(u+=" "),u+=c)}else for(c in a)a[c]&&(u&&(u+=" "),u+=c);return u}function n(){for(var a,l,c=0,u="",p=arguments.length;c<p;c++)(a=arguments[c])&&(l=e(a))&&(u&&(u+=" "),u+=l);return u}return SE.exports=n,SE.exports.clsx=n,SE.exports}var ga={},Bf={},bD;function qw(){if(bD)return Bf;bD=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.dontSetMe=c,Bf.findInArray=e,Bf.int=l,Bf.isFunction=n,Bf.isNum=a;function e(u,p){for(let m=0,S=u.length;m<S;m++)if(p.apply(p,[u[m],m,u]))return u[m]}function n(u){return typeof u=="function"||Object.prototype.toString.call(u)==="[object Function]"}function a(u){return typeof u=="number"&&!isNaN(u)}function l(u){return parseInt(u,10)}function c(u,p,m){if(u[p])return new Error(`Invalid prop ${p} passed to ${m} - do not set this, set it on the child.`)}return Bf}var Hf={},vD;function tte(){if(vD)return Hf;vD=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.browserPrefixToKey=a,Hf.browserPrefixToStyle=l,Hf.default=void 0,Hf.getPrefix=n;const e=["Moz","Webkit","O","ms"];function n(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const p=window.document?.documentElement?.style;if(!p||u in p)return"";for(let m=0;m<e.length;m++)if(a(u,e[m])in p)return e[m];return""}function a(u,p){return p?`${p}${c(u)}`:u}function l(u,p){return p?`-${p.toLowerCase()}-${u}`:u}function c(u){let p="",m=!0;for(let S=0;S<u.length;S++)m?(p+=u[S].toUpperCase(),m=!1):u[S]==="-"?m=!0:p+=u[S];return p}return Hf.default=n(),Hf}var SD;function z4(){if(SD)return ga;SD=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.addClassName=j,ga.addEvent=p,ga.addUserSelectStyles=D,ga.createCSSTransform=M,ga.createSVGTransform=N,ga.getTouch=$,ga.getTouchIdentifier=z,ga.getTranslation=T,ga.innerHeight=C,ga.innerWidth=x,ga.matchesSelector=c,ga.matchesSelectorAndParentsTo=u,ga.offsetXYFromParent=w,ga.outerHeight=S,ga.outerWidth=v,ga.removeClassName=V,ga.removeEvent=m,ga.scheduleRemoveUserSelectStyles=A;var e=qw(),n=a(tte());function a(B,L){if(typeof WeakMap=="function")var P=new WeakMap,G=new WeakMap;return(a=function(F,W){if(!W&&F&&F.__esModule)return F;var k,ne,re={__proto__:null,default:F};if(F===null||typeof F!="object"&&typeof F!="function")return re;if(k=W?G:P){if(k.has(F))return k.get(F);k.set(F,re)}for(const q in F)q!=="default"&&{}.hasOwnProperty.call(F,q)&&((ne=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(F,q))&&(ne.get||ne.set)?k(re,q,ne):re[q]=F[q]);return re})(B,L)}let l="";function c(B,L){return l||(l=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(B[P])})),(0,e.isFunction)(B[l])?B[l](L):!1}function u(B,L,P){let G=B;do{if(c(G,L))return!0;if(G===P)return!1;G=G.parentNode}while(G);return!1}function p(B,L,P,G){if(!B)return;const F={capture:!0,...G};B.addEventListener?B.addEventListener(L,P,F):B.attachEvent?B.attachEvent("on"+L,P):B["on"+L]=P}function m(B,L,P,G){if(!B)return;const F={capture:!0,...G};B.removeEventListener?B.removeEventListener(L,P,F):B.detachEvent?B.detachEvent("on"+L,P):B["on"+L]=null}function S(B){let L=B.clientHeight;const P=B.ownerDocument.defaultView.getComputedStyle(B);return L+=(0,e.int)(P.borderTopWidth),L+=(0,e.int)(P.borderBottomWidth),L}function v(B){let L=B.clientWidth;const P=B.ownerDocument.defaultView.getComputedStyle(B);return L+=(0,e.int)(P.borderLeftWidth),L+=(0,e.int)(P.borderRightWidth),L}function C(B){let L=B.clientHeight;const P=B.ownerDocument.defaultView.getComputedStyle(B);return L-=(0,e.int)(P.paddingTop),L-=(0,e.int)(P.paddingBottom),L}function x(B){let L=B.clientWidth;const P=B.ownerDocument.defaultView.getComputedStyle(B);return L-=(0,e.int)(P.paddingLeft),L-=(0,e.int)(P.paddingRight),L}function w(B,L,P){const F=L===L.ownerDocument.body?{left:0,top:0}:L.getBoundingClientRect(),W=(B.clientX+L.scrollLeft-F.left)/P,k=(B.clientY+L.scrollTop-F.top)/P;return{x:W,y:k}}function M(B,L){const P=T(B,L,"px");return{[(0,n.browserPrefixToKey)("transform",n.default)]:P}}function N(B,L){return T(B,L,"")}function T(B,L,P){let{x:G,y:F}=B,W=`translate(${G}${P},${F}${P})`;if(L){const k=`${typeof L.x=="string"?L.x:L.x+P}`,ne=`${typeof L.y=="string"?L.y:L.y+P}`;W=`translate(${k}, ${ne})`+W}return W}function $(B,L){return B.targetTouches&&(0,e.findInArray)(B.targetTouches,P=>L===P.identifier)||B.changedTouches&&(0,e.findInArray)(B.changedTouches,P=>L===P.identifier)}function z(B){if(B.targetTouches&&B.targetTouches[0])return B.targetTouches[0].identifier;if(B.changedTouches&&B.changedTouches[0])return B.changedTouches[0].identifier}function D(B){if(!B)return;let L=B.getElementById("react-draggable-style-el");L||(L=B.createElement("style"),L.type="text/css",L.id="react-draggable-style-el",L.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
450
450
|
`,L.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
451
451
|
`,B.getElementsByTagName("head")[0].appendChild(L)),B.body&&j(B.body,"react-draggable-transparent-selection")}function A(B){window.requestAnimationFrame?window.requestAnimationFrame(()=>{I(B)}):I(B)}function I(B){if(B)try{if(B.body&&V(B.body,"react-draggable-transparent-selection"),B.selection)B.selection.empty();else{const L=(B.defaultView||window).getSelection();L&&L.type!=="Caret"&&L.removeAllRanges()}}catch{}}function j(B,L){B.classList?B.classList.add(L):B.className.match(new RegExp(`(?:^|\\s)${L}(?!\\S)`))||(B.className+=` ${L}`)}function V(B,L){B.classList?B.classList.remove(L):B.className=B.className.replace(new RegExp(`(?:^|\\s)${L}(?!\\S)`,"g"),"")}return ga}var zc={},CD;function wH(){if(CD)return zc;CD=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.canDragX=c,zc.canDragY=u,zc.createCoreData=m,zc.createDraggableData=S,zc.getBoundPosition=a,zc.getControlPosition=p,zc.snapToGrid=l;var e=qw(),n=z4();function a(x,w,M){if(!x.props.bounds)return[w,M];let{bounds:N}=x.props;N=typeof N=="string"?N:v(N);const T=C(x);if(typeof N=="string"){const{ownerDocument:$}=T,z=$.defaultView;let D;if(N==="parent"?D=T.parentNode:D=T.getRootNode().querySelector(N),!(D instanceof z.HTMLElement))throw new Error('Bounds selector "'+N+'" could not find an element.');const A=D,I=z.getComputedStyle(T),j=z.getComputedStyle(A);N={left:-T.offsetLeft+(0,e.int)(j.paddingLeft)+(0,e.int)(I.marginLeft),top:-T.offsetTop+(0,e.int)(j.paddingTop)+(0,e.int)(I.marginTop),right:(0,n.innerWidth)(A)-(0,n.outerWidth)(T)-T.offsetLeft+(0,e.int)(j.paddingRight)-(0,e.int)(I.marginRight),bottom:(0,n.innerHeight)(A)-(0,n.outerHeight)(T)-T.offsetTop+(0,e.int)(j.paddingBottom)-(0,e.int)(I.marginBottom)}}return(0,e.isNum)(N.right)&&(w=Math.min(w,N.right)),(0,e.isNum)(N.bottom)&&(M=Math.min(M,N.bottom)),(0,e.isNum)(N.left)&&(w=Math.max(w,N.left)),(0,e.isNum)(N.top)&&(M=Math.max(M,N.top)),[w,M]}function l(x,w,M){const N=Math.round(w/x[0])*x[0],T=Math.round(M/x[1])*x[1];return[N,T]}function c(x){return x.props.axis==="both"||x.props.axis==="x"}function u(x){return x.props.axis==="both"||x.props.axis==="y"}function p(x,w,M){const N=typeof w=="number"?(0,n.getTouch)(x,w):null;if(typeof w=="number"&&!N)return null;const T=C(M),$=M.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,n.offsetXYFromParent)(N||x,$,M.props.scale)}function m(x,w,M){const N=!(0,e.isNum)(x.lastX),T=C(x);return N?{node:T,deltaX:0,deltaY:0,lastX:w,lastY:M,x:w,y:M}:{node:T,deltaX:w-x.lastX,deltaY:M-x.lastY,lastX:x.lastX,lastY:x.lastY,x:w,y:M}}function S(x,w){const M=x.props.scale;return{node:w.node,x:x.state.x+w.deltaX/M,y:x.state.y+w.deltaY/M,deltaX:w.deltaX/M,deltaY:w.deltaY/M,lastX:x.state.x,lastY:x.state.y}}function v(x){return{left:x.left,top:x.top,right:x.right,bottom:x.bottom}}function C(x){const w=x.findDOMNode();if(!w)throw new Error("<DraggableCore>: Unmounted during event!");return w}return zc}var gS={},CE={},xD;function $H(){if(xD)return CE;xD=1,Object.defineProperty(CE,"__esModule",{value:!0}),CE.default=e;function e(){}return CE}var ED;function nte(){if(ED)return gS;ED=1,Object.defineProperty(gS,"__esModule",{value:!0}),gS.default=void 0;var e=S(_),n=m(Uw()),a=m(Hc),l=z4(),c=wH(),u=qw(),p=m($H());function m(T){return T&&T.__esModule?T:{default:T}}function S(T,$){if(typeof WeakMap=="function")var z=new WeakMap,D=new WeakMap;return(S=function(A,I){if(!I&&A&&A.__esModule)return A;var j,V,B={__proto__:null,default:A};if(A===null||typeof A!="object"&&typeof A!="function")return B;if(j=I?D:z){if(j.has(A))return j.get(A);j.set(A,B)}for(const L in A)L!=="default"&&{}.hasOwnProperty.call(A,L)&&((V=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(A,L))&&(V.get||V.set)?j(B,L,V):B[L]=A[L]);return B})(T,$)}function v(T,$,z){return($=C($))in T?Object.defineProperty(T,$,{value:z,enumerable:!0,configurable:!0,writable:!0}):T[$]=z,T}function C(T){var $=x(T,"string");return typeof $=="symbol"?$:$+""}function x(T,$){if(typeof T!="object"||!T)return T;var z=T[Symbol.toPrimitive];if(z!==void 0){var D=z.call(T,$);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(T)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let M=w.mouse,N=class extends e.Component{constructor(){super(...arguments),v(this,"dragging",!1),v(this,"lastX",NaN),v(this,"lastY",NaN),v(this,"touchIdentifier",null),v(this,"mounted",!1),v(this,"handleDragStart",$=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button=="number"&&$.button!==0)return!1;const z=this.findDOMNode();if(!z||!z.ownerDocument||!z.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:D}=z;if(this.props.disabled||!($.target instanceof D.defaultView.Node)||this.props.handle&&!(0,l.matchesSelectorAndParentsTo)($.target,this.props.handle,z)||this.props.cancel&&(0,l.matchesSelectorAndParentsTo)($.target,this.props.cancel,z))return;$.type==="touchstart"&&!this.props.allowMobileScroll&&$.preventDefault();const A=(0,l.getTouchIdentifier)($);this.touchIdentifier=A;const I=(0,c.getControlPosition)($,A,this);if(I==null)return;const{x:j,y:V}=I,B=(0,c.createCoreData)(this,j,V);(0,p.default)("DraggableCore: handleDragStart: %j",B),(0,p.default)("calling",this.props.onStart),!(this.props.onStart($,B)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,l.addUserSelectStyles)(D),this.dragging=!0,this.lastX=j,this.lastY=V,(0,l.addEvent)(D,M.move,this.handleDrag),(0,l.addEvent)(D,M.stop,this.handleDragStop))}),v(this,"handleDrag",$=>{const z=(0,c.getControlPosition)($,this.touchIdentifier,this);if(z==null)return;let{x:D,y:A}=z;if(Array.isArray(this.props.grid)){let V=D-this.lastX,B=A-this.lastY;if([V,B]=(0,c.snapToGrid)(this.props.grid,V,B),!V&&!B)return;D=this.lastX+V,A=this.lastY+B}const I=(0,c.createCoreData)(this,D,A);if((0,p.default)("DraggableCore: handleDrag: %j",I),this.props.onDrag($,I)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const B=document.createEvent("MouseEvents");B.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(B)}return}this.lastX=D,this.lastY=A}),v(this,"handleDragStop",$=>{if(!this.dragging)return;const z=(0,c.getControlPosition)($,this.touchIdentifier,this);if(z==null)return;let{x:D,y:A}=z;if(Array.isArray(this.props.grid)){let B=D-this.lastX||0,L=A-this.lastY||0;[B,L]=(0,c.snapToGrid)(this.props.grid,B,L),D=this.lastX+B,A=this.lastY+L}const I=(0,c.createCoreData)(this,D,A);if(this.props.onStop($,I)===!1||this.mounted===!1)return!1;const V=this.findDOMNode();V&&this.props.enableUserSelectHack&&(0,l.scheduleRemoveUserSelectStyles)(V.ownerDocument),(0,p.default)("DraggableCore: handleDragStop: %j",I),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,V&&((0,p.default)("DraggableCore: Removing handlers"),(0,l.removeEvent)(V.ownerDocument,M.move,this.handleDrag),(0,l.removeEvent)(V.ownerDocument,M.stop,this.handleDragStop))}),v(this,"onMouseDown",$=>(M=w.mouse,this.handleDragStart($))),v(this,"onMouseUp",$=>(M=w.mouse,this.handleDragStop($))),v(this,"onTouchStart",$=>(M=w.touch,this.handleDragStart($))),v(this,"onTouchEnd",$=>(M=w.touch,this.handleDragStop($)))}componentDidMount(){this.mounted=!0;const $=this.findDOMNode();$&&(0,l.addEvent)($,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const $=this.findDOMNode();if($){const{ownerDocument:z}=$;(0,l.removeEvent)(z,w.mouse.move,this.handleDrag),(0,l.removeEvent)(z,w.touch.move,this.handleDrag),(0,l.removeEvent)(z,w.mouse.stop,this.handleDragStop),(0,l.removeEvent)(z,w.touch.stop,this.handleDragStop),(0,l.removeEvent)($,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,l.scheduleRemoveUserSelectStyles)(z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:a.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return gS.default=N,v(N,"displayName","DraggableCore"),v(N,"propTypes",{allowAnyClick:n.default.bool,allowMobileScroll:n.default.bool,children:n.default.node.isRequired,disabled:n.default.bool,enableUserSelectHack:n.default.bool,offsetParent:function(T,$){if(T[$]&&T[$].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:n.default.arrayOf(n.default.number),handle:n.default.string,cancel:n.default.string,nodeRef:n.default.object,onStart:n.default.func,onDrag:n.default.func,onStop:n.default.func,onMouseDown:n.default.func,scale:n.default.number,className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),v(N,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),gS}var wD;function ote(){return wD||(wD=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return S.default}}),e.default=void 0;var n=x(_),a=C(Uw()),l=C(Hc),c=ete(),u=z4(),p=wH(),m=qw(),S=C(nte()),v=C($H());function C(z){return z&&z.__esModule?z:{default:z}}function x(z,D){if(typeof WeakMap=="function")var A=new WeakMap,I=new WeakMap;return(x=function(j,V){if(!V&&j&&j.__esModule)return j;var B,L,P={__proto__:null,default:j};if(j===null||typeof j!="object"&&typeof j!="function")return P;if(B=V?I:A){if(B.has(j))return B.get(j);B.set(j,P)}for(const G in j)G!=="default"&&{}.hasOwnProperty.call(j,G)&&((L=(B=Object.defineProperty)&&Object.getOwnPropertyDescriptor(j,G))&&(L.get||L.set)?B(P,G,L):P[G]=j[G]);return P})(z,D)}function w(){return w=Object.assign?Object.assign.bind():function(z){for(var D=1;D<arguments.length;D++){var A=arguments[D];for(var I in A)({}).hasOwnProperty.call(A,I)&&(z[I]=A[I])}return z},w.apply(null,arguments)}function M(z,D,A){return(D=N(D))in z?Object.defineProperty(z,D,{value:A,enumerable:!0,configurable:!0,writable:!0}):z[D]=A,z}function N(z){var D=T(z,"string");return typeof D=="symbol"?D:D+""}function T(z,D){if(typeof z!="object"||!z)return z;var A=z[Symbol.toPrimitive];if(A!==void 0){var I=A.call(z,D);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(z)}class $ extends n.Component{static getDerivedStateFromProps(D,A){let{position:I}=D,{prevPropsPosition:j}=A;return I&&(!j||I.x!==j.x||I.y!==j.y)?((0,v.default)("Draggable: getDerivedStateFromProps %j",{position:I,prevPropsPosition:j}),{x:I.x,y:I.y,prevPropsPosition:{...I}}):null}constructor(D){super(D),M(this,"onDragStart",(A,I)=>{if((0,v.default)("Draggable: onDragStart: %j",I),this.props.onStart(A,(0,p.createDraggableData)(this,I))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),M(this,"onDrag",(A,I)=>{if(!this.state.dragging)return!1;(0,v.default)("Draggable: onDrag: %j",I);const j=(0,p.createDraggableData)(this,I),V={x:j.x,y:j.y,slackX:0,slackY:0};if(this.props.bounds){const{x:L,y:P}=V;V.x+=this.state.slackX,V.y+=this.state.slackY;const[G,F]=(0,p.getBoundPosition)(this,V.x,V.y);V.x=G,V.y=F,V.slackX=this.state.slackX+(L-V.x),V.slackY=this.state.slackY+(P-V.y),j.x=V.x,j.y=V.y,j.deltaX=V.x-this.state.x,j.deltaY=V.y-this.state.y}if(this.props.onDrag(A,j)===!1)return!1;this.setState(V)}),M(this,"onDragStop",(A,I)=>{if(!this.state.dragging||this.props.onStop(A,(0,p.createDraggableData)(this,I))===!1)return!1;(0,v.default)("Draggable: onDragStop: %j",I);const V={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:L,y:P}=this.props.position;V.x=L,V.y=P}this.setState(V)}),this.state={dragging:!1,dragged:!1,x:D.position?D.position.x:D.defaultPosition.x,y:D.position?D.position.y:D.defaultPosition.y,prevPropsPosition:{...D.position},slackX:0,slackY:0,isElementSVG:!1},D.position&&!(D.onDrag||D.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??l.default.findDOMNode(this)}render(){const{axis:D,bounds:A,children:I,defaultPosition:j,defaultClassName:V,defaultClassNameDragging:B,defaultClassNameDragged:L,position:P,positionOffset:G,scale:F,...W}=this.props;let k={},ne=null;const q=!!!P||this.state.dragging,K=P||j,J={x:(0,p.canDragX)(this)&&q?this.state.x:K.x,y:(0,p.canDragY)(this)&&q?this.state.y:K.y};this.state.isElementSVG?ne=(0,u.createSVGTransform)(J,G):k=(0,u.createCSSTransform)(J,G);const ae=(0,c.clsx)(I.props.className||"",V,{[B]:this.state.dragging,[L]:this.state.dragged});return n.createElement(S.default,w({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),n.cloneElement(n.Children.only(I),{className:ae,style:{...I.props.style,...k},transform:ne}))}}e.default=$,M($,"displayName","Draggable"),M($,"propTypes",{...S.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:m.dontSetMe,style:m.dontSetMe,transform:m.dontSetMe}),M($,"defaultProps",{...S.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(cR)),cR}var $D;function D4(){if($D)return hS.exports;$D=1;const{default:e,DraggableCore:n}=ote();return hS.exports=e,hS.exports.default=e,hS.exports.DraggableCore=n,hS.exports}var ate=D4(),yS={exports:{}},bS={},xE={},RD;function rte(){if(RD)return xE;RD=1,xE.__esModule=!0,xE.cloneElement=m;var e=n(_);function n(S){return S&&S.__esModule?S:{default:S}}function a(S,v){var C=Object.keys(S);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(S);v&&(x=x.filter(function(w){return Object.getOwnPropertyDescriptor(S,w).enumerable})),C.push.apply(C,x)}return C}function l(S){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?a(Object(C),!0).forEach(function(x){c(S,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(C)):a(Object(C)).forEach(function(x){Object.defineProperty(S,x,Object.getOwnPropertyDescriptor(C,x))})}return S}function c(S,v,C){return(v=u(v))in S?Object.defineProperty(S,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):S[v]=C,S}function u(S){var v=p(S,"string");return typeof v=="symbol"?v:v+""}function p(S,v){if(typeof S!="object"||!S)return S;var C=S[Symbol.toPrimitive];if(C!==void 0){var x=C.call(S,v);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(S)}function m(S,v){return v.style&&S.props.style&&(v.style=l(l({},S.props.style),v.style)),v.className&&S.props.className&&(v.className=`${S.props.className} ${v.className}`),e.default.cloneElement(S,v)}return xE}var vS={},TD;function RH(){if(TD)return vS;TD=1,vS.__esModule=!0,vS.resizableProps=void 0;var e=n(Uw());D4();function n(a){return a&&a.__esModule?a:{default:a}}return vS.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];const[u]=l;return u.axis==="both"||u.axis==="y"?e.default.number.isRequired(...l):e.default.number(...l)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];const[u]=l;return u.axis==="both"||u.axis==="x"?e.default.number.isRequired(...l):e.default.number(...l)}},vS}var OD;function TH(){if(OD)return bS;OD=1,bS.__esModule=!0,bS.default=void 0;var e=u(_),n=D4(),a=rte(),l=RH();const c=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function u(T,$){if(typeof WeakMap=="function")var z=new WeakMap,D=new WeakMap;return(u=function(A,I){if(!I&&A&&A.__esModule)return A;var j,V,B={__proto__:null,default:A};if(A===null||typeof A!="object"&&typeof A!="function")return B;if(j=I?D:z){if(j.has(A))return j.get(A);j.set(A,B)}for(const L in A)L!=="default"&&{}.hasOwnProperty.call(A,L)&&((V=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(A,L))&&(V.get||V.set)?j(B,L,V):B[L]=A[L]);return B})(T,$)}function p(){return p=Object.assign?Object.assign.bind():function(T){for(var $=1;$<arguments.length;$++){var z=arguments[$];for(var D in z)({}).hasOwnProperty.call(z,D)&&(T[D]=z[D])}return T},p.apply(null,arguments)}function m(T,$){if(T==null)return{};var z,D,A=S(T,$);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(T);for(D=0;D<I.length;D++)z=I[D],$.indexOf(z)===-1&&{}.propertyIsEnumerable.call(T,z)&&(A[z]=T[z])}return A}function S(T,$){if(T==null)return{};var z={};for(var D in T)if({}.hasOwnProperty.call(T,D)){if($.indexOf(D)!==-1)continue;z[D]=T[D]}return z}function v(T,$){var z=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);$&&(D=D.filter(function(A){return Object.getOwnPropertyDescriptor(T,A).enumerable})),z.push.apply(z,D)}return z}function C(T){for(var $=1;$<arguments.length;$++){var z=arguments[$]!=null?arguments[$]:{};$%2?v(Object(z),!0).forEach(function(D){x(T,D,z[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(z)):v(Object(z)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(z,D))})}return T}function x(T,$,z){return($=w($))in T?Object.defineProperty(T,$,{value:z,enumerable:!0,configurable:!0,writable:!0}):T[$]=z,T}function w(T){var $=M(T,"string");return typeof $=="symbol"?$:$+""}function M(T,$){if(typeof T!="object"||!T)return T;var z=T[Symbol.toPrimitive];if(z!==void 0){var D=z.call(T,$);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(T)}let N=class extends e.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,z){const{minConstraints:D,maxConstraints:A,lockAspectRatio:I}=this.props;if(!D&&!A&&!I)return[$,z];if(I){const P=this.props.width/this.props.height,G=$-this.props.width,F=z-this.props.height;Math.abs(G)>Math.abs(F*P)?z=$/P:$=z*P}const[j,V]=[$,z];let[B,L]=this.slack||[0,0];return $+=B,z+=L,D&&($=Math.max(D[0],$),z=Math.max(D[1],z)),A&&($=Math.min(A[0],$),z=Math.min(A[1],z)),this.slack=[B+(j-$),L+(V-z)],[$,z]}resizeHandler($,z){return(D,A)=>{let{node:I,deltaX:j,deltaY:V}=A;$==="onResizeStart"&&this.resetData();const B=(this.props.axis==="both"||this.props.axis==="x")&&z!=="n"&&z!=="s",L=(this.props.axis==="both"||this.props.axis==="y")&&z!=="e"&&z!=="w";if(!B&&!L)return;const P=z[0],G=z[z.length-1],F=I.getBoundingClientRect();if(this.lastHandleRect!=null){if(G==="w"){const K=F.left-this.lastHandleRect.left;j+=K}if(P==="n"){const K=F.top-this.lastHandleRect.top;V+=K}}this.lastHandleRect=F,G==="w"&&(j=-j),P==="n"&&(V=-V);let W=this.props.width+(B?j/this.props.transformScale:0),k=this.props.height+(L?V/this.props.transformScale:0);[W,k]=this.runConstraints(W,k),$==="onResizeStop"&&this.lastSize&&({width:W,height:k}=this.lastSize);const ne=W!==this.props.width||k!==this.props.height;$!=="onResizeStop"&&(this.lastSize={width:W,height:k});const re=typeof this.props[$]=="function"?this.props[$]:null;re&&!($==="onResize"&&!ne)&&(D.persist?.(),re(D,{node:I,size:{width:W,height:k},handle:z})),$==="onResizeStop"&&this.resetData()}}renderResizeHandle($,z){const{handle:D}=this.props;if(!D)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:z});if(typeof D=="function")return D($,z);const A=typeof D.type=="string",I=C({ref:z},A?{}:{handleAxis:$});return e.cloneElement(D,I)}render(){const $=this.props,{children:z,className:D,draggableOpts:A,width:I,height:j,handle:V,handleSize:B,lockAspectRatio:L,axis:P,minConstraints:G,maxConstraints:F,onResize:W,onResizeStop:k,onResizeStart:ne,resizeHandles:re,transformScale:q}=$,K=m($,c);return(0,a.cloneElement)(z,C(C({},K),{},{className:`${D?`${D} `:""}react-resizable`,children:[...e.Children.toArray(z.props.children),...re.map(J=>{const ae=this.handleRefs[J]??(this.handleRefs[J]=e.createRef());return e.createElement(n.DraggableCore,p({},A,{nodeRef:ae,key:`resizableHandle-${J}`,onStop:this.resizeHandler("onResizeStop",J),onStart:this.resizeHandler("onResizeStart",J),onDrag:this.resizeHandler("onResize",J)}),this.renderResizeHandle(J,ae))})]}))}};return bS.default=N,N.propTypes=l.resizableProps,N.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},bS}var SS={},MD;function lte(){if(MD)return SS;MD=1,SS.__esModule=!0,SS.default=void 0;var e=p(_),n=u(Uw()),a=u(TH()),l=RH();const c=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function u($){return $&&$.__esModule?$:{default:$}}function p($,z){if(typeof WeakMap=="function")var D=new WeakMap,A=new WeakMap;return(p=function(I,j){if(!j&&I&&I.__esModule)return I;var V,B,L={__proto__:null,default:I};if(I===null||typeof I!="object"&&typeof I!="function")return L;if(V=j?A:D){if(V.has(I))return V.get(I);V.set(I,L)}for(const P in I)P!=="default"&&{}.hasOwnProperty.call(I,P)&&((B=(V=Object.defineProperty)&&Object.getOwnPropertyDescriptor(I,P))&&(B.get||B.set)?V(L,P,B):L[P]=I[P]);return L})($,z)}function m(){return m=Object.assign?Object.assign.bind():function($){for(var z=1;z<arguments.length;z++){var D=arguments[z];for(var A in D)({}).hasOwnProperty.call(D,A)&&($[A]=D[A])}return $},m.apply(null,arguments)}function S($,z){var D=Object.keys($);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols($);z&&(A=A.filter(function(I){return Object.getOwnPropertyDescriptor($,I).enumerable})),D.push.apply(D,A)}return D}function v($){for(var z=1;z<arguments.length;z++){var D=arguments[z]!=null?arguments[z]:{};z%2?S(Object(D),!0).forEach(function(A){C($,A,D[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(D)):S(Object(D)).forEach(function(A){Object.defineProperty($,A,Object.getOwnPropertyDescriptor(D,A))})}return $}function C($,z,D){return(z=x(z))in $?Object.defineProperty($,z,{value:D,enumerable:!0,configurable:!0,writable:!0}):$[z]=D,$}function x($){var z=w($,"string");return typeof z=="symbol"?z:z+""}function w($,z){if(typeof $!="object"||!$)return $;var D=$[Symbol.toPrimitive];if(D!==void 0){var A=D.call($,z);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)($)}function M($,z){if($==null)return{};var D,A,I=N($,z);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols($);for(A=0;A<j.length;A++)D=j[A],z.indexOf(D)===-1&&{}.propertyIsEnumerable.call($,D)&&(I[D]=$[D])}return I}function N($,z){if($==null)return{};var D={};for(var A in $)if({}.hasOwnProperty.call($,A)){if(z.indexOf(A)!==-1)continue;D[A]=$[A]}return D}let T=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(z,D)=>{const{size:A}=D;this.props.onResize?(z.persist?.(),this.setState(A,()=>this.props.onResize&&this.props.onResize(z,D))):this.setState(A)}}static getDerivedStateFromProps(z,D){return D.propsWidth!==z.width||D.propsHeight!==z.height?{width:z.width,height:z.height,propsWidth:z.width,propsHeight:z.height}:null}render(){const z=this.props,{handle:D,handleSize:A,onResize:I,onResizeStart:j,onResizeStop:V,draggableOpts:B,minConstraints:L,maxConstraints:P,lockAspectRatio:G,axis:F,width:W,height:k,resizeHandles:ne,style:re,transformScale:q}=z,K=M(z,c);return e.createElement(a.default,{axis:F,draggableOpts:B,handle:D,handleSize:A,height:this.state.height,lockAspectRatio:G,maxConstraints:P,minConstraints:L,onResizeStart:j,onResize:this.onResize,onResizeStop:V,resizeHandles:ne,transformScale:q,width:this.state.width},e.createElement("div",m({},K,{style:v(v({},re),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return SS.default=T,T.propTypes=v(v({},l.resizableProps),{},{children:n.default.element}),SS}var ND;function ite(){return ND||(ND=1,yS.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},yS.exports.Resizable=TH().default,yS.exports.ResizableBox=lte().default),yS.exports}var ste=ite();function zD(e){const{children:n,cols:a,containerWidth:l,margin:c,containerPadding:u,rowHeight:p,maxRows:m,isDraggable:S,isResizable:v,isBounded:C,static:x,useCSSTransforms:w=!0,usePercentages:M=!1,transformScale:N=1,positionStrategy:T,dragThreshold:$=0,droppingPosition:z,className:D="",style:A,handle:I="",cancel:j="",x:V,y:B,w:L,h:P,minW:G=1,maxW:F=1/0,minH:W=1,maxH:k=1/0,i:ne,resizeHandles:re,resizeHandle:q,constraints:K=iH,layoutItem:J,layout:ae=[],onDragStart:Z,onDrag:le,onDragStop:oe,onResizeStart:te,onResize:ue,onResizeStop:ce}=e,[fe,ie]=_.useState(!1),[ge,Ce]=_.useState(!1),de=_.useRef(null),se=_.useRef({left:0,top:0}),pe=_.useRef({top:0,left:0,width:0,height:0}),Te=_.useRef(void 0),we=_.useRef(ae);we.current=ae;const be=_.useRef(null),Ne=_.useRef(null),xe=_.useRef(!1),ze=_.useRef({x:0,y:0}),Me=_.useRef(!1),qe=_.useMemo(()=>({cols:a,containerPadding:u,containerWidth:l,margin:c,maxRows:m,rowHeight:p}),[a,u,l,c,m,p]),Xe=_.useMemo(()=>({cols:a,maxRows:m,containerWidth:l,containerHeight:0,rowHeight:p,margin:c,layout:[]}),[a,m,l,p,c]),Ge=_.useCallback(()=>({...Xe,layout:we.current}),[Xe]),it=_.useMemo(()=>J??{i:ne,x:V,y:B,w:L,h:P,minW:G,maxW:F,minH:W,maxH:k},[J,ne,V,B,L,P,G,F,W,k]),nt=_.useCallback(Ct=>{if(T?.calcStyle)return T.calcStyle(Ct);if(w)return sH(Ct);const Rt=KJ(Ct);return M?{...Rt,left:J8(Ct.left/l),width:J8(Ct.width/l)}:Rt},[T,w,M,l]),ut=_.useCallback((Ct,{node:Rt})=>{if(!Z)return;const{offsetParent:$t}=Rt;if(!$t)return;const Ye=$t.getBoundingClientRect(),pt=Rt.getBoundingClientRect(),st=pt.left/N,xt=Ye.left/N,lt=pt.top/N,Fe=Ye.top/N;let tt;if(T?.calcDragPosition){const ot=Ct;tt=T.calcDragPosition(ot.clientX,ot.clientY,ot.clientX-pt.left,ot.clientY-pt.top)}else tt={left:st-xt+$t.scrollLeft,top:lt-Fe+$t.scrollTop};if(se.current=tt,$>0){const ot=Ct;ze.current={x:ot.clientX,y:ot.clientY},xe.current=!0,Me.current=!1,ie(!0);return}ie(!0);const Ve=gE(qe,tt.top,tt.left),{x:Je,y:Ie}=yE(K,it,Ve.x,Ve.y,Ge());Z(ne,Je,Ie,{e:Ct,node:Rt,newPosition:tt})},[Z,N,qe,T,$,K,it,Ge,ne]),_t=_.useCallback((Ct,{node:Rt,deltaX:$t,deltaY:Ye})=>{if(!le||!fe)return;const pt=Ct;if(xe.current&&!Me.current){const Je=pt.clientX-ze.current.x,Ie=pt.clientY-ze.current.y;if(Math.hypot(Je,Ie)<$)return;if(Me.current=!0,xe.current=!1,Z){const ct=gE(qe,se.current.top,se.current.left),{x:Nt,y:Mt}=yE(K,it,ct.x,ct.y,Ge());Z(ne,Nt,Mt,{e:Ct,node:Rt,newPosition:se.current})}}let st=se.current.top+Ye,xt=se.current.left+$t;if(C){const{offsetParent:Je}=Rt;if(Je){const Ie=Je.clientHeight-Jy(P,p,c[1]);st=dw(st,0,Ie);const ot=cb(qe),ct=l-Jy(L,ot,c[0]);xt=dw(xt,0,ct)}}const lt={top:st,left:xt};se.current=lt;const Fe=gE(qe,st,xt),{x:tt,y:Ve}=yE(K,it,Fe.x,Fe.y,Ge());le(ne,tt,Ve,{e:Ct,node:Rt,newPosition:lt})},[le,Z,fe,$,C,P,p,c,qe,l,L,ne,K,it,Ge]),bt=_.useCallback((Ct,{node:Rt})=>{if(!oe||!fe)return;const $t=xe.current;if(xe.current=!1,Me.current=!1,ze.current={x:0,y:0},$t){ie(!1),se.current={left:0,top:0};return}const{left:Ye,top:pt}=se.current,st={top:pt,left:Ye};ie(!1),se.current={left:0,top:0};const xt=gE(qe,pt,Ye),{x:lt,y:Fe}=yE(K,it,xt.x,xt.y,Ge());oe(ne,lt,Fe,{e:Ct,node:Rt,newPosition:st})},[oe,fe,qe,K,it,Ge,ne]);be.current=ut,Ne.current=_t;const St=_.useCallback((Ct,{node:Rt,size:$t,handle:Ye},pt,st)=>{const xt=st==="onResizeStart"?te:st==="onResize"?ue:ce;if(!xt)return;let lt;Rt?lt=aee(Ye,pt,$t,l):lt={...$t,top:pt.top,left:pt.left},pe.current=lt;const Fe=PJ(qe,lt.width,lt.height),{w:tt,h:Ve}=WJ(K,it,Fe.w,Fe.h,Ye,Ge());xt(ne,tt,Ve,{e:Ct.nativeEvent,node:Rt,size:lt,handle:Ye})},[te,ue,ce,l,qe,ne,K,it,Ge]),Pt=_.useCallback((Ct,Rt)=>{Ce(!0);const $t=mS(qe,V,B,L,P),Ye={...Rt,handle:Rt.handle};St(Ct,Ye,$t,"onResizeStart")},[St,qe,V,B,L,P]),yt=_.useCallback((Ct,Rt)=>{const $t=mS(qe,V,B,L,P),Ye={...Rt,handle:Rt.handle};St(Ct,Ye,$t,"onResize")},[St,qe,V,B,L,P]),at=_.useCallback((Ct,Rt)=>{Ce(!1),pe.current={top:0,left:0,width:0,height:0};const $t=mS(qe,V,B,L,P),Ye={...Rt,handle:Rt.handle};St(Ct,Ye,$t,"onResizeStop")},[St,qe,V,B,L,P]);_.useEffect(()=>{if(!z)return;const Ct=de.current;if(!Ct)return;const Rt=Te.current||{left:0,top:0},$t=fe&&(z.left!==Rt.left||z.top!==Rt.top);if(fe){if($t){const Ye=z.left-se.current.left,pt=z.top-se.current.top,st={node:Ct,deltaX:Ye,deltaY:pt,lastX:se.current.left,lastY:se.current.top,x:z.left,y:z.top};Ne.current?.(z.e,st)}}else{const Ye={node:Ct,deltaX:z.left,deltaY:z.top,lastX:0,lastY:0,x:z.left,y:z.top};be.current?.(z.e,Ye)}Te.current=z},[z,fe,ne]);const ft=mS(qe,V,B,L,P,fe?se.current:null,ge?pe.current:null),ht=_.Children.only(n),dt=mS(qe,0,0,1,1),rt=[dt.width,dt.height],Dt=[1/0,1/0],Vt=ht.props,Ht=Vt.className,Mn=Vt.style;let At=_.cloneElement(ht,{ref:de,className:me("react-grid-item",Ht,D,{static:x,resizing:ge,"react-draggable":S,"react-draggable-dragging":fe,dropping:!!z,cssTransforms:w}),style:{...A,...Mn,...nt(ft)}});const Kt=q;return At=X.jsx(ste.Resizable,{draggableOpts:{disabled:!v},className:v?void 0:"react-resizable-hide",width:ft.width,height:ft.height,minConstraints:rt,maxConstraints:Dt,onResizeStart:Pt,onResize:yt,onResizeStop:at,transformScale:N,resizeHandles:re,handle:Kt,children:At}),At=X.jsx(ate.DraggableCore,{disabled:!S,onStart:ut,onDrag:_t,onStop:bt,handle:I,cancel:".react-resizable-handle"+(j?","+j:""),scale:N,nodeRef:de,children:At}),At}var Gu=()=>{},DD="react-grid-layout",OH=!1;try{OH=/firefox/i.test(navigator.userAgent)}catch{}function cte(e,n){const a=_.Children.toArray(e),l=_.Children.toArray(n);if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++){const u=a[c],p=l[c];if(u?.key!==p?.key)return!1}return!0}function AD(e,n,a,l){const c=[],u=new Set;_.Children.forEach(n,m=>{if(!_.isValidElement(m)||m.key===null)return;const S=String(m.key);u.add(S);const v=e.find(C=>C.i===S);if(v)c.push(eb(v));else{const x=m.props["data-grid"];x?c.push({i:S,x:x.x??0,y:x.y??0,w:x.w??1,h:x.h??1,minW:x.minW,maxW:x.maxW,minH:x.minH,maxH:x.maxH,static:x.static,isDraggable:x.isDraggable,isResizable:x.isResizable,resizeHandles:x.resizeHandles,isBounded:x.isBounded}):c.push({i:S,x:0,y:x4(c),w:1,h:1})}});const p=YJ(c,{cols:a});return l.compact(p,a)}function ute(e){const{children:n,width:a,gridConfig:l,dragConfig:c,resizeConfig:u,dropConfig:p,positionStrategy:m=ree,compactor:S,constraints:v=iH,layout:C=[],droppingItem:x,autoSize:w=!0,className:M="",style:N={},innerRef:T,onLayoutChange:$=Gu,onDragStart:z=Gu,onDrag:D=Gu,onDragStop:A=Gu,onResizeStart:I=Gu,onResize:j=Gu,onResizeStop:V=Gu,onDrop:B=Gu,onDropDragOver:L=Gu}=e,P=_.useMemo(()=>({...lee,...l}),[l]),G=_.useMemo(()=>({...iee,...c}),[c]),F=_.useMemo(()=>({...see,...u}),[u]),W=_.useMemo(()=>({...cee,...p}),[p]),{cols:k,rowHeight:ne,maxRows:re,margin:q,containerPadding:K}=P,{enabled:J,bounded:ae,handle:Z,cancel:le,threshold:oe}=G,{enabled:te,handles:ue,handleComponent:ce}=F,{enabled:fe,defaultItem:ie,onDragOver:ge}=W,Ce=S??pee(),de=Ce.type,se=Ce.allowOverlap,pe=Ce.preventCollision??!1,Te=_.useMemo(()=>x??{i:"__dropping-elem__",...ie},[x,ie]),we=m.type==="transform",be=m.scale,Ne=K??q,[xe,ze]=_.useState(!1),[Me,qe]=_.useState(()=>AD(C,n,k,Ce)),[Xe,Ge]=_.useState(null),[it,nt]=_.useState(!1),[ut,_t]=_.useState(null),[bt,St]=_.useState(),Pt=_.useRef(null),yt=_.useRef(null),at=_.useRef(null),ft=_.useRef(0),ht=_.useRef(Me),dt=_.useRef(C),rt=_.useRef(n),Dt=_.useRef(de),Vt=_.useRef(Me);Vt.current=Me,_.useEffect(()=>{ze(!0),_y(Me,C)||$(Me)},[]),_.useEffect(()=>{if(Xe||ut)return;const Ie=!_y(C,dt.current),ot=!cte(n,rt.current),ct=de!==Dt.current;if(Ie||ot||ct){const Mt=AD(Ie?C:Me,n,k,Ce);_y(Mt,Me)||qe(Mt)}dt.current=C,rt.current=n,Dt.current=de},[C,n,k,de,Ce,Xe,ut,Me]),_.useEffect(()=>{if(!Xe&&!_y(Me,ht.current)){ht.current=Me;const Ie=Me.filter(ot=>ot.i!==Te.i);$(Ie)}},[Me,Xe,$,Te.i]);const Ht=_.useMemo(()=>{if(!w)return;const Ie=x4(Me),ot=Ne[1];return Ie*ne+(Ie-1)*q[1]+ot*2+"px"},[w,Me,ne,q,Ne]),Mn=_.useCallback((Ie,ot,ct,Nt)=>{const Mt=Vt.current,gt=Pm(Mt,Ie);if(!gt)return;const Ut={w:gt.w,h:gt.h,x:gt.x,y:gt.y,i:Ie};Pt.current=eb(gt),at.current=Mt,Ge(Ut),z(Mt,gt,gt,null,Nt.e,Nt.node)},[z]),At=_.useCallback((Ie,ot,ct,Nt)=>{const Mt=Vt.current,gt=Pt.current,Ut=Pm(Mt,Ie);if(!Ut)return;const pn={w:Ut.w,h:Ut.h,x:Ut.x,y:Ut.y,i:Ie},mt=Wm(Mt,Ut,ot,ct,!0,pe,de,k,se);D(mt,gt,Ut,pn,Nt.e,Nt.node),qe(Ce.compact(mt,k)),Ge(pn)},[pe,de,k,se,Ce,D]),Kt=_.useCallback((Ie,ot,ct,Nt)=>{if(!Xe)return;const Mt=Vt.current,gt=Pt.current,Ut=Pm(Mt,Ie);if(!Ut)return;const pn=Wm(Mt,Ut,ot,ct,!0,pe,de,k,se),mt=Ce.compact(pn,k);A(mt,gt,Ut,null,Nt.e,Nt.node);const kt=at.current;Pt.current=null,at.current=null,Ge(null),qe(mt),kt&&!_y(kt,mt)&&$(mt)},[Xe,pe,de,k,se,Ce,A,$]),Ct=_.useCallback((Ie,ot,ct,Nt)=>{const Mt=Vt.current,gt=Pm(Mt,Ie);gt&&(yt.current=eb(gt),at.current=Mt,nt(!0),I(Mt,gt,gt,null,Nt.e,Nt.node))},[I]),Rt=_.useCallback((Ie,ot,ct,Nt)=>{const Mt=Vt.current,gt=yt.current,{handle:Ut}=Nt;let pn=!1,mt,kt;const[wt,jt]=GJ(Mt,Ie,Gt=>(mt=Gt.x,kt=Gt.y,["sw","w","nw","n","ne"].includes(Ut)&&(["sw","nw","w"].includes(Ut)&&(mt=Gt.x+(Gt.w-ot),ot=Gt.x!==mt&&mt<0?Gt.w:ot,mt=mt<0?0:mt),["ne","n","nw"].includes(Ut)&&(kt=Gt.y+(Gt.h-ct),ct=Gt.y!==kt&&kt<0?Gt.h:ct,kt=kt<0?0:kt),pn=!0),pe&&!se&&lH(Mt,{...Gt,w:ot,h:ct,x:mt??Gt.x,y:kt??Gt.y}).filter(no=>no.i!==Gt.i).length>0&&(kt=Gt.y,ct=Gt.h,mt=Gt.x,ot=Gt.w,pn=!1),Gt.w=ot,Gt.h=ct,Gt));if(!jt)return;let Jt=wt;pn&&mt!==void 0&&kt!==void 0&&(Jt=Wm(wt,jt,mt,kt,!0,pe,de,k,se));const zn={w:jt.w,h:jt.h,x:jt.x,y:jt.y,i:Ie,static:!0};j(Jt,gt,jt,zn,Nt.e,Nt.node),qe(Ce.compact(Jt,k)),Ge(zn)},[pe,de,k,se,Ce,j]),$t=_.useCallback((Ie,ot,ct,Nt)=>{const Mt=Vt.current,gt=yt.current,Ut=Pm(Mt,Ie),pn=Ce.compact(Mt,k);V(pn,gt,Ut??null,null,Nt.e,Nt.node);const mt=at.current;yt.current=null,at.current=null,Ge(null),nt(!1),qe(pn),mt&&!_y(mt,pn)&&$(pn)},[k,Ce,V,$]),Ye=_.useCallback(()=>{const Ie=Vt.current;if(!Ie.some(Nt=>Nt.i===Te.i)){_t(null),Ge(null),St(void 0);return}const ct=Ce.compact(Ie.filter(Nt=>Nt.i!==Te.i),k);qe(ct),_t(null),Ge(null),St(void 0)},[Te.i,k,Ce]),pt=_.useCallback(Ie=>{if(Ie.preventDefault(),Ie.stopPropagation(),OH&&!Ie.nativeEvent.target?.classList.contains(DD))return!1;const ot=ge?ge(Ie.nativeEvent):L(Ie);if(ot===!1)return ut&&Ye(),!1;const{dragOffsetX:ct=0,dragOffsetY:Nt=0,...Mt}=ot??{},gt={...Te,...Mt},Ut=Ie.currentTarget.getBoundingClientRect(),pn={cols:k,margin:q,maxRows:re,rowHeight:ne,containerWidth:a,containerPadding:Ne},mt=cb(pn),kt=Jy(gt.w,mt,q[0]),wt=Jy(gt.h,ne,q[1]),jt=kt/2,Jt=wt/2,zn=Ie.clientX-Ut.left+ct-jt,Gt=Ie.clientY-Ut.top+Nt-Jt,In=Math.max(0,zn),no=Math.max(0,Gt),Eo={left:In/be,top:no/be,e:Ie.nativeEvent};if(ut)bt&&(bt.left!==Eo.left||bt.top!==Eo.top)&&St(Eo);else{const cn=VJ(pn,no,In,gt.w,gt.h);_t(X.jsx("div",{},gt.i)),St(Eo),qe([...Vt.current,{...gt,x:cn.x,y:cn.y,static:!1,isDraggable:!0}])}},[ut,bt,Te,ge,L,Ye,be,k,q,re,ne,a,Ne]),st=_.useCallback(Ie=>{Ie.preventDefault(),Ie.stopPropagation(),ft.current--,ft.current<0&&(ft.current=0),ft.current===0&&Ye()},[Ye]),xt=_.useCallback(Ie=>{Ie.preventDefault(),Ie.stopPropagation(),ft.current++},[]),lt=_.useCallback(Ie=>{Ie.preventDefault(),Ie.stopPropagation();const ot=Vt.current,ct=ot.find(Nt=>Nt.i===Te.i);ft.current=0,Ye(),B(ot,ct,Ie.nativeEvent)},[Te.i,Ye,B]),Fe=_.useCallback((Ie,ot)=>{if(!Ie||!Ie.key)return null;const ct=Pm(Me,String(Ie.key));if(!ct)return null;const Nt=typeof ct.isDraggable=="boolean"?ct.isDraggable:!ct.static&&J,Mt=typeof ct.isResizable=="boolean"?ct.isResizable:!ct.static&&te,gt=ct.resizeHandles||[...ue],Ut=Nt&&ae&&ct.isBounded!==!1,pn=ce;return X.jsx(zD,{containerWidth:a,cols:k,margin:q,containerPadding:Ne,maxRows:re,rowHeight:ne,cancel:le,handle:Z,onDragStart:Mn,onDrag:At,onDragStop:Kt,onResizeStart:Ct,onResize:Rt,onResizeStop:$t,isDraggable:Nt,isResizable:Mt,isBounded:Ut,useCSSTransforms:we&&xe,usePercentages:!xe,transformScale:be,positionStrategy:m,dragThreshold:oe,w:ct.w,h:ct.h,x:ct.x,y:ct.y,i:ct.i,minH:ct.minH,minW:ct.minW,maxH:ct.maxH,maxW:ct.maxW,static:ct.static,droppingPosition:ot?bt:void 0,resizeHandles:gt,resizeHandle:pn,constraints:v,layoutItem:ct,layout:Me,children:Ie},ct.i)},[Me,a,k,q,Ne,re,ne,le,Z,Mn,At,Kt,Ct,Rt,$t,J,te,ae,we,xe,be,m,oe,bt,ue,ce,v]),tt=()=>Xe?X.jsx(zD,{w:Xe.w,h:Xe.h,x:Xe.x,y:Xe.y,i:Xe.i,className:`react-grid-placeholder ${it?"placeholder-resizing":""}`,containerWidth:a,cols:k,margin:q,containerPadding:Ne,maxRows:re,rowHeight:ne,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:we,transformScale:be,constraints:v,layout:Me,children:X.jsx("div",{})}):null,Ve=me(DD,M),Je={height:Ht,...N};return X.jsxs("div",{ref:T,className:Ve,style:Je,onDrop:fe?lt:void 0,onDragLeave:fe?st:void 0,onDragEnter:fe?xt:void 0,onDragOver:fe?pt:void 0,children:[_.Children.map(n,Ie=>_.isValidElement(Ie)?Fe(Ie):null),fe&&ut&&Fe(ut,!0),tt()]})}function dte(e){return e instanceof HTMLElement?!!e.closest([".cps-bi-builder__widget-card-toolbar","button","input","textarea","select","option","label","a",'[role="button"]','[role="checkbox"]','[role="switch"]','[role="combobox"]','[role="option"]',".ant-select",".ant-picker"].join(", ")):!1}function fte({component:e,mode:n,selected:a,configPanelOpen:l,unauthorized:c,interactionLocked:u,onSelect:p,onOpenSettings:m,onDuplicate:S,onDelete:v,children:C}){const x=Kf(e.styleConfig),w=x.showCard,M=n==="edit";if(!M&&!w&&!e.baseConfig.showTitle)return X.jsx("div",{className:"cps-bi-builder__widget-content-plain",children:C});const N=["cps-bi-builder__widget-card",M?"is-editable":"",a?"is-selected":"",w?"":"is-card-hidden"].filter(Boolean).join(" ");return X.jsxs("div",{className:N,"data-layout-h":e.layout.h,"data-layout-y":e.layout.y,"data-testid":`builder-widget-${e.uniqueCode}`,onClick:T=>{!M||u||!l||dte(T.target)||p(e.id)},onKeyDown:T=>{!M||u||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),m(e.id))},tabIndex:M?0:-1,style:{"--cps-bi-builder-widget-card-padding":`${w?x.cardPadding:0}px`,"--cps-bi-builder-widget-card-background":x.cardBackgroundColor,"--cps-bi-builder-widget-card-border":x.cardBorderColor,"--cps-bi-builder-widget-card-radius":`${x.cardBorderRadius}px`},children:[M?X.jsxs("div",{className:"cps-bi-builder__widget-card-toolbar",onClick:T=>{T.stopPropagation()},onMouseDown:T=>{T.stopPropagation()},onPointerDown:T=>{T.stopPropagation()},children:[c?null:X.jsx(Pn,{"aria-label":"设置",icon:X.jsx(lM,{}),onClick:T=>{T.stopPropagation(),m(e.id)},size:"small",type:"text"}),c?null:X.jsx(Pn,{"aria-label":"复制",icon:X.jsx(eM,{}),onClick:T=>{T.stopPropagation(),S(e.id)},size:"small",type:"text"}),X.jsx(Pn,{"aria-label":"删除",icon:X.jsx(tM,{}),onClick:T=>{T.stopPropagation(),v(e.id)},size:"small",type:"text"})]}):null,X.jsxs("div",{className:`cps-bi-builder__widget-card-surface${w?"":" is-card-hidden"}`,children:[e.baseConfig.showTitle?X.jsx("div",{className:"cps-bi-builder__widget-card-header",children:X.jsx("h3",{className:"cps-bi-builder__widget-card-title",children:e.baseConfig.title||e.widgetCode})}):null,X.jsx("div",{className:"cps-bi-builder__widget-card-content",children:C})]})]})}const pte=_.memo(fte);function mte(e){const{widgetCode:n,widgetName:a}=e;return X.jsx(Bc,{className:"cps-bi-builder__widget-state",description:"当前用户未开通该组件授权,请联系管理员。",kind:"unauthorized",title:"组件未授权"})}function mw(e,n=0){if(e===null)return"null";if(typeof e>"u")return"undefined";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return n>=2?`array:${e.length}`:`array:${e.length}:${e.slice(0,3).map(a=>mw(a,n+1)).join("|")}`;if(typeof e=="object"){const a=e,l=Object.keys(a).sort();return n>=2?`object:${l.join(",")}`:`object:${l.slice(0,6).map(c=>`${c}:${mw(a[c],n+1)}`).join("|")}`}return typeof e}class hte extends _.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}componentDidUpdate(n){n.resetKey!==this.props.resetKey&&this.state.error&&this.setState({error:null})}render(){return this.state.error?this.props.fallback:this.props.children}}function gte({dashboardCode:e,runtime:n,resolveComponent:a,builderDataResolveEnabled:l,unauthorized:c,notifyUpdate:u,onReceiveUpdate:p}){const{widgetMap:m}=rd(),S=m.get(n.widgetCode),{active:v,data:C,error:x,loading:w}=aH({dashboardCode:e,component:a,customConfig:n.customConfig,enabled:l,onReceiveUpdate:p,scene:"builder-edit",uniqueCode:n.uniqueCode,widgetCode:n.widgetCode}),M=[n.uniqueCode,mw(n.customConfig),w?"loading":"ready",x?"resolve-error":"resolve-ok",mw(C)].join("::");if(c)return X.jsx(mte,{widgetCode:n.widgetCode,widgetName:S?.name});if(!S)return X.jsx(Bc,{className:"cps-bi-builder__widget-state",description:`当前环境未注册组件 ${n.widgetCode},请检查 widgets 注册表。`,kind:"error",title:"组件未注册"});if(l&&v&&x)return X.jsx(Bc,{className:"cps-bi-builder__widget-state",description:"请检查 dataSource adapter 返回结果、网络请求或运行时数据结构。",kind:"error",title:"组件数据解析失败"});const N=S.component;return X.jsx(hte,{fallback:X.jsx(Bc,{className:"cps-bi-builder__widget-state",description:"组件运行时抛出了异常,请检查组件实现。",kind:"error",title:"组件渲染失败"}),resetKey:M,children:X.jsx(N,{config:n.customConfig,context:{dashboardCode:e,mode:"builder"},data:l&&v&&!w?C:void 0,notifyUpdate:u,onReceiveUpdate:p,uniqueCode:n.uniqueCode,widgetCode:n.widgetCode})})}const yte=_.memo(gte),MH=_.createContext(null);function bte(e,n){if(e===n)return!0;if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}function vte(e){let n=e;const a=new Set;return{getSnapshot:()=>n,subscribe(l){return a.add(l),()=>{a.delete(l)}},setSnapshot(l){if(n.mode!==l.mode||n.interactionLocked!==l.interactionLocked||n.selectedComponentId!==l.selectedComponentId||n.dashboardCode!==l.dashboardCode||n.builderDataResolveEnabled!==l.builderDataResolveEnabled||!bte(n.unauthorizedWidgetCodes,l.unauthorizedWidgetCodes)){n=l;for(const u of a)u()}}}}function Ste({store:e,mode:n,interactionLocked:a,selectedComponentId:l,unauthorizedWidgetCodes:c,dashboardCode:u,builderDataResolveEnabled:p,getWidgetHandler:m,onSelectComponent:S,onOpenComponentSettings:v,onDuplicateComponent:C,onDeleteComponent:x,children:w}){const M=_.useRef(m);M.current=m;const N=_.useRef(S);N.current=S;const T=_.useRef(v);T.current=v;const $=_.useRef(C);$.current=C;const z=_.useRef(x);z.current=x;const D=_.useRef(vte({mode:n,interactionLocked:a,selectedComponentId:l,unauthorizedWidgetCodes:c,dashboardCode:u,builderDataResolveEnabled:p}));_.useLayoutEffect(()=>{D.current.setSnapshot({mode:n,interactionLocked:a,selectedComponentId:l,unauthorizedWidgetCodes:c,dashboardCode:u,builderDataResolveEnabled:p})},[p,u,a,n,l,c]);const A=_.useCallback(P=>M.current(P),[]),I=_.useCallback(P=>{N.current(P)},[]),j=_.useCallback(P=>{T.current(P)},[]),V=_.useCallback(P=>{$.current(P)},[]),B=_.useCallback(P=>{z.current(P)},[]),L=_.useMemo(()=>({store:e,stateStore:D.current,getWidgetHandler:A,selectComponent:I,openComponentSettings:j,duplicateComponent:V,deleteComponent:B}),[B,V,A,j,I,e]);return X.jsx(MH.Provider,{value:L,children:w})}const Cte=_.memo(Ste);function A4(){const e=_.useContext(MH);if(!e)throw new Error("useCanvasStageNodeContext 必须在 CanvasStageNodeProvider 内使用。");return e}function Lf(e,n=Object.is){const{stateStore:a}=A4(),l=_.useRef(e);l.current=e;const c=_.useRef(n);c.current=n;const u=_.useRef(e(a.getSnapshot())),p=_.useCallback(()=>{const m=l.current(a.getSnapshot());return c.current(u.current,m)?u.current:(u.current=m,m)},[a]);return _.useSyncExternalStore(_.useCallback(m=>a.subscribe(()=>{const S=l.current(a.getSnapshot());c.current(u.current,S)||(u.current=S,m())}),[a]),p,p)}function xte(e,n){return e===n?!0:!e||!n?!1:e.kind===n.kind&&e.widgetCode===n.widgetCode&&e.uniqueCode===n.uniqueCode&&e.customConfig===n.customConfig}function Ete({componentId:e}){const{getWidgetHandler:n,store:a}=A4(),l=Yy(a,_.useCallback(()=>a.selectComponentRuntimeById(e),[a,e])),c=Yy(a,_.useCallback(()=>a.selectComponentById(e),[a,e]),xte),u=Lf(_.useCallback(x=>l?x.unauthorizedWidgetCodes.has(l.widgetCode):!1,[l])),p=Lf(_.useCallback(x=>x.dashboardCode,[])),m=Lf(_.useCallback(x=>x.builderDataResolveEnabled,[]));if(!l||!c)return null;const S=n(e),v=S?.notifyUpdate??(()=>{}),C=S?.onReceiveUpdate??(()=>()=>{});return X.jsx(yte,{dashboardCode:p,builderDataResolveEnabled:m,notifyUpdate:v,onReceiveUpdate:C,resolveComponent:c,runtime:l,unauthorized:u})}const wte=_.memo(Ete);function $te({componentId:e}){const{store:n,deleteComponent:a,duplicateComponent:l,openComponentSettings:c,selectComponent:u}=A4(),p=Yy(n,_.useCallback(()=>n.selectComponentShellById(e),[n,e])),m=Lf(_.useCallback(w=>w.mode,[])),S=Lf(_.useCallback(w=>w.selectedComponentId===e,[e])),v=Lf(_.useCallback(w=>w.selectedComponentId!==null,[])),C=Lf(_.useCallback(w=>w.interactionLocked,[])),x=Lf(_.useCallback(w=>p?w.unauthorizedWidgetCodes.has(p.widgetCode):!1,[p]));return p?X.jsx(pte,{component:p,configPanelOpen:v,interactionLocked:C,mode:m,onDelete:a,onDuplicate:l,onOpenSettings:c,onSelect:u,selected:S,unauthorized:x,children:X.jsx(wte,{componentId:e})}):null}const Rte=_.memo($te);function Tte(e){const{store:n,layout:a,componentIds:l,dashboardCode:c,canEdit:u,handMode:p,interactionLocked:m,interactionActive:S,selectedComponentId:v,builderDataResolveEnabled:C,unauthorizedWidgetCodes:x,getWidgetHandler:w,onOpenComponentSettings:M,onDuplicateComponent:N,onDeleteComponent:T,onLayoutStart:$,onLayoutStop:z,onResizeStart:D,onResize:A,compactor:I,frameMetrics:j,cols:V,rowHeight:B,margin:L,padding:P,prefixCls:G,positionStrategy:F}=e;return X.jsx(Cte,{dashboardCode:c,getWidgetHandler:w,interactionLocked:m||!u,mode:u?"edit":"preview",builderDataResolveEnabled:C,onDeleteComponent:T,onDuplicateComponent:N,onOpenComponentSettings:M,onSelectComponent:M,selectedComponentId:v,store:n,unauthorizedWidgetCodes:x,children:X.jsx(ute,{autoSize:!1,className:`cps-bi-builder__grid-layout${S?" is-animated":""}`,compactor:I,dragConfig:{enabled:u&&!p,cancel:`.cps-bi-builder__widget-card-toolbar, .cps-bi-builder__widget-card-toolbar *, button, input, textarea, select, option, .${G}-select, .${G}-select *, .cps-bi-builder__zoom-overlay, .cps-bi-builder__zoom-overlay *`},gridConfig:{cols:V,rowHeight:B,margin:L,containerPadding:P},layout:a,onDragStart:$,onDragStop:z,onResizeStart:D,onResize:A,onResizeStop:z,positionStrategy:F,resizeConfig:{enabled:u&&!p,handles:["w","e","sw","s","se"]},style:{height:`${j.canvasHeight}px`},width:j.canvasWidth,children:l.map(W=>X.jsx("div",{children:X.jsx(Rte,{componentId:W})},W))})})}function Ote(e){const{mode:n,componentCount:a,isScreenMode:l,zoomScale:c,frameMetrics:u,settings:p,backgroundStyle:m,children:S}=e,[v,C]=p.padding;return X.jsxs("div",{className:`cps-bi-builder__canvas-content${l?" is-screen-mode":" is-responsive-mode"}`,"data-testid":"builder-canvas-content",style:{width:l?`${u.canvasWidth}px`:u.responsiveFluid?"100%":`${u.canvasWidth}px`,height:`${u.canvasHeight}px`,minHeight:l?void 0:u.responsiveFluid?"100%":`${Math.max(u.canvasHeight,u.viewportInnerHeight)}px`,transform:l?`scale(${c})`:"none",transformOrigin:"left top",...m},children:[p.showGrid?X.jsx("div",{className:"cps-bi-builder__canvas-grid-lines",style:{backgroundImage:["linear-gradient(to right, rgba(37, 58, 93, 0.05) 1px, transparent 1px)","linear-gradient(to bottom, rgba(37, 58, 93, 0.05) 1px, transparent 1px)"].join(","),backgroundPosition:[`${v}px ${C}px`,`${v}px ${C}px`].join(","),backgroundSize:[`${u.gridStepX}px ${u.gridStepY}px`,`${u.gridStepX}px ${u.gridStepY}px`].join(",")}}):null,S,a===0?X.jsx("div",{className:"cps-bi-builder__canvas-empty",children:X.jsx(os,{description:n==="preview"?"预览模式下暂无组件":"画布暂无组件,请先添加组件"})}):null]})}const Mte=180,_D=5,NH={s:"ns-resize",w:"ew-resize",e:"ew-resize",sw:"nesw-resize",se:"nwse-resize"};function zH(e){if(!(e instanceof Element))return null;const n=e.closest('[class*="react-resizable-handle-"]');if(!n)return null;for(const a of Array.from(n.classList)){const l=a.match(/react-resizable-handle-([nesw]{1,2})/);if(!l)continue;const c=l[1];return c in NH?c:null}return null}function Nte(e){const n=zH(e);return n?NH[n]:null}function zte(e){return!!e?.includes("s")}function BD(e){return e instanceof MouseEvent?e.clientY:null}function Dte(e){const{store:n,canvasLayoutSnapshot:a,dashboardCode:l,mode:c,readonly:u,selectedComponentId:p,builderDataResolveEnabled:m,onOpenComponentSettings:S,onDuplicateComponent:v,onDeleteComponent:C,onUpdateComponentLayouts:x,unauthorizedWidgetCodes:w}=e,{prefixCls:M,widgetMap:N}=rd(),[T,$]=_.useState(!1),[z,D]=_.useState(!1),[A,I]=_.useState(null),[j,V]=_.useState(null),B=_.useRef(null),L=_.useRef(null),P=_.useRef(null),G=a.settings??{canvasMode:"responsive",cols:24,rowHeight:10,margin:[8,8],padding:[8,8],bgColor:"#ffffff",showGrid:!0,minWidth:960,defaultComponentCols:8,defaultComponentRows:16,collisionReflowMode:"push"},F=G.canvasMode==="screen",W=G.collisionReflowMode==="block"?"block":"push",k=!u&&c==="edit",ne=_.useMemo(()=>nH(G),[G]),re=_.useMemo(()=>W==="block"?{...dee,preventCollision:!0}:M4,[W]),q=_.useMemo(()=>a.items.map(it=>{const nt=n.selectComponentById(it.id);if(!nt)return{...it.layout,i:it.id,minW:1,minH:1};const ut=N.get(nt.widgetCode);return{...it.layout,i:it.id,minW:ut?.minWidth??1,minH:ut?.minHeight??1}}),[a.items,n,N]),K=Oee(L),J=Mee({isScreenMode:F,layout:q,screenSize:ne,settings:G,viewportSize:K}),ae=j===null||F?J:{...J,canvasHeight:j},{applyZoomValue:Z,handMode:le,handleScrollerMouseDown:oe,panning:te,showZoomOverlay:ue,spacePressed:ce,zoomLayerStyle:fe,zoomPercent:ie,zoomScale:ge}=Ree({canvasHeight:ae.canvasHeight,canvasWidth:ae.canvasWidth,isScreenMode:F,scrollerRef:L}),{startAutoPan:Ce,stopAutoPan:de,updatePointerClientY:se}=bee({enabled:!F,scrollerRef:L}),pe=zee(n,a.componentIds),Te=_.useMemo(()=>({...kO,scale:ge}),[ge]);_.useEffect(()=>{if(!A)return;const it=document.body.style.cursor,nt=document.documentElement.style.cursor;return document.body.style.cursor=A,document.documentElement.style.cursor=A,()=>{document.body.style.cursor=it,document.documentElement.style.cursor=nt}},[A]),_.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]),_.useEffect(()=>{F&&(de(),D(!1),$(!1),V(null),P.current=null)},[F,de]);const we=()=>{B.current&&window.clearTimeout(B.current),$(!0),B.current=window.setTimeout(()=>{$(!1),B.current=null},Mte)},be=it=>{if(F)return;const nt=dH({layout:it,rowHeight:G.rowHeight,marginY:G.margin[1],paddingY:G.padding[1],viewportInnerHeight:J.viewportInnerHeight});V(ut=>ut===nt?ut:nt)},Ne=it=>{P.current=null,de(),V(null),I(null),D(!1),we(),x(it.map(nt=>({componentId:String(nt.i),layout:{x:nt.x,y:nt.y,w:nt.w,h:nt.h}})))},xe=()=>{B.current&&(window.clearTimeout(B.current),B.current=null),D(!0),$(!0)},ze=(...it)=>{xe();const nt=it[4];if(!(nt instanceof Event))return;P.current=zH(nt.target);const ut=Nte(nt.target);if(ut&&I(ut),zte(P.current)){Ce(BD(nt));return}de()},Me=(...it)=>{const nt=it[0];Array.isArray(nt)&&be(nt),se(BD(it[4]))},qe=T||le,Xe=G.bgImageUrl?{backgroundColor:G.bgColor,backgroundImage:`url("${G.bgImageUrl}")`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}:{backgroundColor:G.bgColor},Ge=X.jsx(Ote,{backgroundStyle:Xe,componentCount:a.componentIds.length,frameMetrics:ae,isScreenMode:F,mode:c,settings:G,zoomScale:ge,children:X.jsx(Tte,{canEdit:k,cols:G.cols,compactor:re,componentIds:a.componentIds,dashboardCode:l,frameMetrics:ae,getWidgetHandler:pe,handMode:le,interactionActive:z,interactionLocked:qe,layout:q,margin:G.margin,builderDataResolveEnabled:m,onDeleteComponent:C,onDuplicateComponent:v,onLayoutStart:xe,onLayoutStop:Ne,onOpenComponentSettings:S,onResize:Me,onResizeStart:ze,padding:G.padding,positionStrategy:F?Te:kO,prefixCls:M,rowHeight:G.rowHeight,selectedComponentId:p,store:n,unauthorizedWidgetCodes:w})});return X.jsxs("section",{className:`cps-bi-builder__canvas${F?" is-screen-mode":" is-responsive-mode"}${z?" is-interaction-active":""}${le?" is-hand-mode":""}${te?" is-panning":""}`,"data-testid":"builder-canvas",children:[F&&(ue||ie!==100)?X.jsxs("div",{className:"cps-bi-builder__zoom-overlay","data-testid":"builder-canvas-zoom-overlay",children:[X.jsx("button",{"aria-label":"缩小 5%",onClick:()=>Z(ie-_D),type:"button",children:X.jsx(aM,{})}),X.jsxs("span",{className:"cps-bi-builder__zoom-overlay-value","data-testid":"builder-canvas-zoom-percent",children:[ie,"%"]}),X.jsx("button",{"aria-label":"放大 5%",onClick:()=>Z(ie+_D),type:"button",children:X.jsx(vw,{})}),X.jsx("button",{"aria-label":"还原 100%",onClick:()=>Z(100),type:"button",children:X.jsx(yA,{})})]}):null,X.jsx("div",{className:`cps-bi-builder__canvas-scroller${F&&ce?" is-space-active":""}${te?" is-panning":""}`,"data-testid":"builder-canvas-viewport",onMouseDown:oe,ref:L,children:F?X.jsx("div",{className:"cps-bi-builder__canvas-zoom-layer","data-testid":"builder-canvas-zoom-layer",style:fe,children:Ge}):Ge})]})}function Ate(e){const{getContainer:n,onCancel:a,onConfirm:l,open:c}=e;return X.jsx(Cr,{centered:!0,cancelText:"取消",getContainer:n,okText:"确认清空",onCancel:a,onOk:l,open:c,title:"确认清空画布",children:"清空后无法恢复,确定清空?"})}const _te={by:"widgetCode",values:[]};function Bte(e){const{dashboardCode:n,selectedComponent:a,components:l,readonly:c,onClose:u,onUpdateSelectedComponent:p,unauthorizedWidgetCodes:m}=e,{services:S,widgetMap:v}=rd();if(!a)return null;const C=v.get(a.widgetCode),x=C?.configComponent,w=m.has(a.widgetCode),M=Kf(a.styleConfig),N=a.linkageConfig.target??_te,T=l.filter(j=>j.id!==a.id).map(j=>({label:`${j.baseConfig.title||j.widgetCode}(${j.uniqueCode})`,value:j.uniqueCode})),$=new Set;for(const j of l)$.add(j.widgetCode);const z=Array.from($).map(j=>{const V=v.get(j);return{label:V?`${V.name}(${j})`:j,value:j}}),D=N.by==="uniqueCode"?T:z,A=j=>{p(j)},I=[{key:"base",label:"基础信息",children:X.jsxs(It,{className:"cps-bi-builder__config-form",layout:"vertical",children:[X.jsx(It.Item,{label:"组件类型名称",children:X.jsx(ea,{"aria-label":"组件类型名称",disabled:!0,value:C?.name??a.widgetCode})}),X.jsx(It.Item,{label:"组件唯一编码",children:X.jsx(ea,{"aria-label":"组件唯一编码",disabled:!0,value:a.uniqueCode})}),X.jsx(It.Item,{label:"显示标题",children:X.jsx(Ff,{checked:a.baseConfig.showTitle,disabled:c,onChange:j=>{A({type:"base",patch:{showTitle:j}})}})}),a.baseConfig.showTitle?X.jsx(It.Item,{label:"组件标题",children:X.jsx(ea,{"aria-label":"组件标题",disabled:c,onChange:j=>{A({type:"base",patch:{title:j.target.value}})},value:a.baseConfig.title})}):null]})},{key:"appearance",label:"容器外观",children:X.jsxs(It,{className:"cps-bi-builder__config-form",layout:"vertical",children:[X.jsx(It.Item,{label:"显示卡片",children:X.jsx(Ff,{checked:M.showCard,disabled:c,onChange:j=>{A({type:"style",patch:{showCard:j}})}})}),X.jsx(It.Item,{label:"卡片内边距",children:X.jsx(ai,{"aria-label":"卡片内边距",className:"cps-bi-builder__field-control",disabled:c,min:0,onChange:j=>{typeof j=="number"&&A({type:"style",patch:{cardPadding:j}})},value:M.cardPadding})}),X.jsx(It.Item,{label:"卡片背景色",children:X.jsx(ea,{"aria-label":"卡片背景色",disabled:c,onChange:j=>{A({type:"style",patch:{cardBackgroundColor:j.target.value||void 0}})},value:M.cardBackgroundColor})}),X.jsx(It.Item,{label:"边框颜色",children:X.jsx(ea,{"aria-label":"边框颜色",disabled:c,onChange:j=>{A({type:"style",patch:{cardBorderColor:j.target.value||void 0}})},value:M.cardBorderColor})}),X.jsx(It.Item,{label:"圆角",children:X.jsx(ai,{"aria-label":"圆角",className:"cps-bi-builder__field-control",disabled:c,min:0,onChange:j=>{typeof j=="number"&&A({type:"style",patch:{cardBorderRadius:j}})},value:M.cardBorderRadius})})]})},{key:"linkage",label:"联动目标",children:X.jsxs(It,{className:"cps-bi-builder__config-form",layout:"vertical",children:[X.jsx(It.Item,{label:"联动目标类型",children:X.jsx(ia,{"aria-label":"联动目标类型",disabled:c,onChange:j=>{A({type:"linkage",target:{by:j,values:[]}})},options:[{label:"按组件唯一编码",value:"uniqueCode"},{label:"按组件类型编码",value:"widgetCode"}],value:N.by})}),X.jsx(It.Item,{label:"联动目标列表",children:X.jsx(ia,{"aria-label":"联动目标列表",disabled:c,mode:"multiple",onChange:j=>{A({type:"linkage",target:{by:N.by,values:Array.isArray(j)?j:j?[j]:[]}})},options:D,placeholder:N.by==="uniqueCode"?"请选择目标组件":"请选择目标组件类型",value:N.values})})]})}];return x&&I.push({key:"custom",label:"自定义配置",children:X.jsx("section",{className:"cps-bi-builder__config-section",children:X.jsx(x,{context:{dashboardCode:n,kind:a.kind,mode:"builder",uniqueCode:a.uniqueCode,widgetCode:a.widgetCode},onChange:j=>{A({type:"custom",config:j})},services:S,value:a.customConfig})})}),X.jsx("aside",{className:"cps-bi-builder__config",children:w?X.jsxs("div",{className:"cps-bi-builder__config-alert",children:[X.jsx("div",{className:"cps-bi-builder__config-alert-actions",children:X.jsx(Pn,{"aria-label":"关闭配置面板",icon:X.jsx(jc,{}),onClick:u,type:"text"})}),X.jsx(c1,{description:`当前环境未获得组件 ${C?.name??a.widgetCode}(${a.widgetCode})的使用权限,设计态仅保留占位提示。请联系管理员开通授权或替换当前组件。`,icon:X.jsx(oM,{}),title:"当前组件不可配置",showIcon:!0,type:"warning"})]}):X.jsx(jw,{className:"cps-bi-builder__config-tabs",items:I,tabBarExtraContent:X.jsx(Pn,{"aria-label":"关闭配置面板",icon:X.jsx(jc,{}),onClick:u,type:"text"}),tabBarGutter:8})})}function Hte(e){_.useEffect(()=>{if(!e)return;const n=a=>{a.preventDefault(),Reflect.set(a,"returnValue","")};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[e])}function jte(e,n){const[a,l]=_.useState(null),[c,u]=_.useState(!1);_.useEffect(()=>{let v=!0;async function C(){if(!e.getAuthorizedWidgetCodes){l(null),u(!0);return}u(!1);try{const x=await e.getAuthorizedWidgetCodes({categories:["extension"]});if(!v)return;l(new Set(x)),u(!0)}catch{if(!v)return;l(null),u(!0)}}return C(),()=>{v=!1}},[e]);const p=_.useMemo(()=>{if(!e.getAuthorizedWidgetCodes||!c||!n)return new Set;const v=new Set;for(const C of n.components)C.kind==="extension"&&(a?.has(C.widgetCode)||v.add(C.widgetCode));return v},[c,a,n,e]),m=_.useMemo(()=>!!n?.components.some(v=>v.kind==="extension"),[n]),S=_.useMemo(()=>e.getAuthorizedWidgetCodes&&!c&&m?"正在校验扩展组件授权,请稍后再试。":p.size>0?"当前仪表盘包含未授权组件,禁止保存和发布。":null,[c,m,e,p]);return{authorizationReady:c,unauthorizedWidgetCodes:p,persistenceBlockedReason:S}}function ZS(e,n,a){return Math.max(n,Math.min(a,e))}function DH(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}function Ite(e){return`${e.id}::${e.code}`}function AH(e){return e.reduce((n,a)=>Math.max(n,a.layout.y+a.layout.h),0)}function _H(e,n){return e.x===n.x&&e.y===n.y&&e.w===n.w&&e.h===n.h}function BH(e,n){return e.title===n.title&&e.showTitle===n.showTitle}function HH(e,n){const a=Kf(e);return a.showCard===n.showCard&&a.cardPadding===n.cardPadding&&a.cardBackgroundColor===n.cardBackgroundColor&&a.cardBorderColor===n.cardBorderColor&&a.cardBorderRadius===n.cardBorderRadius}function Lte(e,n){return e.by===n.by&&e.values.length===n.values.length&&e.values.every((a,l)=>a===n.values[l])}function Vte(e,n){return!(e.x+e.w<=n.x||n.x+n.w<=e.x||e.y+e.h<=n.y||n.y+n.h<=e.y)}function jH(e,n,a){return n.x<0||n.y<0||n.w<1||n.h<1||n.x+n.w>a?!1:!e.some(l=>Vte(l,n))}function HD(e,n,a,l,c,u){const p=ZS(c,0,Math.max(0,n-a)),m=Math.max(0,u);for(let S=m;;S+=1){const v=S===m?p:0;for(let C=v;C<=n-a;C+=1)if(jH(e,{x:C,y:S,w:a,h:l},n))return{x:C,y:S}}}function hw(e,n,a){const l=e.defaultComponentCols??Math.floor(e.cols/3),c=ZS(Math.round(l),1,e.cols),u=e.defaultComponentRows??16,p=Math.max(1,Math.round(u));return{x:0,y:a,w:ZS(Math.max(c,n.minWidth),1,e.cols),h:Math.max(1,Math.max(p,n.minHeight))}}function IH(e){const n={...e};return n.defaultComponentCols!==void 0&&(n.defaultComponentCols=ZS(Math.round(n.defaultComponentCols),1,n.cols)),n.defaultComponentRows!==void 0&&(n.defaultComponentRows=Math.max(1,Math.round(n.defaultComponentRows))),n}function jD(){return{schemaVersion:"1.1.0",id:"local-dashboard",code:"local_dashboard",name:"未命名仪表盘",version:"1.0.0",status:"draft",updater:"sdk",updateTime:new Date().toISOString(),settings:{canvasMode:"responsive",cols:24,rowHeight:10,margin:[8,8],padding:[8,8],bgColor:"#ffffff",showGrid:!0,minWidth:960,defaultComponentCols:8,defaultComponentRows:16,collisionReflowMode:"push"},components:[]}}function Pte(){return{by:"widgetCode",values:[]}}function LH(e){return{id:e.id,uniqueCode:e.uniqueCode,widgetCode:e.manifest.widgetCode,kind:e.manifest.kind,layout:e.layout??hw(e.settings,e.manifest,e.y),baseConfig:{title:e.manifest.defaultBaseConfig?.title??e.manifest.name,showTitle:e.manifest.defaultBaseConfig?.showTitle??!0},styleConfig:hJ(e.manifest),linkageConfig:{target:Pte()},customConfig:{...e.manifest.defaultConfig}}}function Ute(e){return{...e.source,id:e.id,uniqueCode:e.uniqueCode,layout:{...e.source.layout,x:0,y:e.y},baseConfig:{...e.source.baseConfig},styleConfig:{...e.source.styleConfig},linkageConfig:{target:{by:e.source.linkageConfig.target.by,values:[...e.source.linkageConfig.target.values]}},customConfig:DH(e.source.customConfig)}}function qte(e,n,a,l,c){const u=ZS(a,0,Math.max(0,n-l));for(let p=0;;p+=1)if(jH(e,{x:u,y:p,w:l,h:c},n))return p}function Fte(e){const n=e.components.map(a=>{const l=typeof a.baseConfig.showCard=="boolean"?!!a.baseConfig.showCard:void 0,c=Kf({showCard:l,...a.styleConfig}),u={title:a.baseConfig.title,showTitle:a.baseConfig.showTitle},p={showCard:c.showCard,cardPadding:c.cardPadding,cardBackgroundColor:c.cardBackgroundColor,cardBorderColor:c.cardBorderColor,cardBorderRadius:c.cardBorderRadius},m=Object.keys(a.baseConfig),S=Object.keys(a.styleConfig??{});return l===void 0&&m.length===2&&S.length===5&&BH(a.baseConfig,u)&&HH(a.styleConfig,p)?a:{...a,baseConfig:u,styleConfig:p}});return{...e,settings:IH(e.settings),components:n}}function ld(e,n){return{...e,...n,updateTime:new Date().toISOString()}}function Gte(e,n,a){let l=!1;const c=e.components.map(u=>{if(u.id!==n)return u;const p=a(u);return Object.is(p,u)?u:(l=!0,p)});return l?ld(e,{components:c}):null}function Yte(e,n){switch(n.type){case"base":{const a={title:n.patch.title??e.baseConfig.title,showTitle:n.patch.showTitle??e.baseConfig.showTitle};return BH(e.baseConfig,a)?e:{...e,baseConfig:a}}case"style":{const a=Kf({...Kf(e.styleConfig),...n.patch});return HH(e.styleConfig,a)?e:{...e,styleConfig:{showCard:a.showCard,cardPadding:a.cardPadding,cardBackgroundColor:a.cardBackgroundColor,cardBorderColor:a.cardBorderColor,cardBorderRadius:a.cardBorderRadius}}}case"linkage":return Lte(e.linkageConfig.target,n.target)?e:{...e,linkageConfig:{...e.linkageConfig,target:{by:n.target.by,values:[...n.target.values]}}};case"custom":return ts(e.customConfig)===ts(n.config)?e:{...e,customConfig:DH(n.config)};default:return e}}function Xte(e,n,a){return Gte(e,n,l=>Yte(l,a))}function kte(e,n,a){let l=!1;const c=e.components.map(u=>u.id!==n||_H(u.layout,a)?u:(l=!0,{...u,layout:a}));return l?ld(e,{components:c}):null}function Wte(e,n){if(n.length===0)return null;const a=new Map;for(const u of n)a.set(u.componentId,u.layout);let l=!1;const c=e.components.map(u=>{const p=a.get(u.id);return!p||_H(u.layout,p)?u:(l=!0,{...u,layout:p})});return l?ld(e,{components:c}):null}function Kte(e,n){return ld(e,{settings:IH({...e.settings,...n})})}function Qte(e,n){const a=`comp_${Wf(8)}`,l=AH(e.components),c=hw(e.settings,n,l),u=LH({manifest:n,id:a,uniqueCode:`widget_${Wf(10)}`,settings:e.settings,y:l,layout:c});return{schema:ld(e,{components:[...e.components,u]}),selectedComponentId:a}}function Zte(e,n){if(n.length===0)return null;const a=e.settings.cols,l=e.components.map(v=>v.layout),c=hw(e.settings,n[0],0),u=HD(l,a,c.w,c.h,0,0);let p=u.x,m=u.y;const S=n.map(v=>{const C=hw(e.settings,v,0),x=HD(l,a,C.w,C.h,p,m),w={...C,x:x.x,y:x.y};return l.push(w),p=w.x+w.w,m=w.y,p>=a&&(p=0,m+=1),LH({manifest:v,id:`comp_${Wf(8)}`,uniqueCode:`widget_${Wf(10)}`,settings:e.settings,y:w.y,layout:w})});return{schema:ld(e,{components:[...e.components,...S]}),selectedComponentId:S[S.length-1]?.id??null}}function Jte(e,n){const a=e.components.find(p=>p.id===n);if(!a)return null;const l=`comp_${Wf(8)}`,c=AH(e.components),u=Ute({source:a,id:l,uniqueCode:`widget_${Wf(10)}`,y:c});return{schema:ld(e,{components:[...e.components,u]}),selectedComponentId:l}}function ene(e,n,a){return e.components.some(c=>c.id===n)?{schema:ld(e,{components:e.components.filter(c=>c.id!==n)}),selectedComponentId:a===n?null:a}:null}function tne(e){const n=e.settings.cols,a=new Map(e.components.map((p,m)=>[p.id,m])),l=[...e.components].sort((p,m)=>p.layout.y!==m.layout.y?p.layout.y-m.layout.y:p.layout.x!==m.layout.x?p.layout.x-m.layout.x:(a.get(p.id)??0)-(a.get(m.id)??0)),c=[],u=new Map(l.map(p=>{const m=Math.min(Math.max(p.layout.w,1),n),S=Math.max(p.layout.h,1),v=Math.max(0,Math.min(p.layout.x,Math.max(0,n-m))),C=qte(c,n,v,m,S),x={...p.layout,x:v,y:C,w:m,h:S};return c.push(x),[p.id,{...p,layout:x}]}));return ld(e,{components:e.components.map(p=>u.get(p.id)??p)})}function gR(e){return Fte(e)}function nne({initialSchema:e,initialMode:n="edit",readonly:a=!1,onSchemaChange:l,onModeChange:c,onSave:u,onPublish:p,onEdit:m,onDuplicate:S,onDelete:v}){const C=gR(e??jD()),x=_.useRef(oJ(C)),w=_.useRef(null),M=_.useRef(ts(C)),N=_.useRef(C),T=_.useRef(C.components[0]?.id??null),[$,z]=_.useState(n),[D,A]=_.useState(C.components[0]?.id??null),[I,j]=_.useState([]),[V,B]=_.useState([]),[L,P]=_.useState(!1),[G,F]=_.useState(!1),[W,k]=_.useState(!1);_.useEffect(()=>x.current.subscribe(ze=>{N.current=ze.schema;const Me=T.current;if(!ze.schema){Me!==null&&A(null);return}if(!Me)return;ze.schema.components.some(Xe=>Xe.id===Me)||A(null)}),[]),_.useEffect(()=>{T.current=D},[D]),_.useEffect(()=>{const xe=gR(e??jD()),ze=Ite(xe);w.current!==ze&&(w.current=ze,x.current.reset(xe),N.current=xe,M.current=ts(xe),z(n),j([]),B([]),k(!1),A(xe.components[0]?.id??null))},[n,e]);const ne=_.useCallback((xe,ze={})=>{const Me=ze.trackHistory??!0,qe=ze.clearRedo??!0,Xe=N.current;Me&&Xe&&j(it=>[...it,Xe]),qe&&B([]);const Ge=gR(xe);N.current=Ge,x.current.setSchema(Ge),k(ts(Ge)!==M.current),l?.(Ge)},[l]),re=_.useCallback(xe=>{xe&&ne(xe)},[ne]),q=_.useCallback(xe=>{ne(xe)},[ne]),K=_.useCallback(xe=>{z(xe),c?.(xe)},[c]),J=_.useCallback(xe=>{A(xe)},[]),ae=_.useCallback(xe=>{const ze=N.current,Me=T.current;a||!ze||!Me||re(xe(ze,Me))},[re,a]),Z=_.useCallback(xe=>{ae((ze,Me)=>Xte(ze,Me,xe))},[ae]),le=_.useCallback((xe,ze)=>{const Me=N.current;a||!Me||re(kte(Me,xe,ze))},[re,a]),oe=_.useCallback(xe=>{const ze=N.current;a||!ze||re(Wte(ze,xe))},[re,a]),te=_.useCallback(xe=>{const ze=N.current;a||!ze||ne(Kte(ze,xe))},[ne,a]),ue=_.useCallback(xe=>{const ze=N.current;if(a||!ze)return;const Me=Qte(ze,xe);ne(Me.schema),A(Me.selectedComponentId??null)},[ne,a]),ce=_.useCallback(xe=>{const ze=N.current;if(a||!ze)return;const Me=Zte(ze,xe);Me&&(ne(Me.schema),A(Me.selectedComponentId??null))},[ne,a]),fe=_.useCallback(xe=>{const ze=N.current;if(a||!ze)return;const Me=Jte(ze,xe);Me&&(ne(Me.schema),A(Me.selectedComponentId??null))},[ne,a]),ie=_.useCallback(xe=>{const ze=N.current;if(a||!ze)return;const Me=ene(ze,xe,T.current);Me&&(ne(Me.schema),A(Me.selectedComponentId??null))},[ne,a]),ge=_.useCallback(()=>{const xe=N.current;a||!xe||xe.components.length===0||ne(tne(xe))},[ne,a]),Ce=_.useCallback(()=>{const xe=N.current;if(!xe||I.length===0)return;const ze=I[I.length-1];ze&&(j(Me=>Me.slice(0,-1)),B(Me=>[...Me,xe]),N.current=ze,x.current.setSchema(ze),k(ts(ze)!==M.current),l?.(ze))},[l,I]),de=_.useCallback(()=>{const xe=N.current;if(!xe||V.length===0)return;const ze=V[V.length-1];ze&&(B(Me=>Me.slice(0,-1)),j(Me=>[...Me,xe]),N.current=ze,x.current.setSchema(ze),k(ts(ze)!==M.current),l?.(ze))},[l,V]),se=_.useCallback(()=>{const xe=N.current;a||!xe||xe.components.length===0||(ne({...xe,components:[],updateTime:new Date().toISOString()}),A(null))},[ne,a]),pe=_.useCallback(async()=>{const xe=N.current;if(!(!u||!xe)){P(!0);try{await u(xe),M.current=ts(xe),k(!1)}finally{P(!1)}}},[u]),Te=_.useCallback(async()=>{const xe=N.current;if(!(!p||!xe)){F(!0);try{await p(xe),M.current=ts(xe),k(!1)}finally{F(!1)}}},[p]),we=_.useCallback(()=>{const xe=N.current;xe&&m?.(xe)},[m]),be=_.useCallback(()=>{const xe=N.current;xe&&S?.(xe)},[S]),Ne=_.useCallback(()=>{const xe=N.current;xe&&v?.(xe.code)},[v]);return{store:x.current,getSchema:()=>N.current,selectedComponentId:D,mode:$,saving:L,publishing:G,canUndo:I.length>0,canRedo:V.length>0,dirty:W,setMode:K,setSchema:q,selectComponent:J,updateSelectedComponent:Z,updateComponentLayout:le,updateComponentLayouts:oe,updateDashboardSettings:te,addComponent:ue,addComponents:ce,duplicateComponentById:fe,removeComponentById:ie,autoAlign:ge,undo:Ce,redo:de,clearCanvas:se,save:pe,publish:Te,edit:we,duplicate:be,remove:Ne}}function one(e,n){const[a,l]=_.useState(!1),[c,u]=_.useState(!1),[p,m]=_.useState(!1);_.useEffect(()=>{const v=()=>{const C=document.fullscreenElement===n.current;l(C),u(!1),m(!1),e.setMode(C?"preview":"edit"),C&&e.selectComponent(null)};return document.addEventListener("fullscreenchange",v),()=>{document.removeEventListener("fullscreenchange",v)}},[e,n]);const S=_.useCallback(async()=>{const v=n.current;if(v)try{if(!document.fullscreenElement){await v.requestFullscreen();return}if(document.fullscreenElement===v){await document.exitFullscreen();return}await v.requestFullscreen()}catch{}},[n]);return{fullscreen:a,fullscreenExitFocused:p,fullscreenExitHovered:c,setFullscreenExitFocused:m,setFullscreenExitHovered:u,toggleFullscreen:S}}function ID(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ane(e){return!ID(e)||!ID(e.settings)?!1:typeof e.schemaVersion=="string"&&typeof e.id=="string"&&typeof e.code=="string"&&typeof e.name=="string"&&typeof e.version=="string"&&typeof e.status=="string"&&typeof e.updater=="string"&&typeof e.updateTime=="string"&&Array.isArray(e.components)}function rne(e){const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),a=URL.createObjectURL(n),l=document.createElement("a");l.href=a,l.download=`${e.code||"dashboard"}.json`,l.click(),URL.revokeObjectURL(a)}function lne(e){const{initialSchema:n,initialMode:a,readonly:l=!1,allowUseBuiltInWidgets:c=!0,builderDataResolveMode:u,widgetCatalogFilterRender:p,onSchemaChange:m,onModeChange:S,onSave:v,onPublish:C,onOpenCanvasSettings:x,onOpenVersionHistory:w,onHelp:M,onEdit:N,onDuplicate:T,onDelete:$,titleRender:z}=e,{prefixCls:D,services:A,themeConfig:I,widgets:j}=rd(),V=_.useRef(null),B=_.useRef(null),[L,P]=_.useState(null),[G,F]=_.useState(!1),[W,k]=_.useState(!1),[ne,re]=_.useState(!1),q=nne({initialSchema:n,initialMode:a,readonly:l,onSchemaChange:m,onModeChange:S,onSave:v,onPublish:C,onEdit:N,onDuplicate:T,onDelete:$}),K=Yy(q.store,_.useCallback(ut=>ut.schema,[])),J=Yy(q.store,_.useCallback(()=>q.store.selectCanvasLayoutSnapshot(),[q.store])),ae=Yy(q.store,_.useCallback(()=>q.selectedComponentId?q.store.selectComponentById(q.selectedComponentId):null,[q.selectedComponentId,q.store])),{fullscreen:Z,fullscreenExitFocused:le,fullscreenExitHovered:oe,setFullscreenExitFocused:te,setFullscreenExitHovered:ue,toggleFullscreen:ce}=one(q,V),{persistenceBlockedReason:fe,unauthorizedWidgetCodes:ie}=jte(A,K);Hte(q.dirty);const ge=_.useCallback(ut=>{V.current=ut,P(ut)},[]),Ce=_.useCallback(()=>L??document.body,[L]),de=()=>{!K||q.mode!=="edit"||(x?.(K),F(!0))},se=_.useCallback(()=>{fe&&Cr.warning({content:fe,getContainer:L??void 0,title:"无法继续"})},[L,fe]),pe=_.useCallback(async()=>{if(fe){se();return}await q.save()},[q,se,fe]),Te=_.useCallback(async()=>{if(fe){se();return}await q.publish()},[q,se,fe]),we=_.useCallback(ut=>{Cr.error({content:ut,getContainer:L??void 0,title:"导入 失败"})},[L]),be=_.useCallback(()=>{B.current?.click()},[]),Ne=_.useCallback(()=>{const ut=q.getSchema();ut&&rne(ut)},[q]),xe=_.useCallback(async ut=>{const[_t]=Array.from(ut.target.files??[]);if(ut.target.value="",!!_t)try{const bt=await _t.text(),St=JSON.parse(bt);if(!ane(St)){we("文件内容不是合法的仪表盘 JSON,请检查 schema 结构。");return}q.setSchema(St),q.selectComponent(St.components[0]?.id??null),q.setMode("edit"),F(!1)}catch{we("文件无法解析为合法 JSON,请检查编码与内容。")}},[q,we]),ze=_.useMemo(()=>{if(typeof navigator>"u")return"Ctrl";const ut=navigator.userAgentData?.platform??navigator.userAgent??"";return/mac/i.test(ut)?"⌘":"Ctrl"},[]),Me=oe||le,qe=u!=="disabled",Xe=K?.code??"dashboard",Ge=K?.settings??{canvasMode:"responsive",cols:24,rowHeight:10,margin:[8,8],padding:[8,8],bgColor:"#ffffff",showGrid:!0,minWidth:960,defaultComponentCols:8,defaultComponentRows:16,collisionReflowMode:"push"},it=K?.components??[],nt=_.useCallback(ut=>{q.selectComponent(ut)},[q]);return X.jsx(GO,{getPopupContainer:()=>Ce(),children:X.jsxs("section",{className:`cps-bi-builder${Z?" is-fullscreen":""}${q.mode==="preview"?" is-preview-runtime":""}`,ref:ge,children:[Z?X.jsx("div",{className:"cps-bi-builder__fullscreen-exit-zone","data-testid":"builder-fullscreen-exit-zone","data-visible":Me,onMouseEnter:()=>{ue(!0)},onMouseLeave:()=>{ue(!1)},children:X.jsx("div",{className:"cps-bi-builder__fullscreen-exit",children:X.jsx(Pn,{"aria-label":"退出全屏",icon:X.jsx(cA,{"aria-hidden":!0}),onBlur:ut=>{ut.currentTarget.parentElement?.contains(ut.relatedTarget)||te(!1)},onClick:()=>{ce()},onFocus:()=>{te(!0)},tabIndex:Me?0:-1,type:"primary",children:"退出全屏"})})}):X.jsx(IJ,{allowUseBuiltInWidgets:c,canRedo:q.canRedo,canUndo:q.canUndo,fullscreen:Z,hasComponents:it.length>0,modalContainer:L,mode:q.mode,onAddWidget:q.addComponent,onAddWidgets:q.addComponents,onAutoAlign:q.autoAlign,onClearCanvas:()=>{re(!0)},onDelete:q.remove,onDuplicate:q.duplicate,onEdit:q.edit,onHelp:M||(()=>{k(!0)}),onImportJson:be,onOpenCanvasSettings:de,onOpenVersionHistory:w,onPublish:Te,onRedo:q.redo,onExportJson:Ne,onSave:pe,onToggleFullscreen:()=>{ce()},persistenceDisabled:!!fe,persistenceDisabledReason:fe,onUndo:q.undo,publishing:q.publishing,readonly:l,saving:q.saving,schema:K,status:K?.status,title:K?.name,titleRender:z,version:K?.version,widgetCatalogFilterRender:p,widgets:j}),X.jsxs("section",{className:`cps-bi-builder__main${q.mode==="preview"?" is-preview-mode":""}`,children:[q.mode==="edit"?X.jsx(Dte,{builderDataResolveEnabled:qe,canvasLayoutSnapshot:J,dashboardCode:Xe,mode:q.mode,onDeleteComponent:q.removeComponentById,onDuplicateComponent:q.duplicateComponentById,onOpenComponentSettings:nt,onUpdateComponentLayouts:q.updateComponentLayouts,readonly:l,selectedComponentId:q.selectedComponentId,store:q.store,unauthorizedWidgetCodes:ie}):K?X.jsx(Y7,{prefixCls:D,services:A,themeConfig:I,widgets:j,children:X.jsx(rH,{scene:"builder-preview",schema:K})}):null,q.mode==="edit"?X.jsx(Bte,{components:it,dashboardCode:Xe,onClose:()=>{q.selectComponent(null)},onUpdateSelectedComponent:q.updateSelectedComponent,readonly:l,selectedComponent:ae,unauthorizedWidgetCodes:ie}):null]}),X.jsx("input",{accept:"application/json,.json",className:"cps-bi-builder__hidden-input",onChange:ut=>{xe(ut)},ref:B,type:"file"}),X.jsx(LJ,{getContainer:L??void 0,onApply:q.updateDashboardSettings,onCancel:()=>F(!1),open:G,settings:Ge}),X.jsx(OJ,{getContainer:L??void 0,modifierLabel:ze,onClose:()=>{k(!1)},open:W}),X.jsx(Ate,{getContainer:L??void 0,onCancel:()=>{re(!1)},onConfirm:()=>{q.clearCanvas(),re(!1)},open:ne})]})})}exports.DashboardBuilder=lne;exports.DashboardConfigProvider=Y7;exports.DashboardViewer=rH;exports.builtinWidgets=Q7;
|
package/dist/index.js
CHANGED
|
@@ -62229,7 +62229,7 @@ function bJ() {
|
|
|
62229
62229
|
category: "view",
|
|
62230
62230
|
keywords: ["倒计时", "时间", "内置组件"],
|
|
62231
62231
|
minWidth: 6,
|
|
62232
|
-
minHeight:
|
|
62232
|
+
minHeight: 2,
|
|
62233
62233
|
defaultBaseConfig: {
|
|
62234
62234
|
title: "倒计时",
|
|
62235
62235
|
showTitle: !1
|
|
@@ -62250,7 +62250,7 @@ const vJ = [
|
|
|
62250
62250
|
chartType: "line",
|
|
62251
62251
|
description: "官方内置折线图,适合趋势变化与多时点对比。",
|
|
62252
62252
|
icon: /* @__PURE__ */ Z(zA, {}),
|
|
62253
|
-
minHeight:
|
|
62253
|
+
minHeight: 8,
|
|
62254
62254
|
name: "折线图",
|
|
62255
62255
|
widgetCode: "builtin-line-chart"
|
|
62256
62256
|
}),
|
|
@@ -62258,7 +62258,7 @@ const vJ = [
|
|
|
62258
62258
|
chartType: "bar",
|
|
62259
62259
|
description: "官方内置柱状图,适合分类指标对比。",
|
|
62260
62260
|
icon: /* @__PURE__ */ Z(gA, {}),
|
|
62261
|
-
minHeight:
|
|
62261
|
+
minHeight: 8,
|
|
62262
62262
|
name: "柱状图",
|
|
62263
62263
|
widgetCode: "builtin-bar-chart"
|
|
62264
62264
|
}),
|
|
@@ -62266,7 +62266,7 @@ const vJ = [
|
|
|
62266
62266
|
chartType: "pie",
|
|
62267
62267
|
description: "官方内置饼图,适合份额占比分析。",
|
|
62268
62268
|
icon: /* @__PURE__ */ Z(DA, {}),
|
|
62269
|
-
minHeight:
|
|
62269
|
+
minHeight: 8,
|
|
62270
62270
|
name: "饼图",
|
|
62271
62271
|
widgetCode: "builtin-pie-chart"
|
|
62272
62272
|
}),
|
|
@@ -62274,7 +62274,7 @@ const vJ = [
|
|
|
62274
62274
|
chartType: "area",
|
|
62275
62275
|
description: "官方内置面积图,适合展示趋势变化与累计体量。",
|
|
62276
62276
|
icon: /* @__PURE__ */ Z(hA, {}),
|
|
62277
|
-
minHeight:
|
|
62277
|
+
minHeight: 8,
|
|
62278
62278
|
name: "面积图",
|
|
62279
62279
|
widgetCode: "builtin-area-chart"
|
|
62280
62280
|
}),
|