bi-components-library 1.2.70 → 1.2.71

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.umd.js CHANGED
@@ -61,7 +61,7 @@ ${(e||"").replace(/\r\n/g,`
61
61
  `).trim():""}catch{T=B.trim()}}else{const B=(D.innerText||"").replace(/\u200B/g,"").replace(/\r\n/g,`
62
62
  `);T=B.replace(/\n/g,"").trim().length>0?B:""}if(T)f.current.add(w);else if(f.current.has(w)){N.add(w);const B=D.getAttribute("data-node-type");B==="report-url"?N.add(`${w}__url`):B==="markdown-name"&&N.add(`${w}__name`)}})}const I=e.current.__tempVariableValues;if(I?(A=I,setTimeout(()=>{if(e.current){const M=e.current;M.__tempVariableValues===I&&delete M.__tempVariableValues}},100)):C||(e.current.querySelectorAll('[data-type="variable"]').forEach(H=>{const k=H.dataset.key;if(k){const G=H.getAttribute("data-report-url");if(G){const U=H.dataset.multiKey,X=U?`${U}::${k}`:k;O[X]={url:G,name:H.getAttribute("data-report-name")||H.innerText.replace(/\u200B/g,"").trim(),multiKey:U}}const j=()=>{if(H.dataset.variableRender==="antd-textarea"){const Z=(H.getAttribute("data-value")||"").trim();if(!Z)return"";try{return decodeURIComponent(Z).replace(/\r\n/g,`
63
63
  `).trim()}catch{return Z.trim()}}const U=(H.innerText||"").replace(/\u200B/g,"").replace(/\r\n/g,`
64
- `);return U.replace(/\n/g,"").trim().length>0?U:""},P=H.getAttribute("data-node-type");if(P==="report-url")if(G)A[`${k}__url`]=G;else{const U=j().replace(/\n/g,"").trim();U&&(A[`${k}__url`]=U)}else{const U=j();U&&(P==="markdown-name"?A[`${k}__name`]=U:A[k]=U)}}}),e.current.querySelectorAll('[data-type="select"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.getAttribute("data-value")||"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="searchable-select"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.getAttribute("data-value")||"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="textarea"]').forEach(H=>{const k=H.dataset.key;if(k){const G=H.value.replace(/[\u200B]/g,"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="richtext"]').forEach(H=>{const k=H.dataset.key;if(k){const G=H.getAttribute("data-node-type")||"",j=G==="report-module"||G==="markdown-module",P=j?(H.innerHTML||"").replace(/[\u200B]/g,"").trim():(H.textContent||"").replace(/[\u200B]/g,"").trim();if(j){const U=Number.parseInt(H.getAttribute("data-module-index")||"0",10);A[`${k}__module_${Number.isFinite(U)?U:0}`]=P}else P&&(A[k]=P)}}),e.current.querySelectorAll('[data-type="datepicker"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.getAttribute("data-value")||"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="number-input"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.value||"").trim();G&&(A[k]=G)}})),o&&Object.keys(o).length>0){const M=new Set(t.filter(w=>w.type==="upload"&&w.key).map(w=>w.key)),D={};C||Object.entries(o).forEach(([w,T])=>{if(!Array.isArray(T))return;let B=0;for(let $=0;$<T.length;$++)`${w}_${$}`in A&&B++;let z=-1;for(let $=0;$<T.length;$++)f.current.has(`${w}_${$}`)&&(z=$);if(z>=B&&B<T.length)for(let $=B;$<T.length;$++)N.add(`${w}_${$}`)}),Object.entries(o).forEach(([w,T])=>{M.has(w)||(Array.isArray(T)?T.forEach((B,z)=>{B!=null&&String(B).trim()!==""&&(D[`${w}_${z}`]=String(B))}):T!=null&&String(T).trim()!==""&&(t.find(z=>z.key===w&&z.type==="report-url")?D[`${w}__url`]=String(T):D[w]=String(T)))}),Object.entries(D).forEach(([w,T])=>{const B=w in A,z=N.has(w),$=g.current[w]!==T;!z&&(!B||$)&&(A[w]=T)});for(const w of Object.keys(g.current))!(w in D)&&w in A&&delete A[w];g.current=D}if(d1(e,t,a,l,A,n,u,s,c,d),v.current=b,h&&e.current)for(const[M,{name:D,url:w}]of Object.entries(h.current)){const T=e.current.querySelector(`[data-type="variable"][data-key="${M}"]`);if(!T)continue;const B=T.querySelector(".rte-report-dropdown-host");B&&(B.style.display="",B.style.visibility="",B.classList.remove("hidden"),B.classList.add("rte-report-dropdown-host-quiet"));const z=[document.createTextNode(D)];B&&z.push(B),T.setAttribute("data-report-url",w),T.setAttribute("data-report-name",D),T.removeAttribute("data-tooltip"),T.contentEditable="false",T.classList.add("rte-report-name-chip"),T.classList.remove("show-placeholder","rte-variable-with-icon"),T.replaceChildren(...z),Gl(T)}if(C&&(E.current=!1),setTimeout(()=>{if(fa(e),h?.current)for(const[M,D]of Object.entries(h.current))O[M]||(O[M]=D);if(Object.keys(O).length>0&&e.current)for(const[M,D]of Object.entries(O)){let w=null;if(D.multiKey){const z=M.split("::")[1];w=e.current.querySelector(`[data-type="variable"][data-multi-key="${D.multiKey}"][data-key="${z}"]`)}else w=e.current.querySelector(`[data-type="variable"][data-key="${M}"]`);if(!w)continue;const T=w.querySelector(".rte-report-dropdown-host");T&&(T.style.display="",T.style.visibility="",T.classList.remove("hidden"),T.classList.add("rte-report-dropdown-host-quiet"));const B=[document.createTextNode(D.name)];T&&B.push(T),w.classList.remove("show-placeholder","rte-variable-with-icon"),w.classList.add("rte-report-name-chip"),w.setAttribute("data-report-url",D.url),w.setAttribute("data-report-name",D.name),w.contentEditable="false",w.replaceChildren(...B),Gl(w)}pa(e,t,a,c)},0),r?.current){const{key:M,offset:D}=r.current;setTimeout(()=>{if(!e.current)return;const w=e.current.querySelector(`[data-type="variable"][data-key="${M}"]`);if(w){if(w.dataset.variableRender==="antd-textarea"){const T=w.querySelector("textarea");if(T){T.focus();try{const B=T.value?.length??0;T.setSelectionRange(Math.min(D,B),Math.min(D,B))}catch{}r.current=null;return}}try{const T=document.createRange(),B=document.createTreeWalker(w,NodeFilter.SHOW_TEXT,null);let z=0,$=null,H=0;for(;B.nextNode();){const k=B.currentNode,G=k.textContent?.length||0;if(z+G>=D){$=k,H=D-z;break}z+=G}if($){T.setStart($,Math.min(H,$.textContent?.length||0)),T.collapse(!0);const k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(T),w.focus())}else{T.selectNodeContents(w),T.collapse(!1);const k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(T),w.focus())}}catch{const T=document.createRange();T.selectNodeContents(w),T.collapse(!1);const B=window.getSelection();B&&(B.removeAllRanges(),B.addRange(T),w.focus())}r.current=null}},0)}},[t,a,l,e,n,r,i,u,s,o,c,d]);_.useEffect(()=>{m()},[m])}function m1(e,t,a,l,n){_.useEffect(()=>{const r=e.current;if(!r)return;const i=o=>typeof o=="string"?/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(o):o.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(o.name||""),u=o=>{const c=o.target?.closest(".upload-info-icon");if(c&&c.classList.contains("upload-info-icon")){const h=c.dataset.uploadKey;if(h){const f=c.dataset.tooltip||"";let y=!1;try{const v=JSON.parse(f);v&&v.type==="steps"&&Array.isArray(v.images)&&(y=!0)}catch{}if(y){const E=c.closest('[data-type="upload"], [data-type="video-upload"]');l({key:h,anchorEl:E||c,type:"upload"})}else{const E=c.closest('[data-type="upload"], [data-type="video-upload"]');l({key:h,anchorEl:E||c,type:"upload"})}}return}const d=o.target?.closest('[data-type="upload"]');if(d){const h=d.dataset.key;if(h){const f=a[h];f&&i(f)&&l({key:h,anchorEl:d,type:"upload-preview"})}}},s=o=>{if(n)return;const c=o.target?.closest(".upload-info-icon"),d=o.relatedTarget;if(d?.closest?.(".rte-tooltip-overlay"))return;if(c&&c.classList.contains("upload-info-icon")){const f=c.closest('[data-type="upload"], [data-type="video-upload"]');if(d&&f&&f.contains(d))return;if(!d||!r.contains(d))l(null);else{const y=d.closest('[data-type="upload"], [data-type="video-upload"]');(!y||y!==f)&&l(null)}return}const h=o.target?.closest('[data-type="upload"], [data-type="video-upload"]');if(h){const f=d;if(f?.closest?.(".rte-tooltip-overlay")||f&&h.contains(f))return;l(null)}};return r.addEventListener("mouseover",u,!0),r.addEventListener("mouseout",s,!0),()=>{r.removeEventListener("mouseover",u,!0),r.removeEventListener("mouseout",s,!0)}},[t,a,e,l,n])}function v1(e,t,a,l,n){_.useEffect(()=>{const r=e.current;if(!r)return;const i=c=>{if(l==="hideTagClose")return;const d=c.currentTarget,h=d.dataset.tooltip,f=d.dataset.tagKey||"";h&&a({key:f,anchorEl:d,type:"tag"})},u=c=>{n||c.relatedTarget?.closest?.(".rte-tooltip-overlay")||a(null)};let s;const o=()=>{r.querySelectorAll(".tag-node[data-tooltip]").forEach(d=>{d.addEventListener("mouseenter",i),d.addEventListener("mouseleave",u)})};return s=requestAnimationFrame(()=>{s=requestAnimationFrame(o)}),()=>{cancelAnimationFrame(s),r.querySelectorAll(".tag-node[data-tooltip]").forEach(d=>{d.removeEventListener("mouseenter",i),d.removeEventListener("mouseleave",u)})}},[t,e,a,l,n])}function g1(e,t,a,l){_.useEffect(()=>{const n=e.current;if(!n)return;const r=u=>{if(u.target?.closest(".rte-report-dropdown-host"))return;const o=u.target?.closest(".variable-info-icon");if(o&&o.classList.contains("variable-info-icon")){const c=o.dataset.variableKey;c&&a({key:c,anchorEl:o,type:"variable"});return}},i=u=>{if(l)return;const s=u.target,o=u.relatedTarget;if(o?.closest?.(".rte-tooltip-overlay"))return;if(s?.closest?.(".variable-info-icon")){if(!o||!n.contains(o)){a(null);return}!!o.closest?.(".variable-info-icon")||a(null)}};return n.addEventListener("mouseover",r,!0),n.addEventListener("mouseout",i,!0),()=>{n.removeEventListener("mouseover",r,!0),n.removeEventListener("mouseout",i,!0)}},[t,e,a,l])}function E1(e,t,a,l,n){_.useEffect(()=>{const r=e.current;if(!r)return;const i=d=>typeof d=="string"?/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(d):d.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(d.name||""),u=d=>{const h=d.currentTarget,f=h.dataset.fileName,y=h.closest('[data-type="upload"]'),E=y?.dataset.key||"",v=E?a[E]:null;if(v&&i(v)){l({key:E,anchorEl:y||h,type:"upload-preview"});return}f&&l({key:E,anchorEl:y||h,type:"upload-label"})},s=d=>{n||d.relatedTarget?.closest?.(".rte-tooltip-overlay")||l(null)};let o;const c=()=>{r.querySelectorAll(".upload-label[data-file-name]").forEach(h=>{h.addEventListener("mouseenter",u),h.addEventListener("mouseleave",s)})};return o=requestAnimationFrame(()=>{o=requestAnimationFrame(c)}),()=>{cancelAnimationFrame(o),r.querySelectorAll(".upload-label[data-file-name]").forEach(h=>{h.removeEventListener("mouseenter",u),h.removeEventListener("mouseleave",s)})}},[t,a,e,l,n])}function y1(e,t,a,l,n,r,i,u){_.useEffect(()=>{const s=setTimeout(()=>{pa(e,t,a,n),Wl(e,t,a,l,n,{reportAnalyzeState:i,requireReportUrlAnalyze:u})},0);return()=>clearTimeout(s)},[a,t,e,l,n,r,i,u])}function T1(e,t){const a=_.useRef(0),l=_.useRef(0);_.useEffect(()=>{if(!e.current)return;let n=!1,r=0;const i=m=>m instanceof HTMLElement?!!(m.closest(".rte-datepicker-wrapper")||m.closest(".rte-datepicker-host")||m.closest(".ant-picker")||m.closest(".ant-picker-dropdown")):!1,u=m=>m instanceof HTMLElement?!!(m.closest(".rte-select-wrapper")||m.closest(".rte-select-host")||m.closest(".ant-select")||m.closest(".ant-select-dropdown")):!1,s=m=>{n=!0,i(m.target)&&(a.current=Date.now()),u(m.target)&&(l.current=Date.now())},o=()=>{n=!1,r=Date.now()};let c=!1,d=0;const h=()=>{c=!0},f=()=>{c=!1,d=Date.now()},y=()=>{d=Date.now()},E=m=>{i(m.target)&&(a.current=Date.now()),u(m.target)&&(l.current=Date.now())},v=()=>{if(Date.now()-a.current<800||Date.now()-l.current<800)return;const m=document.activeElement;if(m&&(m.closest(".rte-datepicker-wrapper")||m.closest(".rte-datepicker-host")||m.closest(".ant-picker-dropdown")||m.tagName==="INPUT"&&m.closest(".ant-picker")||m.closest(".rte-select-wrapper")||m.closest(".rte-select-host")||m.closest(".ant-select")||m.closest(".ant-select-dropdown"))||!e.current)return;const b=window.getSelection();if(!b||b.rangeCount===0||t.current||n||c||Date.now()-d<500)return;const x=b.getRangeAt(0);if(!x.collapsed)return e.current.contains(x.commonAncestorContainer),void 0;const C=b.anchorNode;if(!C||!e.current.contains(C))return;let A=!1,O=!1;if(C.nodeType===Node.ELEMENT_NODE){const S=C;(S.closest('[data-type="datepicker"]')||S.closest(".rte-datepicker-wrapper")||S.closest(".rte-datepicker-host"))&&(A=!0),(S.closest('[data-type="select"]')||S.closest(".rte-select-wrapper")||S.closest(".rte-select-host"))&&(O=!0)}else if(C.parentElement){const S=C.parentElement;(S.closest('[data-type="datepicker"]')||S.closest(".rte-datepicker-wrapper")||S.closest(".rte-datepicker-host"))&&(A=!0),(S.closest('[data-type="select"]')||S.closest(".rte-select-wrapper")||S.closest(".rte-select-host"))&&(O=!0)}if(A||O)return;let N=null;if(C.nodeType===Node.ELEMENT_NODE?N=C.closest('[data-type="variable"]'):C.nodeType===Node.TEXT_NODE&&C.parentElement&&(N=C.parentElement.closest('[data-type="variable"]')),!N){if(Date.now()-r>500)return;const S=e.current.querySelectorAll('[data-type="variable"]');if(S.length>0){let L=null;for(const I of Array.from(S))if(I.style.display!=="none"){L=I;break}if(!L&&S.length>0&&(L=S[0]),L){const I=document.createRange();I.selectNodeContents(L),I.collapse(!1),b.removeAllRanges(),b.addRange(I),L.focus()}else b.removeAllRanges()}else b.removeAllRanges()}},g=e.current;return g&&(g.addEventListener("compositionstart",h),g.addEventListener("compositionend",f),g.addEventListener("input",y)),document.addEventListener("mousedown",s),document.addEventListener("mouseup",o),document.addEventListener("focusin",E),document.addEventListener("selectionchange",v),()=>{g&&(g.removeEventListener("compositionstart",h),g.removeEventListener("compositionend",f),g.removeEventListener("input",y)),document.removeEventListener("mousedown",s),document.removeEventListener("mouseup",o),document.removeEventListener("focusin",E),document.removeEventListener("selectionchange",v)}},[e,t])}var Dl={exports:{}},x1=Dl.exports,fo;function po(){return fo||(fo=1,function(e,t){(function(a,l){e.exports=l()})(x1,function(){var a=1e3,l=6e4,n=36e5,r="millisecond",i="second",u="minute",s="hour",o="day",c="week",d="month",h="quarter",f="year",y="date",E="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var T=["th","st","nd","rd"],B=w%100;return"["+w+(T[(B-20)%10]||T[B]||T[0])+"]"}},b=function(w,T,B){var z=String(w);return!z||z.length>=T?w:""+Array(T+1-z.length).join(B)+w},x={s:b,z:function(w){var T=-w.utcOffset(),B=Math.abs(T),z=Math.floor(B/60),$=B%60;return(T<=0?"+":"-")+b(z,2,"0")+":"+b($,2,"0")},m:function w(T,B){if(T.date()<B.date())return-w(B,T);var z=12*(B.year()-T.year())+(B.month()-T.month()),$=T.clone().add(z,d),H=B-$<0,k=T.clone().add(z+(H?-1:1),d);return+(-(z+(B-$)/(H?$-k:k-$))||0)},a:function(w){return w<0?Math.ceil(w)||0:Math.floor(w)},p:function(w){return{M:d,y:f,w:c,d:o,D:y,h:s,m:u,s:i,ms:r,Q:h}[w]||String(w||"").toLowerCase().replace(/s$/,"")},u:function(w){return w===void 0}},C="en",A={};A[C]=m;var O="$isDayjsObject",N=function(w){return w instanceof M||!(!w||!w[O])},S=function w(T,B,z){var $;if(!T)return C;if(typeof T=="string"){var H=T.toLowerCase();A[H]&&($=H),B&&(A[H]=B,$=H);var k=T.split("-");if(!$&&k.length>1)return w(k[0])}else{var G=T.name;A[G]=T,$=G}return!z&&$&&(C=$),$||!z&&C},L=function(w,T){if(N(w))return w.clone();var B=typeof T=="object"?T:{};return B.date=w,B.args=arguments,new M(B)},I=x;I.l=S,I.i=N,I.w=function(w,T){return L(w,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var M=function(){function w(B){this.$L=S(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[O]=!0}var T=w.prototype;return T.parse=function(B){this.$d=function(z){var $=z.date,H=z.utc;if($===null)return new Date(NaN);if(I.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var k=$.match(v);if(k){var G=k[2]-1||0,j=(k[7]||"0").substring(0,3);return H?new Date(Date.UTC(k[1],G,k[3]||1,k[4]||0,k[5]||0,k[6]||0,j)):new Date(k[1],G,k[3]||1,k[4]||0,k[5]||0,k[6]||0,j)}}return new Date($)}(B),this.init()},T.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},T.$utils=function(){return I},T.isValid=function(){return this.$d.toString()!==E},T.isSame=function(B,z){var $=L(B);return this.startOf(z)<=$&&$<=this.endOf(z)},T.isAfter=function(B,z){return L(B)<this.startOf(z)},T.isBefore=function(B,z){return this.endOf(z)<L(B)},T.$g=function(B,z,$){return I.u(B)?this[z]:this.set($,B)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(B,z){var $=this,H=!!I.u(z)||z,k=I.p(B),G=function(oe,he){var ge=I.w($.$u?Date.UTC($.$y,he,oe):new Date($.$y,he,oe),$);return H?ge:ge.endOf(o)},j=function(oe,he){return I.w($.toDate()[oe].apply($.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(he)),$)},P=this.$W,U=this.$M,X=this.$D,Z="set"+(this.$u?"UTC":"");switch(k){case f:return H?G(1,0):G(31,11);case d:return H?G(1,U):G(0,U+1);case c:var W=this.$locale().weekStart||0,le=(P<W?P+7:P)-W;return G(H?X-le:X+(6-le),U);case o:case y:return j(Z+"Hours",0);case s:return j(Z+"Minutes",1);case u:return j(Z+"Seconds",2);case i:return j(Z+"Milliseconds",3);default:return this.clone()}},T.endOf=function(B){return this.startOf(B,!1)},T.$set=function(B,z){var $,H=I.p(B),k="set"+(this.$u?"UTC":""),G=($={},$[o]=k+"Date",$[y]=k+"Date",$[d]=k+"Month",$[f]=k+"FullYear",$[s]=k+"Hours",$[u]=k+"Minutes",$[i]=k+"Seconds",$[r]=k+"Milliseconds",$)[H],j=H===o?this.$D+(z-this.$W):z;if(H===d||H===f){var P=this.clone().set(y,1);P.$d[G](j),P.init(),this.$d=P.set(y,Math.min(this.$D,P.daysInMonth())).$d}else G&&this.$d[G](j);return this.init(),this},T.set=function(B,z){return this.clone().$set(B,z)},T.get=function(B){return this[I.p(B)]()},T.add=function(B,z){var $,H=this;B=Number(B);var k=I.p(z),G=function(U){var X=L(H);return I.w(X.date(X.date()+Math.round(U*B)),H)};if(k===d)return this.set(d,this.$M+B);if(k===f)return this.set(f,this.$y+B);if(k===o)return G(1);if(k===c)return G(7);var j=($={},$[u]=l,$[s]=n,$[i]=a,$)[k]||1,P=this.$d.getTime()+B*j;return I.w(P,this)},T.subtract=function(B,z){return this.add(-1*B,z)},T.format=function(B){var z=this,$=this.$locale();if(!this.isValid())return $.invalidDate||E;var H=B||"YYYY-MM-DDTHH:mm:ssZ",k=I.z(this),G=this.$H,j=this.$m,P=this.$M,U=$.weekdays,X=$.months,Z=$.meridiem,W=function(he,ge,Ye,Pe){return he&&(he[ge]||he(z,H))||Ye[ge].slice(0,Pe)},le=function(he){return I.s(G%12||12,he,"0")},oe=Z||function(he,ge,Ye){var Pe=he<12?"AM":"PM";return Ye?Pe.toLowerCase():Pe};return H.replace(g,function(he,ge){return ge||function(Ye){switch(Ye){case"YY":return String(z.$y).slice(-2);case"YYYY":return I.s(z.$y,4,"0");case"M":return P+1;case"MM":return I.s(P+1,2,"0");case"MMM":return W($.monthsShort,P,X,3);case"MMMM":return W(X,P);case"D":return z.$D;case"DD":return I.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return W($.weekdaysMin,z.$W,U,2);case"ddd":return W($.weekdaysShort,z.$W,U,3);case"dddd":return U[z.$W];case"H":return String(G);case"HH":return I.s(G,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return oe(G,j,!0);case"A":return oe(G,j,!1);case"m":return String(j);case"mm":return I.s(j,2,"0");case"s":return String(z.$s);case"ss":return I.s(z.$s,2,"0");case"SSS":return I.s(z.$ms,3,"0");case"Z":return k}return null}(he)||k.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(B,z,$){var H,k=this,G=I.p(z),j=L(B),P=(j.utcOffset()-this.utcOffset())*l,U=this-j,X=function(){return I.m(k,j)};switch(G){case f:H=X()/12;break;case d:H=X();break;case h:H=X()/3;break;case c:H=(U-P)/6048e5;break;case o:H=(U-P)/864e5;break;case s:H=U/n;break;case u:H=U/l;break;case i:H=U/a;break;default:H=U}return $?H:I.a(H)},T.daysInMonth=function(){return this.endOf(d).$D},T.$locale=function(){return A[this.$L]},T.locale=function(B,z){if(!B)return this.$L;var $=this.clone(),H=S(B,z,!0);return H&&($.$L=H),$},T.clone=function(){return I.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},w}(),D=M.prototype;return L.prototype=D,[["$ms",r],["$s",i],["$m",u],["$H",s],["$W",o],["$M",d],["$y",f],["$D",y]].forEach(function(w){D[w[1]]=function(T){return this.$g(T,w[0],w[1])}}),L.extend=function(w,T){return w.$i||(w(T,M,L),w.$i=!0),L},L.locale=S,L.isDayjs=N,L.unix=function(w){return L(1e3*w)},L.en=A[C],L.Ls=A,L.p={},L})}(Dl)),Dl.exports}var C1=po();const Pl=dn(C1);var Ml={exports:{}},S1=Ml.exports,ho;function A1(){return ho||(ho=1,function(e,t){(function(a,l){e.exports=l(po())})(S1,function(a){function l(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var n=l(a),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(i,u){return u==="W"?i+"周":i+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(i,u){var s=100*i+u;return s<600?"凌晨":s<900?"早上":s<1100?"上午":s<1300?"中午":s<1800?"下午":"晚上"}};return n.default.locale(r,null,!0),r})}(Ml)),Ml.exports}A1();function za(e){"@babel/helpers - typeof";return za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(e)}function w1(e,t){if(za(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var l=a.call(e,t);if(za(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _1(e){var t=w1(e,"string");return za(t)=="symbol"?t:t+""}function k1(e,t,a){return(t=_1(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function bo(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,l)}return a}function mo(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?bo(Object(a),!0).forEach(function(l){k1(e,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):bo(Object(a)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(a,l))})}return e}var N1={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},I1=mo(mo({},N1),{},{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});const L1={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},vo={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},I1),timePickerLocale:Object.assign({},L1)};vo.lang.ok="确定",Pl.locale("zh-cn");const{RangePicker:O1}=pe.DatePicker,D1=({host:e,onChange:t})=>{const a=e.dataset.key,l=e.dataset.value,n=e.dataset.placeholder,r=e.dataset.limitRange?parseInt(e.dataset.limitRange,10):void 0,i=e.dataset.disableFuture==="true",[u,s]=_.useState(()=>{if(!l)return null;const E=l.split(",");return E.length===2&&E[0]&&E[1]?[Pl(E[0]),Pl(E[1])]:null}),[o,c]=_.useState(null),d=E=>E?i&&E.isAfter(Pl(),"day")?!0:!r||!o||!o[0]?!1:Math.abs(E.diff(o[0],"days"))>r:!1,h=E=>{c(E)},f=E=>{if(s(E),c(null),E&&E[0]&&E[1]){const v=`${E[0].format("YYYY-MM-DD")},${E[1].format("YYYY-MM-DD")}`;e.setAttribute("data-value",v),t(a,v)}else e.setAttribute("data-value",""),t(a,"")},y=E=>{c(E?u:null)};return mt.createPortal(V.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"260px",marginLeft:"4px",marginRight:"4px",fontSize:"16px",height:"30px",lineHeight:"30px"},children:V.jsx(O1,{value:u,disabledDate:d,onCalendarChange:h,onChange:f,onOpenChange:y,placeholder:[n||"开始日期",n||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,locale:vo,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),e)},P1=e=>{const[t,a]=_.useState([]);return _.useEffect(()=>{const l=e.current;if(!l)return;const n=()=>{const i=l.querySelectorAll(".rte-datepicker-host"),u=[];i.forEach(s=>{const o=s.getAttribute("data-key");o&&u.push(V.jsx(D1,{host:s,onChange:()=>{if(e.current){const c=new Event("input",{bubbles:!0});e.current.dispatchEvent(c)}}},`datepicker-${o}`))}),a(u)};n();const r=new MutationObserver(i=>{let u=!1;for(const s of i)if(s.type==="childList"){let o=!1;if(s.addedNodes.forEach(c=>{if(c.nodeType===Node.ELEMENT_NODE){const d=c;(d.classList?.contains("rte-datepicker-host")||d.querySelector?.(".rte-datepicker-host"))&&(o=!0)}}),s.removedNodes.forEach(c=>{if(c.nodeType===Node.ELEMENT_NODE){const d=c;(d.classList?.contains("rte-datepicker-host")||d.querySelector?.(".rte-datepicker-host"))&&(o=!0)}}),o){u=!0;break}}u&&n()});return r.observe(l,{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),t},go=({config:e,onSend:t,isProcessing:a=!1,disabled:l=!1,width:n,lockStructure:r=!1,agentOptions:i=[],onAgentSelect:u,onAgentExit:s,loading:o=!1,placeholder:c,border:d,background:h="transparent",hideButtons:f,maxHeight:y,minHeight:E,editorMinHeight:v,editorPadding:g,footerPadding:m,collapsed:b=!1,reportAnalyze:x,markdownAnalyze:C,markdownNameAnalyze:A,onCollapsedChange:O,collapseTransitionMs:N=260,debugTooltipSticky:S=!1,nodeValues:L,onFilesChange:I,onFooterFilesChange:M,showFooterUpload:D=!0,footerFiles:w,videoUrlParse:T,videoUpload:B,reportListFetch:z,onReportGoGenerate:$,onViewReport:H,hideCurrentSessionReport:k,reportNameResolve:G})=>{const[j,P]=pe.message.useMessage(),U=_.useRef(null),X=_.useRef(null),Z=_.useRef(null),W=_.useRef(null),le=_.useRef(null),oe=_.useRef(null),[he,ge]=_.useState(!1),Ye=_.useRef("");if(!Ye.current){const Q=Math.random().toString(36).slice(2,8);Ye.current=`rte_${Q}`}const[Pe,Ut]=_.useState({});_.useEffect(()=>{I?.(Pe)},[Pe,I]);const[lt,Et]=_.useState([]),oa=_.useRef(!1);_.useEffect(()=>{if(!w)return;if(!(w.length===lt.length&&w.every((ue,re)=>{const de=lt[re];return de&&ue.name===de.name&&ue.size===de.size&&ue.lastModified===de.lastModified})))if(w.reduce((de,be)=>de+be.size,0)>52428800){const de=[];let be=0;for(const ie of w){if(be+ie.size>52428800)break;de.push(ie),be+=ie.size}j.error("文件总大小不能超过 50MB"),Et(de)}else oa.current=!0,Et(w)},[w]),_.useEffect(()=>{if(oa.current){oa.current=!1;return}M?.(lt)},[lt,M]);const[Sr,Ya]=_.useState(null),[Bl,Fl]=_.useState(null),[Ar,Rl]=_.useState(null),[rt,Wa]=_.useState({}),[J,ne]=_.useState(""),[fe,ye]=_.useState(!1),we=_.useRef(null),We=_.useRef(null),{tooltipPortal:yt,setPopoverVisible:Ve}=ME({config:e,files:Pe,debugTooltipSticky:S,videoState:rt}),{handleFileChange:qt,handleRemoveFile:zt}=yc({config:e,messageApi:j,activeBatchKey:Bl,activeFileKey:Sr,activeBatchStartIndex:Ar,setActiveFileKey:Ya,setActiveBatchKey:Fl,setActiveBatchStartIndex:Rl,setFiles:Ut}),He=_.useRef(null),[Tt,it]=_.useState({showLeft:!1,showRight:!1}),ja=_.useCallback(()=>{const Q=He.current;Q&&it({showLeft:Q.scrollLeft>0,showRight:Q.scrollLeft+Q.clientWidth<Q.scrollWidth-1})},[]),j1=_.useCallback(Q=>{if(!Q.target.files||Q.target.files.length===0)return;const ue=10*1024*1024,re=50*1024*1024,de=ie=>ie.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(ie.name||""),be=Array.from(Q.target.files).filter(ie=>de(ie)&&ie.size>ue?(j.error("图片大小不能超过 10MB"),!1):!0);Et(ie=>{const me=ie.reduce((_e,Ie)=>_e+Ie.size,0),Ee=[];let xe=me;for(const _e of be){if(xe+_e.size>re){j.error("文件总大小不能超过 50MB");break}Ee.push(_e),xe+=_e.size}return Ee.length>0?[...ie,...Ee]:ie}),Q.target.value="",setTimeout(ja,0)},[j,ja]),K1=_.useCallback(Q=>{Et(ue=>ue.filter((re,de)=>de!==Q)),setTimeout(ja,0)},[ja]),X1=_.useCallback(()=>{const Q=He.current;Q&&Q.scrollBy({left:200,behavior:"smooth"})},[]),Q1=_.useCallback(()=>{const Q=He.current;Q&&Q.scrollBy({left:-200,behavior:"smooth"})},[]),_o=_.useCallback(()=>{l||ge(!0)},[l]);_.useEffect(()=>{l&&ge(!1)},[l]),_.useEffect(()=>{const Q=de=>de instanceof Element?!!de.closest([".rte-agent-dropdown",".rte-report-dropdown-overlay",".rte-tooltip-overlay",".ant-picker-dropdown",".ant-select-dropdown",".ant-image-preview-root"].join(",")):!1,ue=de=>{const be=U.current,ie=de.target;be&&(ie instanceof Node&&be.contains(ie)||Q(ie)||ge(!1))},re=de=>{const be=U.current,ie=de.target;if(be){if(ie instanceof Node&&be.contains(ie)){l||ge(!0);return}Q(ie)||ge(!1)}};return document.addEventListener("mousedown",ue,!0),document.addEventListener("focusin",re,!0),()=>{document.removeEventListener("mousedown",ue,!0),document.removeEventListener("focusin",re,!0)}},[l]);const wr=_.useRef(!1),J1=_.useRef(null),{handleMouseDown:Z1,handleMouseMove:ey,handleMouseUp:ty,handleDoubleClick:ay}=Rc({lockStructure:r,onAgentExit:s,editorRef:W,setPopoverVisible:Ve,isDraggingRef:wr,mouseDownPosRef:J1}),[ko,Hl]=_.useState(!1),_r=_.useRef(null),[No,Io]=_.useState(!0),ly=_.useRef(0),[Lo,ny]=_.useState(58),[ry,iy]=_.useState(58),[Oo,uy]=_.useState(!1),[$l,kr]=_.useState(null),Ka=_.useRef(!1),Xa=_.useRef(!1),ht=_.useRef(null),[ca,Qa]=_.useState({}),Ot=_.useRef(()=>{}),Vt=_.useRef({}),Nr=_.useRef(!1),Ul=_.useRef(null),Ja=_.useCallback(()=>{Nr.current=!0,Ul.current!==null&&window.clearTimeout(Ul.current),Ul.current=window.setTimeout(()=>{Nr.current=!1,Ul.current=null},50)},[]),[Gt,ql]=_.useState({}),Do=_.useRef(()=>{}),sy=_.useRef({}),Ir=_.useRef(Gt);_.useEffect(()=>{Ir.current=Gt},[Gt]);const[Yt,Lr]=_.useState({}),Po=_.useRef(()=>{}),Mo=_.useRef(Yt);_.useEffect(()=>{Mo.current=Yt},[Yt]);const[xt,Za]=_.useState(()=>{const Q={};return e.forEach(ue=>{Ue(ue.type)&&ue.key&&(Q[ue.key]=1)}),Q});_c({config:e,editorRef:W,files:Pe,setFiles:Ut,multiVariableCounts:xt,setMultiVariableCounts:Za,reportAnalyzeState:ca,setReportAnalyzeState:Qa,markdownAnalyzeState:Gt,setMarkdownAnalyzeState:ql,markdownNameAnalyzeState:Yt,setMarkdownNameAnalyzeState:Lr,nodeValues:L,resolvedReportNamesRef:Vt});const Bo=_.useRef(L);if(L!==Bo.current&&(Bo.current=L,L)){const Q={};let ue=!1;e.forEach(re=>{if(Ue(re.type)&&re.key){const de=L[re.key],be=Array.isArray(de)?de.filter(ie=>ie.trim().length>0):de;if(Array.isArray(be)&&be.length>0){const ie=re.maxCount??9,me=Math.min(be.length+1,ie);xt[re.key]!==me&&(Q[re.key]=me,ue=!0)}}}),ue&&(Ja(),Za(re=>({...re,...Q})))}const Ne=Oc({config:e,reportAnalyzeState:ca,markdownAnalyzeState:Gt,markdownNameAnalyzeState:Yt}),zl=_.useRef(()=>{}),{handleReportUrlBlur:oy,handleMarkdownBlur:cy,handleMarkdownNameBlur:dy,handleMultiVariableNameResolve:Fo}=Nc({reportAnalyze:x,markdownAnalyze:C,markdownNameAnalyze:A,reportAnalyzeState:ca,setReportAnalyzeState:Qa,markdownAnalyzeState:Gt,setMarkdownAnalyzeState:ql,markdownNameAnalyzeState:Yt,setMarkdownNameAnalyzeState:Lr,editorRef:W,reportAnalyzeRef:Ot,markdownAnalyzeRef:Do,markdownNameAnalyzeRef:Po,markdownAnalyzeStateRef:Ir,markdownNameAnalyzeStateRef:Mo,reportNameResolve:G,applyReportNameChipRef:zl});oc(W,oy,[Ne]),gc(W,dy,[Ne]),Ec(W,cy,[Ne]),_.useEffect(()=>{const Q=W.current;if(!Q||!G)return;const ue=re=>{const de=re.target;if(!de)return;const be=de.closest?.('[data-type="variable"][data-multi-key]');if(!be)return;const ie=be.dataset.key;if(!ie)return;const me=_r.current?.key===ie;if(Nr.current&&(me||!Q.contains(be)))return;const Ee=Q.contains(be)?be:Q.querySelector(`[data-type="variable"][data-key="${ie}"]`);if(!Ee||Ee.getAttribute("data-report-url"))return;const xe=(Ee.innerText||"").replace(/[\u200B\n]/g,"").trim(),_e=Ee.dataset.multiKey,$e=(_e?Ne.find(ut=>Ue(ut.type)&&ut.key===_e):void 0)?.type==="multi-variable-select"?"multi-variable-select":"multi-variable";Fo(ie,xe,$e)};return Q.addEventListener("focusout",ue),()=>Q.removeEventListener("focusout",ue)},[W,Fo,Ne,G]),sc(W,[Ne]),zl.current=(Q,ue,re,de)=>{const be=W.current;if(!be)return;let ie=be.querySelector(`[data-type="variable"][data-key="${Q}"]`);if(ie&&!document.body.contains(ie)){const xe=document.querySelectorAll(`.rte-editor [data-type="variable"][data-key="${Q}"]`);let _e=null;xe.forEach(Ie=>{!_e&&document.body.contains(Ie)&&(_e=Ie)}),ie=_e}if(!ie){Vt.current[Q]={name:ue,url:re};return}if(ie.getAttribute("data-report-url")===re){Vt.current[Q]={name:ue,url:re};return}if(!de?.forceApply){const xe=ie.getAttribute("data-report-url"),_e=(ie.innerText||"").replace(/[\u200B\n]/g,"").trim();if(!(!xe&&_e==="")&&!(xe===re||_e===re))return}Vt.current[Q]={name:ue,url:re};const me=ie.querySelector(".rte-report-dropdown-host");me&&(me.style.display="",me.style.visibility="",me.classList.remove("hidden"),me.classList.add("rte-report-dropdown-host-quiet"));const Ee=[document.createTextNode(ue)];me&&Ee.push(me),ie.classList.remove("show-placeholder","rte-variable-with-icon"),ie.classList.add("rte-report-name-chip"),ie.setAttribute("data-report-url",re),ie.setAttribute("data-report-name",ue),ie.contentEditable="false",ie.replaceChildren(...Ee),Gl(ie),document.dispatchEvent(new CustomEvent("rte-report-dropdown-force-close",{detail:{key:Q}})),setTimeout(()=>{Pr.current()},0)};const fy=_.useCallback((Q,ue,re)=>{W.current&&(ue==="report-url"?(zl.current(Q,re.name,re.url,{forceApply:!0}),setTimeout(()=>{Ot.current(Q,re.url)},0)):(ue==="multi-variable"||ue==="multi-variable-select")&&(zl.current(Q,re.name,re.url,{forceApply:!0}),ue==="multi-variable-select"&&setTimeout(()=>{Ot.current(Q,re.url)},0)))},[W,Ot]),py=Ne.map(Q=>`${Q.type}:${Q.key??""}:${Q.placeholder??""}`).join("|"),hy=hc(W,z,fy,$,H,`${py}::${JSON.stringify(xt)}`,k);b1(W,Ne,Pe,r,xt,_r,void 0,f,void 0,L,rt,!!z,Vt);const Or=_.useRef(new Set),Ro=_.useRef(Ne),Ho=_.useRef(L);(Ro.current!==Ne||Ho.current!==L)&&(Ro.current=Ne,Ho.current=L,Or.current=new Set),_.useEffect(()=>{if(!L||!Ne||Ne.length===0)return;const Q=Ne.filter(me=>me.type==="upload"&&me.key);if(Q.length===0)return;const ue={},re=(me,Ee)=>{Ee&&(Ee instanceof File?ue[me]=Ee:typeof Ee=="string"&&Ee.trim()&&(ue[me]=Ee.trim()))};for(const me of Q){const Ee=me.key;if(Or.current.has(Ee))continue;const xe=L[Ee],_e=typeof me.maxCount=="number"&&me.maxCount>1;if(Array.isArray(xe)&&xe.length>0){_e?xe.forEach((Ie,$e)=>re(`${Ee}-${$e}`,Ie)):re(Ee,xe[0]);continue}if(xe&&!Array.isArray(xe)){re(Ee,xe);continue}if(_e)for(let Ie=0;Ie<me.maxCount;Ie++){const $e=`${Ee}-${Ie}`,ut=L[$e];if(!ut)break;re($e,ut)}}if(Object.keys(ue).length===0)return;for(const me of Q)L[me.key]!==void 0&&Or.current.add(me.key);Ut(me=>{const Ee={...me};let xe=!1;for(const _e of Q){const Ie=_e.key;if(L[Ie]===void 0)continue;if(typeof _e.maxCount=="number"&&_e.maxCount>1)for(let ut=0;ut<_e.maxCount;ut++){const Br=`${Ie}-${ut}`;!ue[Br]&&me[Br]&&(Ee[Br]=null,xe=!0)}}for(const[_e,Ie]of Object.entries(ue))me[_e]!==Ie&&(Ee[_e]=Ie,xe=!0);return xe?Ee:me});const de=Object.entries(ue).filter(([,me])=>typeof me=="string");if(de.length===0)return;const be=async me=>{const Ee=me.split("/").pop()?.split("?")[0]||"file",xe=decodeURIComponent(Ee),_e=async Ie=>{const $e=await Ie.blob();return new File([$e],xe,{type:$e.type||"application/octet-stream"})};try{const Ie=`/api/image-proxy?url=${encodeURIComponent(me)}`,$e=await fetch(Ie);if($e.ok)return _e($e)}catch{}return null};let ie=!1;return Promise.all(de.map(async([me,Ee])=>{const xe=await be(Ee);return xe?{key:me,file:xe}:null})).then(me=>{if(ie)return;const Ee={};for(const xe of me)xe&&(Ee[xe.key]=xe.file);Object.keys(Ee).length>0&&Ut(xe=>{const _e={...xe};let Ie=!1;for(const[$e,ut]of Object.entries(Ee))typeof _e[$e]=="string"&&(_e[$e]=ut,Ie=!0);return Ie?_e:xe})}),()=>{ie=!0}},[L,Ne]);const el=_.useRef(new Set),$o=_.useRef(""),Uo=(e||[]).filter(Q=>Q.key&&Q.type!=="report-module"&&Q.type!=="markdown-module").map(Q=>`${Q.type}:${Q.key}`).join("|");$o.current!==Uo&&($o.current=Uo,el.current=new Set),_.useEffect(()=>{if(!L||!e||e.length===0)return;const Q=e.filter(re=>re.type==="report-url"&&re.key),ue=e.filter(re=>re.type==="multi-variable-select"&&re.key);if(!(Q.length===0&&ue.length===0)){for(const re of Q){const de=re.key;if(el.current.has(de))continue;const be=L[de]??L[`${de}__url`];if(!be||typeof be=="string"&&!be.trim())continue;const ie=Array.isArray(be)?be[0]:String(be);ie&&(el.current.add(de),setTimeout(()=>{Ot.current(de,ie)},100))}for(const re of ue){const de=re.key,be=L[de];!Array.isArray(be)||be.length===0||be.forEach((ie,me)=>{const Ee=typeof ie=="string"?ie.trim():"";if(!Ee)return;const xe=`${de}_${me}`;el.current.has(xe)||(el.current.add(xe),setTimeout(()=>{Ot.current(xe,Ee)},100))})}}},[L,e,Ot]),m1(W,Ne,Pe,Ve,S),v1(W,Ne,Ve,f,S),E1(W,Ne,Pe,Ve,S),g1(W,Ne,Ve,S);const Dr=!!x;y1(W,Ne,Pe,Hl,rt,L,ca,Dr),Sc(W,T,rt,Wa,[Ne]);const by=Ac(B,Wa,W);wc(W,rt,Ve,S),T1(W,wr);const qo=Jo(W),my=ec(W),vy=ac(W),zo=uc(W);_.useEffect(()=>{if(!W.current)return;W.current.querySelectorAll(".rte-richtext-toggle").forEach(ue=>{const re=ue.getAttribute("data-expanded")==="true";ue.innerHTML=re?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})},[Ne,W]);const Vo=P1(W),{measureExpandedContentHeight:tl}=Ic({collapsed:b,collapseTransitionMs:N,contentRef:X,contentBodyRef:Z,editorRef:W,debugIdRef:Ye,setCollapsedContentMaxHeightPx:ny,setExpandedContentMaxHeightPx:iy,setIsCollapseAnimating:uy,effectiveConfig:Ne,files:Pe,multiVariableCounts:xt,selectPortalsLength:qo.length,datePickerPortalsLength:Vo.length,variablePortalsLength:zo.length}),gy=()=>{if(b)return;const Q=Z.current;if(!Q)return;const ue=Math.ceil(Q.getBoundingClientRect().height||0);ue>0&&kr(ue),Ka.current=!0,Xa.current=!1,ht.current&&(window.clearTimeout(ht.current),ht.current=null)};_.useEffect(()=>{const Q=()=>{Ka.current&&(Xa.current=!0,ht.current&&window.clearTimeout(ht.current),ht.current=window.setTimeout(()=>{ht.current=null,Ka.current=!1,Xa.current=!1,kr(null),window.requestAnimationFrame(()=>tl())},450))};return window.addEventListener("focus",Q),()=>window.removeEventListener("focus",Q)},[tl]),_.useEffect(()=>{!Ka.current||!Xa.current||(ht.current&&(window.clearTimeout(ht.current),ht.current=null),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{kr(null),tl(),Ka.current=!1,Xa.current=!1})}))},[Pe,tl]),Lc({config:e,editorRef:W,setIsEmpty:Io,setIsFormValid:Hl});const Ey=Mc({disabled:l,collapsed:b,onCollapsedChange:O,config:e,lockStructure:r,editorRef:W,containerRef:U,fileInputRef:le,onBeforeFilePickerOpen:gy,files:Pe,setFiles:Ut,handleRemoveFile:zt,setActiveBatchKey:Fl,setActiveBatchStartIndex:Rl,setActiveFileKey:Ya,isDraggingRef:wr,richtextPrevScrollTopRef:ly,videoState:rt,setVideoState:Wa,videoFileInputRef:we,activeVideoKeyRef:We,onImagePreview:Q=>{ne(Q),ye(!0)}}),al=Bc({config:e,editorRef:W,setIsEmpty:Io,setIsFormValid:Hl,setReportAnalyzeState:Qa,setMarkdownAnalyzeState:ql,setMarkdownNameAnalyzeState:Lr,collapsed:b,measureExpandedContentHeight:tl,effectiveConfig:Ne,files:Pe,multiVariableCounts:xt,setMultiVariableCounts:Za,savedCursorRef:_r,videoState:rt,resolvedReportNamesRef:Vt,reportAnalyzeState:ca,requireReportUrlAnalyze:Dr}),Pr=_.useRef(al);Pr.current=al;const yy=Hc({disabled:l,config:e,multiVariableCounts:xt,setMultiVariableCounts:Za,editorRef:W,handleInput:al,markdownAnalyzeRef:Do,reportAnalyzeRef:Ot,markdownNameAnalyzeRef:Po,markdownAnalyzeStateRef:Ir,markdownRawTextRef:sy,setMarkdownAnalyzeState:ql,setFooterFiles:Et,footerFiles:lt,messageApi:j,onPasteUnsupported:()=>j.warning("暂不支持上传该文件类型")});Pc({config:e,effectiveConfig:Ne,files:Pe,editorRef:W,setIsFormValid:Hl,multiVariableCounts:xt,setMultiVariableCounts:Za,videoState:rt,reportAnalyzeState:ca,requireReportUrlAnalyze:Dr});const Mr=_.useCallback((Q,ue)=>{delete Vt.current[Q],da({keys:[Q]}),ue==="report-url"&&Qa(re=>({...re,[Q]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}))},[Qa]),Ty=_.useCallback(Q=>{Ja();const{nodeKey:ue,nodeType:re}=vc(Q);Mr(ue,re),Q.focus(),Pr.current()},[Mr,Ja]),xy=mc(W,Ty,xt),Go=$c({config:e,files:Pe,footerFiles:lt,onFooterFilesClear:()=>Et([]),onSend:t,isProcessing:a,disabled:l,loading:o,isFormValid:ko,editorRef:W,markdownAnalyzeState:Gt,markdownNameAnalyzeState:Yt,videoState:rt}),Cy=Fc({disabled:l,lockStructure:r,config:e,editorRef:W,handleInput:al,onEnterSend:Go,onReportChipDeleted:Mr}),Sy={...n?{width:typeof n=="number"?`${n}px`:n}:{},...d?{border:d}:{},...h?{background:h}:{},...y?{maxHeight:typeof y=="number"?`${y}px`:y}:{},...E&&!b?{minHeight:typeof E=="number"?`${E}px`:E}:{},...lt.length>0?{minHeight:"220px"}:{},...y?{"--rte-richtext-fullscreen-height":typeof y=="number"?`${y}px`:y}:{},...v?{"--rte-editor-min-height":typeof v=="number"?`${v}px`:v}:{},...g?{"--rte-editor-padding":g}:{},...m?{"--rte-footer-padding":m}:{}},Ay=typeof N=="number"&&Number.isFinite(N)&&N>=0?N:260,wy={overflow:"hidden"},_y=$l!=null?`${$l}px`:b?`${Lo}px`:`${Math.max(ry,Lo)}px`,ky=e.length===0&&No&&!b,Ny=$l!=null||b||Oo||ky?"hidden":"auto",Yo=_.useRef(b),Wo=Yo.current!==b;Wo&&(Yo.current=b);const Iy=$l!=null?"none":Wo||Oo?`max-height ${Ay}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",Ly={maxHeight:_y,minHeight:b?0:void 0,overflow:Ny,overscrollBehavior:he?"contain":"auto",transition:Iy,willChange:"max-height"},jo=e.find(Q=>Q.type==="tag"),Wt=jo?.text?i.find(Q=>Q.label===jo.text):void 0;return V.jsxs("div",{className:`rich-text-editor ${he?"rte-editor-selected":""}`,style:Sy,"data-disabled":l,ref:U,onMouseDownCapture:_o,onFocusCapture:_o,children:[P,V.jsxs("div",{className:"rich-text-editor-content",ref:X,style:wy,onMouseDown:Q=>{if(e.length!==0)return;const ue=Q.target,re=W.current;if(!re||re.contains(ue)||ue.closest('button, input, a, svg, [role="button"], .rte-footer-files-wrapper'))return;Q.preventDefault(),re.childNodes.length===0&&re.appendChild(document.createElement("br")),re.focus();const de=document.createRange();de.setStart(re,0),de.collapse(!0);const be=window.getSelection();be?.removeAllRanges(),be?.addRange(de)},children:[lt.length>0&&V.jsxs("div",{className:"rte-footer-files-wrapper",children:[Tt.showLeft&&V.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-left",children:V.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-left",onClick:Q1,children:V.jsx("svg",{style:{width:"16px",height:"16px",transform:"rotate(180deg)"},"aria-hidden":"true",children:V.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})}),V.jsx("div",{className:"rte-footer-files-list",ref:He,onScroll:ja,children:lt.map((Q,ue)=>{const re=Q.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(Q.name||""),de=Q.size<1024?`${Q.size}B`:Q.size<1024*1024?`${Math.round(Q.size/1024)}KB`:`${(Q.size/(1024*1024)).toFixed(1)}MB`,be=re?URL.createObjectURL(Q):"";return V.jsxs("div",{className:"rte-footer-file-chip",style:re?{cursor:"pointer"}:void 0,onClick:re?()=>{ne(be),ye(!0)}:void 0,children:[re?V.jsx("img",{style:{width:"32px",height:"32px",objectFit:"cover"},className:"rte-footer-file-thumb",src:be,alt:Q.name}):V.jsx("div",{className:"rte-footer-file-icon",children:V.jsx("svg",{style:{width:"18px",height:"18px"},"aria-hidden":"true",children:V.jsx("use",{xlinkHref:`#${(()=>{const ie=(Q.name||"").split(".").pop()?.toLowerCase()||"";return["xls","xla","xlb","xlc","xlm","xlsx","xlt","xlw","csv","tsv","iif"].includes(ie)?"icon-a-xlsxcsv":["doc","docx","dot","odt","rtf","wiz"].includes(ie)?"icon-docx":["ppt","pptx","pot","ppa","pps","pwz"].includes(ie)?"icon-ppt":["txt","asm","bat","c","cc","conf","cpp","css","cxx","def","dic","eml","h","hh","in","js","ksh","php","pkl","rb","tar","tex","ts","xml"].includes(ie)?"icon-txt":ie==="pdf"?"icon-pdf":["html","htm","json","ics","ifb"].includes(ie)?"icon-a-htmljson":ie==="md"?"icon-md":"icon-lianjie"})()}`})})}),V.jsxs("div",{className:"rte-footer-file-info",children:[V.jsx("span",{className:"rte-footer-file-name",title:Q.name,children:Q.name}),V.jsx("span",{className:"rte-footer-file-size",children:de})]}),V.jsx("span",{className:"rte-footer-file-remove",onClick:ie=>{ie.stopPropagation(),K1(ue)},children:V.jsx("i",{className:"iconfont icon-guanbi ",style:{width:"8px",height:"8px",fontSize:"8px",display:"flex",alignItems:"center"}})})]},`${Q.name}-${Q.size}-${ue}`)})}),Tt.showRight&&V.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-right",children:V.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-right",onClick:X1,children:V.jsx("svg",{style:{width:"16px",height:"16px"},"aria-hidden":"true",children:V.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})})]}),V.jsxs("div",{ref:Z,className:`rich-text-editor-content-body ${e.length===0?"rich-text-editor-content-body-default":""}`,style:Ly,children:[V.jsx("div",{ref:W,className:`rte-editor ${e.length===0?"rte-editor-default":""} ${No&&c?"rte-editor-empty":""} ${e.some(Q=>Q.type==="tag")?"rte-editor-with-agent":""}`,contentEditable:e.length===0,suppressContentEditableWarning:!0,"data-placeholder":c,onMouseDown:Z1,onMouseMove:ey,onMouseUp:ty,onClick:Ey,onDoubleClick:ay,onInput:()=>{Ja(),al()},onKeyDown:Cy,onPaste:Q=>{Ja(),yy(Q)}}),V.jsx("input",{type:"file",ref:le,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:qt}),V.jsx("input",{type:"file",ref:we,className:"rte-file-input",accept:"video/*",onChange:Q=>{const ue=Q.target.files?.[0],re=We.current;ue&&ue.size>1024*1024*1024?j.warning("视频文件不能超过1GB"):ue&&re&&by(re,ue),We.current=null,we.current&&(we.current.value="")}})]})]}),V.jsxs("div",{className:"rich-text-editor-footer",children:[V.jsxs("div",{className:"rich-text-editor-footer-left",children:[V.jsx("div",{className:"rich-text-editor-brand",children:f!=="hideAgent"&&V.jsx(pe.Dropdown,{placement:"topLeft",menu:{selectedKeys:Wt?[String(Wt.key)]:[],items:i.filter(Q=>Q.isShowNew!==1).map(Q=>({key:Q.key,label:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[Q.icon&&V.jsx("i",{className:Q.icon}),V.jsx("span",{children:Q.label})]}),onClick:()=>{u?.(Q)}}))},trigger:["click"],disabled:l||a,overlayClassName:"rte-agent-dropdown",children:V.jsxs("div",{className:"rte-agent-badge",style:{cursor:i.length>0?"pointer":"default"},children:[V.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),V.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})}),!e.find(Q=>Q.type==="tag")&&V.jsxs(V.Fragment,{children:[V.jsx("div",{className:"rte-footer-upload-btn",onClick:()=>oe.current?.click(),title:"上传文件",children:V.jsx("i",{className:"iconfont icon-lianjie",style:{fontSize:"16px"}})}),V.jsx("input",{type:"file",ref:oe,className:"rte-file-input",accept:".pdf,.xla,.xlb,.xlc,.xlm,.xls,.xlsx,.xlt,.xlw,.csv,.tsv,.iif,.doc,.docx,.dot,.odt,.rtf,.pot,.ppa,.pps,.ppt,.pptx,.pwz,.wiz,.asm,.bat,.c,.cc,.conf,.cpp,.css,.cxx,.def,.dic,.eml,.h,.hh,.htm,.html,.ics,.ifb,.in,.js,.json,.ksh,.png,.jpeg,.jpg,.gif,.webp,.md,.php,.pkl,.rb,.tar,.tex,.ts,.txt,.xml,",multiple:!0,onChange:j1})]})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[V.jsxs("div",{className:"rte-brand-badge",children:[V.jsx("div",{className:"rte-brand-badge",children:V.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""})}),V.jsx("span",{className:"rte-brand-text",style:{marginLeft:"4px"},children:"SealSeek 2.0"})]}),!Wt||Wt.points===void 0||Wt.points===null?null:V.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[V.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),V.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(Wt.points)]}),Wt.labelValue===2&&V.jsx("div",{className:"rte-limited-free-badge",children:V.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]}),V.jsx("button",{type:"button",onClick:Go,disabled:a||l||o||!ko,className:"rich-text-editor-send-button",children:a||o?V.jsx("span",{className:"rte-send-spinner"}):V.jsx("i",{className:"iconfont icon-fasong"})})]})]}),yt,V.jsx(pe.Image,{style:{display:"none"},src:J,preview:{visible:fe,onVisibleChange:Q=>ye(Q)}}),Vo,qo,my,vy,zo,hy,xy]})};go.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Eo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",M1=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],B1=({autoLoading:e,batchSize:t,loadingProgress:a,loadIcon:l,onBatchSizeChange:n,onLoadNextPage:r,onStartAutoLoad:i,onStopLoad:u})=>e&&a?V.jsxs("div",{className:"auto_load_progress",children:[l||V.jsx("img",{src:Eo,alt:"自动加载",width:14,height:14}),V.jsxs("span",{children:["正在加载第",a.currentPage,"/",a.totalPages,"页"]}),V.jsx(pe.Progress,{percent:a.percentage,type:"line",size:[160,8]}),V.jsx("span",{onClick:u,className:"auto_load_stop_btn",children:"停止加载"})]}):V.jsxs("div",{className:"auto_load_container",children:[V.jsx("div",{onClick:r,className:"auto_load_next_btn",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:"加载下一页"}),V.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:[V.jsxs("div",{className:"auto_load_btn",onClick:e?void 0:i,children:[l||V.jsx("img",{src:Eo,alt:"自动加载",width:14,height:14}),V.jsx("span",{children:"自动加载"})]}),V.jsx(pe.Select,{value:t,onChange:n,options:M1,disabled:e,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),F1=({current:e,loadIcon:t,pageSize:a,total:l,cachedPages:n,loadedCount:r,autoLoading:i=!1,loadingProgress:u,onChange:s,onLoadNextPage:o,onStartAutoLoad:c,onStopLoading:d})=>{const[h,f]=_.useState(5),y=Math.ceil(l/a),E=_.useMemo(()=>n.length>=y,[n,y]),v=()=>Array.from({length:y},(b,x)=>x+1).filter(b=>!n.includes(b)).slice(0,h),g=(m,b,x)=>{const C=n.includes(m);return b==="prev"||b==="next"||b==="jump-prev"||b==="jump-next"?V.jsx("div",{className:"pageBox",children:x}):V.jsxs("div",{className:"pageBox",style:{backgroundColor:e===m?"#2563EB":"#f5f5f5",color:e===m?"#fff":C?"#171717":"#a3a3a3"},children:[m,!C&&V.jsx("span",{className:"unload_spot"})]})};return V.jsxs("div",{className:"pagination_footer",children:[V.jsxs("div",{className:"pagination_leftWrap",children:[V.jsxs("span",{className:"pagination_total",children:[V.jsx(bt.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",r,"/",l,"条数据"]}),!E&&V.jsx(B1,{loadIcon:t||void 0,autoLoading:i,batchSize:h,loadingProgress:u,disabled:!o||!c,onBatchSizeChange:f,onLoadNextPage:()=>o?.(),onStartAutoLoad:()=>{const m=v();c?.(m)},onStopLoad:()=>d?.()})]}),V.jsx(pe.Pagination,{current:e,pageSize:a,total:l,onChange:m=>s(m),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:g})]})},yo=e=>{const{loading:t,autoLoading:a,loadingProgress:l,columns:n=[],dataSource:r=[],total:i,current:u,pageSize:s,cachedPages:o,onChangePage:c,onLoadNextPage:d,onStartAutoLoad:h,onStopLoading:f,...y}=e,E=_.useRef(null),v=_.useCallback(g=>{c(g),o.includes(g)&&E.current?.scrollTo({key:`${(g-1)*s+1}`})},[o,c,s]);return V.jsxs("div",{className:"flex flex-col",children:[V.jsx(pe.Table,{ref:E,...y,columns:n,dataSource:r,pagination:!1,virtual:!0}),V.jsx(F1,{loading:t,autoLoading:a,loadingProgress:l,current:u,pageSize:s,total:i,loadedCount:r.length,cachedPages:o,onChange:v,onLoadNextPage:d,onStartAutoLoad:h,onStopLoading:f})]})};yo.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const To=({texts:e=[],placeholder:t="请输入内容",animationSpeed:a=100,autoPlay:l=!0,value:n,onChange:r,...i})=>{const[u,s]=_.useState(""),[o,c]=_.useState(0),[d,h]=_.useState(!1),[f,y]=_.useState(!1),[E,v]=_.useState(!1),g=_.useRef(void 0),m=_.useRef(void 0),b=_.useRef(e),x=_.useRef(o),C=_.useRef(f),A=_.useRef(u);_.useEffect(()=>{b.current=e,x.current=o,C.current=f,A.current=u});const O=_.useCallback((w,T)=>{let B=0;v(!0);const z=()=>{B<w.length?(s(w.slice(0,B+1)),B++,m.current=window.setTimeout(z,a)):(v(!1),T?.())};z()},[a]),N=_.useCallback(w=>{let T=A.current.length;const B=()=>{T>0?(s(A.current.slice(0,T-1)),T--,m.current=window.setTimeout(B,a/2)):w?.()};B()},[a]),S=_.useCallback(()=>{if(b.current.length===0||C.current)return;h(!0);const w=b.current[x.current];A.current?N(()=>{O(w,()=>{g.current=window.setTimeout(()=>{c(T=>(T+1)%b.current.length),h(!1)},2e3)})}):O(w,()=>{g.current=window.setTimeout(()=>{c(T=>(T+1)%b.current.length),h(!1)},2e3)})},[N,O]);_.useEffect(()=>(l&&e.length>0&&!f&&S(),()=>{g.current&&window.clearTimeout(g.current),m.current&&window.clearTimeout(m.current)}),[o,f,l,e.length,S]),_.useEffect(()=>{!d&&l&&e.length>0&&!f&&S()},[o,d,l,e.length,f,S]);const L=w=>{y(!0),g.current&&window.clearTimeout(g.current),m.current&&window.clearTimeout(m.current),h(!1),v(!1),i.onFocus?.(w)},I=w=>{y(!1),!n&&e.length>0&&(s(""),c(0)),i.onBlur?.(w)},M=w=>{r?.(w.target.value),i.onChange?.(w)},D=()=>f||n?t:u||t;return V.jsxs("div",{style:{position:"relative"},children:[V.jsx(pe.Input,{...i,value:n,onChange:M,onFocus:L,onBlur:I,placeholder:D(),style:{...i.style,position:"relative",zIndex:1}}),!f&&!n&&u&&V.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[V.jsx("span",{children:u}),E&&V.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),V.jsx("style",{children:`
64
+ `);return U.replace(/\n/g,"").trim().length>0?U:""},P=H.getAttribute("data-node-type");if(P==="report-url")if(G)A[`${k}__url`]=G;else{const U=j().replace(/\n/g,"").trim();U&&(A[`${k}__url`]=U)}else{const U=j();U&&(P==="markdown-name"?A[`${k}__name`]=U:A[k]=U)}}}),e.current.querySelectorAll('[data-type="select"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.getAttribute("data-value")||"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="searchable-select"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.getAttribute("data-value")||"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="textarea"]').forEach(H=>{const k=H.dataset.key;if(k){const G=H.value.replace(/[\u200B]/g,"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="richtext"]').forEach(H=>{const k=H.dataset.key;if(k){const G=H.getAttribute("data-node-type")||"",j=G==="report-module"||G==="markdown-module",P=j?(H.innerHTML||"").replace(/[\u200B]/g,"").trim():(H.textContent||"").replace(/[\u200B]/g,"").trim();if(j){const U=Number.parseInt(H.getAttribute("data-module-index")||"0",10);A[`${k}__module_${Number.isFinite(U)?U:0}`]=P}else P&&(A[k]=P)}}),e.current.querySelectorAll('[data-type="datepicker"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.getAttribute("data-value")||"").trim();G&&(A[k]=G)}}),e.current.querySelectorAll('[data-type="number-input"]').forEach(H=>{const k=H.dataset.key;if(k){const G=(H.value||"").trim();G&&(A[k]=G)}})),o&&Object.keys(o).length>0){const M=new Set(t.filter(w=>w.type==="upload"&&w.key).map(w=>w.key)),D={};C||Object.entries(o).forEach(([w,T])=>{if(!Array.isArray(T))return;let B=0;for(let $=0;$<T.length;$++)`${w}_${$}`in A&&B++;let z=-1;for(let $=0;$<T.length;$++)f.current.has(`${w}_${$}`)&&(z=$);if(z>=B&&B<T.length)for(let $=B;$<T.length;$++)N.add(`${w}_${$}`)}),Object.entries(o).forEach(([w,T])=>{M.has(w)||(Array.isArray(T)?T.forEach((B,z)=>{B!=null&&String(B).trim()!==""&&(D[`${w}_${z}`]=String(B))}):T!=null&&String(T).trim()!==""&&(t.find(z=>z.key===w&&z.type==="report-url")?D[`${w}__url`]=String(T):D[w]=String(T)))}),Object.entries(D).forEach(([w,T])=>{const B=w in A,z=N.has(w),$=g.current[w]!==T;!z&&(!B||$)&&(A[w]=T)});for(const w of Object.keys(g.current))!(w in D)&&w in A&&delete A[w];g.current=D}if(d1(e,t,a,l,A,n,u,s,c,d),v.current=b,h&&e.current)for(const[M,{name:D,url:w}]of Object.entries(h.current)){const T=e.current.querySelector(`[data-type="variable"][data-key="${M}"]`);if(!T)continue;const B=T.querySelector(".rte-report-dropdown-host");B&&(B.style.display="",B.style.visibility="",B.classList.remove("hidden"),B.classList.add("rte-report-dropdown-host-quiet"));const z=[document.createTextNode(D)];B&&z.push(B),T.setAttribute("data-report-url",w),T.setAttribute("data-report-name",D),T.removeAttribute("data-tooltip"),T.contentEditable="false",T.classList.add("rte-report-name-chip"),T.classList.remove("show-placeholder","rte-variable-with-icon"),T.replaceChildren(...z),Gl(T)}if(C&&(E.current=!1),setTimeout(()=>{if(fa(e),h?.current)for(const[M,D]of Object.entries(h.current))O[M]||(O[M]=D);if(Object.keys(O).length>0&&e.current)for(const[M,D]of Object.entries(O)){let w=null;if(D.multiKey){const z=M.split("::")[1];w=e.current.querySelector(`[data-type="variable"][data-multi-key="${D.multiKey}"][data-key="${z}"]`)}else w=e.current.querySelector(`[data-type="variable"][data-key="${M}"]`);if(!w)continue;const T=w.querySelector(".rte-report-dropdown-host");T&&(T.style.display="",T.style.visibility="",T.classList.remove("hidden"),T.classList.add("rte-report-dropdown-host-quiet"));const B=[document.createTextNode(D.name)];T&&B.push(T),w.classList.remove("show-placeholder","rte-variable-with-icon"),w.classList.add("rte-report-name-chip"),w.setAttribute("data-report-url",D.url),w.setAttribute("data-report-name",D.name),w.contentEditable="false",w.replaceChildren(...B),Gl(w)}pa(e,t,a,c)},0),r?.current){const{key:M,offset:D}=r.current;setTimeout(()=>{if(!e.current)return;const w=e.current.querySelector(`[data-type="variable"][data-key="${M}"]`);if(w){if(w.dataset.variableRender==="antd-textarea"){const T=w.querySelector("textarea");if(T){T.focus();try{const B=T.value?.length??0;T.setSelectionRange(Math.min(D,B),Math.min(D,B))}catch{}r.current=null;return}}try{const T=document.createRange(),B=document.createTreeWalker(w,NodeFilter.SHOW_TEXT,null);let z=0,$=null,H=0;for(;B.nextNode();){const k=B.currentNode,G=k.textContent?.length||0;if(z+G>=D){$=k,H=D-z;break}z+=G}if($){T.setStart($,Math.min(H,$.textContent?.length||0)),T.collapse(!0);const k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(T),w.focus())}else{T.selectNodeContents(w),T.collapse(!1);const k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(T),w.focus())}}catch{const T=document.createRange();T.selectNodeContents(w),T.collapse(!1);const B=window.getSelection();B&&(B.removeAllRanges(),B.addRange(T),w.focus())}r.current=null}},0)}},[t,a,l,e,n,r,i,u,s,o,c,d]);_.useEffect(()=>{m()},[m])}function m1(e,t,a,l,n){_.useEffect(()=>{const r=e.current;if(!r)return;const i=o=>typeof o=="string"?/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(o):o.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(o.name||""),u=o=>{const c=o.target?.closest(".upload-info-icon");if(c&&c.classList.contains("upload-info-icon")){const h=c.dataset.uploadKey;if(h){const f=c.dataset.tooltip||"";let y=!1;try{const v=JSON.parse(f);v&&v.type==="steps"&&Array.isArray(v.images)&&(y=!0)}catch{}if(y){const E=c.closest('[data-type="upload"], [data-type="video-upload"]');l({key:h,anchorEl:E||c,type:"upload"})}else{const E=c.closest('[data-type="upload"], [data-type="video-upload"]');l({key:h,anchorEl:E||c,type:"upload"})}}return}const d=o.target?.closest('[data-type="upload"]');if(d){const h=d.dataset.key;if(h){const f=a[h];f&&i(f)&&l({key:h,anchorEl:d,type:"upload-preview"})}}},s=o=>{if(n)return;const c=o.target?.closest(".upload-info-icon"),d=o.relatedTarget;if(d?.closest?.(".rte-tooltip-overlay"))return;if(c&&c.classList.contains("upload-info-icon")){const f=c.closest('[data-type="upload"], [data-type="video-upload"]');if(d&&f&&f.contains(d))return;if(!d||!r.contains(d))l(null);else{const y=d.closest('[data-type="upload"], [data-type="video-upload"]');(!y||y!==f)&&l(null)}return}const h=o.target?.closest('[data-type="upload"], [data-type="video-upload"]');if(h){const f=d;if(f?.closest?.(".rte-tooltip-overlay")||f&&h.contains(f))return;l(null)}};return r.addEventListener("mouseover",u,!0),r.addEventListener("mouseout",s,!0),()=>{r.removeEventListener("mouseover",u,!0),r.removeEventListener("mouseout",s,!0)}},[t,a,e,l,n])}function v1(e,t,a,l,n){_.useEffect(()=>{const r=e.current;if(!r)return;const i=c=>{if(l==="hideTagClose")return;const d=c.currentTarget,h=d.dataset.tooltip,f=d.dataset.tagKey||"";h&&a({key:f,anchorEl:d,type:"tag"})},u=c=>{n||c.relatedTarget?.closest?.(".rte-tooltip-overlay")||a(null)};let s;const o=()=>{r.querySelectorAll(".tag-node[data-tooltip]").forEach(d=>{d.addEventListener("mouseenter",i),d.addEventListener("mouseleave",u)})};return s=requestAnimationFrame(()=>{s=requestAnimationFrame(o)}),()=>{cancelAnimationFrame(s),r.querySelectorAll(".tag-node[data-tooltip]").forEach(d=>{d.removeEventListener("mouseenter",i),d.removeEventListener("mouseleave",u)})}},[t,e,a,l,n])}function g1(e,t,a,l){_.useEffect(()=>{const n=e.current;if(!n)return;const r=u=>{if(u.target?.closest(".rte-report-dropdown-host"))return;const o=u.target?.closest(".variable-info-icon");if(o&&o.classList.contains("variable-info-icon")){const c=o.dataset.variableKey;c&&a({key:c,anchorEl:o,type:"variable"});return}},i=u=>{if(l)return;const s=u.target,o=u.relatedTarget;if(o?.closest?.(".rte-tooltip-overlay"))return;if(s?.closest?.(".variable-info-icon")){if(!o||!n.contains(o)){a(null);return}!!o.closest?.(".variable-info-icon")||a(null)}};return n.addEventListener("mouseover",r,!0),n.addEventListener("mouseout",i,!0),()=>{n.removeEventListener("mouseover",r,!0),n.removeEventListener("mouseout",i,!0)}},[t,e,a,l])}function E1(e,t,a,l,n){_.useEffect(()=>{const r=e.current;if(!r)return;const i=d=>typeof d=="string"?/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(d):d.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(d.name||""),u=d=>{const h=d.currentTarget,f=h.dataset.fileName,y=h.closest('[data-type="upload"]'),E=y?.dataset.key||"",v=E?a[E]:null;if(v&&i(v)){l({key:E,anchorEl:y||h,type:"upload-preview"});return}f&&l({key:E,anchorEl:y||h,type:"upload-label"})},s=d=>{n||d.relatedTarget?.closest?.(".rte-tooltip-overlay")||l(null)};let o;const c=()=>{r.querySelectorAll(".upload-label[data-file-name]").forEach(h=>{h.addEventListener("mouseenter",u),h.addEventListener("mouseleave",s)})};return o=requestAnimationFrame(()=>{o=requestAnimationFrame(c)}),()=>{cancelAnimationFrame(o),r.querySelectorAll(".upload-label[data-file-name]").forEach(h=>{h.removeEventListener("mouseenter",u),h.removeEventListener("mouseleave",s)})}},[t,a,e,l,n])}function y1(e,t,a,l,n,r,i,u){_.useEffect(()=>{const s=setTimeout(()=>{pa(e,t,a,n),Wl(e,t,a,l,n,{reportAnalyzeState:i,requireReportUrlAnalyze:u})},0);return()=>clearTimeout(s)},[a,t,e,l,n,r,i,u])}function T1(e,t){const a=_.useRef(0),l=_.useRef(0);_.useEffect(()=>{if(!e.current)return;let n=!1,r=0;const i=m=>m instanceof HTMLElement?!!(m.closest(".rte-datepicker-wrapper")||m.closest(".rte-datepicker-host")||m.closest(".ant-picker")||m.closest(".ant-picker-dropdown")):!1,u=m=>m instanceof HTMLElement?!!(m.closest(".rte-select-wrapper")||m.closest(".rte-select-host")||m.closest(".ant-select")||m.closest(".ant-select-dropdown")):!1,s=m=>{n=!0,i(m.target)&&(a.current=Date.now()),u(m.target)&&(l.current=Date.now())},o=()=>{n=!1,r=Date.now()};let c=!1,d=0;const h=()=>{c=!0},f=()=>{c=!1,d=Date.now()},y=()=>{d=Date.now()},E=m=>{i(m.target)&&(a.current=Date.now()),u(m.target)&&(l.current=Date.now())},v=()=>{if(Date.now()-a.current<800||Date.now()-l.current<800)return;const m=document.activeElement;if(m&&(m.closest(".rte-datepicker-wrapper")||m.closest(".rte-datepicker-host")||m.closest(".ant-picker-dropdown")||m.tagName==="INPUT"&&m.closest(".ant-picker")||m.closest(".rte-select-wrapper")||m.closest(".rte-select-host")||m.closest(".ant-select")||m.closest(".ant-select-dropdown"))||!e.current)return;const b=window.getSelection();if(!b||b.rangeCount===0||t.current||n||c||Date.now()-d<500)return;const x=b.getRangeAt(0);if(!x.collapsed)return e.current.contains(x.commonAncestorContainer),void 0;const C=b.anchorNode;if(!C||!e.current.contains(C))return;let A=!1,O=!1;if(C.nodeType===Node.ELEMENT_NODE){const S=C;(S.closest('[data-type="datepicker"]')||S.closest(".rte-datepicker-wrapper")||S.closest(".rte-datepicker-host"))&&(A=!0),(S.closest('[data-type="select"]')||S.closest(".rte-select-wrapper")||S.closest(".rte-select-host"))&&(O=!0)}else if(C.parentElement){const S=C.parentElement;(S.closest('[data-type="datepicker"]')||S.closest(".rte-datepicker-wrapper")||S.closest(".rte-datepicker-host"))&&(A=!0),(S.closest('[data-type="select"]')||S.closest(".rte-select-wrapper")||S.closest(".rte-select-host"))&&(O=!0)}if(A||O)return;let N=null;if(C.nodeType===Node.ELEMENT_NODE?N=C.closest('[data-type="variable"]'):C.nodeType===Node.TEXT_NODE&&C.parentElement&&(N=C.parentElement.closest('[data-type="variable"]')),!N){if(Date.now()-r>500)return;const S=e.current.querySelectorAll('[data-type="variable"]');if(S.length>0){let L=null;for(const I of Array.from(S))if(I.style.display!=="none"){L=I;break}if(!L&&S.length>0&&(L=S[0]),L){const I=document.createRange();I.selectNodeContents(L),I.collapse(!1),b.removeAllRanges(),b.addRange(I),L.focus()}else b.removeAllRanges()}else b.removeAllRanges()}},g=e.current;return g&&(g.addEventListener("compositionstart",h),g.addEventListener("compositionend",f),g.addEventListener("input",y)),document.addEventListener("mousedown",s),document.addEventListener("mouseup",o),document.addEventListener("focusin",E),document.addEventListener("selectionchange",v),()=>{g&&(g.removeEventListener("compositionstart",h),g.removeEventListener("compositionend",f),g.removeEventListener("input",y)),document.removeEventListener("mousedown",s),document.removeEventListener("mouseup",o),document.removeEventListener("focusin",E),document.removeEventListener("selectionchange",v)}},[e,t])}var Dl={exports:{}},x1=Dl.exports,fo;function po(){return fo||(fo=1,function(e,t){(function(a,l){e.exports=l()})(x1,function(){var a=1e3,l=6e4,n=36e5,r="millisecond",i="second",u="minute",s="hour",o="day",c="week",d="month",h="quarter",f="year",y="date",E="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var T=["th","st","nd","rd"],B=w%100;return"["+w+(T[(B-20)%10]||T[B]||T[0])+"]"}},b=function(w,T,B){var z=String(w);return!z||z.length>=T?w:""+Array(T+1-z.length).join(B)+w},x={s:b,z:function(w){var T=-w.utcOffset(),B=Math.abs(T),z=Math.floor(B/60),$=B%60;return(T<=0?"+":"-")+b(z,2,"0")+":"+b($,2,"0")},m:function w(T,B){if(T.date()<B.date())return-w(B,T);var z=12*(B.year()-T.year())+(B.month()-T.month()),$=T.clone().add(z,d),H=B-$<0,k=T.clone().add(z+(H?-1:1),d);return+(-(z+(B-$)/(H?$-k:k-$))||0)},a:function(w){return w<0?Math.ceil(w)||0:Math.floor(w)},p:function(w){return{M:d,y:f,w:c,d:o,D:y,h:s,m:u,s:i,ms:r,Q:h}[w]||String(w||"").toLowerCase().replace(/s$/,"")},u:function(w){return w===void 0}},C="en",A={};A[C]=m;var O="$isDayjsObject",N=function(w){return w instanceof M||!(!w||!w[O])},S=function w(T,B,z){var $;if(!T)return C;if(typeof T=="string"){var H=T.toLowerCase();A[H]&&($=H),B&&(A[H]=B,$=H);var k=T.split("-");if(!$&&k.length>1)return w(k[0])}else{var G=T.name;A[G]=T,$=G}return!z&&$&&(C=$),$||!z&&C},L=function(w,T){if(N(w))return w.clone();var B=typeof T=="object"?T:{};return B.date=w,B.args=arguments,new M(B)},I=x;I.l=S,I.i=N,I.w=function(w,T){return L(w,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var M=function(){function w(B){this.$L=S(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[O]=!0}var T=w.prototype;return T.parse=function(B){this.$d=function(z){var $=z.date,H=z.utc;if($===null)return new Date(NaN);if(I.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var k=$.match(v);if(k){var G=k[2]-1||0,j=(k[7]||"0").substring(0,3);return H?new Date(Date.UTC(k[1],G,k[3]||1,k[4]||0,k[5]||0,k[6]||0,j)):new Date(k[1],G,k[3]||1,k[4]||0,k[5]||0,k[6]||0,j)}}return new Date($)}(B),this.init()},T.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},T.$utils=function(){return I},T.isValid=function(){return this.$d.toString()!==E},T.isSame=function(B,z){var $=L(B);return this.startOf(z)<=$&&$<=this.endOf(z)},T.isAfter=function(B,z){return L(B)<this.startOf(z)},T.isBefore=function(B,z){return this.endOf(z)<L(B)},T.$g=function(B,z,$){return I.u(B)?this[z]:this.set($,B)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(B,z){var $=this,H=!!I.u(z)||z,k=I.p(B),G=function(oe,he){var ge=I.w($.$u?Date.UTC($.$y,he,oe):new Date($.$y,he,oe),$);return H?ge:ge.endOf(o)},j=function(oe,he){return I.w($.toDate()[oe].apply($.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(he)),$)},P=this.$W,U=this.$M,X=this.$D,Z="set"+(this.$u?"UTC":"");switch(k){case f:return H?G(1,0):G(31,11);case d:return H?G(1,U):G(0,U+1);case c:var W=this.$locale().weekStart||0,le=(P<W?P+7:P)-W;return G(H?X-le:X+(6-le),U);case o:case y:return j(Z+"Hours",0);case s:return j(Z+"Minutes",1);case u:return j(Z+"Seconds",2);case i:return j(Z+"Milliseconds",3);default:return this.clone()}},T.endOf=function(B){return this.startOf(B,!1)},T.$set=function(B,z){var $,H=I.p(B),k="set"+(this.$u?"UTC":""),G=($={},$[o]=k+"Date",$[y]=k+"Date",$[d]=k+"Month",$[f]=k+"FullYear",$[s]=k+"Hours",$[u]=k+"Minutes",$[i]=k+"Seconds",$[r]=k+"Milliseconds",$)[H],j=H===o?this.$D+(z-this.$W):z;if(H===d||H===f){var P=this.clone().set(y,1);P.$d[G](j),P.init(),this.$d=P.set(y,Math.min(this.$D,P.daysInMonth())).$d}else G&&this.$d[G](j);return this.init(),this},T.set=function(B,z){return this.clone().$set(B,z)},T.get=function(B){return this[I.p(B)]()},T.add=function(B,z){var $,H=this;B=Number(B);var k=I.p(z),G=function(U){var X=L(H);return I.w(X.date(X.date()+Math.round(U*B)),H)};if(k===d)return this.set(d,this.$M+B);if(k===f)return this.set(f,this.$y+B);if(k===o)return G(1);if(k===c)return G(7);var j=($={},$[u]=l,$[s]=n,$[i]=a,$)[k]||1,P=this.$d.getTime()+B*j;return I.w(P,this)},T.subtract=function(B,z){return this.add(-1*B,z)},T.format=function(B){var z=this,$=this.$locale();if(!this.isValid())return $.invalidDate||E;var H=B||"YYYY-MM-DDTHH:mm:ssZ",k=I.z(this),G=this.$H,j=this.$m,P=this.$M,U=$.weekdays,X=$.months,Z=$.meridiem,W=function(he,ge,Ye,Pe){return he&&(he[ge]||he(z,H))||Ye[ge].slice(0,Pe)},le=function(he){return I.s(G%12||12,he,"0")},oe=Z||function(he,ge,Ye){var Pe=he<12?"AM":"PM";return Ye?Pe.toLowerCase():Pe};return H.replace(g,function(he,ge){return ge||function(Ye){switch(Ye){case"YY":return String(z.$y).slice(-2);case"YYYY":return I.s(z.$y,4,"0");case"M":return P+1;case"MM":return I.s(P+1,2,"0");case"MMM":return W($.monthsShort,P,X,3);case"MMMM":return W(X,P);case"D":return z.$D;case"DD":return I.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return W($.weekdaysMin,z.$W,U,2);case"ddd":return W($.weekdaysShort,z.$W,U,3);case"dddd":return U[z.$W];case"H":return String(G);case"HH":return I.s(G,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return oe(G,j,!0);case"A":return oe(G,j,!1);case"m":return String(j);case"mm":return I.s(j,2,"0");case"s":return String(z.$s);case"ss":return I.s(z.$s,2,"0");case"SSS":return I.s(z.$ms,3,"0");case"Z":return k}return null}(he)||k.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(B,z,$){var H,k=this,G=I.p(z),j=L(B),P=(j.utcOffset()-this.utcOffset())*l,U=this-j,X=function(){return I.m(k,j)};switch(G){case f:H=X()/12;break;case d:H=X();break;case h:H=X()/3;break;case c:H=(U-P)/6048e5;break;case o:H=(U-P)/864e5;break;case s:H=U/n;break;case u:H=U/l;break;case i:H=U/a;break;default:H=U}return $?H:I.a(H)},T.daysInMonth=function(){return this.endOf(d).$D},T.$locale=function(){return A[this.$L]},T.locale=function(B,z){if(!B)return this.$L;var $=this.clone(),H=S(B,z,!0);return H&&($.$L=H),$},T.clone=function(){return I.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},w}(),D=M.prototype;return L.prototype=D,[["$ms",r],["$s",i],["$m",u],["$H",s],["$W",o],["$M",d],["$y",f],["$D",y]].forEach(function(w){D[w[1]]=function(T){return this.$g(T,w[0],w[1])}}),L.extend=function(w,T){return w.$i||(w(T,M,L),w.$i=!0),L},L.locale=S,L.isDayjs=N,L.unix=function(w){return L(1e3*w)},L.en=A[C],L.Ls=A,L.p={},L})}(Dl)),Dl.exports}var C1=po();const Pl=dn(C1);var Ml={exports:{}},S1=Ml.exports,ho;function A1(){return ho||(ho=1,function(e,t){(function(a,l){e.exports=l(po())})(S1,function(a){function l(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var n=l(a),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(i,u){return u==="W"?i+"周":i+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(i,u){var s=100*i+u;return s<600?"凌晨":s<900?"早上":s<1100?"上午":s<1300?"中午":s<1800?"下午":"晚上"}};return n.default.locale(r,null,!0),r})}(Ml)),Ml.exports}A1();function za(e){"@babel/helpers - typeof";return za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(e)}function w1(e,t){if(za(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var l=a.call(e,t);if(za(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _1(e){var t=w1(e,"string");return za(t)=="symbol"?t:t+""}function k1(e,t,a){return(t=_1(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function bo(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,l)}return a}function mo(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?bo(Object(a),!0).forEach(function(l){k1(e,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):bo(Object(a)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(a,l))})}return e}var N1={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},I1=mo(mo({},N1),{},{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});const L1={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},vo={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},I1),timePickerLocale:Object.assign({},L1)};vo.lang.ok="确定",Pl.locale("zh-cn");const{RangePicker:O1}=pe.DatePicker,D1=({host:e,onChange:t})=>{const a=e.dataset.key,l=e.dataset.value,n=e.dataset.placeholder,r=e.dataset.limitRange?parseInt(e.dataset.limitRange,10):void 0,i=e.dataset.disableFuture==="true",[u,s]=_.useState(()=>{if(!l)return null;const E=l.split(",");return E.length===2&&E[0]&&E[1]?[Pl(E[0]),Pl(E[1])]:null}),[o,c]=_.useState(null),d=E=>E?i&&E.isAfter(Pl(),"day")?!0:!r||!o||!o[0]?!1:Math.abs(E.diff(o[0],"days"))>r:!1,h=E=>{c(E)},f=E=>{if(s(E),c(null),E&&E[0]&&E[1]){const v=`${E[0].format("YYYY-MM-DD")},${E[1].format("YYYY-MM-DD")}`;e.setAttribute("data-value",v),t(a,v)}else e.setAttribute("data-value",""),t(a,"")},y=E=>{c(E?u:null)};return mt.createPortal(V.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"260px",marginLeft:"4px",marginRight:"4px",fontSize:"16px",height:"30px",lineHeight:"30px"},children:V.jsx(O1,{value:u,disabledDate:d,onCalendarChange:h,onChange:f,onOpenChange:y,placeholder:[n||"开始日期",n||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,locale:vo,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),e)},P1=e=>{const[t,a]=_.useState([]);return _.useEffect(()=>{const l=e.current;if(!l)return;const n=()=>{const i=l.querySelectorAll(".rte-datepicker-host"),u=[];i.forEach(s=>{const o=s.getAttribute("data-key");o&&u.push(V.jsx(D1,{host:s,onChange:()=>{if(e.current){const c=new Event("input",{bubbles:!0});e.current.dispatchEvent(c)}}},`datepicker-${o}`))}),a(u)};n();const r=new MutationObserver(i=>{let u=!1;for(const s of i)if(s.type==="childList"){let o=!1;if(s.addedNodes.forEach(c=>{if(c.nodeType===Node.ELEMENT_NODE){const d=c;(d.classList?.contains("rte-datepicker-host")||d.querySelector?.(".rte-datepicker-host"))&&(o=!0)}}),s.removedNodes.forEach(c=>{if(c.nodeType===Node.ELEMENT_NODE){const d=c;(d.classList?.contains("rte-datepicker-host")||d.querySelector?.(".rte-datepicker-host"))&&(o=!0)}}),o){u=!0;break}}u&&n()});return r.observe(l,{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),t},go=({config:e,onSend:t,isProcessing:a=!1,disabled:l=!1,width:n,lockStructure:r=!1,agentOptions:i=[],onAgentSelect:u,onAgentExit:s,loading:o=!1,placeholder:c,border:d,background:h="transparent",hideButtons:f,maxHeight:y,minHeight:E,editorMinHeight:v,editorPadding:g,footerPadding:m,collapsed:b=!1,reportAnalyze:x,markdownAnalyze:C,markdownNameAnalyze:A,onCollapsedChange:O,collapseTransitionMs:N=260,debugTooltipSticky:S=!1,nodeValues:L,onFilesChange:I,onFooterFilesChange:M,showFooterUpload:D=!0,footerFiles:w,videoUrlParse:T,videoUpload:B,reportListFetch:z,onReportGoGenerate:$,onViewReport:H,hideCurrentSessionReport:k,reportNameResolve:G})=>{const[j,P]=pe.message.useMessage(),U=_.useRef(null),X=_.useRef(null),Z=_.useRef(null),W=_.useRef(null),le=_.useRef(null),oe=_.useRef(null),[he,ge]=_.useState(!1),Ye=_.useRef("");if(!Ye.current){const Q=Math.random().toString(36).slice(2,8);Ye.current=`rte_${Q}`}const[Pe,Ut]=_.useState({});_.useEffect(()=>{I?.(Pe)},[Pe,I]);const[lt,Et]=_.useState([]),oa=_.useRef(!1);_.useEffect(()=>{if(!w)return;if(!(w.length===lt.length&&w.every((ue,re)=>{const de=lt[re];return de&&ue.name===de.name&&ue.size===de.size&&ue.lastModified===de.lastModified})))if(w.reduce((de,be)=>de+be.size,0)>52428800){const de=[];let be=0;for(const ie of w){if(be+ie.size>52428800)break;de.push(ie),be+=ie.size}j.error("文件总大小不能超过 50MB"),Et(de)}else oa.current=!0,Et(w)},[w]),_.useEffect(()=>{if(oa.current){oa.current=!1;return}M?.(lt)},[lt,M]);const[Sr,Ya]=_.useState(null),[Bl,Fl]=_.useState(null),[Ar,Rl]=_.useState(null),[rt,Wa]=_.useState({}),[J,ne]=_.useState(""),[fe,ye]=_.useState(!1),we=_.useRef(null),We=_.useRef(null),{tooltipPortal:yt,setPopoverVisible:Ve}=ME({config:e,files:Pe,debugTooltipSticky:S,videoState:rt}),{handleFileChange:qt,handleRemoveFile:zt}=yc({config:e,messageApi:j,activeBatchKey:Bl,activeFileKey:Sr,activeBatchStartIndex:Ar,setActiveFileKey:Ya,setActiveBatchKey:Fl,setActiveBatchStartIndex:Rl,setFiles:Ut}),He=_.useRef(null),[Tt,it]=_.useState({showLeft:!1,showRight:!1}),ja=_.useCallback(()=>{const Q=He.current;Q&&it({showLeft:Q.scrollLeft>0,showRight:Q.scrollLeft+Q.clientWidth<Q.scrollWidth-1})},[]),j1=_.useCallback(Q=>{if(!Q.target.files||Q.target.files.length===0)return;const ue=10*1024*1024,re=50*1024*1024,de=ie=>ie.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(ie.name||""),be=Array.from(Q.target.files).filter(ie=>de(ie)&&ie.size>ue?(j.error("图片大小不能超过 10MB"),!1):!0);Et(ie=>{const me=ie.reduce((_e,Ie)=>_e+Ie.size,0),Ee=[];let xe=me;for(const _e of be){if(xe+_e.size>re){j.error("文件总大小不能超过 50MB");break}Ee.push(_e),xe+=_e.size}return Ee.length>0?[...ie,...Ee]:ie}),Q.target.value="",setTimeout(ja,0)},[j,ja]),K1=_.useCallback(Q=>{Et(ue=>ue.filter((re,de)=>de!==Q)),setTimeout(ja,0)},[ja]),X1=_.useCallback(()=>{const Q=He.current;Q&&Q.scrollBy({left:200,behavior:"smooth"})},[]),Q1=_.useCallback(()=>{const Q=He.current;Q&&Q.scrollBy({left:-200,behavior:"smooth"})},[]),_o=_.useCallback(()=>{l||ge(!0)},[l]);_.useEffect(()=>{l&&ge(!1)},[l]),_.useEffect(()=>{const Q=de=>de instanceof Element?!!de.closest([".rte-agent-dropdown",".rte-report-dropdown-overlay",".rte-tooltip-overlay",".ant-picker-dropdown",".ant-select-dropdown",".ant-image-preview-root"].join(",")):!1,ue=de=>{const be=U.current,ie=de.target;be&&(ie instanceof Node&&be.contains(ie)||Q(ie)||ge(!1))},re=de=>{const be=U.current,ie=de.target;if(be){if(ie instanceof Node&&be.contains(ie)){l||ge(!0);return}Q(ie)||ge(!1)}};return document.addEventListener("mousedown",ue,!0),document.addEventListener("focusin",re,!0),()=>{document.removeEventListener("mousedown",ue,!0),document.removeEventListener("focusin",re,!0)}},[l]);const wr=_.useRef(!1),J1=_.useRef(null),{handleMouseDown:Z1,handleMouseMove:ey,handleMouseUp:ty,handleDoubleClick:ay}=Rc({lockStructure:r,onAgentExit:s,editorRef:W,setPopoverVisible:Ve,isDraggingRef:wr,mouseDownPosRef:J1}),[ko,Hl]=_.useState(!1),_r=_.useRef(null),[No,Io]=_.useState(!0),ly=_.useRef(0),[Lo,ny]=_.useState(58),[ry,iy]=_.useState(58),[Oo,uy]=_.useState(!1),[$l,kr]=_.useState(null),Ka=_.useRef(!1),Xa=_.useRef(!1),ht=_.useRef(null),[ca,Qa]=_.useState({}),Ot=_.useRef(()=>{}),Vt=_.useRef({}),Nr=_.useRef(!1),Ul=_.useRef(null),Ja=_.useCallback(()=>{Nr.current=!0,Ul.current!==null&&window.clearTimeout(Ul.current),Ul.current=window.setTimeout(()=>{Nr.current=!1,Ul.current=null},50)},[]),[Gt,ql]=_.useState({}),Do=_.useRef(()=>{}),sy=_.useRef({}),Ir=_.useRef(Gt);_.useEffect(()=>{Ir.current=Gt},[Gt]);const[Yt,Lr]=_.useState({}),Po=_.useRef(()=>{}),Mo=_.useRef(Yt);_.useEffect(()=>{Mo.current=Yt},[Yt]);const[xt,Za]=_.useState(()=>{const Q={};return e.forEach(ue=>{Ue(ue.type)&&ue.key&&(Q[ue.key]=1)}),Q});_c({config:e,editorRef:W,files:Pe,setFiles:Ut,multiVariableCounts:xt,setMultiVariableCounts:Za,reportAnalyzeState:ca,setReportAnalyzeState:Qa,markdownAnalyzeState:Gt,setMarkdownAnalyzeState:ql,markdownNameAnalyzeState:Yt,setMarkdownNameAnalyzeState:Lr,nodeValues:L,resolvedReportNamesRef:Vt});const Bo=_.useRef(L);if(L!==Bo.current&&(Bo.current=L,L)){const Q={};let ue=!1;e.forEach(re=>{if(Ue(re.type)&&re.key){const de=L[re.key],be=Array.isArray(de)?de.filter(ie=>ie.trim().length>0):de;if(Array.isArray(be)&&be.length>0){const ie=re.maxCount??9,me=Math.min(be.length+1,ie);xt[re.key]!==me&&(Q[re.key]=me,ue=!0)}}}),ue&&(Ja(),Za(re=>({...re,...Q})))}const Ne=Oc({config:e,reportAnalyzeState:ca,markdownAnalyzeState:Gt,markdownNameAnalyzeState:Yt}),zl=_.useRef(()=>{}),{handleReportUrlBlur:oy,handleMarkdownBlur:cy,handleMarkdownNameBlur:dy,handleMultiVariableNameResolve:Fo}=Nc({reportAnalyze:x,markdownAnalyze:C,markdownNameAnalyze:A,reportAnalyzeState:ca,setReportAnalyzeState:Qa,markdownAnalyzeState:Gt,setMarkdownAnalyzeState:ql,markdownNameAnalyzeState:Yt,setMarkdownNameAnalyzeState:Lr,editorRef:W,reportAnalyzeRef:Ot,markdownAnalyzeRef:Do,markdownNameAnalyzeRef:Po,markdownAnalyzeStateRef:Ir,markdownNameAnalyzeStateRef:Mo,reportNameResolve:G,applyReportNameChipRef:zl});oc(W,oy,[Ne]),gc(W,dy,[Ne]),Ec(W,cy,[Ne]),_.useEffect(()=>{const Q=W.current;if(!Q||!G)return;const ue=re=>{const de=re.target;if(!de)return;const be=de.closest?.('[data-type="variable"][data-multi-key]');if(!be)return;const ie=be.dataset.key;if(!ie)return;const me=_r.current?.key===ie;if(Nr.current&&(me||!Q.contains(be)))return;const Ee=Q.contains(be)?be:Q.querySelector(`[data-type="variable"][data-key="${ie}"]`);if(!Ee||Ee.getAttribute("data-report-url"))return;const xe=(Ee.innerText||"").replace(/[\u200B\n]/g,"").trim(),_e=Ee.dataset.multiKey,$e=(_e?Ne.find(ut=>Ue(ut.type)&&ut.key===_e):void 0)?.type==="multi-variable-select"?"multi-variable-select":"multi-variable";Fo(ie,xe,$e)};return Q.addEventListener("focusout",ue),()=>Q.removeEventListener("focusout",ue)},[W,Fo,Ne,G]),sc(W,[Ne]),zl.current=(Q,ue,re,de)=>{const be=W.current;if(!be)return;let ie=be.querySelector(`[data-type="variable"][data-key="${Q}"]`);if(ie&&!document.body.contains(ie)){const xe=document.querySelectorAll(`.rte-editor [data-type="variable"][data-key="${Q}"]`);let _e=null;xe.forEach(Ie=>{!_e&&document.body.contains(Ie)&&(_e=Ie)}),ie=_e}if(!ie){Vt.current[Q]={name:ue,url:re};return}if(ie.getAttribute("data-report-url")===re){Vt.current[Q]={name:ue,url:re};return}if(!de?.forceApply){const xe=ie.getAttribute("data-report-url"),_e=(ie.innerText||"").replace(/[\u200B\n]/g,"").trim();if(!(!xe&&_e==="")&&!(xe===re||_e===re))return}Vt.current[Q]={name:ue,url:re};const me=ie.querySelector(".rte-report-dropdown-host");me&&(me.style.display="",me.style.visibility="",me.classList.remove("hidden"),me.classList.add("rte-report-dropdown-host-quiet"));const Ee=[document.createTextNode(ue)];me&&Ee.push(me),ie.classList.remove("show-placeholder","rte-variable-with-icon"),ie.classList.add("rte-report-name-chip"),ie.setAttribute("data-report-url",re),ie.setAttribute("data-report-name",ue),ie.contentEditable="false",ie.replaceChildren(...Ee),Gl(ie),document.dispatchEvent(new CustomEvent("rte-report-dropdown-force-close",{detail:{key:Q}})),setTimeout(()=>{Pr.current()},0)};const fy=_.useCallback((Q,ue,re)=>{W.current&&(ue==="report-url"?(zl.current(Q,re.name,re.url,{forceApply:!0}),setTimeout(()=>{Ot.current(Q,re.url)},0)):(ue==="multi-variable"||ue==="multi-variable-select")&&(zl.current(Q,re.name,re.url,{forceApply:!0}),ue==="multi-variable-select"&&setTimeout(()=>{Ot.current(Q,re.url)},0)))},[W,Ot]),py=Ne.map(Q=>`${Q.type}:${Q.key??""}:${Q.placeholder??""}`).join("|"),hy=hc(W,z,fy,$,H,`${py}::${JSON.stringify(xt)}`,k);b1(W,Ne,Pe,r,xt,_r,void 0,f,void 0,L,rt,!!z,Vt);const Or=_.useRef(new Set),Ro=_.useRef(Ne),Ho=_.useRef(L);(Ro.current!==Ne||Ho.current!==L)&&(Ro.current=Ne,Ho.current=L,Or.current=new Set),_.useEffect(()=>{if(!L||!Ne||Ne.length===0)return;const Q=Ne.filter(me=>me.type==="upload"&&me.key);if(Q.length===0)return;const ue={},re=(me,Ee)=>{Ee&&(Ee instanceof File?ue[me]=Ee:typeof Ee=="string"&&Ee.trim()&&(ue[me]=Ee.trim()))};for(const me of Q){const Ee=me.key;if(Or.current.has(Ee))continue;const xe=L[Ee],_e=typeof me.maxCount=="number"&&me.maxCount>1;if(Array.isArray(xe)&&xe.length>0){_e?xe.forEach((Ie,$e)=>re(`${Ee}-${$e}`,Ie)):re(Ee,xe[0]);continue}if(xe&&!Array.isArray(xe)){re(Ee,xe);continue}if(_e)for(let Ie=0;Ie<me.maxCount;Ie++){const $e=`${Ee}-${Ie}`,ut=L[$e];if(!ut)break;re($e,ut)}}if(Object.keys(ue).length===0)return;for(const me of Q)L[me.key]!==void 0&&Or.current.add(me.key);Ut(me=>{const Ee={...me};let xe=!1;for(const _e of Q){const Ie=_e.key;if(L[Ie]===void 0)continue;if(typeof _e.maxCount=="number"&&_e.maxCount>1)for(let ut=0;ut<_e.maxCount;ut++){const Br=`${Ie}-${ut}`;!ue[Br]&&me[Br]&&(Ee[Br]=null,xe=!0)}}for(const[_e,Ie]of Object.entries(ue))me[_e]!==Ie&&(Ee[_e]=Ie,xe=!0);return xe?Ee:me});const de=Object.entries(ue).filter(([,me])=>typeof me=="string");if(de.length===0)return;const be=async me=>{const Ee=me.split("/").pop()?.split("?")[0]||"file",xe=decodeURIComponent(Ee),_e=async Ie=>{const $e=await Ie.blob();return new File([$e],xe,{type:$e.type||"application/octet-stream"})};try{const Ie=`/api/image-proxy?url=${encodeURIComponent(me)}`,$e=await fetch(Ie);if($e.ok)return _e($e)}catch{}return null};let ie=!1;return Promise.all(de.map(async([me,Ee])=>{const xe=await be(Ee);return xe?{key:me,file:xe}:null})).then(me=>{if(ie)return;const Ee={};for(const xe of me)xe&&(Ee[xe.key]=xe.file);Object.keys(Ee).length>0&&Ut(xe=>{const _e={...xe};let Ie=!1;for(const[$e,ut]of Object.entries(Ee))typeof _e[$e]=="string"&&(_e[$e]=ut,Ie=!0);return Ie?_e:xe})}),()=>{ie=!0}},[L,Ne]);const el=_.useRef(new Set),$o=_.useRef(""),Uo=(e||[]).filter(Q=>Q.key&&Q.type!=="report-module"&&Q.type!=="markdown-module").map(Q=>`${Q.type}:${Q.key}`).join("|");$o.current!==Uo&&($o.current=Uo,el.current=new Set),_.useEffect(()=>{if(!L||!e||e.length===0)return;const Q=e.filter(re=>re.type==="report-url"&&re.key),ue=e.filter(re=>re.type==="multi-variable-select"&&re.key);if(!(Q.length===0&&ue.length===0)){for(const re of Q){const de=re.key;if(el.current.has(de))continue;const be=L[de]??L[`${de}__url`];if(!be||typeof be=="string"&&!be.trim())continue;const ie=Array.isArray(be)?be[0]:String(be);ie&&(el.current.add(de),setTimeout(()=>{Ot.current(de,ie)},100))}for(const re of ue){const de=re.key,be=L[de];!Array.isArray(be)||be.length===0||be.forEach((ie,me)=>{const Ee=typeof ie=="string"?ie.trim():"";if(!Ee)return;const xe=`${de}_${me}`;el.current.has(xe)||(el.current.add(xe),setTimeout(()=>{Ot.current(xe,Ee)},100))})}}},[L,e,Ot]),m1(W,Ne,Pe,Ve,S),v1(W,Ne,Ve,f,S),E1(W,Ne,Pe,Ve,S),g1(W,Ne,Ve,S);const Dr=!!x;y1(W,Ne,Pe,Hl,rt,L,ca,Dr),Sc(W,T,rt,Wa,[Ne]);const by=Ac(B,Wa,W);wc(W,rt,Ve,S),T1(W,wr);const qo=Jo(W),my=ec(W),vy=ac(W),zo=uc(W);_.useEffect(()=>{if(!W.current)return;W.current.querySelectorAll(".rte-richtext-toggle").forEach(ue=>{const re=ue.getAttribute("data-expanded")==="true";ue.innerHTML=re?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})},[Ne,W]);const Vo=P1(W),{measureExpandedContentHeight:tl}=Ic({collapsed:b,collapseTransitionMs:N,contentRef:X,contentBodyRef:Z,editorRef:W,debugIdRef:Ye,setCollapsedContentMaxHeightPx:ny,setExpandedContentMaxHeightPx:iy,setIsCollapseAnimating:uy,effectiveConfig:Ne,files:Pe,multiVariableCounts:xt,selectPortalsLength:qo.length,datePickerPortalsLength:Vo.length,variablePortalsLength:zo.length}),gy=()=>{if(b)return;const Q=Z.current;if(!Q)return;const ue=Math.ceil(Q.getBoundingClientRect().height||0);ue>0&&kr(ue),Ka.current=!0,Xa.current=!1,ht.current&&(window.clearTimeout(ht.current),ht.current=null)};_.useEffect(()=>{const Q=()=>{Ka.current&&(Xa.current=!0,ht.current&&window.clearTimeout(ht.current),ht.current=window.setTimeout(()=>{ht.current=null,Ka.current=!1,Xa.current=!1,kr(null),window.requestAnimationFrame(()=>tl())},450))};return window.addEventListener("focus",Q),()=>window.removeEventListener("focus",Q)},[tl]),_.useEffect(()=>{!Ka.current||!Xa.current||(ht.current&&(window.clearTimeout(ht.current),ht.current=null),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{kr(null),tl(),Ka.current=!1,Xa.current=!1})}))},[Pe,tl]),Lc({config:e,editorRef:W,setIsEmpty:Io,setIsFormValid:Hl});const Ey=Mc({disabled:l,collapsed:b,onCollapsedChange:O,config:e,lockStructure:r,editorRef:W,containerRef:U,fileInputRef:le,onBeforeFilePickerOpen:gy,files:Pe,setFiles:Ut,handleRemoveFile:zt,setActiveBatchKey:Fl,setActiveBatchStartIndex:Rl,setActiveFileKey:Ya,isDraggingRef:wr,richtextPrevScrollTopRef:ly,videoState:rt,setVideoState:Wa,videoFileInputRef:we,activeVideoKeyRef:We,onImagePreview:Q=>{ne(Q),ye(!0)}}),al=Bc({config:e,editorRef:W,setIsEmpty:Io,setIsFormValid:Hl,setReportAnalyzeState:Qa,setMarkdownAnalyzeState:ql,setMarkdownNameAnalyzeState:Lr,collapsed:b,measureExpandedContentHeight:tl,effectiveConfig:Ne,files:Pe,multiVariableCounts:xt,setMultiVariableCounts:Za,savedCursorRef:_r,videoState:rt,resolvedReportNamesRef:Vt,reportAnalyzeState:ca,requireReportUrlAnalyze:Dr}),Pr=_.useRef(al);Pr.current=al;const yy=Hc({disabled:l,config:e,multiVariableCounts:xt,setMultiVariableCounts:Za,editorRef:W,handleInput:al,markdownAnalyzeRef:Do,reportAnalyzeRef:Ot,markdownNameAnalyzeRef:Po,markdownAnalyzeStateRef:Ir,markdownRawTextRef:sy,setMarkdownAnalyzeState:ql,setFooterFiles:Et,footerFiles:lt,messageApi:j,onPasteUnsupported:()=>j.warning("暂不支持上传该文件类型")});Pc({config:e,effectiveConfig:Ne,files:Pe,editorRef:W,setIsFormValid:Hl,multiVariableCounts:xt,setMultiVariableCounts:Za,videoState:rt,reportAnalyzeState:ca,requireReportUrlAnalyze:Dr});const Mr=_.useCallback((Q,ue)=>{delete Vt.current[Q],da({keys:[Q]}),ue==="report-url"&&Qa(re=>({...re,[Q]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}))},[Qa]),Ty=_.useCallback(Q=>{Ja();const{nodeKey:ue,nodeType:re}=vc(Q);Mr(ue,re),Q.focus(),Pr.current()},[Mr,Ja]),xy=mc(W,Ty,xt),Go=$c({config:e,files:Pe,footerFiles:lt,onFooterFilesClear:()=>Et([]),onSend:t,isProcessing:a,disabled:l,loading:o,isFormValid:ko,editorRef:W,markdownAnalyzeState:Gt,markdownNameAnalyzeState:Yt,videoState:rt}),Cy=Fc({disabled:l,lockStructure:r,config:e,editorRef:W,handleInput:al,onEnterSend:Go,onReportChipDeleted:Mr}),Sy={...n?{width:typeof n=="number"?`${n}px`:n}:{},...d?{border:d}:{},...h?{background:h}:{},...y?{maxHeight:typeof y=="number"?`${y}px`:y}:{},...E&&!b?{minHeight:typeof E=="number"?`${E}px`:E}:{},...lt.length>0?{minHeight:"220px"}:{},...y?{"--rte-richtext-fullscreen-height":typeof y=="number"?`${y}px`:y}:{},...v?{"--rte-editor-min-height":typeof v=="number"?`${v}px`:v}:{},...g?{"--rte-editor-padding":g}:{},...m?{"--rte-footer-padding":m}:{}},Ay=typeof N=="number"&&Number.isFinite(N)&&N>=0?N:260,wy={overflow:"hidden"},_y=$l!=null?`${$l}px`:b?`${Lo}px`:`${Math.max(ry,Lo)}px`,ky=e.length===0&&No&&!b,Ny=$l!=null||b||Oo||ky?"hidden":"auto",Yo=_.useRef(b),Wo=Yo.current!==b;Wo&&(Yo.current=b);const Iy=$l!=null?"none":Wo||Oo?`max-height ${Ay}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",Ly={maxHeight:_y,minHeight:b?0:void 0,overflow:Ny,overscrollBehavior:he?"contain":"auto",transition:Iy,willChange:"max-height"},jo=e.find(Q=>Q.type==="tag"),Wt=jo?.text?i.find(Q=>Q.label===jo.text):void 0;return V.jsxs("div",{className:`rich-text-editor ${he?"rte-editor-selected":""}`,style:Sy,"data-disabled":l,ref:U,onMouseDownCapture:_o,onFocusCapture:_o,children:[P,V.jsxs("div",{className:"rich-text-editor-content",ref:X,style:wy,onMouseDown:Q=>{if(e.length!==0)return;const ue=Q.target,re=W.current;if(!re||re.contains(ue)||ue.closest('button, input, a, svg, [role="button"], .rte-footer-files-wrapper'))return;Q.preventDefault(),re.childNodes.length===0&&re.appendChild(document.createElement("br")),re.focus();const de=document.createRange();de.setStart(re,0),de.collapse(!0);const be=window.getSelection();be?.removeAllRanges(),be?.addRange(de)},children:[lt.length>0&&V.jsxs("div",{className:"rte-footer-files-wrapper",children:[Tt.showLeft&&V.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-left",children:V.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-left",onClick:Q1,children:V.jsx("svg",{style:{width:"16px",height:"16px",transform:"rotate(180deg)"},"aria-hidden":"true",children:V.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})}),V.jsx("div",{className:"rte-footer-files-list",ref:He,onScroll:ja,children:lt.map((Q,ue)=>{const re=Q.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(Q.name||""),de=Q.size<1024?`${Q.size}B`:Q.size<1024*1024?`${Math.round(Q.size/1024)}KB`:`${(Q.size/(1024*1024)).toFixed(1)}MB`,be=re?URL.createObjectURL(Q):"";return V.jsxs("div",{className:"rte-footer-file-chip",style:re?{cursor:"pointer"}:void 0,onClick:re?()=>{ne(be),ye(!0)}:void 0,children:[re?V.jsx("img",{style:{width:"32px",height:"32px",objectFit:"contain",background:"#ffffff",border:"0.5px solid #EDF0F2",boxShadow:"0 2px 6px 1px rgba(174, 176, 180, 0.08)",boxSizing:"border-box"},className:"rte-footer-file-thumb",src:be,alt:Q.name}):V.jsx("div",{className:"rte-footer-file-icon",children:V.jsx("svg",{style:{width:"18px",height:"18px"},"aria-hidden":"true",children:V.jsx("use",{xlinkHref:`#${(()=>{const ie=(Q.name||"").split(".").pop()?.toLowerCase()||"";return["xls","xla","xlb","xlc","xlm","xlsx","xlt","xlw","csv","tsv","iif"].includes(ie)?"icon-a-xlsxcsv":["doc","docx","dot","odt","rtf","wiz"].includes(ie)?"icon-docx":["ppt","pptx","pot","ppa","pps","pwz"].includes(ie)?"icon-ppt":["txt","asm","bat","c","cc","conf","cpp","css","cxx","def","dic","eml","h","hh","in","js","ksh","php","pkl","rb","tar","tex","ts","xml"].includes(ie)?"icon-txt":ie==="pdf"?"icon-pdf":["html","htm","json","ics","ifb"].includes(ie)?"icon-a-htmljson":ie==="md"?"icon-md":"icon-lianjie"})()}`})})}),V.jsxs("div",{className:"rte-footer-file-info",children:[V.jsx("span",{className:"rte-footer-file-name",title:Q.name,children:Q.name}),V.jsx("span",{className:"rte-footer-file-size",children:de})]}),V.jsx("span",{className:"rte-footer-file-remove",onClick:ie=>{ie.stopPropagation(),K1(ue)},children:V.jsx("i",{className:"iconfont icon-guanbi ",style:{width:"8px",height:"8px",fontSize:"8px",display:"flex",alignItems:"center"}})})]},`${Q.name}-${Q.size}-${ue}`)})}),Tt.showRight&&V.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-right",children:V.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-right",onClick:X1,children:V.jsx("svg",{style:{width:"16px",height:"16px"},"aria-hidden":"true",children:V.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})})]}),V.jsxs("div",{ref:Z,className:`rich-text-editor-content-body ${e.length===0?"rich-text-editor-content-body-default":""}`,style:Ly,children:[V.jsx("div",{ref:W,className:`rte-editor ${e.length===0?"rte-editor-default":""} ${No&&c?"rte-editor-empty":""} ${e.some(Q=>Q.type==="tag")?"rte-editor-with-agent":""}`,contentEditable:e.length===0,suppressContentEditableWarning:!0,"data-placeholder":c,onMouseDown:Z1,onMouseMove:ey,onMouseUp:ty,onClick:Ey,onDoubleClick:ay,onInput:()=>{Ja(),al()},onKeyDown:Cy,onPaste:Q=>{Ja(),yy(Q)}}),V.jsx("input",{type:"file",ref:le,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:qt}),V.jsx("input",{type:"file",ref:we,className:"rte-file-input",accept:"video/*",onChange:Q=>{const ue=Q.target.files?.[0],re=We.current;ue&&ue.size>1024*1024*1024?j.warning("视频文件不能超过1GB"):ue&&re&&by(re,ue),We.current=null,we.current&&(we.current.value="")}})]})]}),V.jsxs("div",{className:"rich-text-editor-footer",children:[V.jsxs("div",{className:"rich-text-editor-footer-left",children:[V.jsx("div",{className:"rich-text-editor-brand",children:f!=="hideAgent"&&V.jsx(pe.Dropdown,{placement:"topLeft",menu:{selectedKeys:Wt?[String(Wt.key)]:[],items:i.filter(Q=>Q.isShowNew!==1).map(Q=>({key:Q.key,label:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[Q.icon&&V.jsx("i",{className:Q.icon}),V.jsx("span",{children:Q.label})]}),onClick:()=>{u?.(Q)}}))},trigger:["click"],disabled:l||a,overlayClassName:"rte-agent-dropdown",children:V.jsxs("div",{className:"rte-agent-badge",style:{cursor:i.length>0?"pointer":"default"},children:[V.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),V.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})}),!e.find(Q=>Q.type==="tag")&&V.jsxs(V.Fragment,{children:[V.jsx("div",{className:"rte-footer-upload-btn",onClick:()=>oe.current?.click(),title:"上传文件",children:V.jsx("i",{className:"iconfont icon-lianjie",style:{fontSize:"16px"}})}),V.jsx("input",{type:"file",ref:oe,className:"rte-file-input",accept:".pdf,.xla,.xlb,.xlc,.xlm,.xls,.xlsx,.xlt,.xlw,.csv,.tsv,.iif,.doc,.docx,.dot,.odt,.rtf,.pot,.ppa,.pps,.ppt,.pptx,.pwz,.wiz,.asm,.bat,.c,.cc,.conf,.cpp,.css,.cxx,.def,.dic,.eml,.h,.hh,.htm,.html,.ics,.ifb,.in,.js,.json,.ksh,.png,.jpeg,.jpg,.gif,.webp,.md,.php,.pkl,.rb,.tar,.tex,.ts,.txt,.xml,",multiple:!0,onChange:j1})]})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[V.jsxs("div",{className:"rte-brand-badge",children:[V.jsx("div",{className:"rte-brand-badge",children:V.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""})}),V.jsx("span",{className:"rte-brand-text",style:{marginLeft:"4px"},children:"SealSeek 2.0"})]}),!Wt||Wt.points===void 0||Wt.points===null?null:V.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[V.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),V.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(Wt.points)]}),Wt.labelValue===2&&V.jsx("div",{className:"rte-limited-free-badge",children:V.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]}),V.jsx("button",{type:"button",onClick:Go,disabled:a||l||o||!ko,className:"rich-text-editor-send-button",children:a||o?V.jsx("span",{className:"rte-send-spinner"}):V.jsx("i",{className:"iconfont icon-fasong"})})]})]}),yt,V.jsx(pe.Image,{style:{display:"none"},src:J,preview:{visible:fe,onVisibleChange:Q=>ye(Q)}}),Vo,qo,my,vy,zo,hy,xy]})};go.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Eo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",M1=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],B1=({autoLoading:e,batchSize:t,loadingProgress:a,loadIcon:l,onBatchSizeChange:n,onLoadNextPage:r,onStartAutoLoad:i,onStopLoad:u})=>e&&a?V.jsxs("div",{className:"auto_load_progress",children:[l||V.jsx("img",{src:Eo,alt:"自动加载",width:14,height:14}),V.jsxs("span",{children:["正在加载第",a.currentPage,"/",a.totalPages,"页"]}),V.jsx(pe.Progress,{percent:a.percentage,type:"line",size:[160,8]}),V.jsx("span",{onClick:u,className:"auto_load_stop_btn",children:"停止加载"})]}):V.jsxs("div",{className:"auto_load_container",children:[V.jsx("div",{onClick:r,className:"auto_load_next_btn",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:"加载下一页"}),V.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:[V.jsxs("div",{className:"auto_load_btn",onClick:e?void 0:i,children:[l||V.jsx("img",{src:Eo,alt:"自动加载",width:14,height:14}),V.jsx("span",{children:"自动加载"})]}),V.jsx(pe.Select,{value:t,onChange:n,options:M1,disabled:e,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),F1=({current:e,loadIcon:t,pageSize:a,total:l,cachedPages:n,loadedCount:r,autoLoading:i=!1,loadingProgress:u,onChange:s,onLoadNextPage:o,onStartAutoLoad:c,onStopLoading:d})=>{const[h,f]=_.useState(5),y=Math.ceil(l/a),E=_.useMemo(()=>n.length>=y,[n,y]),v=()=>Array.from({length:y},(b,x)=>x+1).filter(b=>!n.includes(b)).slice(0,h),g=(m,b,x)=>{const C=n.includes(m);return b==="prev"||b==="next"||b==="jump-prev"||b==="jump-next"?V.jsx("div",{className:"pageBox",children:x}):V.jsxs("div",{className:"pageBox",style:{backgroundColor:e===m?"#2563EB":"#f5f5f5",color:e===m?"#fff":C?"#171717":"#a3a3a3"},children:[m,!C&&V.jsx("span",{className:"unload_spot"})]})};return V.jsxs("div",{className:"pagination_footer",children:[V.jsxs("div",{className:"pagination_leftWrap",children:[V.jsxs("span",{className:"pagination_total",children:[V.jsx(bt.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",r,"/",l,"条数据"]}),!E&&V.jsx(B1,{loadIcon:t||void 0,autoLoading:i,batchSize:h,loadingProgress:u,disabled:!o||!c,onBatchSizeChange:f,onLoadNextPage:()=>o?.(),onStartAutoLoad:()=>{const m=v();c?.(m)},onStopLoad:()=>d?.()})]}),V.jsx(pe.Pagination,{current:e,pageSize:a,total:l,onChange:m=>s(m),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:g})]})},yo=e=>{const{loading:t,autoLoading:a,loadingProgress:l,columns:n=[],dataSource:r=[],total:i,current:u,pageSize:s,cachedPages:o,onChangePage:c,onLoadNextPage:d,onStartAutoLoad:h,onStopLoading:f,...y}=e,E=_.useRef(null),v=_.useCallback(g=>{c(g),o.includes(g)&&E.current?.scrollTo({key:`${(g-1)*s+1}`})},[o,c,s]);return V.jsxs("div",{className:"flex flex-col",children:[V.jsx(pe.Table,{ref:E,...y,columns:n,dataSource:r,pagination:!1,virtual:!0}),V.jsx(F1,{loading:t,autoLoading:a,loadingProgress:l,current:u,pageSize:s,total:i,loadedCount:r.length,cachedPages:o,onChange:v,onLoadNextPage:d,onStartAutoLoad:h,onStopLoading:f})]})};yo.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const To=({texts:e=[],placeholder:t="请输入内容",animationSpeed:a=100,autoPlay:l=!0,value:n,onChange:r,...i})=>{const[u,s]=_.useState(""),[o,c]=_.useState(0),[d,h]=_.useState(!1),[f,y]=_.useState(!1),[E,v]=_.useState(!1),g=_.useRef(void 0),m=_.useRef(void 0),b=_.useRef(e),x=_.useRef(o),C=_.useRef(f),A=_.useRef(u);_.useEffect(()=>{b.current=e,x.current=o,C.current=f,A.current=u});const O=_.useCallback((w,T)=>{let B=0;v(!0);const z=()=>{B<w.length?(s(w.slice(0,B+1)),B++,m.current=window.setTimeout(z,a)):(v(!1),T?.())};z()},[a]),N=_.useCallback(w=>{let T=A.current.length;const B=()=>{T>0?(s(A.current.slice(0,T-1)),T--,m.current=window.setTimeout(B,a/2)):w?.()};B()},[a]),S=_.useCallback(()=>{if(b.current.length===0||C.current)return;h(!0);const w=b.current[x.current];A.current?N(()=>{O(w,()=>{g.current=window.setTimeout(()=>{c(T=>(T+1)%b.current.length),h(!1)},2e3)})}):O(w,()=>{g.current=window.setTimeout(()=>{c(T=>(T+1)%b.current.length),h(!1)},2e3)})},[N,O]);_.useEffect(()=>(l&&e.length>0&&!f&&S(),()=>{g.current&&window.clearTimeout(g.current),m.current&&window.clearTimeout(m.current)}),[o,f,l,e.length,S]),_.useEffect(()=>{!d&&l&&e.length>0&&!f&&S()},[o,d,l,e.length,f,S]);const L=w=>{y(!0),g.current&&window.clearTimeout(g.current),m.current&&window.clearTimeout(m.current),h(!1),v(!1),i.onFocus?.(w)},I=w=>{y(!1),!n&&e.length>0&&(s(""),c(0)),i.onBlur?.(w)},M=w=>{r?.(w.target.value),i.onChange?.(w)},D=()=>f||n?t:u||t;return V.jsxs("div",{style:{position:"relative"},children:[V.jsx(pe.Input,{...i,value:n,onChange:M,onFocus:L,onBlur:I,placeholder:D(),style:{...i.style,position:"relative",zIndex:1}}),!f&&!n&&u&&V.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[V.jsx("span",{children:u}),E&&V.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),V.jsx("style",{children:`
65
65
  @keyframes blink {
66
66
  0%, 50% { opacity: 1; }
67
67
  51%, 100% { opacity: 0; }