@gientech/modual 2.2.9 → 2.2.11
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/README.md +775 -761
- package/assets/{GientechStreamReader-Btox1v82.js → GientechStreamReader-Cw7qAuh1.js} +1 -1
- package/assets/{LeftOutlined-DbVWaJal.js → LeftOutlined-e0IEJaBy.js} +1 -1
- package/assets/_commonjsHelpers-_d1bhYXs.js +1 -0
- package/assets/{circle-plus-Bqwlq2UM.js → circle-plus-D-3IlJj0.js} +1 -1
- package/assets/database.svg +11 -11
- package/assets/database_add.svg +53 -53
- package/assets/database_connect.svg +66 -66
- package/assets/database_upload.svg +29 -29
- package/assets/databse.svg +6 -6
- package/assets/defaultWeLogo.svg +14 -14
- package/assets/graph.svg +4 -4
- package/assets/iconAi.svg +9 -0
- package/assets/{index-zCzB-56N.js → index-B1tZE4X5.js} +1 -1
- package/assets/{index-CaKTISxy.js → index-BL0njpis.js} +8 -8
- package/assets/{index-DiTGnLML.js → index-BmxlskIi.js} +1 -1
- package/assets/{index-BB-K4Uv2.js → index-BtIbpTbT.js} +1 -1
- package/assets/{index-O8MDfMV6.js → index-BzdLAhNN.js} +1 -1
- package/assets/{index-BbQ5_tfg.js → index-CJSVtVuI.js} +20 -20
- package/assets/{index-CQChY5LV.js → index-D3P9OTJx.js} +1 -1
- package/assets/{index-DCnYE71u.js → index-DfjY9fMd.js} +18 -18
- package/assets/{index-DIaywdNt.js → index-DhiJUMaM.js} +1 -1
- package/assets/{index-zXg3ABkl.js → index-WUBFv9gs.js} +55 -55
- package/assets/knowledge.svg +4 -4
- package/assets/{lib_enter-e1LoilHd-DARjRYE-.js → lib_enter-e1LoilHd-DrO8w6Nj.js} +3 -3
- package/assets/mysql.svg +14 -14
- package/assets/{plus-B4_cWXV7.js → plus-CmPO6ys9.js} +1 -1
- package/assets/prism-cpp-DTm5qrps-DEcnTKnd.js +1 -0
- package/assets/prism-java-l04-K_JR-DTIQeGI0.js +1 -0
- package/assets/prism-php-Cq3Hq1Wv-BQ6y6LDZ.js +1 -0
- package/assets/prism-python-CP37PFZv-BvLoHz-u.js +1 -0
- package/assets/prism-ruby-DcAmdHPZ-CavK5dyy.js +1 -0
- package/assets/prism-rust-CuWIv8B8-D_BYGjS-.js +1 -0
- package/assets/prism-typescript-DSWPRTnC-CeVC8Yup.js +1 -0
- package/assets/{search-B5sYxJby.js → search-DH1utHsY.js} +1 -1
- package/assets/sensitive.svg +5 -5
- package/assets/{style-CLviPb8g.js → style-Ct4HaW_s.js} +7 -7
- package/assets/{triangle-alert-DMLBtHZo.js → triangle-alert-BjbZI8PD.js} +1 -1
- package/assets/{x-BHe7G4Ln.js → x-BUKpZUhr.js} +1 -1
- package/assistantConfig.js +20 -20
- package/chat.js +1 -1
- package/chatCompare.js +1 -1
- package/database.js +2 -2
- package/databaseId.js +1 -1
- package/databaseTable.js +2 -2
- package/index.js +1 -1
- package/modelManage.js +2 -2
- package/package.json +11 -6
- package/prismSetup.d.ts +10 -0
- package/prismSetup.js +9 -0
- package/sensitive.js +6 -6
- package/sensitiveWords.js +1 -1
- package/streamFilesReader.js +1 -1
- package/worker/pdf.worker.min.js +21 -21
- package/assets/prism-cpp-DTm5qrps-DCvIrbpC.js +0 -1
- package/assets/prism-java-l04-K_JR-DA8-aCBu.js +0 -1
- package/assets/prism-php-Cq3Hq1Wv-kjCPib2J.js +0 -1
- package/assets/prism-python-CP37PFZv-BhlyiSdN.js +0 -1
- package/assets/prism-ruby-DcAmdHPZ-k8JrZLoB.js +0 -1
- package/assets/prism-rust-CuWIv8B8-OHEgXNIx.js +0 -1
- package/assets/prism-typescript-DSWPRTnC-XMYg5ury.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as w,jsxs as ee,Fragment as at}from"react/jsx-runtime";import*as d0 from"react";import we,{createElement as ir,PureComponent as La,useState as oe,useMemo as Fe,createContext as Kn,Children as Oa,cloneElement as Ma,Component as qa,useRef as He,useEffect as Ee,useCallback as dt}from"react";import{c as Y0,
|
|
1
|
+
import{jsx as w,jsxs as ee,Fragment as at}from"react/jsx-runtime";import*as d0 from"react";import we,{createElement as ir,PureComponent as La,useState as oe,useMemo as Fe,createContext as Kn,Children as Oa,cloneElement as Ma,Component as qa,useRef as He,useEffect as Ee,useCallback as dt}from"react";import{c as Y0,bp as Ua,_ as Ha,aU as $r,G as Gn,f as Br,F as Je,H as X0,bq as Xn,aG as Jt,J as Wr,bo as $a,T as nt,x as Wa}from"./index-DfjY9fMd.js";import{f as ja,r as Va,c as Ka,B as Ga,z as Xa,d as Yn,g as Qn,a as Zn,b as pr,e as Ar,h as hr,D as Ya,i as Qa,T as vr,j as or,k as Za,l as Ja,G as ei,m as ti,W as ri,n as ni,o as ai,p as Jn,q as ii,K as oi,s as si,u as ui,F as ci,t as jr,v as sr,Q as li,J as di,w as xi,x as fi,y as pi,A as hi,E as vi}from"./index-WUBFv9gs.js";import{o as gi,F as mi,U as Vr}from"./lib_enter-e1LoilHd-DrO8w6Nj.js";import{u as v0}from"./index-CpW6Dhpp.js";import{b as Ci,h as Kr,a as yi,d as Fi}from"./index-CJSVtVuI.js";import{D as Ei}from"./index-BL0njpis.js";import{P as Bi}from"./plus-CmPO6ys9.js";import{S as gr}from"./search-DH1utHsY.js";import{X as ea}from"./x-BUKpZUhr.js";import{s as Me,S as xt,M as ta}from"./index-BmxlskIi.js";import{a as ra,c as ur}from"./_commonjsHelpers-_d1bhYXs.js";import{P as Ai}from"./index-BtIbpTbT.js";import{C as bi,G as na,c as Di,r as _i}from"./GientechStreamReader-Cw7qAuh1.js";import{P as wi}from"./index-BzdLAhNN.js";/* empty css *//* empty css */import{D as aa}from"./index-B1tZE4X5.js";import"../database.js";import"../databaseId.js";import"../databaseTable.js";import"../modelManage.js";import"../sensitive.js";import"../assistantConfig.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -49,12 +49,12 @@ import{jsx as w,jsxs as ee,Fragment as at}from"react/jsx-runtime";import*as d0 f
|
|
|
49
49
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
50
50
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
51
51
|
THE SOFTWARE.
|
|
52
|
-
*/function mr(r){if(r.constructor!==Array)throw new TypeError("Expected array.");if(r.length===16)return r;if(r.length===6){var u=Q0();return u[0]=r[0],u[1]=r[1],u[4]=r[2],u[5]=r[3],u[12]=r[4],u[13]=r[5],u}throw new RangeError("Expected array with either 6 or 16 values.")}function Q0(){for(var r=[],u=0;u<16;u++)u%5==0?r.push(1):r.push(0);return r}function to(r,u){for(var t=mr(r),e=mr(u),p=[],c=0;c<4;c++)for(var d=[t[c],t[c+4],t[c+8],t[c+12]],s=0;s<4;s++){var h=s*4,n=[e[h],e[h+1],e[h+2],e[h+3]],o=d[0]*n[0]+d[1]*n[1]+d[2]*n[2]+d[3]*n[3];p[c+h]=o}return p}function ro(r){if(typeof r=="string"){var u=r.match(/matrix(3d)?\(([^)]+)\)/);if(u){var t=u[2].split(", ").map(parseFloat);return mr(t)}}return Q0()}function no(r){var u=Q0();return u[0]=r,u}function ao(r){var u=Q0();return u[5]=r,u}function io(r){var u=Q0();return u[12]=r,u}function oo(r){var u=Q0();return u[13]=r,u}var pt=function(r){return typeof r=="number"},ca=function(r){return typeof r=="function"},la=function(r){return Object.prototype.toString.call(r)==="[object Object]"},G0=function(r){return Array.prototype.slice.apply(r)},da=function(r){var u=r.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(u).filter(function(t){return u[t]>1})};function A0(r){return[].slice.call(arguments,1).forEach(function(u){if(u)for(var t in u)Object.prototype.hasOwnProperty.call(u,t)&&(r[t]=u[t])}),r}var Cr,yr=function(r,u,t){return r+(u-r)*t},xa={__proto__:null,isNumber:pt,isFunction:ca,isObject:la,toArray:G0,getDuplicateValsAsStrings:da,assign:A0,tweenProp:yr},Dr="data-flip-id",_r="data-inverse-flip-id",wr="data-portal-key",so="data-exit-container",ft={__proto__:null,DATA_FLIP_ID:Dr,DATA_INVERSE_FLIP_ID:_r,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:wr},Fr={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},en=function(r){return la(r)?r:Object.keys(Fr).indexOf(r)>-1?Fr[r]:{}};typeof window<"u"&&(Cr=window.requestAnimationFrame);var uo=Cr=Cr||function(r){window.setTimeout(r,1e3/60)},co=Date.now(),lo=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-co};function fa(r,u){var t=r.indexOf(u);t!==-1&&r.splice(t,1)}var xo=(function(){function r(){}return r.prototype.run=function(){var u=this;uo(function(){u.springSystem.loop(lo())})},r})(),dr=function(){this.position=0,this.velocity=0},fo=0,s0=.001,po=(function(){function r(t){this._id="s"+fo++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new dr,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new dr,this._restSpeedThreshold=.001,this._tempState=new dr,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var u=r.prototype;return u.getId=function(){return this._id},u.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},u.setSpringConfig=function(t){return this._springConfig=t,this},u.getCurrentValue=function(){return this._currentState.position},u.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},u.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,p=this.listeners.length;e<p;e++){var c=this.listeners[e].onSpringEndStateChange;c&&c(this)}return this},u.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},u.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,p=this.listeners.length;e<p;e++){var c=this.listeners[e];c.onSpringUpdate&&c.onSpringUpdate(this)}return this},u.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},u.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},u.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},u.advance=function(t,e){var p=this.isAtRest();if(!p||!this._wasAtRest){var c=e;e>.064&&(c=.064),this._timeAccumulator+=c;for(var d,s,h,n,o,E,l=this._springConfig.tension,v=this._springConfig.friction,g=this._currentState.position,i=this._currentState.velocity,a=this._tempState.position,m=this._tempState.velocity;this._timeAccumulator>=s0;)this._timeAccumulator-=s0,this._timeAccumulator<s0&&(this._previousState.position=g,this._previousState.velocity=i),s=l*(this._endValue-a)-v*i,n=l*(this._endValue-(a=g+(d=i)*s0*.5))-v*(m=i+s*s0*.5),E=l*(this._endValue-(a=g+(h=m)*s0*.5))-v*(m=i+n*s0*.5),a=g+(o=m)*s0,g+=1/6*(d+2*(h+o)+(m=i+E*s0))*s0,i+=1/6*(s+2*(n+E)+(l*(this._endValue-a)-v*m))*s0;this._tempState.position=a,this._tempState.velocity=m,this._currentState.position=g,this._currentState.velocity=i,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/s0),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),p=!0);var x=!1;this._wasAtRest&&(this._wasAtRest=!1,x=!0);var f=!1;p&&(this._wasAtRest=!0,f=!0),this.notifyPositionUpdated(x,f)}},u.notifyPositionUpdated=function(t,e){var p=this;this.listeners.filter(Boolean).forEach(function(c){t&&c.onSpringActivate&&!p._onActivateCalled&&(c.onSpringActivate(p),p._onActivateCalled=!0),c.onSpringUpdate&&c.onSpringUpdate(p),e&&c.onSpringAtRest&&c.onSpringAtRest(p)})},u.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},u.wasAtRest=function(){return this._wasAtRest},u.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},u._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t)},u.addListener=function(t){return this.listeners.push(t),this},u.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(p){var c;t[p]=(c=t[p],function(){c.apply(void 0,[].slice.call(arguments)),e.removeListener(t)})}),this.listeners.push(t),this},u.removeListener=function(t){return fa(this.listeners,t),this},r})(),pa=(function(){function r(t){this.looper=t||new xo,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var u=r.prototype;return u.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},u.createSpringWithConfig=function(t){var e=new po(this);return this.registerSpring(e),e.setSpringConfig(t),e},u.getIsIdle=function(){return this._isIdle},u.registerSpring=function(t){this._springRegistry[t.getId()]=t},u.deregisterSpring=function(t){fa(this._activeSprings,t),delete this._springRegistry[t.getId()]},u.advance=function(t,e){for(var p=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(d){d.systemShouldAdvance()?d.advance(t/1e3,e/1e3):p._idleSpringIndices.push(p._activeSprings.indexOf(d))});this._idleSpringIndices.length>0;){var c=this._idleSpringIndices.pop();c>=0&&this._activeSprings.splice(c,1)}},u.loop=function(t){var e;this._lastTimeMillis===-1&&(this._lastTimeMillis=t-1);var p=t-this._lastTimeMillis;this._lastTimeMillis=t;var c=0,d=this.listeners.length;for(c=0;c<d;c++)(e=this.listeners[c]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,p),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),c=0;c<d;c++)(e=this.listeners[c]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run()},u.activateSpring=function(t){var e=this._springRegistry[t];this._activeSprings.indexOf(e)===-1&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},r})(),ho=new pa,ha=function(r){var u=r.springConfig,t=u.overshootClamping,e=r.getOnUpdateFunc,p=r.onAnimationEnd,c=r.onSpringActivate,d=ho.createSpring(u.stiffness,u.damping);d.setOvershootClampingEnabled(!!t);var s={onSpringActivate:c,onSpringAtRest:function(){d.destroy(),p()},onSpringUpdate:e({spring:d,onAnimationEnd:p})};return d.addListener(s),d},tn=function(r){var u=ha(r);return u.setEndValue(1),u},rn=function(r,u){if(u===void 0&&(u={}),r&&r.length){u.reverse&&r.reverse();var t,e=typeof(t=u.speed)!="number"?1.1:1+Math.min(Math.max(5*t,0),5),p=1/Math.max(Math.min(r.length,100),10),c=r.map(function(d,s){var h=d.getOnUpdateFunc;return d.getOnUpdateFunc=function(n){var o=h(n);return function(E){var l=E.getCurrentValue();(l=l<.01?0:l>.99?1:l)>=p&&c[s+1]&&c[s+1](Math.max(Math.min(l*e,1),0)),o(E)}},d}).map(function(d){var s=ha(d);if(s)return s.setEndValue.bind(s)}).filter(Boolean);c[0]&&c[0](1)}},nn=function(r){return[0,1,4,5,12,13].map(function(u){return r[u]})},an=function(r){return r.top<window.innerHeight&&r.bottom>0&&r.left<window.innerWidth&&r.right>0};function on(r){return JSON.parse(r.dataset.flipConfig||"{}")}var va=function(r,u){var t;return A0(r,((t={})[u[0]]=u[1],t))},ga=function(r,u){return G0(u?document.querySelectorAll("["+wr+'="'+u+'"]'):r.querySelectorAll("["+Dr+"]"))},ma=function(r){return r.map(function(u){return[u,u.getBoundingClientRect()]})},vo=function(r){var u=r.cachedOrderedFlipIds,t=u===void 0?[]:u,e=r.inProgressAnimations,p=e===void 0?{}:e,c=r.flippedElementPositionsBeforeUpdate,d=c===void 0?{}:c,s=r.flipCallbacks,h=s===void 0?{}:s,n=r.containerEl,o=r.applyTransformOrigin,E=r.spring,l=r.debug,v=r.portalKey,g=r.staggerConfig,i=g===void 0?{}:g,a=r.decisionData,m=a===void 0?{}:a,x=r.handleEnterUpdateDelete,f=r.onComplete,F=r.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var b,C=ma(ga((b={element:n,portalKey:v}).element,b.portalKey)).map(function(q){var H=q[0],te=q[1],T=window.getComputedStyle(H);return[H.dataset.flipId,{element:H,rect:te,opacity:parseFloat(T.opacity),transform:T.transform}]}).reduce(va,{}),_=(function(q){var H=q.containerEl,te=q.portalKey;return te?(function(T){return function(P){return G0(document.querySelectorAll("["+wr+'="'+T+'"]'+P))}})(te):H?(function(T){var P=Math.random().toFixed(5);return T.dataset.flipperId=P,function(S){return G0(T.querySelectorAll('[data-flipper-id="'+P+'"] '+S))}})(H):function(){return[]}})({containerEl:n,portalKey:v}),y=(function(q){return function(H){return q("["+Dr+'="'+H+'"]')[0]}})(_),k=function(q){return d[q]&&C[q]},D=Object.keys(d).concat(Object.keys(C)).filter(function(q){return!k(q)}),R={flipCallbacks:h,getElement:y,flippedElementPositionsBeforeUpdate:d,flippedElementPositionsAfterUpdate:C,inProgressAnimations:p,decisionData:m},I=(function(q){var H,te=q.unflippedIds,T=q.flipCallbacks,P=q.getElement,S=q.flippedElementPositionsBeforeUpdate,N=q.flippedElementPositionsAfterUpdate,W=q.inProgressAnimations,V=q.decisionData,Y=te.filter(function(ue){return N[ue]}).filter(function(ue){return T[ue]&&T[ue].onAppear}),$=te.filter(function(ue){return S[ue]&&T[ue]&&T[ue].onExit}),ae=new Promise(function(ue){H=ue}),fe=[],e0=0,De=$.map(function(ue,ge){var me=S[ue].domDataForExitAnimations,Ie=me.element,Xe=me.parent,Ye=me.childPosition,Qe=Ye.top,a0=Ye.left,Re=Ye.width,Se=Ye.height;getComputedStyle(Xe).position==="static"&&(Xe.style.position="relative"),Ie.style.transform="matrix(1, 0, 0, 1, 0, 0)",Ie.style.position="absolute",Ie.style.top=Qe+"px",Ie.style.left=a0+"px",Ie.style.height=Se+"px",Ie.style.width=Re+"px";var _e=fe.filter(function(u0){return u0[0]===Xe})[0];_e||(_e=[Xe,document.createDocumentFragment()],fe.push(_e)),_e[1].appendChild(Ie),e0+=1;var Ke=function(){try{Xe.removeChild(Ie)}catch{}finally{(e0-=1)==0&&H()}};return W[ue]={stop:Ke},function(){return T[ue].onExit(Ie,ge,Ke,V)}});return fe.forEach(function(ue){ue[0].appendChild(ue[1])}),De.length||H(),{hideEnteringElements:function(){Y.forEach(function(ue){var ge=P(ue);ge&&(ge.style.opacity="0")})},animateEnteringElements:function(){Y.forEach(function(ue,ge){var me=P(ue);me&&T[ue].onAppear(me,ge,V)})},animateExitingElements:function(){return De.forEach(function(ue){return ue()}),ae}}})(A0({},R,{unflippedIds:D})),z=I.hideEnteringElements,M=I.animateEnteringElements,U=I.animateExitingElements,G=A0({},R,{containerEl:n,flippedIds:t.filter(k),applyTransformOrigin:o,spring:E,debug:l,staggerConfig:i,scopedSelector:_,onComplete:f});F&&F(n,m);var Z=(function(q){var H,te=q.flippedIds,T=q.flipCallbacks,P=q.inProgressAnimations,S=q.flippedElementPositionsBeforeUpdate,N=q.flippedElementPositionsAfterUpdate,W=q.applyTransformOrigin,V=q.spring,Y=q.getElement,$=q.debug,ae=q.staggerConfig,fe=ae===void 0?{}:ae,e0=q.decisionData,De=e0===void 0?{}:e0,ue=q.onComplete,ge=q.containerEl,me=new Promise(function(j){H=j});if(ue&&me.then(function(){return ue(ge,De)}),!te.length)return function(){return H([]),me};var Ie=[],Xe=Y(te[0]),Ye=Xe?Xe.ownerDocument.querySelector("body"):document.querySelector("body");da(te);var Qe=te.map(function(j){var de=S[j].rect,Be=N[j].rect,Ge=S[j].opacity,D0=N[j].opacity,We=Be.width<1||Be.height<1,pe=N[j].element;if(!an(de)&&!an(Be)||!pe)return!1;var _0,z0,w0,Ze=on(pe),S0=(w0=(z0=(_0={flipperSpring:V,flippedSpring:Ze.spring})===void 0?{}:_0).flippedSpring,A0({},Fr.noWobble,en(z0.flipperSpring),en(w0))),k0=Ze.stagger===!0?"default":Ze.stagger,I0={element:pe,id:j,stagger:k0,springConfig:S0};if(T[j]&&T[j].shouldFlip&&!T[j].shouldFlip(De.previous,De.current))return!1;var L0=Math.abs(de.left-Be.left)+Math.abs(de.top-Be.top),Z0=Math.abs(de.width-Be.width)+Math.abs(de.height-Be.height),J0=Math.abs(D0-Ge);if(de.height===0&&Be.height===0||de.width===0&&Be.width===0||L0<.5&&Z0<.5&&J0<.01)return!1;var O0=ro(N[j].transform),t0={matrix:O0},i0={matrix:[]},x0=[O0];Ze.translate&&(x0.push(io(de.left-Be.left)),x0.push(oo(de.top-Be.top))),Ze.scale&&(x0.push(no(Math.max(de.width,1)/Math.max(Be.width,1))),x0.push(ao(Math.max(de.height,1)/Math.max(Be.height,1)))),Ze.opacity&&(i0.opacity=Ge,t0.opacity=D0);var f0=[];if(!T[j]||!T[j].shouldInvert||T[j].shouldInvert(De.previous,De.current)){var et=(function(Ae,qe){return G0(Ae.querySelectorAll("["+_r+'="'+qe+'"]'))})(pe,j);f0=et.map(function(Ae){return[Ae,on(Ae)]})}i0.matrix=nn(x0.reduce(to)),t0.matrix=nn(t0.matrix);var Te,se=(function(Ae){var qe=Ae.element,r0=Ae.invertedChildren,g0=Ae.body;return function(F0){var c0=F0.matrix,R0=F0.opacity,M0=F0.forceMinVals;if(pt(R0)&&(qe.style.opacity=R0+""),M0&&(qe.style.minHeight="1px",qe.style.minWidth="1px"),c0){var q0=(function(N0){return"matrix("+N0.join(", ")+")"})(c0);qe.style.transform=q0,r0&&(function(N0){var U0=N0.matrix,nr=N0.body;N0.invertedChildren.forEach(function(it){var ot=it[0],st=it[1];if(nr.contains(ot)){var ut=U0[0],ct=U0[3],ar=U0[5],n0={translateX:0,translateY:0,scaleX:1,scaleY:1},tt="";st.translate&&(n0.translateX=-U0[4]/ut,n0.translateY=-ar/ct,tt+="translate("+n0.translateX+"px, "+n0.translateY+"px)"),st.scale&&(n0.scaleX=1/ut,n0.scaleY=1/ct,tt+=" scale("+n0.scaleX+", "+n0.scaleY+")"),ot.style.transform=tt}})})({invertedChildren:r0,matrix:c0,body:g0})}}})({element:pe,invertedChildren:f0,body:Ye});if(T[j]&&T[j].onComplete){var y0=T[j].onComplete;Te=function(){return y0(pe,De)}}var Pe=pt(i0.opacity)&&pt(t0.opacity)&&i0.opacity!==t0.opacity,je=!1;return A0({},I0,{stagger:k0,springConfig:S0,getOnUpdateFunc:function(Ae){var qe=Ae.spring,r0=Ae.onAnimationEnd;return P[j]={destroy:qe.destroy.bind(qe),onAnimationEnd:r0},function(g0){T[j]&&T[j].onSpringUpdate&&T[j].onSpringUpdate(g0.getCurrentValue()),je||(je=!0,T[j]&&T[j].onStart&&T[j].onStart(pe,De));var F0=g0.getCurrentValue();if(Ye.contains(pe)){var c0={matrix:[]};c0.matrix=i0.matrix.map(function(R0,M0){return yr(R0,t0.matrix[M0],F0)}),Pe&&(c0.opacity=yr(i0.opacity,t0.opacity,F0)),se(c0)}else g0.destroy()}},initializeFlip:function(){se({matrix:i0.matrix,opacity:Pe?i0.opacity:void 0,forceMinVals:We}),T[j]&&T[j].onStartImmediate&&T[j].onStartImmediate(pe,De),Ze.transformOrigin?pe.style.transformOrigin=Ze.transformOrigin:W&&(pe.style.transformOrigin="0 0"),f0.forEach(function(Ae){var qe=Ae[0],r0=Ae[1];r0.transformOrigin?qe.style.transformOrigin=r0.transformOrigin:W&&(qe.style.transformOrigin="0 0")})},onAnimationEnd:function(Ae){delete P[j],ca(Te)&&Te(),pe.style.transform="",f0.forEach(function(qe){qe[0].style.transform=""}),We&&pe&&(pe.style.minHeight="",pe.style.minWidth=""),Ae||(Ie.push(j),Ie.length>=Qe.length&&H(Ie))},delayUntil:Ze.delayUntil})}).filter(Boolean);if(Qe.forEach(function(j){return(0,j.initializeFlip)()}),$)return function(){};var a0=Qe.filter(function(j){return j.delayUntil&&(de=j.delayUntil,Qe.filter(function(Be){return Be.id===de}).length);var de}),Re={},Se={},_e={};a0.forEach(function(j){j.stagger?(_e[j.stagger]=!0,Se[j.delayUntil]?Se[j.delayUntil].push(j.stagger):Se[j.delayUntil]=[j.stagger]):Re[j.delayUntil]?Re[j.delayUntil].push(j):Re[j.delayUntil]=[j]});var Ke=Qe.filter(function(j){return j.stagger}).reduce(function(j,de){return j[de.stagger]?j[de.stagger].push(de):j[de.stagger]=[de],j},{}),u0=Qe.filter(function(j){return a0.indexOf(j)===-1});return u0.forEach(function(j){j.onSpringActivate=function(){Re[j.id]&&Re[j.id].forEach(tn),Se[j.id]&&Object.keys(Se[j.id].reduce(function(de,Be){var Ge;return A0(de,((Ge={})[Be]=!0,Ge))},{})).forEach(function(de){rn(Ke[de],fe[de])})}}),function(){return Qe.length||H([]),u0.filter(function(j){return!j.stagger}).forEach(tn),Object.keys(Ke).forEach(function(j){_e[j]||rn(Ke[j],fe[j])}),me}})(G);x?x({hideEnteringElements:z,animateEnteringElements:M,animateExitingElements:U,animateFlippedElements:Z}):(z(),U().then(M),Z())}},go=function(r){var u=r.element,t=r.flipCallbacks,e=t===void 0?{}:t,p=r.inProgressAnimations,c=p===void 0?{}:p,d=ga(u,r.portalKey),s=G0(u.querySelectorAll("["+_r+"]")),h={},n=[],o={};d.filter(function(v){return e&&e[v.dataset.flipId]&&e[v.dataset.flipId].onExit}).forEach(function(v){var g=v.parentNode;if(v.closest){var i=v.closest("["+so+"]");i&&(g=i)}var a=n.findIndex(function(m){return m[0]===g});a===-1&&(n.push([g,g.getBoundingClientRect()]),a=n.length-1),h[v.dataset.flipId]=n[a][1],o[v.dataset.flipId]=g});var E=ma(d),l=E.map(function(v){var g=v[0],i=v[1],a={};if(e&&e[g.dataset.flipId]&&e[g.dataset.flipId].onExit){var m=h[g.dataset.flipId];A0(a,{element:g,parent:o[g.dataset.flipId],childPosition:{top:i.top-m.top,left:i.left-m.left,width:i.width,height:i.height}})}return[g.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(g).opacity||"1"),domDataForExitAnimations:a}]}).reduce(va,{});return(function(v,g){Object.keys(v).forEach(function(i){v[i].destroy&&v[i].destroy(),v[i].onAnimationEnd&&v[i].onAnimationEnd(!0),delete v[i]}),g.forEach(function(i){i.style.transform="",i.style.opacity=""})})(c,d.concat(s)),{flippedElementPositions:l,cachedOrderedFlipIds:E.map(function(v){return v[0].dataset.flipId})}};new pa;function Zt(){return Zt=Object.assign?Object.assign.bind():function(r){for(var u=1;u<arguments.length;u++){var t=arguments[u];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},Zt.apply(this,arguments)}function Er(r,u){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Er(r,u)}function Ca(r,u){if(r==null)return{};var t,e,p={},c=Object.keys(r);for(e=0;e<c.length;e++)u.indexOf(t=c[e])>=0||(p[t]=r[t]);return p}var ya=Kn({}),Fa=Kn("portal"),Ea=(function(r){var u,t;function e(){for(var c,d=arguments.length,s=new Array(d),h=0;h<d;h++)s[h]=arguments[h];return(c=r.call.apply(r,[this].concat(s))||this).inProgressAnimations={},c.flipCallbacks={},c.el=void 0,c}t=r,(u=e).prototype=Object.create(t.prototype),u.prototype.constructor=u,Er(u,t);var p=e.prototype;return p.getSnapshotBeforeUpdate=function(c){return c.flipKey!==this.props.flipKey&&this.el?go({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},p.componentDidUpdate=function(c,d,s){this.props.flipKey!==c.flipKey&&this.el&&vo({flippedElementPositionsBeforeUpdate:s.flippedElementPositions,cachedOrderedFlipIds:s.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:c.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},p.render=function(){var c=this,d=this.props,s=d.portalKey,h=we.createElement(ya.Provider,{value:this.flipCallbacks},we.createElement(d.element,{className:d.className,ref:function(n){return c.el=n}},this.props.children));return s&&(h=we.createElement(Fa.Provider,{value:s},h)),h},e})(qa);Ea.defaultProps={applyTransformOrigin:!0,element:"div"};var mo=["children","flipId","inverseFlipId","portalKey"],Co=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],sn=function(r){var u,t=r.children,e=r.flipId,p=r.inverseFlipId,c=r.portalKey,d=Ca(r,mo),s=t,h=(function(o){return typeof o=="function"})(s);if(!h)try{s=Oa.only(t)}catch{throw new Error("Each Flipped component must wrap a single child")}d.scale||d.translate||d.opacity||xa.assign(d,{translate:!0,scale:!0,opacity:!0});var n=((u={})[ft.DATA_FLIP_CONFIG]=JSON.stringify(d),u);return e!==void 0?n[ft.DATA_FLIP_ID]=String(e):p&&(n[ft.DATA_INVERSE_FLIP_ID]=String(p)),c!==void 0&&(n[ft.DATA_PORTAL_KEY]=c),h?s(n):Ma(s,n)},Ba=function(r){var u=r.children,t=r.flipId,e=r.shouldFlip,p=r.shouldInvert,c=r.onAppear,d=r.onStart,s=r.onStartImmediate,h=r.onComplete,n=r.onExit,o=r.onSpringUpdate,E=Ca(r,Co);return u?E.inverseFlipId?we.createElement(sn,Zt({},E),u):we.createElement(Fa.Consumer,null,function(l){return we.createElement(ya.Consumer,null,function(v){return xa.isObject(v)&&t&&(v[t]={shouldFlip:e,shouldInvert:p,onAppear:c,onStart:d,onStartImmediate:s,onComplete:h,onExit:n,onSpringUpdate:o}),we.createElement(sn,Zt({flipId:t},E,{portalKey:l}),u)})}):null};Ba.displayName="Flipped";function yo(r){const{data:u,activedItem:t,onChange:e,onDelete:p,sortRules:c=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:d,assistantList:s,height:h=400,styles:n={},hasMore:o=!1,loadingMore:E=!1}=r,l=u.map(k=>k.sessionId+"-"+k.gmtModified).join(","),v=Fe(()=>{const k=c.length>0?c:[{label:"\u5F53\u5929",dayPeriod:1}],D=eo(u,k),R=k.every(z=>!D[z.label]||D[z.label].length===0),I=[];return k.forEach(z=>{D[z.label]&&D[z.label].length>0&&(I.push({type:"group",label:z.label}),D[z.label].forEach(M=>I.push({type:"item",data:M})))}),D.other.length>0&&!R&&(I.push({type:"group",label:"\u5176\u4ED6"}),D.other.forEach(z=>I.push({type:"item",data:z}))),R&&D.other.length>0&&D.other.forEach(z=>I.push({type:"item",data:z})),I},[u,c,l]),g=Fe(()=>v.map(k=>k.type==="group"?`g:${k.label}`:`i:${k.data.sessionId}`).join("|"),[v]),i=56,a=14,m=36,x=k=>k===v.length?m:v[k].type==="group"?32:i+a,f=He(null),F=Fe(()=>v.findIndex(k=>{var D;return k.type==="item"&&((D=k.data)==null?void 0:D.sessionId)===t}),[v,t]),b=Fe(()=>v.findIndex(k=>k.type==="item"),[v]),C=He(void 0);Ee(()=>{const k=C.current;t!==k&&F>-1&&F===b&&f.current&&f.current.scrollToItem(F,"start"),C.current=t},[t,F,b]);const _=He(0);if(Ee(()=>{if(f.current){const k=_.current,D=v.length;if(_.current=D,D!==k){const I=(k>0?Math.abs(D-k)/k:1)>.5||k<10&&D>20;f.current.resetAfterIndex(0,I)}}},[v.length]),Ee(()=>{f.current&&f.current.resetAfterIndex(0,!0)},[g]),v.length===0)return w("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const y=(n==null?void 0:n.colors)||{};return w(Ea,{flipKey:l,spring:{stiffness:180,damping:18},children:w(Zi,{ref:f,height:h,width:"100%",itemCount:v.length+1,itemSize:x,itemKey:k=>{if(k===v.length)return"footer";const D=v[k];return D.type==="item"?D.data.sessionId:`group-${D.label}`},onItemsRendered:({visibleStopIndex:k})=>{o&&!E&&k>=v.length-1-3&&typeof d=="function"&&d("conversations:load_more")},style:{overflowX:"hidden"},children:({index:k,style:D})=>{if(k===v.length){const I=(n==null?void 0:n.colors)||{};return w("div",{style:{...D,height:m,lineHeight:`${m}px`,textAlign:"center",fontSize:"10px",color:I.textMuted||"#9ca3af",background:I.groupBg||"white"},children:E?"\u52A0\u8F7D\u4E2D...":o?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const R=v[k];return R.type==="group"?w("div",{style:{...D,background:y.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:R.label}):w(Ba,{flipId:R.data.sessionId,children:w("div",{style:D,className:"px-[12px] py-[2px]",children:w(Ji,{isActive:t===R.data.sessionId,isDisabled:!1,isNew:R.data.isNew,data:R.data,eventsEmit:d,assistantList:s,styles:n})})},R.data.sessionId)}})})}const Fo=({value:r,eventsEmit:u,setSearch:t,style:e,styles:p={}})=>{const{messages:c}=er(),d=p.colors||{},s=p.radius||"12px",h=d.border||"#e5e7eb",n=d.primary||"#2563eb",o=p.headerBg||d.sidebarBg||d.background||"#fff",[E,l]=we.useState(!1),v=we.useRef(null);we.useEffect(()=>{E&&v.current&&v.current.focus()},[E]);const g=()=>{l(!1),t("")};return ee("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...e,background:o,borderTopLeftRadius:s,borderTopRightRadius:s},children:[w("button",{className:"border-none flex items-center justify-center",onClick:()=>{l(!1),u&&u("conversation:create")},title:c.sidebar.newConversation,style:{height:42,borderRadius:"90px",background:n,color:d.buttonText||"#fff",fontWeight:600,boxShadow:p.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:E?"0 0":"0 14px",minWidth:E?0:180,width:E?0:void 0,opacity:E?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:E?"none":"auto"},children:ee("div",{className:"flex items-center gap-2",children:[w(Bi,{size:18}),w("span",{className:"text-sm",children:c.sidebar.newChat})]})}),E?ee("div",{className:"flex-1 min-w-0 relative",children:[w("input",{ref:v,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:c.sidebar.searchPlaceholder,value:r,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&g()},style:{minWidth:0,width:"100%",borderRadius:s,background:d.inputBg||"#f4f4f5",border:`1px solid ${h}`,color:d.text||"#222",outline:"none",paddingRight:40}}),w("button",{className:"absolute right-3 flex items-center justify-center transition-colors hover:bg-gray-200 rounded-full",style:{width:20,height:20,color:d.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:g,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:i=>i.preventDefault(),children:w(ta,{size:16})})]}):w("button",{className:"ml-auto flex items-center justify-center transition-colors hover:bg-gray-50",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${h}`,color:n,flexShrink:0},onClick:()=>l(!0),title:c.sidebar.search,children:w(gr,{size:18})})]})};function Eo(r){const{data:u,sortRules:t,activedItem:e,eventsEmit:p,assistantList:c,styles:d={},hasMore:s=!1,loadingMore:h=!1}=r,{messages:n}=er(),[o,E]=oe(""),l=Fe(()=>o?u.filter(C=>(C.label||n.sidebar.unnamedSession).toLowerCase().includes(o.toLowerCase())):u,[u,o,n.sidebar.unnamedSession]),v=Fe(()=>[...l].sort((C,_)=>new Date(_.gmtModified).getTime()-new Date(C.gmtModified).getTime()),[l]),g=He(null),[i,a]=oe(400);Ee(()=>{function C(){g.current&&a(g.current.clientHeight)}return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const m=(d==null?void 0:d.colors)||{};d!=null&&d.radius;const x=(d==null?void 0:d.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",f=m.border||"#e5e7eb",F=m.sidebarBg||m.background||"#EAEEFF",b=m.text||"#222";return ee("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:F,color:b,boxShadow:x,border:`1px solid ${f}`,...d.container},children:[w(Fo,{value:o,setSearch:E,eventsEmit:p,style:d.header,styles:d}),ee("div",{className:"flex-1 min-h-0 relative",ref:g,style:d.list,children:[w(yo,{eventsEmit:p,data:v,assistantList:c,activedItem:e,sortRules:t,height:i,styles:d,hasMore:s,loadingMore:h}),w("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${F}cc, transparent)`}})]})]})}var ht={exports:{}};/*!
|
|
52
|
+
*/function mr(r){if(r.constructor!==Array)throw new TypeError("Expected array.");if(r.length===16)return r;if(r.length===6){var u=Q0();return u[0]=r[0],u[1]=r[1],u[4]=r[2],u[5]=r[3],u[12]=r[4],u[13]=r[5],u}throw new RangeError("Expected array with either 6 or 16 values.")}function Q0(){for(var r=[],u=0;u<16;u++)u%5==0?r.push(1):r.push(0);return r}function to(r,u){for(var t=mr(r),e=mr(u),p=[],c=0;c<4;c++)for(var d=[t[c],t[c+4],t[c+8],t[c+12]],s=0;s<4;s++){var h=s*4,n=[e[h],e[h+1],e[h+2],e[h+3]],o=d[0]*n[0]+d[1]*n[1]+d[2]*n[2]+d[3]*n[3];p[c+h]=o}return p}function ro(r){if(typeof r=="string"){var u=r.match(/matrix(3d)?\(([^)]+)\)/);if(u){var t=u[2].split(", ").map(parseFloat);return mr(t)}}return Q0()}function no(r){var u=Q0();return u[0]=r,u}function ao(r){var u=Q0();return u[5]=r,u}function io(r){var u=Q0();return u[12]=r,u}function oo(r){var u=Q0();return u[13]=r,u}var pt=function(r){return typeof r=="number"},ca=function(r){return typeof r=="function"},la=function(r){return Object.prototype.toString.call(r)==="[object Object]"},G0=function(r){return Array.prototype.slice.apply(r)},da=function(r){var u=r.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(u).filter(function(t){return u[t]>1})};function A0(r){return[].slice.call(arguments,1).forEach(function(u){if(u)for(var t in u)Object.prototype.hasOwnProperty.call(u,t)&&(r[t]=u[t])}),r}var Cr,yr=function(r,u,t){return r+(u-r)*t},xa={__proto__:null,isNumber:pt,isFunction:ca,isObject:la,toArray:G0,getDuplicateValsAsStrings:da,assign:A0,tweenProp:yr},Dr="data-flip-id",_r="data-inverse-flip-id",wr="data-portal-key",so="data-exit-container",ft={__proto__:null,DATA_FLIP_ID:Dr,DATA_INVERSE_FLIP_ID:_r,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:wr},Fr={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},en=function(r){return la(r)?r:Object.keys(Fr).indexOf(r)>-1?Fr[r]:{}};typeof window<"u"&&(Cr=window.requestAnimationFrame);var uo=Cr=Cr||function(r){window.setTimeout(r,1e3/60)},co=Date.now(),lo=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-co};function fa(r,u){var t=r.indexOf(u);t!==-1&&r.splice(t,1)}var xo=(function(){function r(){}return r.prototype.run=function(){var u=this;uo(function(){u.springSystem.loop(lo())})},r})(),dr=function(){this.position=0,this.velocity=0},fo=0,s0=.001,po=(function(){function r(t){this._id="s"+fo++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new dr,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new dr,this._restSpeedThreshold=.001,this._tempState=new dr,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var u=r.prototype;return u.getId=function(){return this._id},u.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},u.setSpringConfig=function(t){return this._springConfig=t,this},u.getCurrentValue=function(){return this._currentState.position},u.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},u.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,p=this.listeners.length;e<p;e++){var c=this.listeners[e].onSpringEndStateChange;c&&c(this)}return this},u.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},u.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,p=this.listeners.length;e<p;e++){var c=this.listeners[e];c.onSpringUpdate&&c.onSpringUpdate(this)}return this},u.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},u.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},u.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},u.advance=function(t,e){var p=this.isAtRest();if(!p||!this._wasAtRest){var c=e;e>.064&&(c=.064),this._timeAccumulator+=c;for(var d,s,h,n,o,E,l=this._springConfig.tension,v=this._springConfig.friction,g=this._currentState.position,i=this._currentState.velocity,a=this._tempState.position,m=this._tempState.velocity;this._timeAccumulator>=s0;)this._timeAccumulator-=s0,this._timeAccumulator<s0&&(this._previousState.position=g,this._previousState.velocity=i),s=l*(this._endValue-a)-v*i,n=l*(this._endValue-(a=g+(d=i)*s0*.5))-v*(m=i+s*s0*.5),E=l*(this._endValue-(a=g+(h=m)*s0*.5))-v*(m=i+n*s0*.5),a=g+(o=m)*s0,g+=1/6*(d+2*(h+o)+(m=i+E*s0))*s0,i+=1/6*(s+2*(n+E)+(l*(this._endValue-a)-v*m))*s0;this._tempState.position=a,this._tempState.velocity=m,this._currentState.position=g,this._currentState.velocity=i,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/s0),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),p=!0);var x=!1;this._wasAtRest&&(this._wasAtRest=!1,x=!0);var f=!1;p&&(this._wasAtRest=!0,f=!0),this.notifyPositionUpdated(x,f)}},u.notifyPositionUpdated=function(t,e){var p=this;this.listeners.filter(Boolean).forEach(function(c){t&&c.onSpringActivate&&!p._onActivateCalled&&(c.onSpringActivate(p),p._onActivateCalled=!0),c.onSpringUpdate&&c.onSpringUpdate(p),e&&c.onSpringAtRest&&c.onSpringAtRest(p)})},u.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},u.wasAtRest=function(){return this._wasAtRest},u.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},u._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t)},u.addListener=function(t){return this.listeners.push(t),this},u.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(p){var c;t[p]=(c=t[p],function(){c.apply(void 0,[].slice.call(arguments)),e.removeListener(t)})}),this.listeners.push(t),this},u.removeListener=function(t){return fa(this.listeners,t),this},r})(),pa=(function(){function r(t){this.looper=t||new xo,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var u=r.prototype;return u.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},u.createSpringWithConfig=function(t){var e=new po(this);return this.registerSpring(e),e.setSpringConfig(t),e},u.getIsIdle=function(){return this._isIdle},u.registerSpring=function(t){this._springRegistry[t.getId()]=t},u.deregisterSpring=function(t){fa(this._activeSprings,t),delete this._springRegistry[t.getId()]},u.advance=function(t,e){for(var p=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(d){d.systemShouldAdvance()?d.advance(t/1e3,e/1e3):p._idleSpringIndices.push(p._activeSprings.indexOf(d))});this._idleSpringIndices.length>0;){var c=this._idleSpringIndices.pop();c>=0&&this._activeSprings.splice(c,1)}},u.loop=function(t){var e;this._lastTimeMillis===-1&&(this._lastTimeMillis=t-1);var p=t-this._lastTimeMillis;this._lastTimeMillis=t;var c=0,d=this.listeners.length;for(c=0;c<d;c++)(e=this.listeners[c]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,p),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),c=0;c<d;c++)(e=this.listeners[c]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run()},u.activateSpring=function(t){var e=this._springRegistry[t];this._activeSprings.indexOf(e)===-1&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},r})(),ho=new pa,ha=function(r){var u=r.springConfig,t=u.overshootClamping,e=r.getOnUpdateFunc,p=r.onAnimationEnd,c=r.onSpringActivate,d=ho.createSpring(u.stiffness,u.damping);d.setOvershootClampingEnabled(!!t);var s={onSpringActivate:c,onSpringAtRest:function(){d.destroy(),p()},onSpringUpdate:e({spring:d,onAnimationEnd:p})};return d.addListener(s),d},tn=function(r){var u=ha(r);return u.setEndValue(1),u},rn=function(r,u){if(u===void 0&&(u={}),r&&r.length){u.reverse&&r.reverse();var t,e=typeof(t=u.speed)!="number"?1.1:1+Math.min(Math.max(5*t,0),5),p=1/Math.max(Math.min(r.length,100),10),c=r.map(function(d,s){var h=d.getOnUpdateFunc;return d.getOnUpdateFunc=function(n){var o=h(n);return function(E){var l=E.getCurrentValue();(l=l<.01?0:l>.99?1:l)>=p&&c[s+1]&&c[s+1](Math.max(Math.min(l*e,1),0)),o(E)}},d}).map(function(d){var s=ha(d);if(s)return s.setEndValue.bind(s)}).filter(Boolean);c[0]&&c[0](1)}},nn=function(r){return[0,1,4,5,12,13].map(function(u){return r[u]})},an=function(r){return r.top<window.innerHeight&&r.bottom>0&&r.left<window.innerWidth&&r.right>0};function on(r){return JSON.parse(r.dataset.flipConfig||"{}")}var va=function(r,u){var t;return A0(r,((t={})[u[0]]=u[1],t))},ga=function(r,u){return G0(u?document.querySelectorAll("["+wr+'="'+u+'"]'):r.querySelectorAll("["+Dr+"]"))},ma=function(r){return r.map(function(u){return[u,u.getBoundingClientRect()]})},vo=function(r){var u=r.cachedOrderedFlipIds,t=u===void 0?[]:u,e=r.inProgressAnimations,p=e===void 0?{}:e,c=r.flippedElementPositionsBeforeUpdate,d=c===void 0?{}:c,s=r.flipCallbacks,h=s===void 0?{}:s,n=r.containerEl,o=r.applyTransformOrigin,E=r.spring,l=r.debug,v=r.portalKey,g=r.staggerConfig,i=g===void 0?{}:g,a=r.decisionData,m=a===void 0?{}:a,x=r.handleEnterUpdateDelete,f=r.onComplete,F=r.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var b,C=ma(ga((b={element:n,portalKey:v}).element,b.portalKey)).map(function(q){var H=q[0],te=q[1],T=window.getComputedStyle(H);return[H.dataset.flipId,{element:H,rect:te,opacity:parseFloat(T.opacity),transform:T.transform}]}).reduce(va,{}),_=(function(q){var H=q.containerEl,te=q.portalKey;return te?(function(T){return function(P){return G0(document.querySelectorAll("["+wr+'="'+T+'"]'+P))}})(te):H?(function(T){var P=Math.random().toFixed(5);return T.dataset.flipperId=P,function(S){return G0(T.querySelectorAll('[data-flipper-id="'+P+'"] '+S))}})(H):function(){return[]}})({containerEl:n,portalKey:v}),y=(function(q){return function(H){return q("["+Dr+'="'+H+'"]')[0]}})(_),k=function(q){return d[q]&&C[q]},D=Object.keys(d).concat(Object.keys(C)).filter(function(q){return!k(q)}),R={flipCallbacks:h,getElement:y,flippedElementPositionsBeforeUpdate:d,flippedElementPositionsAfterUpdate:C,inProgressAnimations:p,decisionData:m},I=(function(q){var H,te=q.unflippedIds,T=q.flipCallbacks,P=q.getElement,S=q.flippedElementPositionsBeforeUpdate,N=q.flippedElementPositionsAfterUpdate,W=q.inProgressAnimations,V=q.decisionData,Y=te.filter(function(ue){return N[ue]}).filter(function(ue){return T[ue]&&T[ue].onAppear}),$=te.filter(function(ue){return S[ue]&&T[ue]&&T[ue].onExit}),ae=new Promise(function(ue){H=ue}),fe=[],e0=0,De=$.map(function(ue,ge){var me=S[ue].domDataForExitAnimations,Ie=me.element,Xe=me.parent,Ye=me.childPosition,Qe=Ye.top,a0=Ye.left,Re=Ye.width,Se=Ye.height;getComputedStyle(Xe).position==="static"&&(Xe.style.position="relative"),Ie.style.transform="matrix(1, 0, 0, 1, 0, 0)",Ie.style.position="absolute",Ie.style.top=Qe+"px",Ie.style.left=a0+"px",Ie.style.height=Se+"px",Ie.style.width=Re+"px";var _e=fe.filter(function(u0){return u0[0]===Xe})[0];_e||(_e=[Xe,document.createDocumentFragment()],fe.push(_e)),_e[1].appendChild(Ie),e0+=1;var Ke=function(){try{Xe.removeChild(Ie)}catch{}finally{(e0-=1)==0&&H()}};return W[ue]={stop:Ke},function(){return T[ue].onExit(Ie,ge,Ke,V)}});return fe.forEach(function(ue){ue[0].appendChild(ue[1])}),De.length||H(),{hideEnteringElements:function(){Y.forEach(function(ue){var ge=P(ue);ge&&(ge.style.opacity="0")})},animateEnteringElements:function(){Y.forEach(function(ue,ge){var me=P(ue);me&&T[ue].onAppear(me,ge,V)})},animateExitingElements:function(){return De.forEach(function(ue){return ue()}),ae}}})(A0({},R,{unflippedIds:D})),z=I.hideEnteringElements,M=I.animateEnteringElements,U=I.animateExitingElements,G=A0({},R,{containerEl:n,flippedIds:t.filter(k),applyTransformOrigin:o,spring:E,debug:l,staggerConfig:i,scopedSelector:_,onComplete:f});F&&F(n,m);var Z=(function(q){var H,te=q.flippedIds,T=q.flipCallbacks,P=q.inProgressAnimations,S=q.flippedElementPositionsBeforeUpdate,N=q.flippedElementPositionsAfterUpdate,W=q.applyTransformOrigin,V=q.spring,Y=q.getElement,$=q.debug,ae=q.staggerConfig,fe=ae===void 0?{}:ae,e0=q.decisionData,De=e0===void 0?{}:e0,ue=q.onComplete,ge=q.containerEl,me=new Promise(function(j){H=j});if(ue&&me.then(function(){return ue(ge,De)}),!te.length)return function(){return H([]),me};var Ie=[],Xe=Y(te[0]),Ye=Xe?Xe.ownerDocument.querySelector("body"):document.querySelector("body");da(te);var Qe=te.map(function(j){var de=S[j].rect,Be=N[j].rect,Ge=S[j].opacity,D0=N[j].opacity,We=Be.width<1||Be.height<1,pe=N[j].element;if(!an(de)&&!an(Be)||!pe)return!1;var _0,z0,w0,Ze=on(pe),S0=(w0=(z0=(_0={flipperSpring:V,flippedSpring:Ze.spring})===void 0?{}:_0).flippedSpring,A0({},Fr.noWobble,en(z0.flipperSpring),en(w0))),k0=Ze.stagger===!0?"default":Ze.stagger,I0={element:pe,id:j,stagger:k0,springConfig:S0};if(T[j]&&T[j].shouldFlip&&!T[j].shouldFlip(De.previous,De.current))return!1;var L0=Math.abs(de.left-Be.left)+Math.abs(de.top-Be.top),Z0=Math.abs(de.width-Be.width)+Math.abs(de.height-Be.height),J0=Math.abs(D0-Ge);if(de.height===0&&Be.height===0||de.width===0&&Be.width===0||L0<.5&&Z0<.5&&J0<.01)return!1;var O0=ro(N[j].transform),t0={matrix:O0},i0={matrix:[]},x0=[O0];Ze.translate&&(x0.push(io(de.left-Be.left)),x0.push(oo(de.top-Be.top))),Ze.scale&&(x0.push(no(Math.max(de.width,1)/Math.max(Be.width,1))),x0.push(ao(Math.max(de.height,1)/Math.max(Be.height,1)))),Ze.opacity&&(i0.opacity=Ge,t0.opacity=D0);var f0=[];if(!T[j]||!T[j].shouldInvert||T[j].shouldInvert(De.previous,De.current)){var et=(function(Ae,qe){return G0(Ae.querySelectorAll("["+_r+'="'+qe+'"]'))})(pe,j);f0=et.map(function(Ae){return[Ae,on(Ae)]})}i0.matrix=nn(x0.reduce(to)),t0.matrix=nn(t0.matrix);var Te,se=(function(Ae){var qe=Ae.element,r0=Ae.invertedChildren,g0=Ae.body;return function(F0){var c0=F0.matrix,R0=F0.opacity,M0=F0.forceMinVals;if(pt(R0)&&(qe.style.opacity=R0+""),M0&&(qe.style.minHeight="1px",qe.style.minWidth="1px"),c0){var q0=(function(N0){return"matrix("+N0.join(", ")+")"})(c0);qe.style.transform=q0,r0&&(function(N0){var U0=N0.matrix,nr=N0.body;N0.invertedChildren.forEach(function(it){var ot=it[0],st=it[1];if(nr.contains(ot)){var ut=U0[0],ct=U0[3],ar=U0[5],n0={translateX:0,translateY:0,scaleX:1,scaleY:1},tt="";st.translate&&(n0.translateX=-U0[4]/ut,n0.translateY=-ar/ct,tt+="translate("+n0.translateX+"px, "+n0.translateY+"px)"),st.scale&&(n0.scaleX=1/ut,n0.scaleY=1/ct,tt+=" scale("+n0.scaleX+", "+n0.scaleY+")"),ot.style.transform=tt}})})({invertedChildren:r0,matrix:c0,body:g0})}}})({element:pe,invertedChildren:f0,body:Ye});if(T[j]&&T[j].onComplete){var y0=T[j].onComplete;Te=function(){return y0(pe,De)}}var Pe=pt(i0.opacity)&&pt(t0.opacity)&&i0.opacity!==t0.opacity,je=!1;return A0({},I0,{stagger:k0,springConfig:S0,getOnUpdateFunc:function(Ae){var qe=Ae.spring,r0=Ae.onAnimationEnd;return P[j]={destroy:qe.destroy.bind(qe),onAnimationEnd:r0},function(g0){T[j]&&T[j].onSpringUpdate&&T[j].onSpringUpdate(g0.getCurrentValue()),je||(je=!0,T[j]&&T[j].onStart&&T[j].onStart(pe,De));var F0=g0.getCurrentValue();if(Ye.contains(pe)){var c0={matrix:[]};c0.matrix=i0.matrix.map(function(R0,M0){return yr(R0,t0.matrix[M0],F0)}),Pe&&(c0.opacity=yr(i0.opacity,t0.opacity,F0)),se(c0)}else g0.destroy()}},initializeFlip:function(){se({matrix:i0.matrix,opacity:Pe?i0.opacity:void 0,forceMinVals:We}),T[j]&&T[j].onStartImmediate&&T[j].onStartImmediate(pe,De),Ze.transformOrigin?pe.style.transformOrigin=Ze.transformOrigin:W&&(pe.style.transformOrigin="0 0"),f0.forEach(function(Ae){var qe=Ae[0],r0=Ae[1];r0.transformOrigin?qe.style.transformOrigin=r0.transformOrigin:W&&(qe.style.transformOrigin="0 0")})},onAnimationEnd:function(Ae){delete P[j],ca(Te)&&Te(),pe.style.transform="",f0.forEach(function(qe){qe[0].style.transform=""}),We&&pe&&(pe.style.minHeight="",pe.style.minWidth=""),Ae||(Ie.push(j),Ie.length>=Qe.length&&H(Ie))},delayUntil:Ze.delayUntil})}).filter(Boolean);if(Qe.forEach(function(j){return(0,j.initializeFlip)()}),$)return function(){};var a0=Qe.filter(function(j){return j.delayUntil&&(de=j.delayUntil,Qe.filter(function(Be){return Be.id===de}).length);var de}),Re={},Se={},_e={};a0.forEach(function(j){j.stagger?(_e[j.stagger]=!0,Se[j.delayUntil]?Se[j.delayUntil].push(j.stagger):Se[j.delayUntil]=[j.stagger]):Re[j.delayUntil]?Re[j.delayUntil].push(j):Re[j.delayUntil]=[j]});var Ke=Qe.filter(function(j){return j.stagger}).reduce(function(j,de){return j[de.stagger]?j[de.stagger].push(de):j[de.stagger]=[de],j},{}),u0=Qe.filter(function(j){return a0.indexOf(j)===-1});return u0.forEach(function(j){j.onSpringActivate=function(){Re[j.id]&&Re[j.id].forEach(tn),Se[j.id]&&Object.keys(Se[j.id].reduce(function(de,Be){var Ge;return A0(de,((Ge={})[Be]=!0,Ge))},{})).forEach(function(de){rn(Ke[de],fe[de])})}}),function(){return Qe.length||H([]),u0.filter(function(j){return!j.stagger}).forEach(tn),Object.keys(Ke).forEach(function(j){_e[j]||rn(Ke[j],fe[j])}),me}})(G);x?x({hideEnteringElements:z,animateEnteringElements:M,animateExitingElements:U,animateFlippedElements:Z}):(z(),U().then(M),Z())}},go=function(r){var u=r.element,t=r.flipCallbacks,e=t===void 0?{}:t,p=r.inProgressAnimations,c=p===void 0?{}:p,d=ga(u,r.portalKey),s=G0(u.querySelectorAll("["+_r+"]")),h={},n=[],o={};d.filter(function(v){return e&&e[v.dataset.flipId]&&e[v.dataset.flipId].onExit}).forEach(function(v){var g=v.parentNode;if(v.closest){var i=v.closest("["+so+"]");i&&(g=i)}var a=n.findIndex(function(m){return m[0]===g});a===-1&&(n.push([g,g.getBoundingClientRect()]),a=n.length-1),h[v.dataset.flipId]=n[a][1],o[v.dataset.flipId]=g});var E=ma(d),l=E.map(function(v){var g=v[0],i=v[1],a={};if(e&&e[g.dataset.flipId]&&e[g.dataset.flipId].onExit){var m=h[g.dataset.flipId];A0(a,{element:g,parent:o[g.dataset.flipId],childPosition:{top:i.top-m.top,left:i.left-m.left,width:i.width,height:i.height}})}return[g.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(g).opacity||"1"),domDataForExitAnimations:a}]}).reduce(va,{});return(function(v,g){Object.keys(v).forEach(function(i){v[i].destroy&&v[i].destroy(),v[i].onAnimationEnd&&v[i].onAnimationEnd(!0),delete v[i]}),g.forEach(function(i){i.style.transform="",i.style.opacity=""})})(c,d.concat(s)),{flippedElementPositions:l,cachedOrderedFlipIds:E.map(function(v){return v[0].dataset.flipId})}};new pa;function Zt(){return Zt=Object.assign?Object.assign.bind():function(r){for(var u=1;u<arguments.length;u++){var t=arguments[u];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},Zt.apply(this,arguments)}function Er(r,u){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Er(r,u)}function Ca(r,u){if(r==null)return{};var t,e,p={},c=Object.keys(r);for(e=0;e<c.length;e++)u.indexOf(t=c[e])>=0||(p[t]=r[t]);return p}var ya=Kn({}),Fa=Kn("portal"),Ea=(function(r){var u,t;function e(){for(var c,d=arguments.length,s=new Array(d),h=0;h<d;h++)s[h]=arguments[h];return(c=r.call.apply(r,[this].concat(s))||this).inProgressAnimations={},c.flipCallbacks={},c.el=void 0,c}t=r,(u=e).prototype=Object.create(t.prototype),u.prototype.constructor=u,Er(u,t);var p=e.prototype;return p.getSnapshotBeforeUpdate=function(c){return c.flipKey!==this.props.flipKey&&this.el?go({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},p.componentDidUpdate=function(c,d,s){this.props.flipKey!==c.flipKey&&this.el&&vo({flippedElementPositionsBeforeUpdate:s.flippedElementPositions,cachedOrderedFlipIds:s.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:c.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},p.render=function(){var c=this,d=this.props,s=d.portalKey,h=we.createElement(ya.Provider,{value:this.flipCallbacks},we.createElement(d.element,{className:d.className,ref:function(n){return c.el=n}},this.props.children));return s&&(h=we.createElement(Fa.Provider,{value:s},h)),h},e})(qa);Ea.defaultProps={applyTransformOrigin:!0,element:"div"};var mo=["children","flipId","inverseFlipId","portalKey"],Co=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],sn=function(r){var u,t=r.children,e=r.flipId,p=r.inverseFlipId,c=r.portalKey,d=Ca(r,mo),s=t,h=(function(o){return typeof o=="function"})(s);if(!h)try{s=Oa.only(t)}catch{throw new Error("Each Flipped component must wrap a single child")}d.scale||d.translate||d.opacity||xa.assign(d,{translate:!0,scale:!0,opacity:!0});var n=((u={})[ft.DATA_FLIP_CONFIG]=JSON.stringify(d),u);return e!==void 0?n[ft.DATA_FLIP_ID]=String(e):p&&(n[ft.DATA_INVERSE_FLIP_ID]=String(p)),c!==void 0&&(n[ft.DATA_PORTAL_KEY]=c),h?s(n):Ma(s,n)},Ba=function(r){var u=r.children,t=r.flipId,e=r.shouldFlip,p=r.shouldInvert,c=r.onAppear,d=r.onStart,s=r.onStartImmediate,h=r.onComplete,n=r.onExit,o=r.onSpringUpdate,E=Ca(r,Co);return u?E.inverseFlipId?we.createElement(sn,Zt({},E),u):we.createElement(Fa.Consumer,null,function(l){return we.createElement(ya.Consumer,null,function(v){return xa.isObject(v)&&t&&(v[t]={shouldFlip:e,shouldInvert:p,onAppear:c,onStart:d,onStartImmediate:s,onComplete:h,onExit:n,onSpringUpdate:o}),we.createElement(sn,Zt({flipId:t},E,{portalKey:l}),u)})}):null};Ba.displayName="Flipped";function yo(r){const{data:u,activedItem:t,onChange:e,onDelete:p,sortRules:c=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:d,assistantList:s,height:h=400,styles:n={},hasMore:o=!1,loadingMore:E=!1}=r,l=u.map(k=>k.sessionId+"-"+k.gmtModified).join(","),v=Fe(()=>{const k=c.length>0?c:[{label:"\u5F53\u5929",dayPeriod:1}],D=eo(u,k),R=k.every(z=>!D[z.label]||D[z.label].length===0),I=[];return k.forEach(z=>{D[z.label]&&D[z.label].length>0&&(I.push({type:"group",label:z.label}),D[z.label].forEach(M=>I.push({type:"item",data:M})))}),D.other.length>0&&!R&&(I.push({type:"group",label:"\u5176\u4ED6"}),D.other.forEach(z=>I.push({type:"item",data:z}))),R&&D.other.length>0&&D.other.forEach(z=>I.push({type:"item",data:z})),I},[u,c,l]),g=Fe(()=>v.map(k=>k.type==="group"?`g:${k.label}`:`i:${k.data.sessionId}`).join("|"),[v]),i=56,a=14,m=36,x=k=>k===v.length?m:v[k].type==="group"?32:i+a,f=He(null),F=Fe(()=>v.findIndex(k=>{var D;return k.type==="item"&&((D=k.data)==null?void 0:D.sessionId)===t}),[v,t]),b=Fe(()=>v.findIndex(k=>k.type==="item"),[v]),C=He(void 0);Ee(()=>{const k=C.current;t!==k&&F>-1&&F===b&&f.current&&f.current.scrollToItem(F,"start"),C.current=t},[t,F,b]);const _=He(0);if(Ee(()=>{if(f.current){const k=_.current,D=v.length;if(_.current=D,D!==k){const I=(k>0?Math.abs(D-k)/k:1)>.5||k<10&&D>20;f.current.resetAfterIndex(0,I)}}},[v.length]),Ee(()=>{f.current&&f.current.resetAfterIndex(0,!0)},[g]),v.length===0)return w("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const y=(n==null?void 0:n.colors)||{};return w(Ea,{flipKey:l,spring:{stiffness:180,damping:18},children:w(Zi,{ref:f,height:h,width:"100%",itemCount:v.length+1,itemSize:x,itemKey:k=>{if(k===v.length)return"footer";const D=v[k];return D.type==="item"?D.data.sessionId:`group-${D.label}`},onItemsRendered:({visibleStopIndex:k})=>{o&&!E&&k>=v.length-1-3&&typeof d=="function"&&d("conversations:load_more")},style:{overflowX:"hidden"},children:({index:k,style:D})=>{if(k===v.length){const I=(n==null?void 0:n.colors)||{};return w("div",{style:{...D,height:m,lineHeight:`${m}px`,textAlign:"center",fontSize:"10px",color:I.textMuted||"#9ca3af",background:I.groupBg||"white"},children:E?"\u52A0\u8F7D\u4E2D...":o?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const R=v[k];return R.type==="group"?w("div",{style:{...D,background:y.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:R.label}):w(Ba,{flipId:R.data.sessionId,children:w("div",{style:D,className:"px-[12px] py-[2px]",children:w(Ji,{isActive:t===R.data.sessionId,isDisabled:!1,isNew:R.data.isNew,data:R.data,eventsEmit:d,assistantList:s,styles:n})})},R.data.sessionId)}})})}const Fo=({value:r,eventsEmit:u,setSearch:t,style:e,styles:p={}})=>{const{messages:c}=er(),d=p.colors||{},s=p.radius||"12px",h=d.border||"#e5e7eb",n=d.primary||"#2563eb",o=p.headerBg||d.sidebarBg||d.background||"#fff",[E,l]=we.useState(!1),v=we.useRef(null);we.useEffect(()=>{E&&v.current&&v.current.focus()},[E]);const g=()=>{l(!1),t("")};return ee("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...e,background:o,borderTopLeftRadius:s,borderTopRightRadius:s},children:[w("button",{className:"border-none flex items-center justify-center",onClick:()=>{l(!1),u&&u("conversation:create")},title:c.sidebar.newConversation,style:{height:42,borderRadius:"90px",background:n,color:d.buttonText||"#fff",fontWeight:600,boxShadow:p.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:E?"0 0":"0 14px",minWidth:E?0:180,width:E?0:void 0,opacity:E?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:E?"none":"auto"},children:ee("div",{className:"flex items-center gap-2",children:[w(Bi,{size:18}),w("span",{className:"text-sm",children:c.sidebar.newChat})]})}),E?ee("div",{className:"flex-1 min-w-0 relative",children:[w("input",{ref:v,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:c.sidebar.searchPlaceholder,value:r,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&g()},style:{minWidth:0,width:"100%",borderRadius:s,background:d.inputBg||"#f4f4f5",border:`1px solid ${h}`,color:d.text||"#222",outline:"none",paddingRight:40}}),w("button",{className:"absolute right-3 flex items-center justify-center transition-colors hover:bg-gray-200 rounded-full",style:{width:20,height:20,color:d.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:g,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:i=>i.preventDefault(),children:w(ea,{size:16})})]}):w("button",{className:"ml-auto flex items-center justify-center transition-colors hover:bg-gray-50",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${h}`,color:n,flexShrink:0},onClick:()=>l(!0),title:c.sidebar.search,children:w(gr,{size:18})})]})};function Eo(r){const{data:u,sortRules:t,activedItem:e,eventsEmit:p,assistantList:c,styles:d={},hasMore:s=!1,loadingMore:h=!1}=r,{messages:n}=er(),[o,E]=oe(""),l=Fe(()=>o?u.filter(C=>(C.label||n.sidebar.unnamedSession).toLowerCase().includes(o.toLowerCase())):u,[u,o,n.sidebar.unnamedSession]),v=Fe(()=>[...l].sort((C,_)=>new Date(_.gmtModified).getTime()-new Date(C.gmtModified).getTime()),[l]),g=He(null),[i,a]=oe(400);Ee(()=>{function C(){g.current&&a(g.current.clientHeight)}return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const m=(d==null?void 0:d.colors)||{};d!=null&&d.radius;const x=(d==null?void 0:d.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",f=m.border||"#e5e7eb",F=m.sidebarBg||m.background||"#EAEEFF",b=m.text||"#222";return ee("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:F,color:b,boxShadow:x,border:`1px solid ${f}`,...d.container},children:[w(Fo,{value:o,setSearch:E,eventsEmit:p,style:d.header,styles:d}),ee("div",{className:"flex-1 min-h-0 relative",ref:g,style:d.list,children:[w(yo,{eventsEmit:p,data:v,assistantList:c,activedItem:e,sortRules:t,height:i,styles:d,hasMore:s,loadingMore:h}),w("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${F}cc, transparent)`}})]})]})}var ht={exports:{}};/*!
|
|
53
53
|
* clipboard.js v2.0.11
|
|
54
54
|
* https://clipboardjs.com/
|
|
55
55
|
*
|
|
56
56
|
* Licensed MIT © Zeno Rocha
|
|
57
|
-
*/var Bo=ht.exports,un;function Ao(){return un||(un=1,(function(r,u){(function(e,p){r.exports=p()})(Bo,function(){return(function(){var t={686:(function(c,d,s){s.d(d,{default:function(){return T}});var h=s(279),n=s.n(h),o=s(370),E=s.n(o),l=s(817),v=s.n(l);function g(P){try{return document.execCommand(P)}catch{return!1}}var i=function(S){var N=v()(S);return g("cut"),N},a=i;function m(P){var S=document.documentElement.getAttribute("dir")==="rtl",N=document.createElement("textarea");N.style.fontSize="12pt",N.style.border="0",N.style.padding="0",N.style.margin="0",N.style.position="absolute",N.style[S?"right":"left"]="-9999px";var W=window.pageYOffset||document.documentElement.scrollTop;return N.style.top="".concat(W,"px"),N.setAttribute("readonly",""),N.value=P,N}var x=function(S,N){var W=m(S);N.container.appendChild(W);var V=v()(W);return g("copy"),W.remove(),V},f=function(S){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},W="";return typeof S=="string"?W=x(S,N):S instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(S==null?void 0:S.type)?W=x(S.value,N):(W=v()(S),g("copy")),W},F=f;function b(P){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(N){return typeof N}:b=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},b(P)}var C=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=S.action,W=N===void 0?"copy":N,V=S.container,Y=S.target,$=S.text;if(W!=="copy"&&W!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Y!==void 0)if(Y&&b(Y)==="object"&&Y.nodeType===1){if(W==="copy"&&Y.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(W==="cut"&&(Y.hasAttribute("readonly")||Y.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if($)return F($,{container:V});if(Y)return W==="cut"?a(Y):F(Y,{container:V})},_=C;function y(P){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(N){return typeof N}:y=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},y(P)}function k(P,S){if(!(P instanceof S))throw new TypeError("Cannot call a class as a function")}function D(P,S){for(var N=0;N<S.length;N++){var W=S[N];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(P,W.key,W)}}function R(P,S,N){return S&&D(P.prototype,S),N&&D(P,N),P}function I(P,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");P.prototype=Object.create(S&&S.prototype,{constructor:{value:P,writable:!0,configurable:!0}}),S&&z(P,S)}function z(P,S){return z=Object.setPrototypeOf||function(W,V){return W.__proto__=V,W},z(P,S)}function M(P){var S=Z();return function(){var W=q(P),V;if(S){var Y=q(this).constructor;V=Reflect.construct(W,arguments,Y)}else V=W.apply(this,arguments);return U(this,V)}}function U(P,S){return S&&(y(S)==="object"||typeof S=="function")?S:G(P)}function G(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function Z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function q(P){return q=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},q(P)}function H(P,S){var N="data-clipboard-".concat(P);if(S.hasAttribute(N))return S.getAttribute(N)}var te=(function(P){I(N,P);var S=M(N);function N(W,V){var Y;return k(this,N),Y=S.call(this),Y.resolveOptions(V),Y.listenClick(W),Y}return R(N,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=y(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var Y=this;this.listener=E()(V,"click",function($){return Y.onClick($)})}},{key:"onClick",value:function(V){var Y=V.delegateTarget||V.currentTarget,$=this.action(Y)||"copy",ae=_({action:$,container:this.container,target:this.target(Y),text:this.text(Y)});this.emit(ae?"success":"error",{action:$,text:ae,trigger:Y,clearSelection:function(){Y&&Y.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return H("action",V)}},{key:"defaultTarget",value:function(V){var Y=H("target",V);if(Y)return document.querySelector(Y)}},{key:"defaultText",value:function(V){return H("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return F(V,Y)}},{key:"cut",value:function(V){return a(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Y=typeof V=="string"?[V]:V,$=!!document.queryCommandSupported;return Y.forEach(function(ae){$=$&&!!document.queryCommandSupported(ae)}),$}}]),N})(n()),T=te}),828:(function(c){var d=9;if(typeof Element<"u"&&!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector}function h(n,o){for(;n&&n.nodeType!==d;){if(typeof n.matches=="function"&&n.matches(o))return n;n=n.parentNode}}c.exports=h}),438:(function(c,d,s){var h=s(828);function n(l,v,g,i,a){var m=E.apply(this,arguments);return l.addEventListener(g,m,a),{destroy:function(){l.removeEventListener(g,m,a)}}}function o(l,v,g,i,a){return typeof l.addEventListener=="function"?n.apply(null,arguments):typeof g=="function"?n.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(m){return n(m,v,g,i,a)}))}function E(l,v,g,i){return function(a){a.delegateTarget=h(a.target,v),a.delegateTarget&&i.call(l,a)}}c.exports=o}),879:(function(c,d){d.node=function(s){return s!==void 0&&s instanceof HTMLElement&&s.nodeType===1},d.nodeList=function(s){var h=Object.prototype.toString.call(s);return s!==void 0&&(h==="[object NodeList]"||h==="[object HTMLCollection]")&&"length"in s&&(s.length===0||d.node(s[0]))},d.string=function(s){return typeof s=="string"||s instanceof String},d.fn=function(s){var h=Object.prototype.toString.call(s);return h==="[object Function]"}}),370:(function(c,d,s){var h=s(879),n=s(438);function o(g,i,a){if(!g&&!i&&!a)throw new Error("Missing required arguments");if(!h.string(i))throw new TypeError("Second argument must be a String");if(!h.fn(a))throw new TypeError("Third argument must be a Function");if(h.node(g))return E(g,i,a);if(h.nodeList(g))return l(g,i,a);if(h.string(g))return v(g,i,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function E(g,i,a){return g.addEventListener(i,a),{destroy:function(){g.removeEventListener(i,a)}}}function l(g,i,a){return Array.prototype.forEach.call(g,function(m){m.addEventListener(i,a)}),{destroy:function(){Array.prototype.forEach.call(g,function(m){m.removeEventListener(i,a)})}}}function v(g,i,a){return n(document.body,g,i,a)}c.exports=o}),817:(function(c){function d(s){var h;if(s.nodeName==="SELECT")s.focus(),h=s.value;else if(s.nodeName==="INPUT"||s.nodeName==="TEXTAREA"){var n=s.hasAttribute("readonly");n||s.setAttribute("readonly",""),s.select(),s.setSelectionRange(0,s.value.length),n||s.removeAttribute("readonly"),h=s.value}else{s.hasAttribute("contenteditable")&&s.focus();var o=window.getSelection(),E=document.createRange();E.selectNodeContents(s),o.removeAllRanges(),o.addRange(E),h=o.toString()}return h}c.exports=d}),279:(function(c){function d(){}d.prototype={on:function(s,h,n){var o=this.e||(this.e={});return(o[s]||(o[s]=[])).push({fn:h,ctx:n}),this},once:function(s,h,n){var o=this;function E(){o.off(s,E),h.apply(n,arguments)}return E._=h,this.on(s,E,n)},emit:function(s){var h=[].slice.call(arguments,1),n=((this.e||(this.e={}))[s]||[]).slice(),o=0,E=n.length;for(o;o<E;o++)n[o].fn.apply(n[o].ctx,h);return this},off:function(s,h){var n=this.e||(this.e={}),o=n[s],E=[];if(o&&h)for(var l=0,v=o.length;l<v;l++)o[l].fn!==h&&o[l].fn._!==h&&E.push(o[l]);return E.length?n[s]=E:delete n[s],this}},c.exports=d,c.exports.TinyEmitter=d})},e={};function p(c){if(e[c])return e[c].exports;var d=e[c]={exports:{}};return t[c](d,d.exports,p),d.exports}return(function(){p.n=function(c){var d=c&&c.__esModule?function(){return c.default}:function(){return c};return p.d(d,{a:d}),d}})(),(function(){p.d=function(c,d){for(var s in d)p.o(d,s)&&!p.o(c,s)&&Object.defineProperty(c,s,{enumerable:!0,get:d[s]})}})(),(function(){p.o=function(c,d){return Object.prototype.hasOwnProperty.call(c,d)}})(),p(686)})().default})})(ht)),ht.exports}var bo=Ao();const Do=Gn(bo),_o=(r,u)=>{let t=r&&r.replace(/<think>[\s\S]*?<\/think>/g,"");t=t.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),t=t.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",t);const e=new Do(u.currentTarget||u.target,{text:()=>t});try{e.on("success",()=>{Me.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),e.destroy()}),e.on("error",p=>{Me.error("\u590D\u5236\u5931\u8D25",2),e.destroy()}),e.onClick(u)}catch(p){e.destroy(),Me.error("\u590D\u5236\u5931\u8D25: "+p,2)}};function wo(r){const u=[];for(const t of r){if(t.query){const e=t.query.queryId||t.query.id||t.queryId||t.id||v0(32);u.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:e,clientSideId:e+"-user",...t.query})}if(t.reply){const e=t.reply.queryId||t.reply.id||t.queryId||t.id||v0(32);u.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:e,clientSideId:e+"-ai",...t.reply})}}return u}const So=""+new URL("defaultWeLogo.svg",import.meta.url).href,ko="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOkSURBVHgBxZRbTBxlFMd/c2EvXBbZLbsCVhcKaAyh2BKTWrX12RhNmxa1IVp98FEJVGNMY2KItSZtqGjaROMlaDSVxiZeqiRa0FBpIlSkhgK15WoLu7AL3V1md25+7CpUojzYB7/km5OZc+Z35pzz/wb+l3X7PotNL9tvd1yIc8OrYp9pWXZ6JXXdfLOtbdNa4fJazoZdu9xVNUE5petIVS9h/npRfkDKefg/A+OaJuUGvIz3DzD14R6uHv/WCmzbcuNlj7S+3z7+5Xepno7TLeJWWiv2n5zyTcEaT/TJlrfwljxCTm42lgHRmIHDqaIqIsTE43NS7FHCBXKkIzw4eGKkYcdnwmGvBspSy+DpxlrffXtqC6WeqM3+CZ3wnAZLOyXAlsXfOjU7D6EYHLw7zVKvgykcG+r98YmKjdG5BK3nw7w7YQuATdAJWR4IJ2UiswKoiC39+S0+4QjNL0NWgDU7y57ZVlLd2n+FO/Kd7BxxcPOpMKGrCSxNTNm2kVUZ2e1g+5YCxh4q4IW+cAactYTZLi6dxgqw4dUjj+UgfXpSJRAaY9Lt4dZAkoW5YWSXyKwo6ZYbhsFCciPe9hgHtDiB+kqe6huF6jknv2As9/Dj3mv2se4Yh5RhEr4SbD2FpMjomkZ0eoaunl5yxXwqKsspKwsiOVzYqST143k8Xe7gvaN17tHOTi0D/D6U3DqhO7oNNxOlU6heD0cOH2frg/dSU1ywMgRhRmMpvvjoG55t3I0RWWDvuST9iy5q64qtr2/LV9Ill/aNOsb9fnC48a+zGYzF6R/opefsGU59sl88d6V5tpagqekNFg2LgeHN3F/pJS9rET2l4v15Ruav1PHLEdsUJYpXcNjXKA54iCd11gf9ONUkLqeVtu4ciQUjwcCF3wjc4sUlJbhouyjOVek6O2kvT3kGV3e9P/uetlmhi4VpCsU0Wz5o5i6/kIehY8UjyHlLpVt8daKZc1d0qt3zaV2ex09LjYvnhsx3rj8pEq90N1QU+Q+9WJVgbzBPpFIzIrZNsYWVlYyVhJXVtFys6UHWf76O36NDu3nt0fbVJ0Wm6Sedomx5hzPCwYpJygvdkOMVQhbKFjrEFG2JRQjPTHH4Uh4HoptFfy2T5+9clt/qo6fS9MMYilqEL1dCyCQtQsnKhC51yUyCkBLz4qeT77Np3KCme/EvwJVndUcfl0qr6uzKwAb8biemqTCjmYS0RUKhM1zuep2TzZfIpFlefwDISXe8s31UTQAAAABJRU5ErkJggg==",Io=(r,u)=>{const t={...Br.colors,...r};return`
|
|
57
|
+
*/var Bo=ht.exports,un;function Ao(){return un||(un=1,(function(r,u){(function(e,p){r.exports=p()})(Bo,function(){return(function(){var t={686:(function(c,d,s){s.d(d,{default:function(){return T}});var h=s(279),n=s.n(h),o=s(370),E=s.n(o),l=s(817),v=s.n(l);function g(P){try{return document.execCommand(P)}catch{return!1}}var i=function(S){var N=v()(S);return g("cut"),N},a=i;function m(P){var S=document.documentElement.getAttribute("dir")==="rtl",N=document.createElement("textarea");N.style.fontSize="12pt",N.style.border="0",N.style.padding="0",N.style.margin="0",N.style.position="absolute",N.style[S?"right":"left"]="-9999px";var W=window.pageYOffset||document.documentElement.scrollTop;return N.style.top="".concat(W,"px"),N.setAttribute("readonly",""),N.value=P,N}var x=function(S,N){var W=m(S);N.container.appendChild(W);var V=v()(W);return g("copy"),W.remove(),V},f=function(S){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},W="";return typeof S=="string"?W=x(S,N):S instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(S==null?void 0:S.type)?W=x(S.value,N):(W=v()(S),g("copy")),W},F=f;function b(P){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(N){return typeof N}:b=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},b(P)}var C=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=S.action,W=N===void 0?"copy":N,V=S.container,Y=S.target,$=S.text;if(W!=="copy"&&W!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Y!==void 0)if(Y&&b(Y)==="object"&&Y.nodeType===1){if(W==="copy"&&Y.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(W==="cut"&&(Y.hasAttribute("readonly")||Y.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if($)return F($,{container:V});if(Y)return W==="cut"?a(Y):F(Y,{container:V})},_=C;function y(P){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(N){return typeof N}:y=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},y(P)}function k(P,S){if(!(P instanceof S))throw new TypeError("Cannot call a class as a function")}function D(P,S){for(var N=0;N<S.length;N++){var W=S[N];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(P,W.key,W)}}function R(P,S,N){return S&&D(P.prototype,S),N&&D(P,N),P}function I(P,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");P.prototype=Object.create(S&&S.prototype,{constructor:{value:P,writable:!0,configurable:!0}}),S&&z(P,S)}function z(P,S){return z=Object.setPrototypeOf||function(W,V){return W.__proto__=V,W},z(P,S)}function M(P){var S=Z();return function(){var W=q(P),V;if(S){var Y=q(this).constructor;V=Reflect.construct(W,arguments,Y)}else V=W.apply(this,arguments);return U(this,V)}}function U(P,S){return S&&(y(S)==="object"||typeof S=="function")?S:G(P)}function G(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function Z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function q(P){return q=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},q(P)}function H(P,S){var N="data-clipboard-".concat(P);if(S.hasAttribute(N))return S.getAttribute(N)}var te=(function(P){I(N,P);var S=M(N);function N(W,V){var Y;return k(this,N),Y=S.call(this),Y.resolveOptions(V),Y.listenClick(W),Y}return R(N,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=y(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var Y=this;this.listener=E()(V,"click",function($){return Y.onClick($)})}},{key:"onClick",value:function(V){var Y=V.delegateTarget||V.currentTarget,$=this.action(Y)||"copy",ae=_({action:$,container:this.container,target:this.target(Y),text:this.text(Y)});this.emit(ae?"success":"error",{action:$,text:ae,trigger:Y,clearSelection:function(){Y&&Y.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return H("action",V)}},{key:"defaultTarget",value:function(V){var Y=H("target",V);if(Y)return document.querySelector(Y)}},{key:"defaultText",value:function(V){return H("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return F(V,Y)}},{key:"cut",value:function(V){return a(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Y=typeof V=="string"?[V]:V,$=!!document.queryCommandSupported;return Y.forEach(function(ae){$=$&&!!document.queryCommandSupported(ae)}),$}}]),N})(n()),T=te}),828:(function(c){var d=9;if(typeof Element<"u"&&!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector}function h(n,o){for(;n&&n.nodeType!==d;){if(typeof n.matches=="function"&&n.matches(o))return n;n=n.parentNode}}c.exports=h}),438:(function(c,d,s){var h=s(828);function n(l,v,g,i,a){var m=E.apply(this,arguments);return l.addEventListener(g,m,a),{destroy:function(){l.removeEventListener(g,m,a)}}}function o(l,v,g,i,a){return typeof l.addEventListener=="function"?n.apply(null,arguments):typeof g=="function"?n.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(m){return n(m,v,g,i,a)}))}function E(l,v,g,i){return function(a){a.delegateTarget=h(a.target,v),a.delegateTarget&&i.call(l,a)}}c.exports=o}),879:(function(c,d){d.node=function(s){return s!==void 0&&s instanceof HTMLElement&&s.nodeType===1},d.nodeList=function(s){var h=Object.prototype.toString.call(s);return s!==void 0&&(h==="[object NodeList]"||h==="[object HTMLCollection]")&&"length"in s&&(s.length===0||d.node(s[0]))},d.string=function(s){return typeof s=="string"||s instanceof String},d.fn=function(s){var h=Object.prototype.toString.call(s);return h==="[object Function]"}}),370:(function(c,d,s){var h=s(879),n=s(438);function o(g,i,a){if(!g&&!i&&!a)throw new Error("Missing required arguments");if(!h.string(i))throw new TypeError("Second argument must be a String");if(!h.fn(a))throw new TypeError("Third argument must be a Function");if(h.node(g))return E(g,i,a);if(h.nodeList(g))return l(g,i,a);if(h.string(g))return v(g,i,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function E(g,i,a){return g.addEventListener(i,a),{destroy:function(){g.removeEventListener(i,a)}}}function l(g,i,a){return Array.prototype.forEach.call(g,function(m){m.addEventListener(i,a)}),{destroy:function(){Array.prototype.forEach.call(g,function(m){m.removeEventListener(i,a)})}}}function v(g,i,a){return n(document.body,g,i,a)}c.exports=o}),817:(function(c){function d(s){var h;if(s.nodeName==="SELECT")s.focus(),h=s.value;else if(s.nodeName==="INPUT"||s.nodeName==="TEXTAREA"){var n=s.hasAttribute("readonly");n||s.setAttribute("readonly",""),s.select(),s.setSelectionRange(0,s.value.length),n||s.removeAttribute("readonly"),h=s.value}else{s.hasAttribute("contenteditable")&&s.focus();var o=window.getSelection(),E=document.createRange();E.selectNodeContents(s),o.removeAllRanges(),o.addRange(E),h=o.toString()}return h}c.exports=d}),279:(function(c){function d(){}d.prototype={on:function(s,h,n){var o=this.e||(this.e={});return(o[s]||(o[s]=[])).push({fn:h,ctx:n}),this},once:function(s,h,n){var o=this;function E(){o.off(s,E),h.apply(n,arguments)}return E._=h,this.on(s,E,n)},emit:function(s){var h=[].slice.call(arguments,1),n=((this.e||(this.e={}))[s]||[]).slice(),o=0,E=n.length;for(o;o<E;o++)n[o].fn.apply(n[o].ctx,h);return this},off:function(s,h){var n=this.e||(this.e={}),o=n[s],E=[];if(o&&h)for(var l=0,v=o.length;l<v;l++)o[l].fn!==h&&o[l].fn._!==h&&E.push(o[l]);return E.length?n[s]=E:delete n[s],this}},c.exports=d,c.exports.TinyEmitter=d})},e={};function p(c){if(e[c])return e[c].exports;var d=e[c]={exports:{}};return t[c](d,d.exports,p),d.exports}return(function(){p.n=function(c){var d=c&&c.__esModule?function(){return c.default}:function(){return c};return p.d(d,{a:d}),d}})(),(function(){p.d=function(c,d){for(var s in d)p.o(d,s)&&!p.o(c,s)&&Object.defineProperty(c,s,{enumerable:!0,get:d[s]})}})(),(function(){p.o=function(c,d){return Object.prototype.hasOwnProperty.call(c,d)}})(),p(686)})().default})})(ht)),ht.exports}var bo=Ao();const Do=ra(bo),_o=(r,u)=>{let t=r&&r.replace(/<think>[\s\S]*?<\/think>/g,"");t=t.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),t=t.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",t);const e=new Do(u.currentTarget||u.target,{text:()=>t});try{e.on("success",()=>{Me.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),e.destroy()}),e.on("error",p=>{Me.error("\u590D\u5236\u5931\u8D25",2),e.destroy()}),e.onClick(u)}catch(p){e.destroy(),Me.error("\u590D\u5236\u5931\u8D25: "+p,2)}};function wo(r){const u=[];for(const t of r){if(t.query){const e=t.query.queryId||t.query.id||t.queryId||t.id||v0(32);u.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:e,clientSideId:e+"-user",...t.query})}if(t.reply){const e=t.reply.queryId||t.reply.id||t.queryId||t.id||v0(32);u.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:e,clientSideId:e+"-ai",...t.reply})}}return u}const So=""+new URL("defaultWeLogo.svg",import.meta.url).href,ko="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOkSURBVHgBxZRbTBxlFMd/c2EvXBbZLbsCVhcKaAyh2BKTWrX12RhNmxa1IVp98FEJVGNMY2KItSZtqGjaROMlaDSVxiZeqiRa0FBpIlSkhgK15WoLu7AL3V1md25+7CpUojzYB7/km5OZc+Z35pzz/wb+l3X7PotNL9tvd1yIc8OrYp9pWXZ6JXXdfLOtbdNa4fJazoZdu9xVNUE5petIVS9h/npRfkDKefg/A+OaJuUGvIz3DzD14R6uHv/WCmzbcuNlj7S+3z7+5Xepno7TLeJWWiv2n5zyTcEaT/TJlrfwljxCTm42lgHRmIHDqaIqIsTE43NS7FHCBXKkIzw4eGKkYcdnwmGvBspSy+DpxlrffXtqC6WeqM3+CZ3wnAZLOyXAlsXfOjU7D6EYHLw7zVKvgykcG+r98YmKjdG5BK3nw7w7YQuATdAJWR4IJ2UiswKoiC39+S0+4QjNL0NWgDU7y57ZVlLd2n+FO/Kd7BxxcPOpMKGrCSxNTNm2kVUZ2e1g+5YCxh4q4IW+cAactYTZLi6dxgqw4dUjj+UgfXpSJRAaY9Lt4dZAkoW5YWSXyKwo6ZYbhsFCciPe9hgHtDiB+kqe6huF6jknv2As9/Dj3mv2se4Yh5RhEr4SbD2FpMjomkZ0eoaunl5yxXwqKsspKwsiOVzYqST143k8Xe7gvaN17tHOTi0D/D6U3DqhO7oNNxOlU6heD0cOH2frg/dSU1ywMgRhRmMpvvjoG55t3I0RWWDvuST9iy5q64qtr2/LV9Ill/aNOsb9fnC48a+zGYzF6R/opefsGU59sl88d6V5tpagqekNFg2LgeHN3F/pJS9rET2l4v15Ruav1PHLEdsUJYpXcNjXKA54iCd11gf9ONUkLqeVtu4ciQUjwcCF3wjc4sUlJbhouyjOVek6O2kvT3kGV3e9P/uetlmhi4VpCsU0Wz5o5i6/kIehY8UjyHlLpVt8daKZc1d0qt3zaV2ex09LjYvnhsx3rj8pEq90N1QU+Q+9WJVgbzBPpFIzIrZNsYWVlYyVhJXVtFys6UHWf76O36NDu3nt0fbVJ0Wm6Sedomx5hzPCwYpJygvdkOMVQhbKFjrEFG2JRQjPTHH4Uh4HoptFfy2T5+9clt/qo6fS9MMYilqEL1dCyCQtQsnKhC51yUyCkBLz4qeT77Np3KCme/EvwJVndUcfl0qr6uzKwAb8biemqTCjmYS0RUKhM1zuep2TzZfIpFlefwDISXe8s31UTQAAAABJRU5ErkJggg==",Io=(r,u)=>{const t={...Br.colors,...r};return`
|
|
58
58
|
.g-welcome-${u} .g-welcome-title {
|
|
59
59
|
background-image: linear-gradient(90deg, #3262FA 0%, #6C18FF 100%);
|
|
60
60
|
-webkit-background-clip: text;
|
|
@@ -171,8 +171,8 @@ import{jsx as w,jsxs as ee,Fragment as at}from"react/jsx-runtime";import*as d0 f
|
|
|
171
171
|
border-color: ${t.primary};
|
|
172
172
|
box-shadow: 0 0 0 2px ${t.primary}1A;
|
|
173
173
|
}
|
|
174
|
-
`};function Ro({config:r,styles:u}){if(!r)return null;const t=JSON.parse(r.configJson),e=Fe(()=>{var p;return{...Br.colors,...(p=u==null?void 0:u.theme)==null?void 0:p.colors}},[u]);return ee("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[ee("div",{className:"flex items-center mb-2",children:[w("span",{className:"text-md font-bold truncate mr-2",style:{color:e.primary},children:t.config_name||"\u52A9\u624B\u914D\u7F6E"}),w("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${e.primary}1A`,color:e.disabled},children:t.model_name})]}),w("div",{className:"border-b my-2",style:{borderColor:e.border}}),ee("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:e.text},children:[ee("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",w("span",{className:"font-semibold",children:t.max_round})]}),ee("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",w("span",{className:"font-semibold",children:t.max_tokens})]}),ee("div",{children:["\u6E29\u5EA6\uFF1A",w("span",{className:"font-semibold",children:t.temperature})]}),ee("div",{children:["\u53EC\u56DE\u6570\uFF1A",w("span",{className:"font-semibold",children:t.top_k})]}),ee("div",{children:["\u591A\u6837\u6027\uFF1A",w("span",{className:"font-semibold",children:t.top_p})]}),ee("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",w("span",{className:"font-semibold",children:t.score_threshold})]})]}),ee("div",{className:"mb-2",children:[w("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),w("div",{className:"flex flex-wrap gap-1",children:t.knowledge_base_name?t.knowledge_base_name.split(";").map((p,c)=>w("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${e.primary}1A`,color:e.primary},children:p},c)):w("span",{className:"text-gray-300",style:{color:e.disabled},children:"\u65E0"})})]}),ee("div",{className:"mb-2",children:[w("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),ee("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!t.enabled_faq&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"FAQ"}),!!t.enabled_graph&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u56FE\u8C31"}),!!t.dependOnKb&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!t.enabled_table_select&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u8868\u683C\u7B5B\u9009"}),!!t.enabled_rerank&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!t.need_trace_source&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u6EAF\u6E90"}),!!t.is_download&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function No(r,u=[],t=60){const[e,p]=oe("");return Ee(()=>{if(p(""),!r)return;let c=0;const d=setInterval(()=>{p(s=>c>=r.length?(clearInterval(d),s):(c++,r.slice(0,c)))},t);return()=>clearInterval(d)},[r,...u]),e}function To(r){const{assistantList:u,eventsEmit:t,styles:e,selectedId:p,onSelectAssistant:c,productLogo:d}=r,{messages:s}=er(),[h,n]=oe(1),[o,E]=oe(!1),[l,v]=oe(""),g=o||l.trim()?6:12,i=He(),a=He(!1),m=He(null),x=He(null),f=He("");Ee(()=>{p&&i.current!==p&&(t==null||t("conversation:new_assistant_change",{assistantId:p}),i.current=p)},[p,t]);const F=Fe(()=>v0(),[]);Ee(()=>{var I;if((I=e==null?void 0:e.theme)!=null&&I.colors){const z=document.createElement("style");return z.innerHTML=Io(e.theme.colors,F),z.id=`g-welcome-styles-${F}`,document.head.appendChild(z),()=>{const M=document.getElementById(z.id);M&&M.remove()}}},[e,F]);const b=Fe(()=>u.find(I=>I.id===p),[u,p]),C=Fe(()=>JSON.parse((b==null?void 0:b.configJson)||"{}"),[b]),_=Fe(()=>{if(!l.trim())return u||[];const I=l.toLowerCase().trim();return(u||[]).filter(z=>{var U,G;const M=((U=z.name)==null?void 0:U.toLowerCase())||"";try{const q=((G=JSON.parse(z.configJson||"{}").config_name)==null?void 0:G.toLowerCase())||"";return M.includes(I)||q.includes(I)}catch{return M.includes(I)}})},[u,l]),y=Math.ceil(((_==null?void 0:_.length)||0)/g),k=(_==null?void 0:_.slice((h-1)*g,h*g))||[];Ee(()=>{if(p&&p!==x.current){if(a.current&&m.current!==null){x.current=p;return}const I=l.trim()?_:u;if(I&&I.length>0){const z=I.findIndex(M=>M.id===p);if(z!==-1){const M=Math.floor(z/g)+1;n(M),x.current=p}}}},[p,u,_,g,l]),Ee(()=>{if(l!==f.current){if(a.current&&m.current!==null){n(m.current),a.current=!1,m.current=null,f.current=l;return}if(x.current===p){f.current=l;return}a.current||(l.trim()&&(x.current=null),n(1)),f.current=l}},[l,p]),Ee(()=>{y>0&&h>y&&n(y)},[y,h]);const D=C.prologue||s.welcome.defaultPrologue,R=No(D,[p],30);return ee("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${F}`,children:[w("img",{src:d||So,alt:"logo",className:"mb-4",style:{width:68,height:68}}),w("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:R}),!p&&w("div",{className:"flex mb-2 g-welcome-subtitle",children:s.welcome.selectAssistant}),ee("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3
|
|
175
|
-
max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[o?w("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:w(Xn,{className:"g-welcome-search-input w-full",placeholder:s.welcome.searchAssistant,prefix:w(gr,{size:16}),suffix:w("button",{type:"button",onClick:()=>{E(!1),v("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:w(ta,{size:14})}),value:l,onChange:I=>v(I.target.value),autoFocus:!0})}):w("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>E(!0),children:w(gr,{size:16})}),k&&k.length>0?w(at,{children:k.map(I=>{const z=p===I.id;let M=I.icon;try{const U=JSON.parse(I.configJson||"{}");M=M||U.icon||U.avatar||U.logo}catch{}return M=M||ko,w(Ai,{content:()=>w(Ro,{config:u.find(U=>U.id===I.id),styles:e}),trigger:"hover",placement:"bottom",children:ee("button",{type:"button",className:`g-welcome-btn px-3 cursor-pointer rounded-full border font-medium min-w-[160px] text-sm transition-all flex items-center gap-2 ${z?"active":""}`,onClick:()=>{c==null||c(I.id);const U=o||l.trim(),Z=(U?u:l.trim()?_:u).findIndex(q=>q.id===I.id);if(Z!==-1){const H=Math.floor(Z/(U?12:g))+1;n(H),x.current=I.id,U&&(m.current=H,a.current=!0,setTimeout(()=>{v(""),E(!1)},100))}},title:I.name,children:[w("span",{className:"icon-badge",children:w("img",{src:M,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),w("span",{className:"truncate max-w-[180px]",children:I.name})]})},I.id)})}):w("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})]}),y>1&&ee("div",{className:"flex items-center gap-2",children:[w("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(I=>Math.max(1,I-1)),disabled:h===1,children:w(bi,{size:16})}),w("div",{className:"flex items-center gap-1",children:(()=>{const I=[];if(y<=7)for(let M=1;M<=y;M++)I.push(M);else if(I.push(1),h<=4){for(let M=2;M<=5;M++)I.push(M);I.push("..."),I.push(y)}else if(h>=y-3){I.push("...");for(let M=y-4;M<=y;M++)I.push(M)}else{I.push("...");for(let M=h-1;M<=h+1;M++)I.push(M);I.push("..."),I.push(y)}return I.map((M,U)=>{if(M==="...")return w("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${U}`);const G=M;return w("button",{type:"button",className:`g-welcome-pagination-btn ${h===G?"active":""}`,onClick:()=>n(G),children:G},G)})})()}),w("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(I=>Math.min(y,I+1)),disabled:h===y,children:w(yi,{size:16})})]})]})}class xr extends Error{}let h0=null,C0=null,l0=null,ve=[],j0,V0,fr=new Map;const Po=({baseUrl:r,token:u,CSRFToken:t,setChatData:e,activeSessionId:p,setAppStatus:c,setConversationList:d})=>{const s=a=>{if(!a)return!1;if(typeof a=="string"){const m=a.trim();return m!==""&&m!=="[]"&&m!=="null"}return!0},h=({content:a,status:m,respTime:x,filePaths:f,reference:F,webReference:b,knowledgeBases:C,graphReference:_,databaseReference:y,llmType:k,resultType:D,queryId:R,tokens:I,chain:z,thoughtChainNodes:M,enableCot:U,chainRespTime:G})=>{e(Z=>{var ae;if(!Z[0])return Z;const q=Z[0],H=q.messages||[],te=H.length-1;if(te<0)return Z;const T=H[te];if(T.istype!=="ai")return Z;let P=H.slice();if(f!=null&&f.length){const fe=H.length-2;if(fe>=0&&((ae=H[fe])==null?void 0:ae.istype)==="user"){const e0={...H[fe],filePaths:f};P[fe]=e0}}const S=R&&R!==T.queryId,N=m===1&&T.status===2,W=S||N?s(_)?_:null:_!==void 0&&s(_)?_:T.graphReference;m===2&&_!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:_,isValid:s(_),lastMessageGraphReference:T.graphReference,finalGraphReference:W,isNewQuery:S,isRestart:N});let V;S?V=a:N?V="":m===4||m===2&&!a?V=T.content||"":V=(T.content||"")+a;const Y={...T,content:V,status:m,respTime:x,filePaths:f,reference:S||N?F||"[]":F,webReference:S||N?b||"[]":b,knowledgeBases:S||N?C||"[]":C,graphReference:W,databaseReference:S||N?y!==void 0?y:null:y!==void 0?y:T.databaseReference,resultType:D,llmType:k,tokens:I,queryId:R||T.queryId||v0(32),chain:S||N?z!==void 0?z:void 0:z!==void 0?z:T.chain,thoughtChainNodes:S||N?M!==void 0?M:void 0:M!==void 0?M:T.thoughtChainNodes,enableCot:U!==void 0?U:T.enableCot,chainRespTime:G!==void 0?G:T.chainRespTime};return Y.clientSideId=Y.clientSideId||Y.queryId+"-ai",P[te]=Y,[{...q,isNew:!1,messages:P},...Z.slice(1)]})},n=a=>{if(a instanceof xr)throw c(m=>({...m,display:"error",sender:"ready"})),h0&&(h0.abort(),h0=null),C0=null,l0=null,a};return{updateUserFilesMessage:({currentFiles:a})=>{e(m=>{if(!m[0])return m;const x=m[0],f=x.messages||[];if(!f.length)return m;const F=f.length-2;if(F<0||f[F].istype!=="user")return m;const C=f.slice();return C[F]={...f[F],currentFiles:a},[{...x,messages:C},...m.slice(1)]})},api_startChat_re:(a,m)=>{h0&&h0.abort(),h0=new AbortController,C0=a.sessionId,l0=a.queryId,ve=[],j0=void 0,V0=void 0,fr=new Map;const x=`${r}/qa/ai/question_re`;console.log("data",a);const f={...a};ja(x,{method:"post",signal:h0.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:u||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(f),onopen:async F=>{if(F.status===500)throw new xr("Internal Server Error");if(!F.ok)throw new xr(`HTTP error: ${F.status}`)},onmessage:F=>{var N,W,V,Y;const b=JSON.parse(F.data);if(C0!==b.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:C0,receivedSessionId:b.sessionId,activeSessionId:p});return}if(p!==b.sessionId)return;const{reply:C,resultType:_,respTime:y,reference:k,webReference:D,graphReference:R,knowledgeBases:I,filePaths:z,status:M,docs:U,llmType:G,databaseReference:Z,businessType:q,nodeStatus:H,enableCot:te,chainRespTime:T}=b;if(M===4&&q){H===2&&typeof T=="number"&&T>0&&fr.set(q,T);const $=H===2&&typeof T=="number"&&T>0?T:void 0;ve=gi(ve,{businessType:q,nodeStatus:H,reply:C,respTime:$,chainRespTime:$}),console.log("[AichatUseController] status=4 \u805A\u5408\u601D\u7EF4\u94FE\u6570\u636E:",{businessType:q,nodeStatus:H,content:(N=C==null?void 0:C.content)==null?void 0:N.substring(0,50),currentThoughtNodesCount:ve.length,chainRespTime:H===2?T:void 0})}else M===1&&q&&console.log("[AichatUseController] status=1 \u8DF3\u8FC7\u601D\u7EF4\u94FE\u805A\u5408:",{businessType:q,content:(W=C==null?void 0:C.content)==null?void 0:W.substring(0,50),note:"status=1 \u7684\u5185\u5BB9\u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u4E0D\u662F\u601D\u7EF4\u94FE"});if(typeof te=="number"&&(j0=te),M===1||M===2){const $=Array.from(fr.values()).reduce((ae,fe)=>ae+fe,0);$>0&&(V0=$)}const P=z?JSON.parse(z):[];M===2&&C&&C.content&&(C.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||C.content.includes("\u5931\u8D25")||C.content.includes("\u9519\u8BEF")||C.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&c($=>({...$,display:"ready",sender:"ready"}));const S=s(R)?R:void 0;if(M===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:R,type:typeof R,isValid:s(R),finalGraphReference:S}),M===4){const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content})):void 0;console.log("[AichatUseController] status=4 \u66F4\u65B0\u601D\u7EF4\u94FE:",{businessType:q,chainLength:($==null?void 0:$.length)||0,replyContentLength:((V=C==null?void 0:C.content)==null?void 0:V.length)||0,note:"status=4 \u65F6\uFF0Creply.content \u5E94\u8BE5\u805A\u5408\u5230\u601D\u7EF4\u94FE\uFF0C\u4E0D\u66F4\u65B0\u6B63\u6587"}),h({content:"",status:M,respTime:y,filePaths:P,reference:k||U||"",webReference:D||"",knowledgeBases:I||"",graphReference:S,databaseReference:Z,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0})}else if(M===1){ve.length>0&&(ve=ve.map(ae=>({...ae,nodeStatus:2}))),console.log("[AichatUseController] status=1 \u66F4\u65B0\u6B63\u6587:",{businessType:q,content:(Y=C==null?void 0:C.content)==null?void 0:Y.substring(0,50),thoughtNodesCount:ve.length,note:"status=1 \u65F6\uFF0Creply.content \u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u601D\u7EF4\u94FE\u8282\u70B9\u72B6\u6001\u66F4\u65B0\u4E3A\u5B8C\u6210"});const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content})):void 0;h({content:C.content||"",status:M,respTime:y,filePaths:P,reference:k||U||"",webReference:D||"",graphReference:S,knowledgeBases:I||"",databaseReference:Z??null,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$??void 0,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0})}else if(M===2){ve.length>0&&(ve=ve.map(ae=>({...ae,nodeStatus:2})));const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content})):void 0;if(h({content:C.content||"",status:2,respTime:y,filePaths:P,reference:k||U||"",webReference:D||"",knowledgeBases:I||"",graphReference:S,databaseReference:Z,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0}),ve=[],c(ae=>({...ae,display:"ready",sender:"ready"})),m){const ae=y||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",ae),m(ae)}}else{const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content,respTime:ae.respTime,chainRespTime:ae.respTime})):void 0;h({content:C.content||"",status:M,respTime:y,filePaths:P,reference:k||U||"",knowledgeBases:I||"",webReference:D||"",graphReference:S,databaseReference:Z,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0})}},onerror:n,onclose:()=>{C0===a.sessionId&&(C0=null,l0=null)}})},addEmptyMessage:({queryId:a,content:m,filePaths:x,currentFiles:f})=>{e(F=>{const b=new Date().toISOString(),C=a||v0(32),_={istype:"user",content:m,time:b,queryId:C,clientSideId:C+"-user",filePaths:x||"",currentFiles:f||[]},y={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:C,clientSideId:C+"-ai"},k=F.find(D=>D.id===p);return k?k.messages.push(_,y):console.warn("addEmptyMessage called without an active session."),[...F]})},setLastEmptyMessage:({now:a})=>{e(m=>{if(!m[0])return m;const x=m[0],f=x.messages||[];if(!f.length)return m;const F=f.length-1;if(F<0)return m;const b=f[F];if(b.istype!=="ai")return m;const C=f.slice();return C[F]={...b,istype:"ai",content:"",time:a,streaming:!0,status:0},[{...x,messages:C},...m.slice(1)]})},stopStream:async()=>{if(l0)try{await Je.delete(`${r}/qa/ai/abortStream?queryId=${l0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",l0)}catch(a){console.error("[AichatUseController] \u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",a)}else console.warn("[AichatUseController] \u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42\u65F6\u672A\u627E\u5230 queryId");h0=null,C0=null,l0=null,c(a=>({...a,display:"ready",sender:"ready"}))},cancelStreamBySessionId:async a=>{if(h0&&C0===a){if(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",a),l0)try{await Je.delete(`${r}/qa/ai/abortStream?queryId=${l0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",l0)}catch(m){console.error("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",m)}else console.warn("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u672A\u627E\u5230 queryId");return h0=null,C0=null,l0=null,c(m=>({...m,display:"ready",sender:"ready"})),!0}return!1}}},zo=1e3,Lo=3e3;function Oo({url:r,token:u,CSRFToken:t,onError:e,activeSessionId:p}){const[c,d]=oe([]),[s,h]=oe(()=>({uploadedFiles:[]})),n=He(!1),o=async i=>{var a,m;if(!i)return null;try{const x=await Je.get(`${r}/index/knowledgeBase/file/getFilesBysessionId?sessionId=${i}`,{headers:{Authorization:u}});console.log("[DEBUG] \u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868 res:",(a=x==null?void 0:x.data)==null?void 0:a.data),h({uploadedFiles:((m=x==null?void 0:x.data)==null?void 0:m.data)||[]})}catch(x){throw console.error("\u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868\u5931\u8D25:",x),x}},E=dt((i,a)=>{const m=i.join(",");let x=0,f=null;f=()=>{n.current=!0};const F=async()=>{if(!n.current){if(x>=zo){n.current||a.onFail("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}x++;try{const b=await Je.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${m}`,{headers:{Authorization:u}});if(n.current)return;if(b.data.success){const C=b.data.data;n.current||a.onStatusUpdate(C),C.every(y=>{const k=y.fileParseStatus??y.status;return k===3||k===4})?n.current||a.onComplete():n.current||setTimeout(F,Lo)}else n.current||a.onFail(b.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch(b){if(e==null||e(b),n.current)return;a.onFail("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};return F(),f},[r,u,e]),l=dt(async(i,a)=>{if(!i){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6");return}Va({url:r,token:u,CSRFToken:t},{uid:i,queryId:a},(m,x)=>{m?(Me.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),o(p)):(console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",x),Me.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25"))})},[r,u,t,p]),v=dt(()=>{n.current=!1},[]),g=dt(()=>{n.current=!0},[]);return{fileManagerData:s,fileStatuses:c,setFileManagerData:h,setFileStatuses:d,pollFileStatus:E,handleRemoveFromTemp:l,resetStopFlag:v,setStopFlag:g,stoppedRef:n,getTempFileList:o}}function Mo({title:r,subtitle:u}){const[t,e]=oe(0);return Ee(()=>{let p;return t<98?p=setTimeout(()=>{e(c=>c+Math.random()*6+1)},80):t<100&&(p=setTimeout(()=>e(100),400)),()=>clearTimeout(p)},[t]),ee("div",{className:"flex flex-col justify-center items-center min-h-screen bg-gradient-to-br from-[#EEF4FF] via-white to-[#F5F8FF]",children:[ee("div",{className:"mb-8 flex flex-col items-center",children:[w("div",{className:"mt-6 text-2xl font-semibold text-[#222222] tracking-wide",children:r||"\u5C0F\u9CB8\u667A\u80FD\u4F1A\u8BDD\u52A9\u624B"}),w("div",{className:"mt-2 text-sm text-[#555555]",children:u||"\u8BA9\u667A\u80FD\u5BF9\u8BDD\u66F4\u7B80\u5355"})]}),ee("div",{className:"relative w-80 max-w-sm",children:[w("div",{className:"w-full h-2 bg-[#EEF4FF] rounded-full overflow-hidden shadow-inner",children:w("div",{className:"h-full bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] transition-all duration-300 ease-out",style:{width:`${Math.min(t,100)}%`}})}),ee("div",{className:"absolute -right-2 top-5 text-sm text-[#555555]",children:[Math.min(Math.round(t),100),"%"]})]}),ee("div",{className:"mt-8 flex flex-col items-center gap-2",children:[w("div",{className:"text-sm text-[#555555] animate-pulse",children:"\u6B63\u5728\u521D\u59CB\u5316\u5E94\u7528"}),w("div",{className:"text-xs text-[#888888]",children:"\u9996\u6B21\u52A0\u8F7D\u53EF\u80FD\u9700\u8981\u4E00\u4E9B\u65F6\u95F4\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85"})]})]})}const Aa=document.createElement("style");Aa.textContent=`
|
|
174
|
+
`};function Ro({config:r,styles:u}){if(!r)return null;const t=JSON.parse(r.configJson),e=Fe(()=>{var p;return{...Br.colors,...(p=u==null?void 0:u.theme)==null?void 0:p.colors}},[u]);return ee("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[ee("div",{className:"flex items-center mb-2",children:[w("span",{className:"text-md font-bold truncate mr-2",style:{color:e.primary},children:t.config_name||"\u52A9\u624B\u914D\u7F6E"}),w("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${e.primary}1A`,color:e.disabled},children:t.model_name})]}),w("div",{className:"border-b my-2",style:{borderColor:e.border}}),ee("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:e.text},children:[ee("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",w("span",{className:"font-semibold",children:t.max_round})]}),ee("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",w("span",{className:"font-semibold",children:t.max_tokens})]}),ee("div",{children:["\u6E29\u5EA6\uFF1A",w("span",{className:"font-semibold",children:t.temperature})]}),ee("div",{children:["\u53EC\u56DE\u6570\uFF1A",w("span",{className:"font-semibold",children:t.top_k})]}),ee("div",{children:["\u591A\u6837\u6027\uFF1A",w("span",{className:"font-semibold",children:t.top_p})]}),ee("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",w("span",{className:"font-semibold",children:t.score_threshold})]})]}),ee("div",{className:"mb-2",children:[w("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),w("div",{className:"flex flex-wrap gap-1",children:t.knowledge_base_name?t.knowledge_base_name.split(";").map((p,c)=>w("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${e.primary}1A`,color:e.primary},children:p},c)):w("span",{className:"text-gray-300",style:{color:e.disabled},children:"\u65E0"})})]}),ee("div",{className:"mb-2",children:[w("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),ee("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!t.enabled_faq&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"FAQ"}),!!t.enabled_graph&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u56FE\u8C31"}),!!t.dependOnKb&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!t.enabled_table_select&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u8868\u683C\u7B5B\u9009"}),!!t.enabled_rerank&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!t.need_trace_source&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u6EAF\u6E90"}),!!t.is_download&&w("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function No(r,u=[],t=60){const[e,p]=oe("");return Ee(()=>{if(p(""),!r)return;let c=0;const d=setInterval(()=>{p(s=>c>=r.length?(clearInterval(d),s):(c++,r.slice(0,c)))},t);return()=>clearInterval(d)},[r,...u]),e}function To(r){const{assistantList:u,eventsEmit:t,styles:e,selectedId:p,onSelectAssistant:c,productLogo:d}=r,{messages:s}=er(),[h,n]=oe(1),[o,E]=oe(!1),[l,v]=oe(""),g=o||l.trim()?6:12,i=He(),a=He(!1),m=He(null),x=He(null),f=He("");Ee(()=>{p&&i.current!==p&&(t==null||t("conversation:new_assistant_change",{assistantId:p}),i.current=p)},[p,t]);const F=Fe(()=>v0(),[]);Ee(()=>{var I;if((I=e==null?void 0:e.theme)!=null&&I.colors){const z=document.createElement("style");return z.innerHTML=Io(e.theme.colors,F),z.id=`g-welcome-styles-${F}`,document.head.appendChild(z),()=>{const M=document.getElementById(z.id);M&&M.remove()}}},[e,F]);const b=Fe(()=>u.find(I=>I.id===p),[u,p]),C=Fe(()=>JSON.parse((b==null?void 0:b.configJson)||"{}"),[b]),_=Fe(()=>{if(!l.trim())return u||[];const I=l.toLowerCase().trim();return(u||[]).filter(z=>{var U,G;const M=((U=z.name)==null?void 0:U.toLowerCase())||"";try{const q=((G=JSON.parse(z.configJson||"{}").config_name)==null?void 0:G.toLowerCase())||"";return M.includes(I)||q.includes(I)}catch{return M.includes(I)}})},[u,l]),y=Math.ceil(((_==null?void 0:_.length)||0)/g),k=(_==null?void 0:_.slice((h-1)*g,h*g))||[];Ee(()=>{if(p&&p!==x.current){if(a.current&&m.current!==null){x.current=p;return}const I=l.trim()?_:u;if(I&&I.length>0){const z=I.findIndex(M=>M.id===p);if(z!==-1){const M=Math.floor(z/g)+1;n(M),x.current=p}}}},[p,u,_,g,l]),Ee(()=>{if(l!==f.current){if(a.current&&m.current!==null){n(m.current),a.current=!1,m.current=null,f.current=l;return}if(x.current===p){f.current=l;return}a.current||(l.trim()&&(x.current=null),n(1)),f.current=l}},[l,p]),Ee(()=>{y>0&&h>y&&n(y)},[y,h]);const D=C.prologue||s.welcome.defaultPrologue,R=No(D,[p],30);return ee("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${F}`,children:[w("img",{src:d||So,alt:"logo",className:"mb-4",style:{width:68,height:68}}),w("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:R}),!p&&w("div",{className:"flex mb-2 g-welcome-subtitle",children:s.welcome.selectAssistant}),ee("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3
|
|
175
|
+
max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[o?w("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:w(Gn,{className:"g-welcome-search-input w-full",placeholder:s.welcome.searchAssistant,prefix:w(gr,{size:16}),suffix:w("button",{type:"button",onClick:()=>{E(!1),v("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:w(ea,{size:14})}),value:l,onChange:I=>v(I.target.value),autoFocus:!0})}):w("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>E(!0),children:w(gr,{size:16})}),k&&k.length>0?w(at,{children:k.map(I=>{const z=p===I.id;let M=I.icon;try{const U=JSON.parse(I.configJson||"{}");M=M||U.icon||U.avatar||U.logo}catch{}return M=M||ko,w(Ai,{content:()=>w(Ro,{config:u.find(U=>U.id===I.id),styles:e}),trigger:"hover",placement:"bottom",children:ee("button",{type:"button",className:`g-welcome-btn px-3 cursor-pointer rounded-full border font-medium min-w-[160px] text-sm transition-all flex items-center gap-2 ${z?"active":""}`,onClick:()=>{c==null||c(I.id);const U=o||l.trim(),Z=(U?u:l.trim()?_:u).findIndex(q=>q.id===I.id);if(Z!==-1){const H=Math.floor(Z/(U?12:g))+1;n(H),x.current=I.id,U&&(m.current=H,a.current=!0,setTimeout(()=>{v(""),E(!1)},100))}},title:I.name,children:[w("span",{className:"icon-badge",children:w("img",{src:M,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),w("span",{className:"truncate max-w-[180px]",children:I.name})]})},I.id)})}):w("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})]}),y>1&&ee("div",{className:"flex items-center gap-2",children:[w("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(I=>Math.max(1,I-1)),disabled:h===1,children:w(bi,{size:16})}),w("div",{className:"flex items-center gap-1",children:(()=>{const I=[];if(y<=7)for(let M=1;M<=y;M++)I.push(M);else if(I.push(1),h<=4){for(let M=2;M<=5;M++)I.push(M);I.push("..."),I.push(y)}else if(h>=y-3){I.push("...");for(let M=y-4;M<=y;M++)I.push(M)}else{I.push("...");for(let M=h-1;M<=h+1;M++)I.push(M);I.push("..."),I.push(y)}return I.map((M,U)=>{if(M==="...")return w("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${U}`);const G=M;return w("button",{type:"button",className:`g-welcome-pagination-btn ${h===G?"active":""}`,onClick:()=>n(G),children:G},G)})})()}),w("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(I=>Math.min(y,I+1)),disabled:h===y,children:w(yi,{size:16})})]})]})}class xr extends Error{}let h0=null,C0=null,l0=null,ve=[],j0,V0,fr=new Map;const Po=({baseUrl:r,token:u,CSRFToken:t,setChatData:e,activeSessionId:p,setAppStatus:c,setConversationList:d})=>{const s=a=>{if(!a)return!1;if(typeof a=="string"){const m=a.trim();return m!==""&&m!=="[]"&&m!=="null"}return!0},h=({content:a,status:m,respTime:x,filePaths:f,reference:F,webReference:b,knowledgeBases:C,graphReference:_,databaseReference:y,llmType:k,resultType:D,queryId:R,tokens:I,chain:z,thoughtChainNodes:M,enableCot:U,chainRespTime:G})=>{e(Z=>{var ae;if(!Z[0])return Z;const q=Z[0],H=q.messages||[],te=H.length-1;if(te<0)return Z;const T=H[te];if(T.istype!=="ai")return Z;let P=H.slice();if(f!=null&&f.length){const fe=H.length-2;if(fe>=0&&((ae=H[fe])==null?void 0:ae.istype)==="user"){const e0={...H[fe],filePaths:f};P[fe]=e0}}const S=R&&R!==T.queryId,N=m===1&&T.status===2,W=S||N?s(_)?_:null:_!==void 0&&s(_)?_:T.graphReference;m===2&&_!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:_,isValid:s(_),lastMessageGraphReference:T.graphReference,finalGraphReference:W,isNewQuery:S,isRestart:N});let V;S?V=a:N?V="":m===4||m===2&&!a?V=T.content||"":V=(T.content||"")+a;const Y={...T,content:V,status:m,respTime:x,filePaths:f,reference:S||N?F||"[]":F,webReference:S||N?b||"[]":b,knowledgeBases:S||N?C||"[]":C,graphReference:W,databaseReference:S||N?y!==void 0?y:null:y!==void 0?y:T.databaseReference,resultType:D,llmType:k,tokens:I,queryId:R||T.queryId||v0(32),chain:S||N?z!==void 0?z:void 0:z!==void 0?z:T.chain,thoughtChainNodes:S||N?M!==void 0?M:void 0:M!==void 0?M:T.thoughtChainNodes,enableCot:U!==void 0?U:T.enableCot,chainRespTime:G!==void 0?G:T.chainRespTime};return Y.clientSideId=Y.clientSideId||Y.queryId+"-ai",P[te]=Y,[{...q,isNew:!1,messages:P},...Z.slice(1)]})},n=a=>{if(a instanceof xr)throw c(m=>({...m,display:"error",sender:"ready"})),h0&&(h0.abort(),h0=null),C0=null,l0=null,a};return{updateUserFilesMessage:({currentFiles:a})=>{e(m=>{if(!m[0])return m;const x=m[0],f=x.messages||[];if(!f.length)return m;const F=f.length-2;if(F<0||f[F].istype!=="user")return m;const C=f.slice();return C[F]={...f[F],currentFiles:a},[{...x,messages:C},...m.slice(1)]})},api_startChat_re:(a,m)=>{h0&&h0.abort(),h0=new AbortController,C0=a.sessionId,l0=a.queryId,ve=[],j0=void 0,V0=void 0,fr=new Map;const x=`${r}/qa/ai/question_re`;console.log("data",a);const f={...a};ja(x,{method:"post",signal:h0.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:u||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(f),onopen:async F=>{if(F.status===500)throw new xr("Internal Server Error");if(!F.ok)throw new xr(`HTTP error: ${F.status}`)},onmessage:F=>{var N,W,V,Y;const b=JSON.parse(F.data);if(C0!==b.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:C0,receivedSessionId:b.sessionId,activeSessionId:p});return}if(p!==b.sessionId)return;const{reply:C,resultType:_,respTime:y,reference:k,webReference:D,graphReference:R,knowledgeBases:I,filePaths:z,status:M,docs:U,llmType:G,databaseReference:Z,businessType:q,nodeStatus:H,enableCot:te,chainRespTime:T}=b;if(M===4&&q){H===2&&typeof T=="number"&&T>0&&fr.set(q,T);const $=H===2&&typeof T=="number"&&T>0?T:void 0;ve=gi(ve,{businessType:q,nodeStatus:H,reply:C,respTime:$,chainRespTime:$}),console.log("[AichatUseController] status=4 \u805A\u5408\u601D\u7EF4\u94FE\u6570\u636E:",{businessType:q,nodeStatus:H,content:(N=C==null?void 0:C.content)==null?void 0:N.substring(0,50),currentThoughtNodesCount:ve.length,chainRespTime:H===2?T:void 0})}else M===1&&q&&console.log("[AichatUseController] status=1 \u8DF3\u8FC7\u601D\u7EF4\u94FE\u805A\u5408:",{businessType:q,content:(W=C==null?void 0:C.content)==null?void 0:W.substring(0,50),note:"status=1 \u7684\u5185\u5BB9\u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u4E0D\u662F\u601D\u7EF4\u94FE"});if(typeof te=="number"&&(j0=te),M===1||M===2){const $=Array.from(fr.values()).reduce((ae,fe)=>ae+fe,0);$>0&&(V0=$)}const P=z?JSON.parse(z):[];M===2&&C&&C.content&&(C.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||C.content.includes("\u5931\u8D25")||C.content.includes("\u9519\u8BEF")||C.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&c($=>({...$,display:"ready",sender:"ready"}));const S=s(R)?R:void 0;if(M===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:R,type:typeof R,isValid:s(R),finalGraphReference:S}),M===4){const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content})):void 0;console.log("[AichatUseController] status=4 \u66F4\u65B0\u601D\u7EF4\u94FE:",{businessType:q,chainLength:($==null?void 0:$.length)||0,replyContentLength:((V=C==null?void 0:C.content)==null?void 0:V.length)||0,note:"status=4 \u65F6\uFF0Creply.content \u5E94\u8BE5\u805A\u5408\u5230\u601D\u7EF4\u94FE\uFF0C\u4E0D\u66F4\u65B0\u6B63\u6587"}),h({content:"",status:M,respTime:y,filePaths:P,reference:k||U||"",webReference:D||"",knowledgeBases:I||"",graphReference:S,databaseReference:Z,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0})}else if(M===1){ve.length>0&&(ve=ve.map(ae=>({...ae,nodeStatus:2}))),console.log("[AichatUseController] status=1 \u66F4\u65B0\u6B63\u6587:",{businessType:q,content:(Y=C==null?void 0:C.content)==null?void 0:Y.substring(0,50),thoughtNodesCount:ve.length,note:"status=1 \u65F6\uFF0Creply.content \u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u601D\u7EF4\u94FE\u8282\u70B9\u72B6\u6001\u66F4\u65B0\u4E3A\u5B8C\u6210"});const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content})):void 0;h({content:C.content||"",status:M,respTime:y,filePaths:P,reference:k||U||"",webReference:D||"",graphReference:S,knowledgeBases:I||"",databaseReference:Z??null,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$??void 0,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0})}else if(M===2){ve.length>0&&(ve=ve.map(ae=>({...ae,nodeStatus:2})));const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content})):void 0;if(h({content:C.content||"",status:2,respTime:y,filePaths:P,reference:k||U||"",webReference:D||"",knowledgeBases:I||"",graphReference:S,databaseReference:Z,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0}),ve=[],c(ae=>({...ae,display:"ready",sender:"ready"})),m){const ae=y||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",ae),m(ae)}}else{const $=ve.length>0?ve.map(ae=>({businessType:ae.businessType,nodeStatus:ae.nodeStatus,content:ae.content,respTime:ae.respTime,chainRespTime:ae.respTime})):void 0;h({content:C.content||"",status:M,respTime:y,filePaths:P,reference:k||U||"",knowledgeBases:I||"",webReference:D||"",graphReference:S,databaseReference:Z,llmType:G,resultType:_,queryId:b.queryId,tokens:b.tokens,chain:$,thoughtChainNodes:ve.length>0?[...ve]:void 0,enableCot:j0,chainRespTime:V0})}},onerror:n,onclose:()=>{C0===a.sessionId&&(C0=null,l0=null)}})},addEmptyMessage:({queryId:a,content:m,filePaths:x,currentFiles:f})=>{e(F=>{const b=new Date().toISOString(),C=a||v0(32),_={istype:"user",content:m,time:b,queryId:C,clientSideId:C+"-user",filePaths:x||"",currentFiles:f||[]},y={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:C,clientSideId:C+"-ai"},k=F.find(D=>D.id===p);return k?k.messages.push(_,y):console.warn("addEmptyMessage called without an active session."),[...F]})},setLastEmptyMessage:({now:a})=>{e(m=>{if(!m[0])return m;const x=m[0],f=x.messages||[];if(!f.length)return m;const F=f.length-1;if(F<0)return m;const b=f[F];if(b.istype!=="ai")return m;const C=f.slice();return C[F]={...b,istype:"ai",content:"",time:a,streaming:!0,status:0},[{...x,messages:C},...m.slice(1)]})},stopStream:async()=>{if(l0)try{await Je.delete(`${r}/qa/ai/abortStream?queryId=${l0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",l0)}catch(a){console.error("[AichatUseController] \u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",a)}else console.warn("[AichatUseController] \u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42\u65F6\u672A\u627E\u5230 queryId");h0=null,C0=null,l0=null,c(a=>({...a,display:"ready",sender:"ready"}))},cancelStreamBySessionId:async a=>{if(h0&&C0===a){if(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",a),l0)try{await Je.delete(`${r}/qa/ai/abortStream?queryId=${l0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",l0)}catch(m){console.error("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",m)}else console.warn("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u672A\u627E\u5230 queryId");return h0=null,C0=null,l0=null,c(m=>({...m,display:"ready",sender:"ready"})),!0}return!1}}},zo=1e3,Lo=3e3;function Oo({url:r,token:u,CSRFToken:t,onError:e,activeSessionId:p}){const[c,d]=oe([]),[s,h]=oe(()=>({uploadedFiles:[]})),n=He(!1),o=async i=>{var a,m;if(!i)return null;try{const x=await Je.get(`${r}/index/knowledgeBase/file/getFilesBysessionId?sessionId=${i}`,{headers:{Authorization:u}});console.log("[DEBUG] \u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868 res:",(a=x==null?void 0:x.data)==null?void 0:a.data),h({uploadedFiles:((m=x==null?void 0:x.data)==null?void 0:m.data)||[]})}catch(x){throw console.error("\u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868\u5931\u8D25:",x),x}},E=dt((i,a)=>{const m=i.join(",");let x=0,f=null;f=()=>{n.current=!0};const F=async()=>{if(!n.current){if(x>=zo){n.current||a.onFail("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}x++;try{const b=await Je.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${m}`,{headers:{Authorization:u}});if(n.current)return;if(b.data.success){const C=b.data.data;n.current||a.onStatusUpdate(C),C.every(y=>{const k=y.fileParseStatus??y.status;return k===3||k===4})?n.current||a.onComplete():n.current||setTimeout(F,Lo)}else n.current||a.onFail(b.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch(b){if(e==null||e(b),n.current)return;a.onFail("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};return F(),f},[r,u,e]),l=dt(async(i,a)=>{if(!i){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6");return}Va({url:r,token:u,CSRFToken:t},{uid:i,queryId:a},(m,x)=>{m?(Me.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),o(p)):(console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",x),Me.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25"))})},[r,u,t,p]),v=dt(()=>{n.current=!1},[]),g=dt(()=>{n.current=!0},[]);return{fileManagerData:s,fileStatuses:c,setFileManagerData:h,setFileStatuses:d,pollFileStatus:E,handleRemoveFromTemp:l,resetStopFlag:v,setStopFlag:g,stoppedRef:n,getTempFileList:o}}function Mo({title:r,subtitle:u}){const[t,e]=oe(0);return Ee(()=>{let p;return t<98?p=setTimeout(()=>{e(c=>c+Math.random()*6+1)},80):t<100&&(p=setTimeout(()=>e(100),400)),()=>clearTimeout(p)},[t]),ee("div",{className:"flex flex-col justify-center items-center min-h-screen bg-gradient-to-br from-[#EEF4FF] via-white to-[#F5F8FF]",children:[ee("div",{className:"mb-8 flex flex-col items-center",children:[w("div",{className:"mt-6 text-2xl font-semibold text-[#222222] tracking-wide",children:r||"\u5C0F\u9CB8\u667A\u80FD\u4F1A\u8BDD\u52A9\u624B"}),w("div",{className:"mt-2 text-sm text-[#555555]",children:u||"\u8BA9\u667A\u80FD\u5BF9\u8BDD\u66F4\u7B80\u5355"})]}),ee("div",{className:"relative w-80 max-w-sm",children:[w("div",{className:"w-full h-2 bg-[#EEF4FF] rounded-full overflow-hidden shadow-inner",children:w("div",{className:"h-full bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] transition-all duration-300 ease-out",style:{width:`${Math.min(t,100)}%`}})}),ee("div",{className:"absolute -right-2 top-5 text-sm text-[#555555]",children:[Math.min(Math.round(t),100),"%"]})]}),ee("div",{className:"mt-8 flex flex-col items-center gap-2",children:[w("div",{className:"text-sm text-[#555555] animate-pulse",children:"\u6B63\u5728\u521D\u59CB\u5316\u5E94\u7528"}),w("div",{className:"text-xs text-[#888888]",children:"\u9996\u6B21\u52A0\u8F7D\u53EF\u80FD\u9700\u8981\u4E00\u4E9B\u65F6\u95F4\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85"})]})]})}const Aa=document.createElement("style");Aa.textContent=`
|
|
176
176
|
.animate-bounce-slow {
|
|
177
177
|
animation: bounce 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
|
178
178
|
}
|
|
@@ -180,7 +180,7 @@ import{jsx as w,jsxs as ee,Fragment as at}from"react/jsx-runtime";import*as d0 f
|
|
|
180
180
|
0%, 100% { transform: translateY(0); }
|
|
181
181
|
50% { transform: translateY(-12px); }
|
|
182
182
|
}
|
|
183
|
-
`;document.head.appendChild(Aa);function qo(){return ee("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:1}})})]}),ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:3}})})]}),ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:1}})})]}),ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:2}})})]})]})}function Uo({msg:r,subMsg:u}){return ee("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[w("div",{className:"mb-6 animate-bounce",children:w(Ii,{size:64,className:"text-[#d70016]"})}),w("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:r||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),w("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:u||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),w(X0,{type:"primary",icon:w(ia,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}function Ho(){return ee("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[w("div",{className:"mb-6 animate-bounce",children:w(Fi,{size:64,className:"text-[#d70016]"})}),w("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),w("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),w(X0,{type:"primary",icon:w(ia,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const $o=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const p={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[c]=Yn();return Ee(()=>{if(!r){c.resetFields();return}c.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),w(Jt,{modal:{styles:p},children:w(ra,{title:w("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:ee("div",{className:"mt-[16px] flex justify-end",children:[w(X0,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),w(X0,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await c.validateFields();u("ok_rename",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:w(Wr,{form:c,children:w(Wr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:w(Xn,{})})})})})},Wo=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const p={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[c]=Yn();return Ee(()=>{if(!r){c.resetFields();return}c.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),w(Jt,{modal:{styles:p},children:w(ra,{title:w("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:ee("div",{className:"mt-[16px] flex justify-end",children:[w(X0,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),w(X0,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await c.validateFields();u("ok_remove",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:w("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${e.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})},jo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFQSURBVHgBpVMxTsNQDLWTiIYBFG7Q3iCcgLIxQJWxZSpbOxFO0HICOhE2shGxEFCGbvQGcAPCCahgIJHoN/5RaEOUBAJPsmTZ3/aT/T4Co23ZxoYeWVACEjj/UOhx6l2E+RzudQfNNcR79ptQjfD1vbE98yfzbFDTEE1ZrBC1/IIJEhYPEYhPKUs3m1OQyJBOWfFPOQX+CQ1qQu6sATBaCLwNrh2/NgOdjQC2FBVu5PW+MTjoDvrccSdfJNILqQCzdB9WpzckudQlg87hYISIl7I7G2YNAZ75SrtFy1wxIBwLwtPAc8ZQA5qq676II5MAw8A7n+z3hpLW2d2V0/pVA99NlGV/BRJdIDbltqcV91++zwesvm2IOH6AEmkTkfsW6Seb6/EL+0dY9EhKl1mYi1Slq3HCQFCP2WHWZJY2qEL6L5LPJ/gy8BfIJmxt6X8C+32HILvaN+0AAAAASUVORK5CYII=",tr=({title:r,setOpen:u})=>ee("div",{style:{width:"100%",height:"60px",borderBottom:"1px solid #EBEBEB",padding:"20px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"16px",fontWeight:600},children:[w("div",{children:r}),w("img",{src:Ka,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>u(!1)})]});Ga();const Vo=({curFileInfo:r,onClose:u,token:t})=>{var s;const e={title:"",subtitle:"",backgroundColor:"#f8f9fa",showGrid:!1,showLegend:!1,showTooltip:!1,showFullscreen:!1,showMinimap:!1},[p,c]=oe({nodeList:[],edgeList:[]});Ee(()=>{console.log("curFileInfo",r)},[r]);const d=async h=>{if(!(!(h!=null&&h.id)||!(h!=null&&h.cyphers)||!(h!=null&&h.fetchUrl)))try{const{cyphers:n,fetchUrl:o,id:E}=h||{};console.log("getGraphData params",n,o,E);const l=await Je.post(o,{cyphers:n,ontologyId:E},{headers:{Authorization:t}});console.log("getGraphData res",l),c((l==null?void 0:l.data)||{})}catch(n){console.log("error",n)}};return Ee(()=>{d(r)},[r]),ee("div",{children:[w(tr,{title:r==null?void 0:r.graphName,setOpen:u}),w("div",{style:{width:"100%",height:"calc(100vh - 60px)"},children:w(Xa,{centerNode:{vid:(s=r==null?void 0:r.traceNode)==null?void 0:s.vid},data:p,layout:{type:"force",linkDistance:190},title:e.title,subtitle:e.subtitle,backgroundColor:e.backgroundColor,showGrid:e.showGrid,showLegend:e.showLegend,showTooltip:e.showTooltip,showFullscreen:e.showFullscreen,showMinimap:e.showMinimap,customPlugins:{},onReady:h=>{console.log("KnowledgeGraphPreview ready:",h)}})})]})},Ko=({content:r,onClose:u,token:t})=>{const e=d=>{if(!(d!=null&&d.metadata))return;const s=pr(d,""),{page_number:h,page_size:n,position:o,offset:E,chunk_type:l}=d.metadata;if(s==="markdown_table")return E!=null&&E.length?{annotations:[{id:v0(),offsets:E}],initialPage:1}:{};{if(!n||!o)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size\u6216\u8005\u6587\u4EF6\u5750\u6807","color: red"),{};const v=Array.isArray(n)?n:JSON.parse(n);if(!v.length)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size","color: red"),{};const g=Array.isArray(o)?o:JSON.parse(o);return!g.length||!h?(console.log("%c\u7F3A\u5C11\u6587\u4EF6\u5750\u6807\u6216\u8005\u6587\u4EF6\u9875\u6570","color: red"),{}):{annotations:g.map((a,m)=>({id:v0(),pageNumber:h[m],x:+(a[0][0]/v[0][0]).toFixed(4),y:+(a[0][1]/v[0][1]).toFixed(4),width:+((a[1][0]-a[0][0])/v[0][0]).toFixed(4),height:+((a[2][1]-a[0][1])/v[0][1]).toFixed(4),content:"",color:l==="image"?"#60f74f":"#4FC3F7"})),initialPage:h[0]}}},p=Fe(()=>{var d,s;if(console.log("content88888888888",r),r&&t){console.log("content999",r);const{annotations:h,initialPage:n}=e(r),o={...r,metadata:{source:((d=r==null?void 0:r.metadata)==null?void 0:d.source)||r.parse_url||r.url,page_size:(s=r==null?void 0:r.metadata)==null?void 0:s.page_size}},E=Qn(Zn(o));return{filePath:E,fileName:Ar(o),fileType:pr(o,E),totalPages:o.pdfPages||0,token:t,annotations:h,initialPage:n,initialZoom:Jn(598,o)}}else return{}},[r]),c=Fe(()=>p.filePath?(console.log("curData",p),w(na,{initialZoom:p.initialZoom||100,convertedFilePath:p.filePath,fileName:p.fileName,fileType:p.fileType,initialPage:p.initialPage,totalPages:p.totalPages,authorization:p.token,annotations:p.annotations,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:d=>{switch(d){case"viewer:close":u();break}},tools:{close:!0}})):w(at,{}),[p]);return w("div",{style:{fontFamily:"Source Han Sans CN",fontSize:"12px"},className:"h-full w-full",children:c})},ba=({curFileInfo:r,onClose:u,token:t})=>{const e=Fe(()=>{var c,d,s;if(r&&t){console.log("content999",r);const h={file_source:r.parse_url||r.parsedFilePath||r.url,file_type:r.file_type,metadata:{source:r.filePath||r.url||((c=r==null?void 0:r.metadata)==null?void 0:c.source)||"",page_size:(d=r==null?void 0:r.metadata)==null?void 0:d.page_size},pdfPages:r.pdfPages},n=Qn(Zn(h));return{filePath:n,fileName:Ar(h),fileType:pr(h,n),totalPages:h.pdfPages||0,token:t,initialZoom:Jn(((s=document.getElementById("pdfBox"))==null?void 0:s.clientWidth)||0,h)}}else return{}},[r]),p=Fe(()=>(console.log("curData",e),e.filePath?w(na,{initialZoom:e.initialZoom||100,convertedFilePath:e.filePath,fileName:e.fileName,fileType:e.fileType,initialPage:1,totalPages:e.totalPages,authorization:e.token,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:c=>{switch(c){case"viewer:close":u();break}},tools:{close:!0}}):w(at,{})),[e]);return w("div",{id:"pdfBox",className:"h-full overflow-y-auto",children:p})},Go=({curFileInfo:r,token:u,onClose:t})=>{const[e,p]=oe(1),[c,d]=oe(10),[s,h]=oe([]),[n,o]=oe([]),[E,l]=oe(0);Ee(()=>{var m;const a=((m=r==null?void 0:r.metadata)==null?void 0:m.fetchUrl)||(r==null?void 0:r.fetchUrl);a&&g(a)},[r,e,c]);const v=async({url:a,params:m})=>{var x;try{const f=await Je.get(`${hr()}${a}?${new URLSearchParams(m).toString()}`,{headers:{Authorization:u}}),F=(x=f==null?void 0:f.data)==null?void 0:x.data;if(F){const{columns:b,dataList:C,totalData:_}=F;h(((b==null?void 0:b.slice(1))||[]).map(y=>({title:y.businessName,dataIndex:y.physicalName,key:y.physicalName}))),o(C||[]),l(_||[])}}catch(f){console.log("error",f)}},g=async a=>{v({url:`${a}`,params:{pageNo:e,pageSize:c}})},i=Fe(()=>{const{databaseName:a,businessTableName:m,tableName:x}=r;return`${a} - ${x||m}`},[r]);return ee("div",{children:[w(tr,{title:i,setOpen:t}),(s==null?void 0:s.length)>0?ee("div",{children:[w("div",{className:"p-4 overflow-auto h-[calc(100vh-120px)]",children:w(mi,{columns:s,dataSource:n,pagination:!1,scroll:{x:"max-content"},rowKey:"id"})}),w("div",{className:"flex justify-end px-[18px]",children:w(wi,{current:e,pageSize:c,responsive:!0,simple:!0,total:E,showSizeChanger:!0,showQuickJumper:!0,onChange:(a,m)=>{p(a),d(m||10)},onShowSizeChange:(a,m)=>{p(1),d(m)}})})]}):w($a,{})]})},cn=({i:r,item:u,j:t,clickTag:e})=>(console.log("j in tag",t),console.log("i in tag",r),console.log("item in tag",u),w("div",{style:{minWidth:"16px",height:"16px",backgroundColor:Xo[u.key],margin:"0 4px",color:Yo[u.key],display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"2px",fontSize:"12px",cursor:"pointer"},onClick:()=>e&&e(r,t,u),children:t.index},t.id)),Xo={knowledgeList:"#EAF4FD",searchList:"#E8F7F0",databaseList:"#FFF4E5",graphList:"#E7F8FB"},Yo={knowledgeList:"#2072F0",searchList:"#39B83F",databaseList:"#F48C14",graphList:"#10BBD9"},ln=[{key:"knowledgeList",name:"\u77E5\u8BC6\u5E93\u6587\u6863"},{key:"searchList",name:"\u8054\u7F51\u641C\u7D22",hideBtns:!0},{key:"databaseList",name:"\u6570\u636E\u5E93",hideBtns:!0},{key:"graphList",name:"\u77E5\u8BC6\u56FE\u8C31",hideBtns:!0}],Qo=({type:r,data:u,token:t,eventsEmit:e,is_download:p})=>{const[c,d]=oe(ln),[s,h]=oe("mark"),[n,o]=oe(!1),[E,l]=oe({}),[v,g]=oe("knowledgeList"),[i,a]=oe({knowledgeList:[],searchList:[],databaseList:[],graphList:[]}),m=Fe(()=>{const C=4-c.length,_=Array(C).fill(null).map((k,D)=>({name:"",key:100+D})),y=[...c,..._];return console.log("rrrrrr",y),y},[c]),x=C=>isNaN(C)?"":(+C).toFixed(2),f=(C,_)=>{switch(C){case"knowledgeList":return ni(_);case"searchList":return ri;case"databaseList":return ti;case"graphList":return ei}},F=(C,_)=>C==="graphList"?_.map(y=>({...y,name:y.graphName})).sort((y,k)=>(k.score||0)-(y.score||0)):C==="knowledgeList"?_.map(y=>({...y,file_type:Ja(y.source)||y.file_type,name:y.sourceFileName||Za(y.source)||y.file_name,score:y.rrf_score})).sort((y,k)=>(k.score||0)-(y.score||0)):C==="searchList"?_.map(y=>({...y,name:y.sourceFileName||y.file_name})).sort((y,k)=>(k.score||0)-(y.score||0)):C==="databaseList"?_.map(y=>{const k=y.tableName?`${y.databaseName||"\u6570\u636E\u5E93"} - ${y.tableName}`:y.databaseName||y.name||"\u6570\u636E\u5E93";return{...y,name:k,file_name:k,file_type:"database"}}).sort((y,k)=>(k.score||0)-(y.score||0)):_,b=(C,_,y)=>{var k;switch(y.key){case"knowledgeList":const{pdfPages:D,parsedFilePath:R,order_num:I,tags:z}=C||{},M=_.id||I||"Unknown ID",U=(z||[]).find(P=>P.id===M);if(C.type==="video")return console.log("sdgasdgag",{file:{...C,...U}}),e==null?void 0:e("retrive_tag:click",{file:{...C,...U}});if(console.log("click knowledge tag",C,_),!C||!U)return;const{metadata:G}=U,Z=G.source.split("/"),q=Z[Z.length-1]||"",H=q.split("."),te=H.slice(0,-1).join(".")||"Unknown Label",T=H[H.length-1]||"Unknown Type";l({id:M,title:te,file_name:q,file_type:T,file_source:ai(T)?`${vr}${G.source}`:R,metadata:G,pdfPages:D}),h("mark"),o(!0);break;case"searchList":console.log("click search tag",C,_);break;case"databaseList":console.log("click database tag",C,_),h("database"),l({...C,metadata:C.metadata||{},fetchUrl:C.fetchUrl||((k=C.metadata)==null?void 0:k.fetchUrl)||""}),o(!0);break;case"graphList":console.log("click graph tag",C,_),h("graphPreview"),l({...C,traceNode:((u==null?void 0:u.traceNode)||[]).find(P=>P.id===_.id)}),o(!0);break}};return Ee(()=>{if(r!==Da.REFERENCELIST||(console.log("data in reference drawer",u),!u))return;const{graphRefs:C,knowledgeRefs:_,webRefs:y,databaseRefs:k}=u;C!=null&&C.length&&(i.graphList=F("graphList",C)),_!=null&&_.length&&(i.knowledgeList=F("knowledgeList",_)),y!=null&&y.length&&(i.searchList=F("searchList",y)),k!=null&&k.length&&(i.databaseList=F("databaseList",k));const D=ln.filter(R=>{var I;return(I=i[R.key])==null?void 0:I.length}).sort((R,I)=>{var z,M;return(((z=i[I.key])==null?void 0:z.length)||0)-(((M=i[R.key])==null?void 0:M.length)||0)});d(D),D!=null&&D.length&&g(D[0].key),a({...i})},[u]),ee(at,{children:[ee("div",{className:"listWrap w-full h-full",children:[w(tr,{title:"\u77E5\u8BC6\u6EAF\u6E90",setOpen:()=>{const C=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(C)}}),ee("div",{style:{height:"calc(100% - 60px)"},children:[w("div",{className:"tabs",style:{display:"flex",justifyContent:"space-between",padding:"12px 20px"},children:m.map(C=>w("div",{className:"tab-item",style:{padding:"5.5px 12px",backgroundColor:C.name?v===C.key?"#4E6EF2":"#F5F6F9":"transparent",cursor:"pointer",borderRadius:"4px",color:v===C.key?"#FFFFFF":"#4E5969",fontSize:"14px",minWidth:"80px",display:"flex",justifyContent:"center"},onClick:()=>{C.name&&g(C.key)},children:C.name},C.key))}),w("div",{className:"listBox",style:{height:"calc(100% - 66px)",overflowY:"auto",display:"flex",flexDirection:"column",alignItems:"center",willChange:"scroll-position",transform:"translateZ(0)"},children:c.map(C=>{let _=i[C.key]||[];return v!==C.key?null:w("div",{children:_.map(y=>{var k,D,R,I,z,M;return ee("div",{style:{width:"360px",padding:"4px 8px",borderRadius:"4px",margin:"6px 0",cursor:"pointer"},className:"listItemBox",onClick:()=>{C.key==="searchList"&&window.open(y.link,"_blank")},children:[ee("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ee("div",{style:{width:C.hideBtns?"339px":"288px",fontSize:"14px",color:"#1D2129",fontWeight:"700",display:"flex",alignItems:"center"},children:[w("img",{src:f(C.key,y.file_type),style:{width:"16px",height:"16px",marginRight:"2px"}}),w(nt,{placement:"topLeft",title:((k=y==null?void 0:y.name)==null?void 0:k.length)>17?y.name:"",children:w("div",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:C.hideBtns?"322px":"258px"},onClick:()=>{var U;C.key==="knowledgeList"?e==null||e("knowledge_referenceFile_title:click",{data:{...y,file_type:y.file_type,file_name:y.file_name,metadata:y.metadata,parsedFilePath:y.parsedFilePath}}):C.key==="databaseList"&&(h("database"),l({...y,metadata:y.metadata||{},fetchUrl:y.fetchUrl||((U=y.metadata)==null?void 0:U.fetchUrl)||""}),o(!0))},children:y.name})})]}),ee("div",{style:{width:"52px",justifyContent:"space-between",alignItems:"center",marginRight:"8px",display:C.hideBtns||y.type==="video"?"none":"flex"},children:[w("img",{src:jo,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>{e==null||e("referenceFile_filechat",{data:{...y,file_type:y.file_type,file_name:y.file_name,metadata:y.metadata,parsedFilePath:y.parsedFilePath}})}}),w("div",{style:{borderRight:"1px solid #E5E6EB",height:"14px"}}),w("img",{src:Ya,style:{width:"16px",height:"16px",cursor:p?"pointer":"not-allowed"},onClick:()=>{var G,Z,q;if(!((G=y==null?void 0:y.tags)!=null&&G.length)&&!((Z=y==null?void 0:y.metadata)!=null&&Z.source)||!p)return;const U=((q=((y==null?void 0:y.tags)||[])[0])==null?void 0:q.metadata)||(y==null?void 0:y.metadata);Qa({filePath:`${vr}${U.source}`,fileName:Ar({metadata:U}),token:t})}})]})]}),!!(typeof y.score=="string"||typeof y.score=="number"||(D=y==null?void 0:y.tags)!=null&&D.length&&y.tags.length>0&&y.tags.length<=10)&&ee("div",{style:{display:"flex",justifyContent:"space-between",height:"18px",marginTop:"4px"},children:[(typeof y.score=="string"||typeof y.score=="number")&&ee("div",{style:{backgroundColor:"#F2F2FB",borderRadius:"4px",padding:"2px 3px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px"},children:[w("span",{style:{color:"#4E5969",marginRight:"6px"},children:"\u5206\u6570:"}),w("span",{style:{color:"#1D2129"},children:x(y.score)})]}),w("div",{style:{flex:1,display:"flex",justifyContent:"flex-end"},children:((R=y==null?void 0:y.tags)!=null&&R.length&&y.tags.length>0&&y.tags.length<=10?y.tags:[]).map(U=>w(cn,{i:y,item:C,j:U,clickTag:b},U.id))})]}),w("div",{style:{flex:1,display:"flex",justifyContent:"flex-start",marginTop:"4px"},children:((I=y==null?void 0:y.tags)!=null&&I.length&&y.tags.length>10?y.tags:[]).map(U=>w(cn,{i:y,item:C,j:U,clickTag:b},U.id))}),!!((z=y==null?void 0:y.main_source)!=null&&z.length)&&ee("div",{style:{flex:1,display:"flex",alignItems:"flex-start",marginTop:"4px"},children:[w("div",{style:{fontSize:"12px",color:"#4E5969",width:"60px"},children:"\u5173\u8054\u6587\u6863:"}),w(nt,{placement:"topLeft",title:((M=sr(y.main_source[0]))==null?void 0:M.length)>22?sr(y.main_source[0]):"",children:w("div",{style:{fontSize:"12px",color:"#4E5969",width:"289px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:sr(y.main_source[0])})})]})]},y.id)})},C.key)})})]})]}),w(Jt,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:ee(aa,{autoFocus:!1,onClose:()=>o(!1),open:n,width:v==="graphList"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,afterOpenChange:C=>{C||l(null)},children:[s==="graphPreview"&&w(Vo,{curFileInfo:E,onClose:o,token:t}),s==="mark"&&w(Ko,{content:E,onClose:o,token:t}),s==="preview"&&w(ba,{curFileInfo:E,onClose:o,token:t}),s==="database"&&w(Go,{curFileInfo:E,onClose:o,token:t})]})})]})},Zo=({fileData:r,token:u})=>{const[t,e]=oe([]);Ee(()=>{var h;const d=r==null?void 0:r.knowledgeBases;if(!(d!=null&&d.length))return;const s=((h=d[0])==null?void 0:h.treeData)||[];s!=null&&s.length&&e(s)},[r]);const p=He(new Map),c=async(d,s)=>{var h,n;if(!p.current.get(d==null?void 0:d.fetchUrl))try{const o=t[s];o.loading=!0;const E=[...t];e(E);const l=await Je.get(`${ii()}/${d.fetchUrl}`,{headers:{Authorization:u}}),v=(n=(h=l==null?void 0:l.data)==null?void 0:h.data)==null?void 0:n.records;if(v){const g=t[s];g.loading=!1,g.children=v;const i=[...t];i[s]=g,e(i),p.current.set(d==null?void 0:d.fetchUrl,!0)}else{const g=t[s];g.loading=!1;const i=[...t];e(i)}}catch{const E=t[s];E.loading=!1;const l=[...t];e(l)}};return ee(at,{children:[w(tr,{title:"\u77E5\u8BC6\u5E93\u6587\u6863\u76EE\u5F55",setOpen:()=>{const d=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(d)}}),w("div",{style:{height:"calc(100% - 60px)",overflowY:"auto",padding:"16px"},children:t.map((d,s)=>{var h;return d.type==="file"?ee("div",{className:"flex",style:{marginTop:"8px"},children:[ea(d),w(nt,{placement:"top",title:((h=d.name)==null?void 0:h.length)>23?d.name:"",children:w("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default",fontSize:"14px"},children:d.name})})]}):w(Jo,{item:d,index:s,clickFileItem:c},s)})})]})},Jo=({item:r,index:u,clickFileItem:t})=>{var c;const[e,p]=oe(!1);return ee("div",{style:{marginTop:"8px"},children:[ee("div",{className:"flex cursor-pointer",onClick:()=>{p(!e),!e&&t(r,u)},children:[ea(r),w(nt,{placement:"top",title:((c=r.name)==null?void 0:c.length)>23?r.name:"",children:ee("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"14px"},children:[r.name," (",r.fileCount||0,")"]})})]},u),w("div",{style:{padding:"2px 0 2px 14px",margin:"8px 0 0 7px",borderLeft:"2px solid #E5E6EB",display:e?"block":"none"},children:(r.children||[]).map((d,s)=>{var h;return ee("div",{className:"flex items-center",children:[w("div",{style:{width:"4px",height:"4px",borderRadius:"2px",background:"black"}}),w(nt,{placement:"top",title:((h=d.name)==null?void 0:h.length)>26?d.name:"",children:w("div",{style:{paddingLeft:"6px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",width:"336px"},children:d.fileName})})]},s)})})]})};var Da=(r=>(r.REFERENCELIST="referencelist",r.ALLFILELIST="allFileList",r))(Da||{});function Mu(r=oi){return function({token:t,url:e="http://localhost:8888",styles:p,CSRFToken:c,eventsEmit:d,scrollOld:s,locale:h="zh",messages:n,...o}){const E=Fe(()=>Wa({theme:Br,mode:"light"},p),[p]),[l,v]=oe(!1),[g,i]=oe(!1),[a,m]=oe(null),[x,f]=oe(!1),[F,b]=oe("mark"),[C,_]=oe({url:"",parse_url:"",file_type:"",file_name:""}),[y,k]=oe([]),[D,R]=oe(1),[I]=oe(16),[z,M]=oe(0),[U,G]=oe(!1),[Z,q]=oe([]),[H,te]=oe(void 0),[T,P]=oe([]),[S,N]=oe([]),[W,V]=oe(void 0),[Y,$]=oe({display:"ready",sender:"ready",app:"initializing"});function ae(A,B){if(!B)return A;const L=Array.isArray(A)?[...A]:{...A};for(const O in B)if(B[O]!==void 0&&B[O]!==null&&Object.prototype.hasOwnProperty.call(B,O))if(O==="actions"&&Array.isArray(A[O])&&Array.isArray(B[O])){const K=new Map;A[O].forEach(J=>{J.name&&K.set(J.name,J)}),B[O].forEach(J=>{J.name&&K.set(J.name,J)}),L[O]=Array.from(K.values())}else typeof A[O]=="object"&&A[O]!==null&&!Array.isArray(A[O])&&typeof B[O]=="object"&&B[O]!==null&&!Array.isArray(B[O])?L[O]=ae(A[O],B[O]):L[O]=B[O];return L}const fe=Fe(()=>oa(h),[h]),e0=Fe(()=>{const A=fe;return{...$0,switchs:($0.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?A.sender.netSearch:A.sender.deepThinking})),actions:($0.actions??[]).map(L=>({...L,tip:L.name==="upload"?A.sender.fileUpload:L.tip}))}},[h,fe]),[De,ue]=oe(()=>ae(e0,o.senderConfig));Ee(()=>{const A=fe,B={...$0,switchs:($0.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?A.sender.netSearch:A.sender.deepThinking})),actions:($0.actions??[]).map(L=>({...L,tip:L.name==="upload"?A.sender.fileUpload:L.tip}))};ue(L=>{const O=ae(B,o.senderConfig);return Array.isArray(L.actions)&&Array.isArray(O.actions)&&(O.actions=O.actions.map((K,J)=>{var re;const ne=(re=L.actions)==null?void 0:re[J];return ne&&ne.name===K.name&&ne.badgeCount!==void 0?{...K,badgeCount:ne.badgeCount}:K})),O})},[h,o.senderConfig,fe]);const{fileStatuses:ge,setFileStatuses:me,pollFileStatus:Ie,handleRemoveFromTemp:Xe,resetStopFlag:Ye,setStopFlag:Qe,stoppedRef:a0,getTempFileList:Re,setFileManagerData:Se,fileManagerData:_e}=Oo({url:e,token:t,CSRFToken:c,activeSessionId:H}),[Ke,u0]=we.useState(()=>{var B;if(!S||S.length===0)return;const A=S.find(L=>L.isDefault);return A?A.id:(B=S[0])==null?void 0:B.id});we.useEffect(()=>{if(!S||S.length===0)return;const A=S.some(B=>B.id===Ke);if(!Ke||!A){const B=S.find(L=>L.isDefault);u0(B?B.id:S[0].id)}},[S]);const[j,de]=oe({}),Be=He(void 0),Ge=He(void 0),D0=He(void 0),We=He(null),pe=He(void 0),_0=He([]),[z0,w0]=oe([]),[Ze,S0]=oe({}),[k0,I0]=oe(!1),[L0,Z0]=oe([]),[J0,O0]=oe(!1),{api_startChat_re:t0,addEmptyMessage:i0,setLastEmptyMessage:x0,stopStream:f0,cancelStreamBySessionId:et}=Po({baseUrl:e,CSRFToken:c,token:t,setChatData:q,activeSessionId:H,setAppStatus:$,setConversationList:k}),Te=Fe(()=>{const A={};return(S||[]).forEach(B=>{A[B.id]=B}),A},[S]),se=Fe(()=>{const A=Z.find(L=>L.id===H)||{id:H,messages:[]},B=A.configId?Te[A.configId]:null;return{...A,assistantInfo:B}},[Z,H,Te]);Ee(()=>{console.log("currentChatData",se)},[se]);const y0=Fe(()=>{if(se.configId&&Te){const A=Te[se.configId];return A!=null&&A.configJson?JSON.parse(A.configJson).is_download:!1}else return!1},[se.configId,Te]);Fe(()=>{if((se.configId||W)&&Te){const A=Te[se.configId];if(A!=null&&A.configJson){const B=JSON.parse(A.configJson);return console.log("is_enableThinking",se.configId,Te,W),!!B.thinking}else if(W){const B=Te[W];if(B!=null&&B.configJson)return!!JSON.parse(B.configJson).thinking}}return!1},[se.configId,Te,W]),Ee(()=>{if(Be.current&&Be.current!==H){const B=Be.current,L=y.find(J=>J.sessionId===B&&J.isNew),O=Z.find(J=>J.id===B&&J.isNew),K=O&&O.messages&&O.messages.length>0;L&&!K&&(k(J=>J.filter(ne=>ne.sessionId!==B)),q(J=>J.filter(ne=>ne.id!==B)))}Be.current=H;const A=se.messages&&se.messages.length>0?se.messages[se.messages.length-1].recommendQuestion:[];P(A)},[H,y,Z,se.messages]);const Pe=async A=>{var B,L,O,K;if(!U){G(!0);try{const J=await Je.get(`${e}/qa/dialogue/list?pageNo=${A}&pageSize=${I}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ne=((L=(B=J==null?void 0:J.data)==null?void 0:B.data)==null?void 0:L.records)||[],re=((K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.total)||0;M(re),k(Ce=>{const ye=new Map;return[...Ce,...ne].forEach(ze=>{ye.set(ze.sessionId,ze)}),Array.from(ye.values())}),R(A)}catch{}finally{G(!1)}}};Ee(()=>{$(A=>({...A,app:"initializing"})),Je.get(`${e}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(A=>{N(A.data.data||[])}).catch(()=>{}),Pe(1).then(()=>{H||q0(),$(A=>({...A,app:"ready"}))}).catch(()=>{$(A=>({...A,app:"error"}))})},[]),Ee(()=>{H&&($(A=>({...A,display:"loading"})),Re(H),Je.get(`${e}/qa/dialogue/getDialogBySessionId?sessionId=${H}`,{headers:{Authorization:t}}).then(A=>{var Ue;if(!A.data.data){$(Q=>({...Q,display:"ready"}));return}const B=((Ue=A.data.data)==null?void 0:Ue.queryReplyPairList)||[],L=wo(B),{sessionId:O,searchConfigDTO:K,filePath:J,configId:ne,reference:re,webReference:Ce,uploadedFiles:ye,fileList:ze,currentFiles:Ne}=A.data.data;if(L.length>0){const Q=L.length-1-[...L].reverse().findIndex(le=>le.istype==="ai");Q>=0&&Q<L.length&&L[Q].istype==="ai"&&(re&&(L[Q].reference=re),Ce&&(L[Q].webReference=Ce))}const xe=Ne||ze||ye;if(xe&&L.length>0){const Q=[...L].reverse().findIndex(le=>le.istype==="user");Q!==-1&&(console.log(L[L.length-1-Q].currentFiles,"filesData"),L[L.length-1-Q].currentFiles=xe)}y.find(Q=>Q.sessionId===O)&&k(Q=>Q.map(le=>le.sessionId===O?{...le,searchConfigDTO:K,filePath:J,configId:ne}:le));const ie={configId:A.data.data.configId,filePath:A.data.data.filePath,searchConfigDTO:A.data.data.searchConfigDTO||{},sessionId:A.data.data.sessionId,label:A.data.data.label,kbId:A.data.data.kbId};q(Q=>{const le=Q.filter(Ve=>Ve.id!==H);return[{id:H,messages:L,...ie},...le]}),$(Q=>({...Q,display:"ready"}))}).catch(A=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",A),A.response&&A.response.status===404&&q0(),$(B=>({...B,display:"error"}))}))},[H,e,t]),Ee(()=>{const A=_e.uploadedFiles.length;ue(B=>{const L=Array.isArray(B.actions)?B.actions:[];return{...B,actions:L.map(K=>K.name==="history"?{...K,badgeCount:A}:K)}})},[_e.uploadedFiles]),Ee(()=>{si({url:e,token:t},A=>{Z0(A)})},[]),we.useEffect(()=>{ge.length&&q(A=>{if(!A[0])return A;const{messages:B}=A[0];for(let L=B.length-1;L>=0;L--)if(B[L].istype==="user"){const O=B[L].currentFiles||[];B[L].currentFiles=ge.map(K=>{var ne,re,Ce;const J=O.find(ye=>ye.uid===K.uid);return{name:((ne=K.file)==null?void 0:ne.name)||K.name,size:((re=K.file)==null?void 0:re.size)||K.size,type:((Ce=K.file)==null?void 0:Ce.type)||K.type,status:K.status,uid:K.uid,url:K.url||(J==null?void 0:J.url)||""}});break}return[...A]})},[ge]);let je=null,Ae=null;const qe=(A,B,L,O)=>{Ae=Ie(A,{onStatusUpdate:B,onComplete:L,onFail:O})},r0=(A,B)=>{q(L=>{const O=[...L];return O[0]&&(O[0]={...O[0],messages:O[0].messages.map(K=>K.queryId===A?{...K,feedbackResult:B}:K)}),O})},g0=async A=>{var B,L;if(A)try{const O=(se==null?void 0:se.configId)||((B=Te==null?void 0:Te[(se==null?void 0:se.configId)||""])==null?void 0:B.id)||"",K=await Je.get(`${e}/qa/ai/recommendQuestion?queryId=${A}&configId=${O||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});P(((L=K.data)==null?void 0:L.data)||[])}catch{P([])}};function F0(A){const{content:B,audioUrl:L,filePaths:O,queryId:K}=A;if(!H||!K)return;const J=(se==null?void 0:se.messages)||[],ne=J.findIndex(X=>(X==null?void 0:X.queryId)===K&&((X==null?void 0:X.istype)==="ai"||(X==null?void 0:X.isUser)===!1));let re;if(ne>0)for(let X=ne-1;X>=0;X-=1){const ie=J[X];if((ie==null?void 0:ie.istype)==="user"||(ie==null?void 0:ie.isUser)===!0){re=ie;break}}const Ce=(re==null?void 0:re.content)??B;if(!Ce)return;const ye=(re==null?void 0:re.filePaths)??O,ze=(typeof ye=="string"&&ye?JSON.parse(ye):ye||[]).map(X=>X.uid),Ne=Date.now();x0({now:Ne}),$(X=>({...X,display:"processing",sender:"processing"}));const xe="query-"+v0(32);ne>=0&&J[ne]&&q(X=>{if(!X[0])return X;const ie=X[0],Ue=ie.messages||[];if(ne>=Ue.length)return X;const Q=Ue.slice();return Q[ne]={...Q[ne],queryId:xe,content:Q[ne].content,reference:"[]",webReference:"[]",graphReference:null,databaseReference:null,status:2,chain:void 0},[{...ie,messages:Q},...X.slice(1)]}),A.clearFn&&A.clearFn(),k(X=>X.map(ie=>ie.sessionId===H?{...ie,gmtModified:Ne}:ie)),t0({configId:se.configId,content:Ce,fileUids:ze,lastDate:Ne,name:se.label||"",queryId:xe,sessionId:String(H||""),type:(re==null?void 0:re.audioUrl)??L?"audioUrl":"text",audioUrl:((re==null?void 0:re.audioUrl)??L)||"",enableThinking:!!j.reasoning,enableWebsearch:!!j.netSearch,qaChannel:j.qaChannel,tempKnowledgeBaseCheck:lt.current},X=>{g0(xe)})}async function c0(A,B){if(Y.sender!=="ready"){Me.warning("\u5F53\u524D\u5BF9\u8BDD\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u518D\u53D1\u9001\u65B0\u7684\u95EE\u9898");return}if(!H)return;const L=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(L);const O=y.find(K=>K.sessionId===H);if(O&&O.isNew){let K=!1;const J=W||O.configId,ne=A&&A.content?A.content.slice(0,20):O.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((re,Ce)=>{xi({url:e,token:t,CSRFToken:c},{label:ne,sessionId:O.sessionId,sysType:"INT_SESSION",configId:J},ye=>{ye&&ye.data&&ye.data.sessionId?(k(ze=>ze.map(Ne=>Ne.sessionId===O.sessionId?{...Ne,isNew:!1,configId:J,label:ne}:Ne)),q(ze=>ze.map(Ne=>Ne.id===O.sessionId?{...Ne,isNew:!1,configId:J,label:ne}:Ne)),K=!0,re()):(Me.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),Ce())})}),!K)return;R0(H,A,B,J);return}R0(H,A,B)}function R0(A,B,L,O){const K="query-"+v0(32),J=y.find(xe=>xe.sessionId===A),ne=O||(J==null?void 0:J.configId)||se.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ne);const re=B.content||B.text||"",Ce=typeof re=="string"?re:String(re),ye=Ce?Ce.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let ze;if(B.files&&B.files.length>0&&(ze=B.files.map(xe=>({name:xe.file.name,size:xe.file.size,type:xe.file.type,filePath:xe.filePath||"",convertedFilePath:xe.convertedFilePath||"",uid:xe.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",B.files),i0({content:Ce,queryId:K,currentFiles:ze,filePaths:ze?JSON.stringify(ze):void 0}),k(xe=>xe.map(X=>X.sessionId===A&&X.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&X.isNew?{...X,label:ye,gmtModified:Date.now(),isNew:!1}:X)),q(xe=>xe.map(X=>X.id===A&&X.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&X.isNew?{...X,label:ye,isNew:!1}:X)),B.files&&B.files.length>0){$(Q=>({...Q,sender:"uploading",display:"uploading"})),je=new AbortController,Ye();const xe=B.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),X=B.files.map((Q,le)=>({...Q,uid:xe[le],status:"uploading"}));me(X);const ie=new FormData;B.files.forEach(Q=>{ie.append("files",Q.file)});const Ue=String(A||"");ie.append("sessionId",Ue),ie.append("uids",xe.join(",")),Je.post(`${e}/index/knowledgeBase/file/uploadFiles`,ie,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:je.signal}).then(Q=>{var m0,Tr,Pr,zr,Lr,Or,Mr,qr,Ur,Hr;if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",Q),console.log("\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u8BE6\u60C5:",{status:Q.status,success:(m0=Q.data)==null?void 0:m0.success,dataType:Array.isArray((Tr=Q.data)==null?void 0:Tr.data)?"array":typeof((Pr=Q.data)==null?void 0:Pr.data),dataLength:Array.isArray((zr=Q.data)==null?void 0:zr.data)?Q.data.data.length:"N/A",errorMsg:(Lr=Q.data)==null?void 0:Lr.errorMsg,errorCode:(Or=Q.data)==null?void 0:Or.errorCode,fullResponse:Q.data}),a0.current)return;const le=(Mr=Q.data)==null?void 0:Mr.data,Oe=((qr=Q.data)==null?void 0:qr.success)===!0,Ve=Array.isArray(le)&&le.length>0;if(Oe&&Ve){const o0=le,H0=o0.map(ke=>ke.uid);me(ke=>ke.map(Le=>{const be=le.find(he=>he.uid===Le.uid);return be?{...Le,...be}:Le})),$(ke=>({...ke,sender:"processing",display:"analyzing"})),me(ke=>ke.map(Le=>({...Le,status:"parsing"}))),qe(H0,ke=>{if(!ke||!Array.isArray(ke)){console.warn("pollFileStatus \u56DE\u8C03\u8FD4\u56DE\u7684 serverStatuses \u65E0\u6548:",ke);return}if(me(be=>be.map(he=>{const B0=ke.find(p0=>p0&&p0.uid===he.uid);if(B0)switch(B0.fileParseStatus??B0.status){case 3:return{...he,status:"done"};case 4:return{...he,status:"error"};case 1:case 2:default:return{...he,status:"parsing"}}return he})),Array.isArray(ke)&&ke.length>0&&ke.every(be=>{if(!be)return!1;const he=be.fileParseStatus??be.status;return he===3||he===4})){me([]);const be=new Map;(ke||[]).forEach(he=>{be.set(he.id,he)}),Se(he=>({uploadedFiles:vi(he.uploadedFiles,o0).map(p0=>{var rt;return{...p0,pdfPages:((rt=be.get(p0.id))==null?void 0:rt.pdfPages)||0}})}))}},()=>{L==null||L(),$(Le=>({...Le,sender:"processing",display:"processing"})),me(Le=>Le.map(be=>{const he=o0.find(B0=>B0.uid===be.uid);return he?{...be,...he,url:he.filePath,filePath:he.filePath,name:he.fileName||be.name,convertedFilePath:he.convertedFilePath||be.convertedFilePath}:be})),q(Le=>{if(!Le[0])return Le;const{messages:be}=Le[0];for(let he=be.length-1;he>=0;he--)if(be[he].istype==="user"){const B0=be[he].currentFiles||[];be[he].currentFiles=B0.map(p0=>{const rt=o0.find(za=>za.uid===p0.uid);return rt?{...p0,...rt}:p0});break}return[...Le]});const ke=Date.now();t0({configId:ne,content:Ce,fileUids:H0,lastDate:ke,name:ye,queryId:K,sessionId:String(A||""),type:"text",audioUrl:"",enableThinking:!!j.reasoning,enableWebsearch:!!j.netSearch,qaChannel:j.qaChannel,tempKnowledgeBaseCheck:lt.current},Le=>{g0(K)})},ke=>{$(Le=>({...Le,display:"ready",sender:"ready"})),me(Le=>Le.map(be=>({...be,status:"error",message:ke})))})}else{let o0="\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";(Ur=Q.data)!=null&&Ur.errorMsg?o0=Q.data.errorMsg:Oe?Ve||(Array.isArray(le)?le.length===0&&(o0="\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u4E3A\u7A7A"):o0=`\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF0C\u671F\u671B\u6570\u7EC4\uFF0C\u5B9E\u9645\u4E3A ${typeof le}`):o0=`\u4E0A\u4F20\u5931\u8D25: success=${(Hr=Q.data)==null?void 0:Hr.success}`,console.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u8BE6\u60C5:",{errorMsg:o0,response:Q.data,isSuccess:Oe,isValidData:Ve}),Me.error(o0),$(H0=>({...H0,display:"error",sender:"ready"})),me(H0=>H0.map(ke=>({...ke,status:"error",message:o0})))}}).catch(Q=>{var le,Oe;((le=Q==null?void 0:Q.response)==null?void 0:le.status)===413?(Oe=Q==null?void 0:Q.response)!=null&&Oe.statusText.includes("Request Entity Too Large")&&Me.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):Me.error("\u7F51\u7EDC\u9519\u8BEF"),$(Ve=>({...Ve,display:"error",sender:"ready"})),me(Ve=>Ve.map(m0=>({...m0,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}$(xe=>({...xe,display:"processing",sender:"processing"}));const Ne=Date.now();k(xe=>xe.map(X=>X.sessionId===A?{...X,gmtModified:Ne}:X)),L==null||L(),t0({configId:ne,content:Ce,fileUids:[],lastDate:Ne,name:ye,queryId:K,sessionId:String(A||""),type:"text",audioUrl:"",enableThinking:!!j.reasoning,enableWebsearch:!!j.netSearch,qaChannel:j.qaChannel,tempKnowledgeBaseCheck:lt.current},xe=>{g0(K)})}function M0(A){A.restult==1?ur({url:e,token:t,CSRFToken:c},{queryId:A.queryId},()=>{r0(A.queryId,null)}):jr({url:e,token:t,CSRFToken:c},{restult:1,queryId:A.queryId},()=>{r0(A.queryId,1)})}function q0(A){const B=v0(32),L={sessionId:B,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};k(O=>[{...L,messages:[]},...O]),q(O=>[{id:B,messages:[],...L},...O]),te(B)}function N0(A){if(A!=null&&A.sessionId&&A.sessionId!==H){H&&et(H),te(A.sessionId),$(L=>({...L,sender:"ready"}));const B=Z.find(L=>L.id===A.sessionId);if(B&&B.messages&&B.messages.length>0){const L=[...B.messages].reverse().find(O=>O.istype==="ai");L&&L.recommendQuestion?P(L.recommendQuestion):P([])}else P([])}}const U0=async A=>new Promise((B,L)=>{fi({url:e,token:t,CSRFToken:c},{sessionId:A},O=>{O?(Me.success("\u5220\u9664\u6210\u529F!"),B(O)):(Me.error("\u5220\u9664\u5931\u8D25!"),L(O))})}),nr=async()=>{try{return k([]),M(0),await Pe(1),[]}catch(A){throw Me.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),A}},it=async(A,B)=>new Promise((L,O)=>{pi({url:e,token:t,CSRFToken:c},{label:B,sessionId:A},K=>{if(K){const J=Date.now();k(ne=>ne.map(re=>re.sessionId===A?{...re,label:B,gmtModified:J}:re)),q(ne=>ne.map(re=>re.id===A?{...re,label:B}:re)),Me.success("\u91CD\u547D\u540D\u6210\u529F!"),L(K)}else Me.error("\u91CD\u547D\u540D\u5931\u8D25"),O(K)})}),ot=A=>{k(B=>{const L=B.filter(O=>O.sessionId!==A);return H===A&&(L.length>0?te(L[0].sessionId):q0()),L})},st=(A,B)=>{const L=Date.now();k(O=>O.map(K=>K.sessionId===A?{...K,label:B,gmtModified:L}:K)),q(O=>O.map(K=>K.id===A?{...K,label:B}:K))},ut=A=>{jr({url:e,token:t,CSRFToken:c},{...A,...Ze,restult:0},()=>{r0(Ze.queryId,0)})},ct=A=>{const B=A.new_name,L=a.data.label;B&&B!==L?a.async_renameConversation(B).then(()=>{a.fn_renameItemInList(B),v(!1)}).catch(()=>{}):v(!1)},ar=A=>{a.async_deleteConversation().then(()=>{a.fn_removeItemFromList(),i(!1)}).catch(()=>{})},n0=(A,B)=>{switch(console.log(A,B),A){case"close_remove":i(!1);break;case"close_rename":v(!1);break;case"ok_rename":ct(B);break;case"ok_remove":ar();break}},tt=async({url:A,params:B,replacePredataFunction:L})=>{var O,K;try{const J=await Je.post(A,B,{headers:{Authorization:t}}),ne=(K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.data;ne&&L(ne)}catch(J){console.log("error",J)}},Ia=async A=>{var B;try{const L=await Je.get(`${hr()}/index/knowledgeBase/file/getFileStatusByUids?uids=${A.data.uids}`,{headers:{Authorization:t}});return console.log("resslkdjgalsg",L),(B=L==null?void 0:L.data)==null?void 0:B.data}catch{}},Rr=async A=>{var B;if(hi.includes(A.file_type)){const L=(B=A.metadata)!=null&&B.source?`${vr}${A.metadata.source}`:A.url||A.convertedFilePath||A.filePath;_({...A,parse_url:L}),b("preview"),f(!0);return}try{const L=await Ia({data:{uids:A.uid},config:{url:hr(),token:t,enableMock:!1}});if(L!=null&&L.length){const O=L[0];_({...A,parse_url:O.convertedFilePath}),b("preview"),f(!0)}}catch{}},lt=He(!1),E0=(A,B)=>{var L,O,K,J,ne,re,Ce;switch(console.log(`[Event] ${A}`,B),A){case"TempKnowledgeBase":lt.current=B;break;case"reference_file:click":if(B.file_type==="image")return;if(!B.parse_url){if(!B.uid)return B.references?void 0:Me.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8");Rr(B);return}_({...B,file_type:B.type,file_name:B.file}),b("preview"),f(!0);break;case"conversations:load_more":{y.length<z&&!U&&Pe(D+1);break}case"retrieve-sql-data:pagingation_click":const{page:ye,pageSize:ze,fetchUrl:Ne,source:xe,replacePredataFunction:X}=B;tt({url:`${e}${Ne}`,replacePredataFunction:X,params:{pageNo:ye,pageSize:ze,convertedFilePath:xe,stream:!1}});break;case"web_referenceFile_title:click":if(!((L=B==null?void 0:B.data)!=null&&L.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(B.data.link,"_blank");break;case"conversation:item_click":N0(B);break;case"files:finished_animation_complete":me([]);break;case"conversation:create":q0();break;case"conversation:new_assistant_change":V(B.assistantId);break;case"conversations:rename_icon_clicked":m({data:B,async_renameConversation:ie=>it(B.sessionId,ie),fn_renameItemInList:ie=>st(B.sessionId,ie)}),v(!0);break;case"conversations:delete_icon_clicked":m({data:B,async_deleteConversation:()=>U0(B.sessionId),async_refreshConversationList:nr,fn_removeItemFromList:()=>ot(B.sessionId)}),i(!0);break;case"sender:send":c0(B,B.clearFn);break;case"sender:send_recommandQuestion":{const ie=((B==null?void 0:B.content)??"").toString();if(!ie)break;c0({content:ie},()=>{});break}case"chatbox:follow_up_question_click":{const ie=((B==null?void 0:B.question)??(B==null?void 0:B.content)??"").toString();if(!ie)break;c0({content:ie},()=>{});break}case"sender:stop":Qe(),je&&(je.abort(),je=null),Ae&&(Ae(),Ae=null),$(ie=>({...ie,display:"ready",sender:"ready"})),me([]),f0==null||f0();break;case"sender:clear":(O=B.clearFn)==null||O.call(B);break;case"sender:configChange":B&&B.all&&de(B.all);break;case"sender:action_upload":We.current&&We.current.click();break;case"sender:action_history":O0(!0);break;case"uploaded_file:item_click":break;case"action_copy:click":B&&_o(B.content,B.event);break;case"chatbox:copy":{let ie=(B==null?void 0:B.content)||"";if(!ie)break;ie=ie.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,"");const Ue=async le=>{try{return await navigator.clipboard.writeText(le),Me.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},Q=le=>{const Oe=document.createElement("textarea");Oe.value=le,Oe.style.position="fixed",Oe.style.opacity="0",document.body.appendChild(Oe),Oe.focus(),Oe.select();try{document.execCommand("copy"),Me.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{Me.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(Oe)};Ue(ie).then(le=>{le||Q(ie)});break}case"chatbox:repeat":console.log(B,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),F0(B);break;case"action_thumbsup":M0(B);break;case"chatbox:like":M0({queryId:B==null?void 0:B.queryId,restult:B==null?void 0:B.result});break;case"action_thumbsdown":B.restult===0?ur({url:e,token:t,CSRFToken:c},{queryId:B.queryId},()=>{r0(B.queryId,null)}):(S0(B),I0(!0));break;case"chatbox:dislike":(B==null?void 0:B.result)===0?ur({url:e,token:t,CSRFToken:c},{queryId:B.queryId},()=>{r0(B.queryId,null)}):(S0({queryId:B==null?void 0:B.queryId}),I0(!0));break;case"action_retrive_tag":d==null||d("action_retrive_tag",B);break;case"referenceFile_view":d==null||d("referenceFile_view",B);break;case"referenceFile_question":console.log(B,"zhezhhzhzh"),Rr(B.data||B),d==null||d("referenceFile_question",B);break;case"referenceFile_download":d==null||d("referenceFile_download",B);break;case"references:click":case"knowledge_base_view_all:click":{const ie=()=>A==="references:click"?w(Qo,{type:"referencelist",data:B,token:t,eventsEmit:d,is_download:y0}):w(Zo,{fileData:B,token:t}),Ue=new CustomEvent("aichat:right_set_content",{detail:{content:w(ie,{})}});window.dispatchEvent(Ue);const Q=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(Q);break}case"retrive_tag:click":d==null||d("retrive_tag:click",B);break;case"fileManager:change":{typeof(B==null?void 0:B.setUploadedFiles)=="function"&&(Ge.current=B.setUploadedFiles,D0.current=B.removeFile,pe.current=B==null?void 0:B.senderConfig,_0.current=Array.isArray(B==null?void 0:B.uploadedFiles)?B.uploadedFiles:[],Array.isArray(B==null?void 0:B.uploadedFiles)&&w0(B.uploadedFiles),console.log("[DEBUG] fileManager:change \u4E8B\u4EF6\u89E6\u53D1\uFF0CsetUploadedFilesRef \u5DF2\u8BBE\u7F6E",{hasSetUploadedFiles:!!Ge.current,uploadedFilesCount:((K=B==null?void 0:B.uploadedFiles)==null?void 0:K.length)||0,pendingFilesCount:((J=B==null?void 0:B.uploadedFiles)==null?void 0:J.length)||0,hasSenderConfig:!!(B!=null&&B.senderConfig),senderConfig:B==null?void 0:B.senderConfig,upload_number_limit:(ne=B==null?void 0:B.senderConfig)==null?void 0:ne.upload_number_limit,upload_size_limit:(re=B==null?void 0:B.senderConfig)==null?void 0:re.upload_size_limit}));break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",B);const ie=(Ce=B==null?void 0:B.file)==null?void 0:Ce.uid;if(!ie){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",B);break}const Ue=[...(se==null?void 0:se.messages)||[]].reverse().find(le=>le.istype==="user"),Q=Ue==null?void 0:Ue.queryId;Xe(ie,Q);break}case"uploaded_file:remove_batch":break;default:d==null||d(A,B)}},Ra=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:w(ki,{size:16}),enabled:!0,component:w(Eo,{data:y,assistantList:S,activedItem:H||"",hasMore:y.length<z,loadingMore:U,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:E0,styles:E.theme})}],Nr=we.useCallback(()=>w(To,{eventsEmit:E0,assistantList:S,styles:E,selectedId:Ke,onSelectAssistant:u0,productLogo:o==null?void 0:o.productLogo}),[E0,S,E,Ke,o==null?void 0:o.productLogo]),Na={...we.useMemo(()=>({AiChatBox:(A,B)=>{var ze,Ne,xe;const L=B===(((ze=se==null?void 0:se.messages)==null?void 0:ze.length)||0)-1;let O="ready";if(L)if(A.status!==void 0)switch(A.status){case 0:O="thinking";break;case 1:O="processing";break;case 2:O="ready";break;case 3:O="error";break;case 4:O="thinking";break;default:O=Y.display}else O=Y.display;let K=[];if(Array.isArray(T))K=T;else if(typeof T=="string")try{K=JSON.parse(T)||[]}catch{K=[]}const J=(()=>{const X=A==null?void 0:A.reference;if(!X)return"[]";if(typeof X=="string")try{return JSON.parse(X),X}catch{return"[]"}try{return JSON.stringify(X)}catch{return"[]"}})(),ne=(()=>{const X=A==null?void 0:A.webReference;if(!X)return"[]";if(typeof X=="string")try{return JSON.parse(X),X}catch{return"[]"}try{return JSON.stringify(X)}catch{return"[]"}})(),re=(()=>{const X=A==null?void 0:A.graphReference;if(!X)return"[]";if(typeof X=="string")try{return JSON.parse(X),X}catch{return"[]"}try{return JSON.stringify(X)}catch{return"[]"}})(),Ce=A==null?void 0:A.databaseReference,ye=(()=>{var ie,Ue,Q;if(A!=null&&A.chainRespTime||(ie=A==null?void 0:A.reply)!=null&&ie.chainRespTime)return(A==null?void 0:A.chainRespTime)??((Ue=A==null?void 0:A.reply)==null?void 0:Ue.chainRespTime);const X=(A==null?void 0:A.chain)||((Q=A==null?void 0:A.reply)==null?void 0:Q.chain);if(Array.isArray(X)&&X.length>0){const le=X.reduce((Oe,Ve)=>{const m0=(Ve==null?void 0:Ve.chainRespTime)??(Ve==null?void 0:Ve.respTime);return m0!=null&&m0>0?Oe+m0:Oe},0);return le>0?le:void 0}})();return w(Vr,{...A,token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",referenceMode:"button",reference:J,webReference:ne,graphReference:re,databaseReference:Ce,contentType:"stream",displayStatus:O,eventsEmit:E0,isLast:L&&(A==null?void 0:A.istype)==="ai",followUpQuestions:L&&(A==null?void 0:A.istype)==="ai"?K:[],defaultAnswer:((Ne=se==null?void 0:se.searchConfigDTO)==null?void 0:Ne.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:y0,styles:E,enableThoughtChain:!0,chain:A==null?void 0:A.chain,thoughtChainNodes:A==null?void 0:A.thoughtChainNodes,thoughtChainStatus:A==null?void 0:A.status,enableCot:(A==null?void 0:A.enableCot)??((xe=A==null?void 0:A.reply)==null?void 0:xe.enableCot),chainRespTime:ye},`${(A==null?void 0:A.queryId)||(A==null?void 0:A.id)||B}-${(A==null?void 0:A.istype)||"unknown"}`)},LogoBox:A=>A&&A.LogoBox===null?null:A&&typeof A.LogoBox=="function"?w(A.LogoBox,{}):w("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>w(qo,{}),DisplayError:()=>w(Ho,{}),AppError:()=>w(Uo,{msg:"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25",subMsg:"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),AppLoading:()=>{var A,B;return w(Mo,{title:(A=o==null?void 0:o.appLoadingConfig)==null?void 0:A.title,subtitle:((B=o==null?void 0:o.appLoadingConfig)==null?void 0:B.subtitle)||""})},UserChatBox:(A,B)=>w(Vr,{token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",...A,referenceMode:"button",contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:E0,styles:E,fileManagerData:_e,currentFiles:A==null?void 0:A.currentFiles},`${(A==null?void 0:A.queryId)||(A==null?void 0:A.id)||B}-user`),WelcomeComponent:Nr}),[Nr,se,Y.display,E0,E,y0,_e]),...o.CustomComponents||{}};Ee(()=>{ue(A=>{const B=Array.isArray(A.switchs)?A.switchs.map(L=>L.name==="reasoning"?{...L,enabled:!0}:L):[];return{...A,switchs:B}})},[]);const Ta=Fe(()=>_e.uploadedFiles||[],[_e]),{FileDisplayTools:Pa}=ui({fileManagerData:{uploadedFiles:Ta},styles:E,eventsEmit:E0});return w(Mi,{locale:h,children:ee("div",{style:{height:"100%",minWidth:"1116px",overflow:"hidden"},children:[w("input",{ref:We,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.md,.json,.csv,.zip,.rar,.7z",style:{display:"none"},onChange:A=>{const B=A.target.files;if(B&&B.length>0){console.log("[DEBUG] handleFileSelect \u89E6\u53D1",{filesCount:B.length,hasSetUploadedFilesRef:!!Ge.current,hasSenderConfig:!!pe.current,dynamicSenderConfig:De,dynamicSenderConfigKeys:De?Object.keys(De):[],senderConfigRef:pe.current,senderConfigRefKeys:pe.current?Object.keys(pe.current):[]});const L=Array.from(B);let O=pe.current;(!O||O.upload_size_limit===void 0&&O.upload_number_limit===void 0&&(!O.upload_file_type_limit||O.upload_file_type_limit.length===0))&&(O=De);const K=_0.current||[];console.log("[DEBUG] \u9A8C\u8BC1\u914D\u7F6E\u68C0\u67E5",{configSource:O,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,existingFilesCount:K.length,newFilesCount:L.length});const J=O&&(O.upload_size_limit!==void 0||O.upload_number_limit!==void 0&&O.upload_number_limit>0||O.upload_file_type_limit&&O.upload_file_type_limit.length>0);if(console.log("[DEBUG] \u914D\u7F6E\u68C0\u67E5\u7ED3\u679C",{hasUploadLimitConfig:J,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,upload_file_type_limit:O==null?void 0:O.upload_file_type_limit}),J){const ne={upload_size_limit:O.upload_size_limit,upload_number_limit:O.upload_number_limit,upload_file_type_limit:O.upload_file_type_limit,upload_limit_message:O.upload_limit_message};console.log("[DEBUG] \u6267\u884C\u6587\u4EF6\u9A8C\u8BC1",{uploadConfig:ne,existingFilesCount:K.length,newFilesCount:L.length,totalCount:K.length+L.length});const re=li(L,K,ne);if(console.log("[DEBUG] \u9A8C\u8BC1\u7ED3\u679C",{valid:re.valid,errors:re.errors,rejectedFilesCount:re.rejectedFiles.length}),!re.valid){di(re);const Ce=L.filter(ye=>!re.rejectedFiles.includes(ye));if(Ce.length===0){We.current&&(We.current.value="");return}L.splice(0,L.length,...Ce)}}if(Ge.current){const ne=L.map(re=>({file:re,type:re.type.startsWith("image/")?"image":"document",status:"pending",name:re.name}));console.log("[DEBUG] \u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ne),Ge.current(ne)}else console.warn("[DEBUG] setUploadedFilesRef \u672A\u8BBE\u7F6E\uFF0C\u5EF6\u8FDF\u91CD\u8BD5"),setTimeout(()=>{if(Ge.current){const ne=L.map(re=>({file:re,type:re.type.startsWith("image/")?"image":"document",status:"pending",name:re.name}));console.log("[DEBUG] \u5EF6\u8FDF\u540E\u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ne),Ge.current(ne)}else console.error("[DEBUG] \u5EF6\u8FDF\u540E setUploadedFilesRef \u4ECD\u672A\u8BBE\u7F6E")},100)}We.current&&(We.current.value="")}}),w(r,{...o,status:Y,chatData:se,sidebar:Ra,recommandQuestions:[],eventsEmit:E0,styles:E,senderConfig:De,fileUploadStatus:ge,CustomComponents:Na,activeSessionId:H,scrollOld:s,rightbarWidth:"400px",locale:h,messages:n,disclaimer:o.disclaimer??fe.disclaimer,chatHeader:{title:(se==null?void 0:se.label)||fe.chatHeader.newConversation,tools:Pa}}),w(ci,{open:k0,feedBackList:L0,setOpen:I0,handleConfirm:ut}),w($o,{isModalOpen:l,handleOk:n0,handleCancel:()=>n0("close_rename"),data:(a==null?void 0:a.data)||{}}),w(Wo,{isModalOpen:g,handleOk:n0,handleCancel:()=>n0("close_remove"),data:(a==null?void 0:a.data)||{}}),w(Jt,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:w(aa,{autoFocus:!1,onClose:()=>f(!1),open:x,width:F==="graphPreview"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,children:F==="preview"&&w(ba,{curFileInfo:C,onClose:f,token:t})})})]})})}}var vt={exports:{}},gt={exports:{}},es=gt.exports,dn;function ce(){return dn||(dn=1,(function(r,u){(function(t,e){r.exports=e()})(es,function(){var t=t||(function(e,p){var c;if(typeof window<"u"&&window.crypto&&(c=window.crypto),typeof self<"u"&&self.crypto&&(c=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window<"u"&&window.msCrypto&&(c=window.msCrypto),!c&&typeof or<"u"&&or.crypto&&(c=or.crypto),!c&&typeof Di=="function")try{c=_i}catch{}var d=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||(function(){function x(){}return function(f){var F;return x.prototype=f,F=new x,x.prototype=null,F}})(),h={},n=h.lib={},o=n.Base=(function(){return{extend:function(x){var f=s(this);return x&&f.mixIn(x),(!f.hasOwnProperty("init")||this.init===f.init)&&(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var f in x)x.hasOwnProperty(f)&&(this[f]=x[f]);x.hasOwnProperty("toString")&&(this.toString=x.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),E=n.WordArray=o.extend({init:function(x,f){x=this.words=x||[],f!=p?this.sigBytes=f:this.sigBytes=x.length*4},toString:function(x){return(x||v).stringify(this)},concat:function(x){var f=this.words,F=x.words,b=this.sigBytes,C=x.sigBytes;if(this.clamp(),b%4)for(var _=0;_<C;_++){var y=F[_>>>2]>>>24-_%4*8&255;f[b+_>>>2]|=y<<24-(b+_)%4*8}else for(var k=0;k<C;k+=4)f[b+k>>>2]=F[k>>>2];return this.sigBytes+=C,this},clamp:function(){var x=this.words,f=this.sigBytes;x[f>>>2]&=4294967295<<32-f%4*8,x.length=e.ceil(f/4)},clone:function(){var x=o.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var f=[],F=0;F<x;F+=4)f.push(d());return new E.init(f,x)}}),l=h.enc={},v=l.Hex={stringify:function(x){for(var f=x.words,F=x.sigBytes,b=[],C=0;C<F;C++){var _=f[C>>>2]>>>24-C%4*8&255;b.push((_>>>4).toString(16)),b.push((_&15).toString(16))}return b.join("")},parse:function(x){for(var f=x.length,F=[],b=0;b<f;b+=2)F[b>>>3]|=parseInt(x.substr(b,2),16)<<24-b%8*4;return new E.init(F,f/2)}},g=l.Latin1={stringify:function(x){for(var f=x.words,F=x.sigBytes,b=[],C=0;C<F;C++){var _=f[C>>>2]>>>24-C%4*8&255;b.push(String.fromCharCode(_))}return b.join("")},parse:function(x){for(var f=x.length,F=[],b=0;b<f;b++)F[b>>>2]|=(x.charCodeAt(b)&255)<<24-b%4*8;return new E.init(F,f)}},i=l.Utf8={stringify:function(x){try{return decodeURIComponent(escape(g.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return g.parse(unescape(encodeURIComponent(x)))}},a=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new E.init,this._nDataBytes=0},_append:function(x){typeof x=="string"&&(x=i.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes},_process:function(x){var f,F=this._data,b=F.words,C=F.sigBytes,_=this.blockSize,y=_*4,k=C/y;x?k=e.ceil(k):k=e.max((k|0)-this._minBufferSize,0);var D=k*_,R=e.min(D*4,C);if(D){for(var I=0;I<D;I+=_)this._doProcessBlock(b,I);f=b.splice(0,D),F.sigBytes-=R}return new E.init(f,R)},clone:function(){var x=o.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});n.Hasher=a.extend({cfg:o.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset()},reset:function(){a.reset.call(this),this._doReset()},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var f=this._doFinalize();return f},blockSize:16,_createHelper:function(x){return function(f,F){return new x.init(F).finalize(f)}},_createHmacHelper:function(x){return function(f,F){return new m.HMAC.init(x,F).finalize(f)}}});var m=h.algo={};return h})(Math);return t})})(gt)),gt.exports}var mt={exports:{}},ts=mt.exports,xn;function rr(){return xn||(xn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ts,function(t){return(function(e){var p=t,c=p.lib,d=c.Base,s=c.WordArray,h=p.x64={};h.Word=d.extend({init:function(n,o){this.high=n,this.low=o}}),h.WordArray=d.extend({init:function(n,o){n=this.words=n||[],o!=e?this.sigBytes=o:this.sigBytes=n.length*8},toX32:function(){for(var n=this.words,o=n.length,E=[],l=0;l<o;l++){var v=n[l];E.push(v.high),E.push(v.low)}return s.create(E,this.sigBytes)},clone:function(){for(var n=d.clone.call(this),o=n.words=this.words.slice(0),E=o.length,l=0;l<E;l++)o[l]=o[l].clone();return n}})})(),t})})(mt)),mt.exports}var Ct={exports:{}},rs=Ct.exports,fn;function ns(){return fn||(fn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(rs,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,p=e.lib,c=p.WordArray,d=c.init,s=c.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var n=h.byteLength,o=[],E=0;E<n;E++)o[E>>>2]|=h[E]<<24-E%4*8;d.call(this,o,n)}else d.apply(this,arguments)};s.prototype=c}})(),t.lib.WordArray})})(Ct)),Ct.exports}var yt={exports:{}},as=yt.exports,pn;function is(){return pn||(pn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(as,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.enc;d.Utf16=d.Utf16BE={stringify:function(h){for(var n=h.words,o=h.sigBytes,E=[],l=0;l<o;l+=2){var v=n[l>>>2]>>>16-l%4*8&65535;E.push(String.fromCharCode(v))}return E.join("")},parse:function(h){for(var n=h.length,o=[],E=0;E<n;E++)o[E>>>1]|=h.charCodeAt(E)<<16-E%2*16;return c.create(o,n*2)}},d.Utf16LE={stringify:function(h){for(var n=h.words,o=h.sigBytes,E=[],l=0;l<o;l+=2){var v=s(n[l>>>2]>>>16-l%4*8&65535);E.push(String.fromCharCode(v))}return E.join("")},parse:function(h){for(var n=h.length,o=[],E=0;E<n;E++)o[E>>>1]|=s(h.charCodeAt(E)<<16-E%2*16);return c.create(o,n*2)}};function s(h){return h<<8&4278255360|h>>>8&16711935}})(),t.enc.Utf16})})(yt)),yt.exports}var Ft={exports:{}},os=Ft.exports,hn;function T0(){return hn||(hn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(os,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.enc;d.Base64={stringify:function(h){var n=h.words,o=h.sigBytes,E=this._map;h.clamp();for(var l=[],v=0;v<o;v+=3)for(var g=n[v>>>2]>>>24-v%4*8&255,i=n[v+1>>>2]>>>24-(v+1)%4*8&255,a=n[v+2>>>2]>>>24-(v+2)%4*8&255,m=g<<16|i<<8|a,x=0;x<4&&v+x*.75<o;x++)l.push(E.charAt(m>>>6*(3-x)&63));var f=E.charAt(64);if(f)for(;l.length%4;)l.push(f);return l.join("")},parse:function(h){var n=h.length,o=this._map,E=this._reverseMap;if(!E){E=this._reverseMap=[];for(var l=0;l<o.length;l++)E[o.charCodeAt(l)]=l}var v=o.charAt(64);if(v){var g=h.indexOf(v);g!==-1&&(n=g)}return s(h,n,E)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(h,n,o){for(var E=[],l=0,v=0;v<n;v++)if(v%4){var g=o[h.charCodeAt(v-1)]<<v%4*2,i=o[h.charCodeAt(v)]>>>6-v%4*2,a=g|i;E[l>>>2]|=a<<24-l%4*8,l++}return c.create(E,l)}})(),t.enc.Base64})})(Ft)),Ft.exports}var Et={exports:{}},ss=Et.exports,vn;function us(){return vn||(vn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ss,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.enc;d.Base64url={stringify:function(h,n){n===void 0&&(n=!0);var o=h.words,E=h.sigBytes,l=n?this._safe_map:this._map;h.clamp();for(var v=[],g=0;g<E;g+=3)for(var i=o[g>>>2]>>>24-g%4*8&255,a=o[g+1>>>2]>>>24-(g+1)%4*8&255,m=o[g+2>>>2]>>>24-(g+2)%4*8&255,x=i<<16|a<<8|m,f=0;f<4&&g+f*.75<E;f++)v.push(l.charAt(x>>>6*(3-f)&63));var F=l.charAt(64);if(F)for(;v.length%4;)v.push(F);return v.join("")},parse:function(h,n){n===void 0&&(n=!0);var o=h.length,E=n?this._safe_map:this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var v=0;v<E.length;v++)l[E.charCodeAt(v)]=v}var g=E.charAt(64);if(g){var i=h.indexOf(g);i!==-1&&(o=i)}return s(h,o,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(h,n,o){for(var E=[],l=0,v=0;v<n;v++)if(v%4){var g=o[h.charCodeAt(v-1)]<<v%4*2,i=o[h.charCodeAt(v)]>>>6-v%4*2,a=g|i;E[l>>>2]|=a<<24-l%4*8,l++}return c.create(E,l)}})(),t.enc.Base64url})})(Et)),Et.exports}var Bt={exports:{}},cs=Bt.exports,gn;function P0(){return gn||(gn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(cs,function(t){return(function(e){var p=t,c=p.lib,d=c.WordArray,s=c.Hasher,h=p.algo,n=[];(function(){for(var i=0;i<64;i++)n[i]=e.abs(e.sin(i+1))*4294967296|0})();var o=h.MD5=s.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(i,a){for(var m=0;m<16;m++){var x=a+m,f=i[x];i[x]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360}var F=this._hash.words,b=i[a+0],C=i[a+1],_=i[a+2],y=i[a+3],k=i[a+4],D=i[a+5],R=i[a+6],I=i[a+7],z=i[a+8],M=i[a+9],U=i[a+10],G=i[a+11],Z=i[a+12],q=i[a+13],H=i[a+14],te=i[a+15],T=F[0],P=F[1],S=F[2],N=F[3];T=E(T,P,S,N,b,7,n[0]),N=E(N,T,P,S,C,12,n[1]),S=E(S,N,T,P,_,17,n[2]),P=E(P,S,N,T,y,22,n[3]),T=E(T,P,S,N,k,7,n[4]),N=E(N,T,P,S,D,12,n[5]),S=E(S,N,T,P,R,17,n[6]),P=E(P,S,N,T,I,22,n[7]),T=E(T,P,S,N,z,7,n[8]),N=E(N,T,P,S,M,12,n[9]),S=E(S,N,T,P,U,17,n[10]),P=E(P,S,N,T,G,22,n[11]),T=E(T,P,S,N,Z,7,n[12]),N=E(N,T,P,S,q,12,n[13]),S=E(S,N,T,P,H,17,n[14]),P=E(P,S,N,T,te,22,n[15]),T=l(T,P,S,N,C,5,n[16]),N=l(N,T,P,S,R,9,n[17]),S=l(S,N,T,P,G,14,n[18]),P=l(P,S,N,T,b,20,n[19]),T=l(T,P,S,N,D,5,n[20]),N=l(N,T,P,S,U,9,n[21]),S=l(S,N,T,P,te,14,n[22]),P=l(P,S,N,T,k,20,n[23]),T=l(T,P,S,N,M,5,n[24]),N=l(N,T,P,S,H,9,n[25]),S=l(S,N,T,P,y,14,n[26]),P=l(P,S,N,T,z,20,n[27]),T=l(T,P,S,N,q,5,n[28]),N=l(N,T,P,S,_,9,n[29]),S=l(S,N,T,P,I,14,n[30]),P=l(P,S,N,T,Z,20,n[31]),T=v(T,P,S,N,D,4,n[32]),N=v(N,T,P,S,z,11,n[33]),S=v(S,N,T,P,G,16,n[34]),P=v(P,S,N,T,H,23,n[35]),T=v(T,P,S,N,C,4,n[36]),N=v(N,T,P,S,k,11,n[37]),S=v(S,N,T,P,I,16,n[38]),P=v(P,S,N,T,U,23,n[39]),T=v(T,P,S,N,q,4,n[40]),N=v(N,T,P,S,b,11,n[41]),S=v(S,N,T,P,y,16,n[42]),P=v(P,S,N,T,R,23,n[43]),T=v(T,P,S,N,M,4,n[44]),N=v(N,T,P,S,Z,11,n[45]),S=v(S,N,T,P,te,16,n[46]),P=v(P,S,N,T,_,23,n[47]),T=g(T,P,S,N,b,6,n[48]),N=g(N,T,P,S,I,10,n[49]),S=g(S,N,T,P,H,15,n[50]),P=g(P,S,N,T,D,21,n[51]),T=g(T,P,S,N,Z,6,n[52]),N=g(N,T,P,S,y,10,n[53]),S=g(S,N,T,P,U,15,n[54]),P=g(P,S,N,T,C,21,n[55]),T=g(T,P,S,N,z,6,n[56]),N=g(N,T,P,S,te,10,n[57]),S=g(S,N,T,P,R,15,n[58]),P=g(P,S,N,T,q,21,n[59]),T=g(T,P,S,N,k,6,n[60]),N=g(N,T,P,S,G,10,n[61]),S=g(S,N,T,P,_,15,n[62]),P=g(P,S,N,T,M,21,n[63]),F[0]=F[0]+T|0,F[1]=F[1]+P|0,F[2]=F[2]+S|0,F[3]=F[3]+N|0},_doFinalize:function(){var i=this._data,a=i.words,m=this._nDataBytes*8,x=i.sigBytes*8;a[x>>>5]|=128<<24-x%32;var f=e.floor(m/4294967296),F=m;a[(x+64>>>9<<4)+15]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,a[(x+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,i.sigBytes=(a.length+1)*4,this._process();for(var b=this._hash,C=b.words,_=0;_<4;_++){var y=C[_];C[_]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}return b},clone:function(){var i=s.clone.call(this);return i._hash=this._hash.clone(),i}});function E(i,a,m,x,f,F,b){var C=i+(a&m|~a&x)+f+b;return(C<<F|C>>>32-F)+a}function l(i,a,m,x,f,F,b){var C=i+(a&x|m&~x)+f+b;return(C<<F|C>>>32-F)+a}function v(i,a,m,x,f,F,b){var C=i+(a^m^x)+f+b;return(C<<F|C>>>32-F)+a}function g(i,a,m,x,f,F,b){var C=i+(m^(a|~x))+f+b;return(C<<F|C>>>32-F)+a}p.MD5=s._createHelper(o),p.HmacMD5=s._createHmacHelper(o)})(Math),t.MD5})})(Bt)),Bt.exports}var At={exports:{}},ls=At.exports,mn;function _a(){return mn||(mn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ls,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=p.Hasher,s=e.algo,h=[],n=s.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,E){for(var l=this._hash.words,v=l[0],g=l[1],i=l[2],a=l[3],m=l[4],x=0;x<80;x++){if(x<16)h[x]=o[E+x]|0;else{var f=h[x-3]^h[x-8]^h[x-14]^h[x-16];h[x]=f<<1|f>>>31}var F=(v<<5|v>>>27)+m+h[x];x<20?F+=(g&i|~g&a)+1518500249:x<40?F+=(g^i^a)+1859775393:x<60?F+=(g&i|g&a|i&a)-1894007588:F+=(g^i^a)-899497514,m=a,a=i,i=g<<30|g>>>2,g=v,v=F}l[0]=l[0]+v|0,l[1]=l[1]+g|0,l[2]=l[2]+i|0,l[3]=l[3]+a|0,l[4]=l[4]+m|0},_doFinalize:function(){var o=this._data,E=o.words,l=this._nDataBytes*8,v=o.sigBytes*8;return E[v>>>5]|=128<<24-v%32,E[(v+64>>>9<<4)+14]=Math.floor(l/4294967296),E[(v+64>>>9<<4)+15]=l,o.sigBytes=E.length*4,this._process(),this._hash},clone:function(){var o=d.clone.call(this);return o._hash=this._hash.clone(),o}});e.SHA1=d._createHelper(n),e.HmacSHA1=d._createHmacHelper(n)})(),t.SHA1})})(At)),At.exports}var bt={exports:{}},ds=bt.exports,Cn;function Sr(){return Cn||(Cn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ds,function(t){return(function(e){var p=t,c=p.lib,d=c.WordArray,s=c.Hasher,h=p.algo,n=[],o=[];(function(){function v(m){for(var x=e.sqrt(m),f=2;f<=x;f++)if(!(m%f))return!1;return!0}function g(m){return(m-(m|0))*4294967296|0}for(var i=2,a=0;a<64;)v(i)&&(a<8&&(n[a]=g(e.pow(i,1/2))),o[a]=g(e.pow(i,1/3)),a++),i++})();var E=[],l=h.SHA256=s.extend({_doReset:function(){this._hash=new d.init(n.slice(0))},_doProcessBlock:function(v,g){for(var i=this._hash.words,a=i[0],m=i[1],x=i[2],f=i[3],F=i[4],b=i[5],C=i[6],_=i[7],y=0;y<64;y++){if(y<16)E[y]=v[g+y]|0;else{var k=E[y-15],D=(k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3,R=E[y-2],I=(R<<15|R>>>17)^(R<<13|R>>>19)^R>>>10;E[y]=D+E[y-7]+I+E[y-16]}var z=F&b^~F&C,M=a&m^a&x^m&x,U=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),G=(F<<26|F>>>6)^(F<<21|F>>>11)^(F<<7|F>>>25),Z=_+G+z+o[y]+E[y],q=U+M;_=C,C=b,b=F,F=f+Z|0,f=x,x=m,m=a,a=Z+q|0}i[0]=i[0]+a|0,i[1]=i[1]+m|0,i[2]=i[2]+x|0,i[3]=i[3]+f|0,i[4]=i[4]+F|0,i[5]=i[5]+b|0,i[6]=i[6]+C|0,i[7]=i[7]+_|0},_doFinalize:function(){var v=this._data,g=v.words,i=this._nDataBytes*8,a=v.sigBytes*8;return g[a>>>5]|=128<<24-a%32,g[(a+64>>>9<<4)+14]=e.floor(i/4294967296),g[(a+64>>>9<<4)+15]=i,v.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v}});p.SHA256=s._createHelper(l),p.HmacSHA256=s._createHmacHelper(l)})(Math),t.SHA256})})(bt)),bt.exports}var Dt={exports:{}},xs=Dt.exports,yn;function fs(){return yn||(yn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),Sr())})(xs,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.algo,s=d.SHA256,h=d.SHA224=s.extend({_doReset:function(){this._hash=new c.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var n=s._doFinalize.call(this);return n.sigBytes-=4,n}});e.SHA224=s._createHelper(h),e.HmacSHA224=s._createHmacHelper(h)})(),t.SHA224})})(Dt)),Dt.exports}var _t={exports:{}},ps=_t.exports,Fn;function wa(){return Fn||(Fn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr())})(ps,function(t){return(function(){var e=t,p=e.lib,c=p.Hasher,d=e.x64,s=d.Word,h=d.WordArray,n=e.algo;function o(){return s.create.apply(s,arguments)}var E=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],l=[];(function(){for(var g=0;g<80;g++)l[g]=o()})();var v=n.SHA512=c.extend({_doReset:function(){this._hash=new h.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(g,i){for(var a=this._hash.words,m=a[0],x=a[1],f=a[2],F=a[3],b=a[4],C=a[5],_=a[6],y=a[7],k=m.high,D=m.low,R=x.high,I=x.low,z=f.high,M=f.low,U=F.high,G=F.low,Z=b.high,q=b.low,H=C.high,te=C.low,T=_.high,P=_.low,S=y.high,N=y.low,W=k,V=D,Y=R,$=I,ae=z,fe=M,e0=U,De=G,ue=Z,ge=q,me=H,Ie=te,Xe=T,Ye=P,Qe=S,a0=N,Re=0;Re<80;Re++){var Se,_e,Ke=l[Re];if(Re<16)_e=Ke.high=g[i+Re*2]|0,Se=Ke.low=g[i+Re*2+1]|0;else{var u0=l[Re-15],j=u0.high,de=u0.low,Be=(j>>>1|de<<31)^(j>>>8|de<<24)^j>>>7,Ge=(de>>>1|j<<31)^(de>>>8|j<<24)^(de>>>7|j<<25),D0=l[Re-2],We=D0.high,pe=D0.low,_0=(We>>>19|pe<<13)^(We<<3|pe>>>29)^We>>>6,z0=(pe>>>19|We<<13)^(pe<<3|We>>>29)^(pe>>>6|We<<26),w0=l[Re-7],Ze=w0.high,S0=w0.low,k0=l[Re-16],I0=k0.high,L0=k0.low;Se=Ge+S0,_e=Be+Ze+(Se>>>0<Ge>>>0?1:0),Se=Se+z0,_e=_e+_0+(Se>>>0<z0>>>0?1:0),Se=Se+L0,_e=_e+I0+(Se>>>0<L0>>>0?1:0),Ke.high=_e,Ke.low=Se}var Z0=ue&me^~ue&Xe,J0=ge&Ie^~ge&Ye,O0=W&Y^W&ae^Y&ae,t0=V&$^V&fe^$&fe,i0=(W>>>28|V<<4)^(W<<30|V>>>2)^(W<<25|V>>>7),x0=(V>>>28|W<<4)^(V<<30|W>>>2)^(V<<25|W>>>7),f0=(ue>>>14|ge<<18)^(ue>>>18|ge<<14)^(ue<<23|ge>>>9),et=(ge>>>14|ue<<18)^(ge>>>18|ue<<14)^(ge<<23|ue>>>9),Te=E[Re],se=Te.high,y0=Te.low,Pe=a0+et,je=Qe+f0+(Pe>>>0<a0>>>0?1:0),Pe=Pe+J0,je=je+Z0+(Pe>>>0<J0>>>0?1:0),Pe=Pe+y0,je=je+se+(Pe>>>0<y0>>>0?1:0),Pe=Pe+Se,je=je+_e+(Pe>>>0<Se>>>0?1:0),Ae=x0+t0,qe=i0+O0+(Ae>>>0<x0>>>0?1:0);Qe=Xe,a0=Ye,Xe=me,Ye=Ie,me=ue,Ie=ge,ge=De+Pe|0,ue=e0+je+(ge>>>0<De>>>0?1:0)|0,e0=ae,De=fe,ae=Y,fe=$,Y=W,$=V,V=Pe+Ae|0,W=je+qe+(V>>>0<Pe>>>0?1:0)|0}D=m.low=D+V,m.high=k+W+(D>>>0<V>>>0?1:0),I=x.low=I+$,x.high=R+Y+(I>>>0<$>>>0?1:0),M=f.low=M+fe,f.high=z+ae+(M>>>0<fe>>>0?1:0),G=F.low=G+De,F.high=U+e0+(G>>>0<De>>>0?1:0),q=b.low=q+ge,b.high=Z+ue+(q>>>0<ge>>>0?1:0),te=C.low=te+Ie,C.high=H+me+(te>>>0<Ie>>>0?1:0),P=_.low=P+Ye,_.high=T+Xe+(P>>>0<Ye>>>0?1:0),N=y.low=N+a0,y.high=S+Qe+(N>>>0<a0>>>0?1:0)},_doFinalize:function(){var g=this._data,i=g.words,a=this._nDataBytes*8,m=g.sigBytes*8;i[m>>>5]|=128<<24-m%32,i[(m+128>>>10<<5)+30]=Math.floor(a/4294967296),i[(m+128>>>10<<5)+31]=a,g.sigBytes=i.length*4,this._process();var x=this._hash.toX32();return x},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g},blockSize:1024/32});e.SHA512=c._createHelper(v),e.HmacSHA512=c._createHmacHelper(v)})(),t.SHA512})})(_t)),_t.exports}var wt={exports:{}},hs=wt.exports,En;function vs(){return En||(En=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr(),wa())})(hs,function(t){return(function(){var e=t,p=e.x64,c=p.Word,d=p.WordArray,s=e.algo,h=s.SHA512,n=s.SHA384=h.extend({_doReset:function(){this._hash=new d.init([new c.init(3418070365,3238371032),new c.init(1654270250,914150663),new c.init(2438529370,812702999),new c.init(355462360,4144912697),new c.init(1731405415,4290775857),new c.init(2394180231,1750603025),new c.init(3675008525,1694076839),new c.init(1203062813,3204075428)])},_doFinalize:function(){var o=h._doFinalize.call(this);return o.sigBytes-=16,o}});e.SHA384=h._createHelper(n),e.HmacSHA384=h._createHmacHelper(n)})(),t.SHA384})})(wt)),wt.exports}var St={exports:{}},gs=St.exports,Bn;function ms(){return Bn||(Bn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr())})(gs,function(t){return(function(e){var p=t,c=p.lib,d=c.WordArray,s=c.Hasher,h=p.x64,n=h.Word,o=p.algo,E=[],l=[],v=[];(function(){for(var a=1,m=0,x=0;x<24;x++){E[a+5*m]=(x+1)*(x+2)/2%64;var f=m%5,F=(2*a+3*m)%5;a=f,m=F}for(var a=0;a<5;a++)for(var m=0;m<5;m++)l[a+5*m]=m+(2*a+3*m)%5*5;for(var b=1,C=0;C<24;C++){for(var _=0,y=0,k=0;k<7;k++){if(b&1){var D=(1<<k)-1;D<32?y^=1<<D:_^=1<<D-32}b&128?b=b<<1^113:b<<=1}v[C]=n.create(_,y)}})();var g=[];(function(){for(var a=0;a<25;a++)g[a]=n.create()})();var i=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],m=0;m<25;m++)a[m]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,m){for(var x=this._state,f=this.blockSize/2,F=0;F<f;F++){var b=a[m+2*F],C=a[m+2*F+1];b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360;var _=x[F];_.high^=C,_.low^=b}for(var y=0;y<24;y++){for(var k=0;k<5;k++){for(var D=0,R=0,I=0;I<5;I++){var _=x[k+5*I];D^=_.high,R^=_.low}var z=g[k];z.high=D,z.low=R}for(var k=0;k<5;k++)for(var M=g[(k+4)%5],U=g[(k+1)%5],G=U.high,Z=U.low,D=M.high^(G<<1|Z>>>31),R=M.low^(Z<<1|G>>>31),I=0;I<5;I++){var _=x[k+5*I];_.high^=D,_.low^=R}for(var q=1;q<25;q++){var D,R,_=x[q],H=_.high,te=_.low,T=E[q];T<32?(D=H<<T|te>>>32-T,R=te<<T|H>>>32-T):(D=te<<T-32|H>>>64-T,R=H<<T-32|te>>>64-T);var P=g[l[q]];P.high=D,P.low=R}var S=g[0],N=x[0];S.high=N.high,S.low=N.low;for(var k=0;k<5;k++)for(var I=0;I<5;I++){var q=k+5*I,_=x[q],W=g[q],V=g[(k+1)%5+5*I],Y=g[(k+2)%5+5*I];_.high=W.high^~V.high&Y.high,_.low=W.low^~V.low&Y.low}var _=x[0],$=v[y];_.high^=$.high,_.low^=$.low}},_doFinalize:function(){var a=this._data,m=a.words;this._nDataBytes*8;var x=a.sigBytes*8,f=this.blockSize*32;m[x>>>5]|=1<<24-x%32,m[(e.ceil((x+1)/f)*f>>>5)-1]|=128,a.sigBytes=m.length*4,this._process();for(var F=this._state,b=this.cfg.outputLength/8,C=b/8,_=[],y=0;y<C;y++){var k=F[y],D=k.high,R=k.low;D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,_.push(R),_.push(D)}return new d.init(_,b)},clone:function(){for(var a=s.clone.call(this),m=a._state=this._state.slice(0),x=0;x<25;x++)m[x]=m[x].clone();return a}});p.SHA3=s._createHelper(i),p.HmacSHA3=s._createHmacHelper(i)})(Math),t.SHA3})})(St)),St.exports}var kt={exports:{}},Cs=kt.exports,An;function ys(){return An||(An=1,(function(r,u){(function(t,e){r.exports=e(ce())})(Cs,function(t){/** @preserve
|
|
183
|
+
`;document.head.appendChild(Aa);function qo(){return ee("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:1}})})]}),ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:3}})})]}),ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:1}})})]}),ee("div",{className:"flex items-start gap-4",children:[w("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),w("div",{className:"flex-1",children:w(xt,{active:!0,paragraph:{rows:2}})})]})]})}function Uo({msg:r,subMsg:u}){return ee("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[w("div",{className:"mb-6 animate-bounce",children:w(Ii,{size:64,className:"text-[#d70016]"})}),w("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:r||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),w("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:u||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),w(X0,{type:"primary",icon:w(ia,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}function Ho(){return ee("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[w("div",{className:"mb-6 animate-bounce",children:w(Fi,{size:64,className:"text-[#d70016]"})}),w("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),w("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),w(X0,{type:"primary",icon:w(ia,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const $o=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const p={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[c]=Xn();return Ee(()=>{if(!r){c.resetFields();return}c.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),w(Jt,{modal:{styles:p},children:w(ta,{title:w("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:ee("div",{className:"mt-[16px] flex justify-end",children:[w(X0,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),w(X0,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await c.validateFields();u("ok_rename",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:w(Wr,{form:c,children:w(Wr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:w(Gn,{})})})})})},Wo=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const p={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[c]=Xn();return Ee(()=>{if(!r){c.resetFields();return}c.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),w(Jt,{modal:{styles:p},children:w(ta,{title:w("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:ee("div",{className:"mt-[16px] flex justify-end",children:[w(X0,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),w(X0,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await c.validateFields();u("ok_remove",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:w("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${e.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})},jo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFQSURBVHgBpVMxTsNQDLWTiIYBFG7Q3iCcgLIxQJWxZSpbOxFO0HICOhE2shGxEFCGbvQGcAPCCahgIJHoN/5RaEOUBAJPsmTZ3/aT/T4Co23ZxoYeWVACEjj/UOhx6l2E+RzudQfNNcR79ptQjfD1vbE98yfzbFDTEE1ZrBC1/IIJEhYPEYhPKUs3m1OQyJBOWfFPOQX+CQ1qQu6sATBaCLwNrh2/NgOdjQC2FBVu5PW+MTjoDvrccSdfJNILqQCzdB9WpzckudQlg87hYISIl7I7G2YNAZ75SrtFy1wxIBwLwtPAc8ZQA5qq676II5MAw8A7n+z3hpLW2d2V0/pVA99NlGV/BRJdIDbltqcV91++zwesvm2IOH6AEmkTkfsW6Seb6/EL+0dY9EhKl1mYi1Slq3HCQFCP2WHWZJY2qEL6L5LPJ/gy8BfIJmxt6X8C+32HILvaN+0AAAAASUVORK5CYII=",tr=({title:r,setOpen:u})=>ee("div",{style:{width:"100%",height:"60px",borderBottom:"1px solid #EBEBEB",padding:"20px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"16px",fontWeight:600},children:[w("div",{children:r}),w("img",{src:Ka,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>u(!1)})]});Ga();const Vo=({curFileInfo:r,onClose:u,token:t})=>{var s;const e={title:"",subtitle:"",backgroundColor:"#f8f9fa",showGrid:!1,showLegend:!1,showTooltip:!1,showFullscreen:!1,showMinimap:!1},[p,c]=oe({nodeList:[],edgeList:[]});Ee(()=>{console.log("curFileInfo",r)},[r]);const d=async h=>{if(!(!(h!=null&&h.id)||!(h!=null&&h.cyphers)||!(h!=null&&h.fetchUrl)))try{const{cyphers:n,fetchUrl:o,id:E}=h||{};console.log("getGraphData params",n,o,E);const l=await Je.post(o,{cyphers:n,ontologyId:E},{headers:{Authorization:t}});console.log("getGraphData res",l),c((l==null?void 0:l.data)||{})}catch(n){console.log("error",n)}};return Ee(()=>{d(r)},[r]),ee("div",{children:[w(tr,{title:r==null?void 0:r.graphName,setOpen:u}),w("div",{style:{width:"100%",height:"calc(100vh - 60px)"},children:w(Xa,{centerNode:{vid:(s=r==null?void 0:r.traceNode)==null?void 0:s.vid},data:p,layout:{type:"force",linkDistance:190},title:e.title,subtitle:e.subtitle,backgroundColor:e.backgroundColor,showGrid:e.showGrid,showLegend:e.showLegend,showTooltip:e.showTooltip,showFullscreen:e.showFullscreen,showMinimap:e.showMinimap,customPlugins:{},onReady:h=>{console.log("KnowledgeGraphPreview ready:",h)}})})]})},Ko=({content:r,onClose:u,token:t})=>{const e=d=>{if(!(d!=null&&d.metadata))return;const s=pr(d,""),{page_number:h,page_size:n,position:o,offset:E,chunk_type:l}=d.metadata;if(s==="markdown_table")return E!=null&&E.length?{annotations:[{id:v0(),offsets:E}],initialPage:1}:{};{if(!n||!o)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size\u6216\u8005\u6587\u4EF6\u5750\u6807","color: red"),{};const v=Array.isArray(n)?n:JSON.parse(n);if(!v.length)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size","color: red"),{};const g=Array.isArray(o)?o:JSON.parse(o);return!g.length||!h?(console.log("%c\u7F3A\u5C11\u6587\u4EF6\u5750\u6807\u6216\u8005\u6587\u4EF6\u9875\u6570","color: red"),{}):{annotations:g.map((a,m)=>({id:v0(),pageNumber:h[m],x:+(a[0][0]/v[0][0]).toFixed(4),y:+(a[0][1]/v[0][1]).toFixed(4),width:+((a[1][0]-a[0][0])/v[0][0]).toFixed(4),height:+((a[2][1]-a[0][1])/v[0][1]).toFixed(4),content:"",color:l==="image"?"#60f74f":"#4FC3F7"})),initialPage:h[0]}}},p=Fe(()=>{var d,s;if(console.log("content88888888888",r),r&&t){console.log("content999",r);const{annotations:h,initialPage:n}=e(r),o={...r,metadata:{source:((d=r==null?void 0:r.metadata)==null?void 0:d.source)||r.parse_url||r.url,page_size:(s=r==null?void 0:r.metadata)==null?void 0:s.page_size}},E=Yn(Qn(o));return{filePath:E,fileName:Ar(o),fileType:pr(o,E),totalPages:o.pdfPages||0,token:t,annotations:h,initialPage:n,initialZoom:Zn(598,o)}}else return{}},[r]),c=Fe(()=>p.filePath?(console.log("curData",p),w(na,{initialZoom:p.initialZoom||100,convertedFilePath:p.filePath,fileName:p.fileName,fileType:p.fileType,initialPage:p.initialPage,totalPages:p.totalPages,authorization:p.token,annotations:p.annotations,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:d=>{switch(d){case"viewer:close":u();break}},tools:{close:!0}})):w(at,{}),[p]);return w("div",{style:{fontFamily:"Source Han Sans CN",fontSize:"12px"},className:"h-full w-full",children:c})},ba=({curFileInfo:r,onClose:u,token:t})=>{const e=Fe(()=>{var c,d,s;if(r&&t){console.log("content999",r);const h={file_source:r.parse_url||r.parsedFilePath||r.url,file_type:r.file_type,metadata:{source:r.filePath||r.url||((c=r==null?void 0:r.metadata)==null?void 0:c.source)||"",page_size:(d=r==null?void 0:r.metadata)==null?void 0:d.page_size},pdfPages:r.pdfPages},n=Yn(Qn(h));return{filePath:n,fileName:Ar(h),fileType:pr(h,n),totalPages:h.pdfPages||0,token:t,initialZoom:Zn(((s=document.getElementById("pdfBox"))==null?void 0:s.clientWidth)||0,h)}}else return{}},[r]),p=Fe(()=>(console.log("curData",e),e.filePath?w(na,{initialZoom:e.initialZoom||100,convertedFilePath:e.filePath,fileName:e.fileName,fileType:e.fileType,initialPage:1,totalPages:e.totalPages,authorization:e.token,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:c=>{switch(c){case"viewer:close":u();break}},tools:{close:!0}}):w(at,{})),[e]);return w("div",{id:"pdfBox",className:"h-full overflow-y-auto",children:p})},Go=({curFileInfo:r,token:u,onClose:t})=>{const[e,p]=oe(1),[c,d]=oe(10),[s,h]=oe([]),[n,o]=oe([]),[E,l]=oe(0);Ee(()=>{var m;const a=((m=r==null?void 0:r.metadata)==null?void 0:m.fetchUrl)||(r==null?void 0:r.fetchUrl);a&&g(a)},[r,e,c]);const v=async({url:a,params:m})=>{var x;try{const f=await Je.get(`${hr()}${a}?${new URLSearchParams(m).toString()}`,{headers:{Authorization:u}}),F=(x=f==null?void 0:f.data)==null?void 0:x.data;if(F){const{columns:b,dataList:C,totalData:_}=F;h(((b==null?void 0:b.slice(1))||[]).map(y=>({title:y.businessName,dataIndex:y.physicalName,key:y.physicalName}))),o(C||[]),l(_||[])}}catch(f){console.log("error",f)}},g=async a=>{v({url:`${a}`,params:{pageNo:e,pageSize:c}})},i=Fe(()=>{const{databaseName:a,businessTableName:m,tableName:x}=r;return`${a} - ${x||m}`},[r]);return ee("div",{children:[w(tr,{title:i,setOpen:t}),(s==null?void 0:s.length)>0?ee("div",{children:[w("div",{className:"p-4 overflow-auto h-[calc(100vh-120px)]",children:w(mi,{columns:s,dataSource:n,pagination:!1,scroll:{x:"max-content"},rowKey:"id"})}),w("div",{className:"flex justify-end px-[18px]",children:w(wi,{current:e,pageSize:c,responsive:!0,simple:!0,total:E,showSizeChanger:!0,showQuickJumper:!0,onChange:(a,m)=>{p(a),d(m||10)},onShowSizeChange:(a,m)=>{p(1),d(m)}})})]}):w($a,{})]})},cn=({i:r,item:u,j:t,clickTag:e})=>(console.log("j in tag",t),console.log("i in tag",r),console.log("item in tag",u),w("div",{style:{minWidth:"16px",height:"16px",backgroundColor:Xo[u.key],margin:"0 4px",color:Yo[u.key],display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"2px",fontSize:"12px",cursor:"pointer"},onClick:()=>e&&e(r,t,u),children:t.index},t.id)),Xo={knowledgeList:"#EAF4FD",searchList:"#E8F7F0",databaseList:"#FFF4E5",graphList:"#E7F8FB"},Yo={knowledgeList:"#2072F0",searchList:"#39B83F",databaseList:"#F48C14",graphList:"#10BBD9"},ln=[{key:"knowledgeList",name:"\u77E5\u8BC6\u5E93\u6587\u6863"},{key:"searchList",name:"\u8054\u7F51\u641C\u7D22",hideBtns:!0},{key:"databaseList",name:"\u6570\u636E\u5E93",hideBtns:!0},{key:"graphList",name:"\u77E5\u8BC6\u56FE\u8C31",hideBtns:!0}],Qo=({type:r,data:u,token:t,eventsEmit:e,is_download:p})=>{const[c,d]=oe(ln),[s,h]=oe("mark"),[n,o]=oe(!1),[E,l]=oe({}),[v,g]=oe("knowledgeList"),[i,a]=oe({knowledgeList:[],searchList:[],databaseList:[],graphList:[]}),m=Fe(()=>{const C=4-c.length,_=Array(C).fill(null).map((k,D)=>({name:"",key:100+D})),y=[...c,..._];return console.log("rrrrrr",y),y},[c]),x=C=>isNaN(C)?"":(+C).toFixed(2),f=(C,_)=>{switch(C){case"knowledgeList":return ni(_);case"searchList":return ri;case"databaseList":return ti;case"graphList":return ei}},F=(C,_)=>C==="graphList"?_.map(y=>({...y,name:y.graphName})).sort((y,k)=>(k.score||0)-(y.score||0)):C==="knowledgeList"?_.map(y=>({...y,file_type:Ja(y.source)||y.file_type,name:y.sourceFileName||Za(y.source)||y.file_name,score:y.rrf_score})).sort((y,k)=>(k.score||0)-(y.score||0)):C==="searchList"?_.map(y=>({...y,name:y.sourceFileName||y.file_name})).sort((y,k)=>(k.score||0)-(y.score||0)):C==="databaseList"?_.map(y=>{const k=y.tableName?`${y.databaseName||"\u6570\u636E\u5E93"} - ${y.tableName}`:y.databaseName||y.name||"\u6570\u636E\u5E93";return{...y,name:k,file_name:k,file_type:"database"}}).sort((y,k)=>(k.score||0)-(y.score||0)):_,b=(C,_,y)=>{var k;switch(y.key){case"knowledgeList":const{pdfPages:D,parsedFilePath:R,order_num:I,tags:z}=C||{},M=_.id||I||"Unknown ID",U=(z||[]).find(P=>P.id===M);if(C.type==="video")return console.log("sdgasdgag",{file:{...C,...U}}),e==null?void 0:e("retrive_tag:click",{file:{...C,...U}});if(console.log("click knowledge tag",C,_),!C||!U)return;const{metadata:G}=U,Z=G.source.split("/"),q=Z[Z.length-1]||"",H=q.split("."),te=H.slice(0,-1).join(".")||"Unknown Label",T=H[H.length-1]||"Unknown Type";l({id:M,title:te,file_name:q,file_type:T,file_source:ai(T)?`${vr}${G.source}`:R,metadata:G,pdfPages:D}),h("mark"),o(!0);break;case"searchList":console.log("click search tag",C,_);break;case"databaseList":console.log("click database tag",C,_),h("database"),l({...C,metadata:C.metadata||{},fetchUrl:C.fetchUrl||((k=C.metadata)==null?void 0:k.fetchUrl)||""}),o(!0);break;case"graphList":console.log("click graph tag",C,_),h("graphPreview"),l({...C,traceNode:((u==null?void 0:u.traceNode)||[]).find(P=>P.id===_.id)}),o(!0);break}};return Ee(()=>{if(r!==Da.REFERENCELIST||(console.log("data in reference drawer",u),!u))return;const{graphRefs:C,knowledgeRefs:_,webRefs:y,databaseRefs:k}=u;C!=null&&C.length&&(i.graphList=F("graphList",C)),_!=null&&_.length&&(i.knowledgeList=F("knowledgeList",_)),y!=null&&y.length&&(i.searchList=F("searchList",y)),k!=null&&k.length&&(i.databaseList=F("databaseList",k));const D=ln.filter(R=>{var I;return(I=i[R.key])==null?void 0:I.length}).sort((R,I)=>{var z,M;return(((z=i[I.key])==null?void 0:z.length)||0)-(((M=i[R.key])==null?void 0:M.length)||0)});d(D),D!=null&&D.length&&g(D[0].key),a({...i})},[u]),ee(at,{children:[ee("div",{className:"listWrap w-full h-full",children:[w(tr,{title:"\u77E5\u8BC6\u6EAF\u6E90",setOpen:()=>{const C=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(C)}}),ee("div",{style:{height:"calc(100% - 60px)"},children:[w("div",{className:"tabs",style:{display:"flex",justifyContent:"space-between",padding:"12px 20px"},children:m.map(C=>w("div",{className:"tab-item",style:{padding:"5.5px 12px",backgroundColor:C.name?v===C.key?"#4E6EF2":"#F5F6F9":"transparent",cursor:"pointer",borderRadius:"4px",color:v===C.key?"#FFFFFF":"#4E5969",fontSize:"14px",minWidth:"80px",display:"flex",justifyContent:"center"},onClick:()=>{C.name&&g(C.key)},children:C.name},C.key))}),w("div",{className:"listBox",style:{height:"calc(100% - 66px)",overflowY:"auto",display:"flex",flexDirection:"column",alignItems:"center",willChange:"scroll-position",transform:"translateZ(0)"},children:c.map(C=>{let _=i[C.key]||[];return v!==C.key?null:w("div",{children:_.map(y=>{var k,D,R,I,z,M;return ee("div",{style:{width:"360px",padding:"4px 8px",borderRadius:"4px",margin:"6px 0",cursor:"pointer"},className:"listItemBox",onClick:()=>{C.key==="searchList"&&window.open(y.link,"_blank")},children:[ee("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ee("div",{style:{width:C.hideBtns?"339px":"288px",fontSize:"14px",color:"#1D2129",fontWeight:"700",display:"flex",alignItems:"center"},children:[w("img",{src:f(C.key,y.file_type),style:{width:"16px",height:"16px",marginRight:"2px"}}),w(nt,{placement:"topLeft",title:((k=y==null?void 0:y.name)==null?void 0:k.length)>17?y.name:"",children:w("div",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:C.hideBtns?"322px":"258px"},onClick:()=>{var U;C.key==="knowledgeList"?e==null||e("knowledge_referenceFile_title:click",{data:{...y,file_type:y.file_type,file_name:y.file_name,metadata:y.metadata,parsedFilePath:y.parsedFilePath}}):C.key==="databaseList"&&(h("database"),l({...y,metadata:y.metadata||{},fetchUrl:y.fetchUrl||((U=y.metadata)==null?void 0:U.fetchUrl)||""}),o(!0))},children:y.name})})]}),ee("div",{style:{width:"52px",justifyContent:"space-between",alignItems:"center",marginRight:"8px",display:C.hideBtns||y.type==="video"?"none":"flex"},children:[w("img",{src:jo,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>{e==null||e("referenceFile_filechat",{data:{...y,file_type:y.file_type,file_name:y.file_name,metadata:y.metadata,parsedFilePath:y.parsedFilePath}})}}),w("div",{style:{borderRight:"1px solid #E5E6EB",height:"14px"}}),w("img",{src:Ya,style:{width:"16px",height:"16px",cursor:p?"pointer":"not-allowed"},onClick:()=>{var G,Z,q;if(!((G=y==null?void 0:y.tags)!=null&&G.length)&&!((Z=y==null?void 0:y.metadata)!=null&&Z.source)||!p)return;const U=((q=((y==null?void 0:y.tags)||[])[0])==null?void 0:q.metadata)||(y==null?void 0:y.metadata);Qa({filePath:`${vr}${U.source}`,fileName:Ar({metadata:U}),token:t})}})]})]}),!!(typeof y.score=="string"||typeof y.score=="number"||(D=y==null?void 0:y.tags)!=null&&D.length&&y.tags.length>0&&y.tags.length<=10)&&ee("div",{style:{display:"flex",justifyContent:"space-between",height:"18px",marginTop:"4px"},children:[(typeof y.score=="string"||typeof y.score=="number")&&ee("div",{style:{backgroundColor:"#F2F2FB",borderRadius:"4px",padding:"2px 3px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px"},children:[w("span",{style:{color:"#4E5969",marginRight:"6px"},children:"\u5206\u6570:"}),w("span",{style:{color:"#1D2129"},children:x(y.score)})]}),w("div",{style:{flex:1,display:"flex",justifyContent:"flex-end"},children:((R=y==null?void 0:y.tags)!=null&&R.length&&y.tags.length>0&&y.tags.length<=10?y.tags:[]).map(U=>w(cn,{i:y,item:C,j:U,clickTag:b},U.id))})]}),w("div",{style:{flex:1,display:"flex",justifyContent:"flex-start",marginTop:"4px"},children:((I=y==null?void 0:y.tags)!=null&&I.length&&y.tags.length>10?y.tags:[]).map(U=>w(cn,{i:y,item:C,j:U,clickTag:b},U.id))}),!!((z=y==null?void 0:y.main_source)!=null&&z.length)&&ee("div",{style:{flex:1,display:"flex",alignItems:"flex-start",marginTop:"4px"},children:[w("div",{style:{fontSize:"12px",color:"#4E5969",width:"60px"},children:"\u5173\u8054\u6587\u6863:"}),w(nt,{placement:"topLeft",title:((M=or(y.main_source[0]))==null?void 0:M.length)>22?or(y.main_source[0]):"",children:w("div",{style:{fontSize:"12px",color:"#4E5969",width:"289px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:or(y.main_source[0])})})]})]},y.id)})},C.key)})})]})]}),w(Jt,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:ee(aa,{autoFocus:!1,onClose:()=>o(!1),open:n,width:v==="graphList"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,afterOpenChange:C=>{C||l(null)},children:[s==="graphPreview"&&w(Vo,{curFileInfo:E,onClose:o,token:t}),s==="mark"&&w(Ko,{content:E,onClose:o,token:t}),s==="preview"&&w(ba,{curFileInfo:E,onClose:o,token:t}),s==="database"&&w(Go,{curFileInfo:E,onClose:o,token:t})]})})]})},Zo=({fileData:r,token:u})=>{const[t,e]=oe([]);Ee(()=>{var h;const d=r==null?void 0:r.knowledgeBases;if(!(d!=null&&d.length))return;const s=((h=d[0])==null?void 0:h.treeData)||[];s!=null&&s.length&&e(s)},[r]);const p=He(new Map),c=async(d,s)=>{var h,n;if(!p.current.get(d==null?void 0:d.fetchUrl))try{const o=t[s];o.loading=!0;const E=[...t];e(E);const l=await Je.get(`${ii()}/${d.fetchUrl}`,{headers:{Authorization:u}}),v=(n=(h=l==null?void 0:l.data)==null?void 0:h.data)==null?void 0:n.records;if(v){const g=t[s];g.loading=!1,g.children=v;const i=[...t];i[s]=g,e(i),p.current.set(d==null?void 0:d.fetchUrl,!0)}else{const g=t[s];g.loading=!1;const i=[...t];e(i)}}catch{const E=t[s];E.loading=!1;const l=[...t];e(l)}};return ee(at,{children:[w(tr,{title:"\u77E5\u8BC6\u5E93\u6587\u6863\u76EE\u5F55",setOpen:()=>{const d=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(d)}}),w("div",{style:{height:"calc(100% - 60px)",overflowY:"auto",padding:"16px"},children:t.map((d,s)=>{var h;return d.type==="file"?ee("div",{className:"flex",style:{marginTop:"8px"},children:[Jn(d),w(nt,{placement:"top",title:((h=d.name)==null?void 0:h.length)>23?d.name:"",children:w("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default",fontSize:"14px"},children:d.name})})]}):w(Jo,{item:d,index:s,clickFileItem:c},s)})})]})},Jo=({item:r,index:u,clickFileItem:t})=>{var c;const[e,p]=oe(!1);return ee("div",{style:{marginTop:"8px"},children:[ee("div",{className:"flex cursor-pointer",onClick:()=>{p(!e),!e&&t(r,u)},children:[Jn(r),w(nt,{placement:"top",title:((c=r.name)==null?void 0:c.length)>23?r.name:"",children:ee("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"14px"},children:[r.name," (",r.fileCount||0,")"]})})]},u),w("div",{style:{padding:"2px 0 2px 14px",margin:"8px 0 0 7px",borderLeft:"2px solid #E5E6EB",display:e?"block":"none"},children:(r.children||[]).map((d,s)=>{var h;return ee("div",{className:"flex items-center",children:[w("div",{style:{width:"4px",height:"4px",borderRadius:"2px",background:"black"}}),w(nt,{placement:"top",title:((h=d.name)==null?void 0:h.length)>26?d.name:"",children:w("div",{style:{paddingLeft:"6px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",width:"336px"},children:d.fileName})})]},s)})})]})};var Da=(r=>(r.REFERENCELIST="referencelist",r.ALLFILELIST="allFileList",r))(Da||{});function qu(r=oi){return function({token:t,url:e="http://localhost:8888",styles:p,CSRFToken:c,eventsEmit:d,scrollOld:s,locale:h="zh",messages:n,...o}){const E=Fe(()=>Wa({theme:Br,mode:"light"},p),[p]),[l,v]=oe(!1),[g,i]=oe(!1),[a,m]=oe(null),[x,f]=oe(!1),[F,b]=oe("mark"),[C,_]=oe({url:"",parse_url:"",file_type:"",file_name:""}),[y,k]=oe([]),[D,R]=oe(1),[I]=oe(16),[z,M]=oe(0),[U,G]=oe(!1),[Z,q]=oe([]),[H,te]=oe(void 0),[T,P]=oe([]),[S,N]=oe([]),[W,V]=oe(void 0),[Y,$]=oe({display:"ready",sender:"ready",app:"initializing"});function ae(A,B){if(!B)return A;const L=Array.isArray(A)?[...A]:{...A};for(const O in B)if(B[O]!==void 0&&B[O]!==null&&Object.prototype.hasOwnProperty.call(B,O))if(O==="actions"&&Array.isArray(A[O])&&Array.isArray(B[O])){const K=new Map;A[O].forEach(J=>{J.name&&K.set(J.name,J)}),B[O].forEach(J=>{J.name&&K.set(J.name,J)}),L[O]=Array.from(K.values())}else typeof A[O]=="object"&&A[O]!==null&&!Array.isArray(A[O])&&typeof B[O]=="object"&&B[O]!==null&&!Array.isArray(B[O])?L[O]=ae(A[O],B[O]):L[O]=B[O];return L}const fe=Fe(()=>oa(h),[h]),e0=Fe(()=>{const A=fe;return{...$0,switchs:($0.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?A.sender.netSearch:A.sender.deepThinking})),actions:($0.actions??[]).map(L=>({...L,tip:L.name==="upload"?A.sender.fileUpload:L.tip}))}},[h,fe]),[De,ue]=oe(()=>ae(e0,o.senderConfig));Ee(()=>{const A=fe,B={...$0,switchs:($0.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?A.sender.netSearch:A.sender.deepThinking})),actions:($0.actions??[]).map(L=>({...L,tip:L.name==="upload"?A.sender.fileUpload:L.tip}))};ue(L=>{const O=ae(B,o.senderConfig);return Array.isArray(L.actions)&&Array.isArray(O.actions)&&(O.actions=O.actions.map((K,J)=>{var re;const ne=(re=L.actions)==null?void 0:re[J];return ne&&ne.name===K.name&&ne.badgeCount!==void 0?{...K,badgeCount:ne.badgeCount}:K})),O})},[h,o.senderConfig,fe]);const{fileStatuses:ge,setFileStatuses:me,pollFileStatus:Ie,handleRemoveFromTemp:Xe,resetStopFlag:Ye,setStopFlag:Qe,stoppedRef:a0,getTempFileList:Re,setFileManagerData:Se,fileManagerData:_e}=Oo({url:e,token:t,CSRFToken:c,activeSessionId:H}),[Ke,u0]=we.useState(()=>{var B;if(!S||S.length===0)return;const A=S.find(L=>L.isDefault);return A?A.id:(B=S[0])==null?void 0:B.id});we.useEffect(()=>{if(!S||S.length===0)return;const A=S.some(B=>B.id===Ke);if(!Ke||!A){const B=S.find(L=>L.isDefault);u0(B?B.id:S[0].id)}},[S]);const[j,de]=oe({}),Be=He(void 0),Ge=He(void 0),D0=He(void 0),We=He(null),pe=He(void 0),_0=He([]),[z0,w0]=oe([]),[Ze,S0]=oe({}),[k0,I0]=oe(!1),[L0,Z0]=oe([]),[J0,O0]=oe(!1),{api_startChat_re:t0,addEmptyMessage:i0,setLastEmptyMessage:x0,stopStream:f0,cancelStreamBySessionId:et}=Po({baseUrl:e,CSRFToken:c,token:t,setChatData:q,activeSessionId:H,setAppStatus:$,setConversationList:k}),Te=Fe(()=>{const A={};return(S||[]).forEach(B=>{A[B.id]=B}),A},[S]),se=Fe(()=>{const A=Z.find(L=>L.id===H)||{id:H,messages:[]},B=A.configId?Te[A.configId]:null;return{...A,assistantInfo:B}},[Z,H,Te]);Ee(()=>{console.log("currentChatData",se)},[se]);const y0=Fe(()=>{if(se.configId&&Te){const A=Te[se.configId];return A!=null&&A.configJson?JSON.parse(A.configJson).is_download:!1}else return!1},[se.configId,Te]);Fe(()=>{if((se.configId||W)&&Te){const A=Te[se.configId];if(A!=null&&A.configJson){const B=JSON.parse(A.configJson);return console.log("is_enableThinking",se.configId,Te,W),!!B.thinking}else if(W){const B=Te[W];if(B!=null&&B.configJson)return!!JSON.parse(B.configJson).thinking}}return!1},[se.configId,Te,W]),Ee(()=>{if(Be.current&&Be.current!==H){const B=Be.current,L=y.find(J=>J.sessionId===B&&J.isNew),O=Z.find(J=>J.id===B&&J.isNew),K=O&&O.messages&&O.messages.length>0;L&&!K&&(k(J=>J.filter(ne=>ne.sessionId!==B)),q(J=>J.filter(ne=>ne.id!==B)))}Be.current=H;const A=se.messages&&se.messages.length>0?se.messages[se.messages.length-1].recommendQuestion:[];P(A)},[H,y,Z,se.messages]);const Pe=async A=>{var B,L,O,K;if(!U){G(!0);try{const J=await Je.get(`${e}/qa/dialogue/list?pageNo=${A}&pageSize=${I}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ne=((L=(B=J==null?void 0:J.data)==null?void 0:B.data)==null?void 0:L.records)||[],re=((K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.total)||0;M(re),k(Ce=>{const ye=new Map;return[...Ce,...ne].forEach(ze=>{ye.set(ze.sessionId,ze)}),Array.from(ye.values())}),R(A)}catch{}finally{G(!1)}}};Ee(()=>{$(A=>({...A,app:"initializing"})),Je.get(`${e}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(A=>{N(A.data.data||[])}).catch(()=>{}),Pe(1).then(()=>{H||q0(),$(A=>({...A,app:"ready"}))}).catch(()=>{$(A=>({...A,app:"error"}))})},[]),Ee(()=>{H&&($(A=>({...A,display:"loading"})),Re(H),Je.get(`${e}/qa/dialogue/getDialogBySessionId?sessionId=${H}`,{headers:{Authorization:t}}).then(A=>{var Ue;if(!A.data.data){$(Q=>({...Q,display:"ready"}));return}const B=((Ue=A.data.data)==null?void 0:Ue.queryReplyPairList)||[],L=wo(B),{sessionId:O,searchConfigDTO:K,filePath:J,configId:ne,reference:re,webReference:Ce,uploadedFiles:ye,fileList:ze,currentFiles:Ne}=A.data.data;if(L.length>0){const Q=L.length-1-[...L].reverse().findIndex(le=>le.istype==="ai");Q>=0&&Q<L.length&&L[Q].istype==="ai"&&(re&&(L[Q].reference=re),Ce&&(L[Q].webReference=Ce))}const xe=Ne||ze||ye;if(xe&&L.length>0){const Q=[...L].reverse().findIndex(le=>le.istype==="user");Q!==-1&&(console.log(L[L.length-1-Q].currentFiles,"filesData"),L[L.length-1-Q].currentFiles=xe)}y.find(Q=>Q.sessionId===O)&&k(Q=>Q.map(le=>le.sessionId===O?{...le,searchConfigDTO:K,filePath:J,configId:ne}:le));const ie={configId:A.data.data.configId,filePath:A.data.data.filePath,searchConfigDTO:A.data.data.searchConfigDTO||{},sessionId:A.data.data.sessionId,label:A.data.data.label,kbId:A.data.data.kbId};q(Q=>{const le=Q.filter(Ve=>Ve.id!==H);return[{id:H,messages:L,...ie},...le]}),$(Q=>({...Q,display:"ready"}))}).catch(A=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",A),A.response&&A.response.status===404&&q0(),$(B=>({...B,display:"error"}))}))},[H,e,t]),Ee(()=>{const A=_e.uploadedFiles.length;ue(B=>{const L=Array.isArray(B.actions)?B.actions:[];return{...B,actions:L.map(K=>K.name==="history"?{...K,badgeCount:A}:K)}})},[_e.uploadedFiles]),Ee(()=>{si({url:e,token:t},A=>{Z0(A)})},[]),we.useEffect(()=>{ge.length&&q(A=>{if(!A[0])return A;const{messages:B}=A[0];for(let L=B.length-1;L>=0;L--)if(B[L].istype==="user"){const O=B[L].currentFiles||[];B[L].currentFiles=ge.map(K=>{var ne,re,Ce;const J=O.find(ye=>ye.uid===K.uid);return{name:((ne=K.file)==null?void 0:ne.name)||K.name,size:((re=K.file)==null?void 0:re.size)||K.size,type:((Ce=K.file)==null?void 0:Ce.type)||K.type,status:K.status,uid:K.uid,url:K.url||(J==null?void 0:J.url)||""}});break}return[...A]})},[ge]);let je=null,Ae=null;const qe=(A,B,L,O)=>{Ae=Ie(A,{onStatusUpdate:B,onComplete:L,onFail:O})},r0=(A,B)=>{q(L=>{const O=[...L];return O[0]&&(O[0]={...O[0],messages:O[0].messages.map(K=>K.queryId===A?{...K,feedbackResult:B}:K)}),O})},g0=async A=>{var B,L;if(A)try{const O=(se==null?void 0:se.configId)||((B=Te==null?void 0:Te[(se==null?void 0:se.configId)||""])==null?void 0:B.id)||"",K=await Je.get(`${e}/qa/ai/recommendQuestion?queryId=${A}&configId=${O||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});P(((L=K.data)==null?void 0:L.data)||[])}catch{P([])}};function F0(A){const{content:B,audioUrl:L,filePaths:O,queryId:K}=A;if(!H||!K)return;const J=(se==null?void 0:se.messages)||[],ne=J.findIndex(X=>(X==null?void 0:X.queryId)===K&&((X==null?void 0:X.istype)==="ai"||(X==null?void 0:X.isUser)===!1));let re;if(ne>0)for(let X=ne-1;X>=0;X-=1){const ie=J[X];if((ie==null?void 0:ie.istype)==="user"||(ie==null?void 0:ie.isUser)===!0){re=ie;break}}const Ce=(re==null?void 0:re.content)??B;if(!Ce)return;const ye=(re==null?void 0:re.filePaths)??O,ze=(typeof ye=="string"&&ye?JSON.parse(ye):ye||[]).map(X=>X.uid),Ne=Date.now();x0({now:Ne}),$(X=>({...X,display:"processing",sender:"processing"}));const xe="query-"+v0(32);ne>=0&&J[ne]&&q(X=>{if(!X[0])return X;const ie=X[0],Ue=ie.messages||[];if(ne>=Ue.length)return X;const Q=Ue.slice();return Q[ne]={...Q[ne],queryId:xe,content:Q[ne].content,reference:"[]",webReference:"[]",graphReference:null,databaseReference:null,status:2,chain:void 0},[{...ie,messages:Q},...X.slice(1)]}),A.clearFn&&A.clearFn(),k(X=>X.map(ie=>ie.sessionId===H?{...ie,gmtModified:Ne}:ie)),t0({configId:se.configId,content:Ce,fileUids:ze,lastDate:Ne,name:se.label||"",queryId:xe,sessionId:String(H||""),type:(re==null?void 0:re.audioUrl)??L?"audioUrl":"text",audioUrl:((re==null?void 0:re.audioUrl)??L)||"",enableThinking:!!j.reasoning,enableWebsearch:!!j.netSearch,qaChannel:j.qaChannel,tempKnowledgeBaseCheck:lt.current},X=>{g0(xe)})}async function c0(A,B){if(Y.sender!=="ready"){Me.warning("\u5F53\u524D\u5BF9\u8BDD\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u518D\u53D1\u9001\u65B0\u7684\u95EE\u9898");return}if(!H)return;const L=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(L);const O=y.find(K=>K.sessionId===H);if(O&&O.isNew){let K=!1;const J=W||O.configId,ne=A&&A.content?A.content.slice(0,20):O.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((re,Ce)=>{xi({url:e,token:t,CSRFToken:c},{label:ne,sessionId:O.sessionId,sysType:"INT_SESSION",configId:J},ye=>{ye&&ye.data&&ye.data.sessionId?(k(ze=>ze.map(Ne=>Ne.sessionId===O.sessionId?{...Ne,isNew:!1,configId:J,label:ne}:Ne)),q(ze=>ze.map(Ne=>Ne.id===O.sessionId?{...Ne,isNew:!1,configId:J,label:ne}:Ne)),K=!0,re()):(Me.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),Ce())})}),!K)return;R0(H,A,B,J);return}R0(H,A,B)}function R0(A,B,L,O){const K="query-"+v0(32),J=y.find(xe=>xe.sessionId===A),ne=O||(J==null?void 0:J.configId)||se.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ne);const re=B.content||B.text||"",Ce=typeof re=="string"?re:String(re),ye=Ce?Ce.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let ze;if(B.files&&B.files.length>0&&(ze=B.files.map(xe=>({name:xe.file.name,size:xe.file.size,type:xe.file.type,filePath:xe.filePath||"",convertedFilePath:xe.convertedFilePath||"",uid:xe.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",B.files),i0({content:Ce,queryId:K,currentFiles:ze,filePaths:ze?JSON.stringify(ze):void 0}),k(xe=>xe.map(X=>X.sessionId===A&&X.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&X.isNew?{...X,label:ye,gmtModified:Date.now(),isNew:!1}:X)),q(xe=>xe.map(X=>X.id===A&&X.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&X.isNew?{...X,label:ye,isNew:!1}:X)),B.files&&B.files.length>0){$(Q=>({...Q,sender:"uploading",display:"uploading"})),je=new AbortController,Ye();const xe=B.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),X=B.files.map((Q,le)=>({...Q,uid:xe[le],status:"uploading"}));me(X);const ie=new FormData;B.files.forEach(Q=>{ie.append("files",Q.file)});const Ue=String(A||"");ie.append("sessionId",Ue),ie.append("uids",xe.join(",")),Je.post(`${e}/index/knowledgeBase/file/uploadFiles`,ie,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:je.signal}).then(Q=>{var m0,Tr,Pr,zr,Lr,Or,Mr,qr,Ur,Hr;if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",Q),console.log("\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u8BE6\u60C5:",{status:Q.status,success:(m0=Q.data)==null?void 0:m0.success,dataType:Array.isArray((Tr=Q.data)==null?void 0:Tr.data)?"array":typeof((Pr=Q.data)==null?void 0:Pr.data),dataLength:Array.isArray((zr=Q.data)==null?void 0:zr.data)?Q.data.data.length:"N/A",errorMsg:(Lr=Q.data)==null?void 0:Lr.errorMsg,errorCode:(Or=Q.data)==null?void 0:Or.errorCode,fullResponse:Q.data}),a0.current)return;const le=(Mr=Q.data)==null?void 0:Mr.data,Oe=((qr=Q.data)==null?void 0:qr.success)===!0,Ve=Array.isArray(le)&&le.length>0;if(Oe&&Ve){const o0=le,H0=o0.map(ke=>ke.uid);me(ke=>ke.map(Le=>{const be=le.find(he=>he.uid===Le.uid);return be?{...Le,...be}:Le})),$(ke=>({...ke,sender:"processing",display:"analyzing"})),me(ke=>ke.map(Le=>({...Le,status:"parsing"}))),qe(H0,ke=>{if(!ke||!Array.isArray(ke)){console.warn("pollFileStatus \u56DE\u8C03\u8FD4\u56DE\u7684 serverStatuses \u65E0\u6548:",ke);return}if(me(be=>be.map(he=>{const B0=ke.find(p0=>p0&&p0.uid===he.uid);if(B0)switch(B0.fileParseStatus??B0.status){case 3:return{...he,status:"done"};case 4:return{...he,status:"error"};case 1:case 2:default:return{...he,status:"parsing"}}return he})),Array.isArray(ke)&&ke.length>0&&ke.every(be=>{if(!be)return!1;const he=be.fileParseStatus??be.status;return he===3||he===4})){me([]);const be=new Map;(ke||[]).forEach(he=>{be.set(he.id,he)}),Se(he=>({uploadedFiles:vi(he.uploadedFiles,o0).map(p0=>{var rt;return{...p0,pdfPages:((rt=be.get(p0.id))==null?void 0:rt.pdfPages)||0}})}))}},()=>{L==null||L(),$(Le=>({...Le,sender:"processing",display:"processing"})),me(Le=>Le.map(be=>{const he=o0.find(B0=>B0.uid===be.uid);return he?{...be,...he,url:he.filePath,filePath:he.filePath,name:he.fileName||be.name,convertedFilePath:he.convertedFilePath||be.convertedFilePath}:be})),q(Le=>{if(!Le[0])return Le;const{messages:be}=Le[0];for(let he=be.length-1;he>=0;he--)if(be[he].istype==="user"){const B0=be[he].currentFiles||[];be[he].currentFiles=B0.map(p0=>{const rt=o0.find(za=>za.uid===p0.uid);return rt?{...p0,...rt}:p0});break}return[...Le]});const ke=Date.now();t0({configId:ne,content:Ce,fileUids:H0,lastDate:ke,name:ye,queryId:K,sessionId:String(A||""),type:"text",audioUrl:"",enableThinking:!!j.reasoning,enableWebsearch:!!j.netSearch,qaChannel:j.qaChannel,tempKnowledgeBaseCheck:lt.current},Le=>{g0(K)})},ke=>{$(Le=>({...Le,display:"ready",sender:"ready"})),me(Le=>Le.map(be=>({...be,status:"error",message:ke})))})}else{let o0="\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";(Ur=Q.data)!=null&&Ur.errorMsg?o0=Q.data.errorMsg:Oe?Ve||(Array.isArray(le)?le.length===0&&(o0="\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u4E3A\u7A7A"):o0=`\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF0C\u671F\u671B\u6570\u7EC4\uFF0C\u5B9E\u9645\u4E3A ${typeof le}`):o0=`\u4E0A\u4F20\u5931\u8D25: success=${(Hr=Q.data)==null?void 0:Hr.success}`,console.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u8BE6\u60C5:",{errorMsg:o0,response:Q.data,isSuccess:Oe,isValidData:Ve}),Me.error(o0),$(H0=>({...H0,display:"error",sender:"ready"})),me(H0=>H0.map(ke=>({...ke,status:"error",message:o0})))}}).catch(Q=>{var le,Oe;((le=Q==null?void 0:Q.response)==null?void 0:le.status)===413?(Oe=Q==null?void 0:Q.response)!=null&&Oe.statusText.includes("Request Entity Too Large")&&Me.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):Me.error("\u7F51\u7EDC\u9519\u8BEF"),$(Ve=>({...Ve,display:"error",sender:"ready"})),me(Ve=>Ve.map(m0=>({...m0,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}$(xe=>({...xe,display:"processing",sender:"processing"}));const Ne=Date.now();k(xe=>xe.map(X=>X.sessionId===A?{...X,gmtModified:Ne}:X)),L==null||L(),t0({configId:ne,content:Ce,fileUids:[],lastDate:Ne,name:ye,queryId:K,sessionId:String(A||""),type:"text",audioUrl:"",enableThinking:!!j.reasoning,enableWebsearch:!!j.netSearch,qaChannel:j.qaChannel,tempKnowledgeBaseCheck:lt.current},xe=>{g0(K)})}function M0(A){A.restult==1?sr({url:e,token:t,CSRFToken:c},{queryId:A.queryId},()=>{r0(A.queryId,null)}):jr({url:e,token:t,CSRFToken:c},{restult:1,queryId:A.queryId},()=>{r0(A.queryId,1)})}function q0(A){const B=v0(32),L={sessionId:B,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};k(O=>[{...L,messages:[]},...O]),q(O=>[{id:B,messages:[],...L},...O]),te(B)}function N0(A){if(A!=null&&A.sessionId&&A.sessionId!==H){H&&et(H),te(A.sessionId),$(L=>({...L,sender:"ready"}));const B=Z.find(L=>L.id===A.sessionId);if(B&&B.messages&&B.messages.length>0){const L=[...B.messages].reverse().find(O=>O.istype==="ai");L&&L.recommendQuestion?P(L.recommendQuestion):P([])}else P([])}}const U0=async A=>new Promise((B,L)=>{fi({url:e,token:t,CSRFToken:c},{sessionId:A},O=>{O?(Me.success("\u5220\u9664\u6210\u529F!"),B(O)):(Me.error("\u5220\u9664\u5931\u8D25!"),L(O))})}),nr=async()=>{try{return k([]),M(0),await Pe(1),[]}catch(A){throw Me.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),A}},it=async(A,B)=>new Promise((L,O)=>{pi({url:e,token:t,CSRFToken:c},{label:B,sessionId:A},K=>{if(K){const J=Date.now();k(ne=>ne.map(re=>re.sessionId===A?{...re,label:B,gmtModified:J}:re)),q(ne=>ne.map(re=>re.id===A?{...re,label:B}:re)),Me.success("\u91CD\u547D\u540D\u6210\u529F!"),L(K)}else Me.error("\u91CD\u547D\u540D\u5931\u8D25"),O(K)})}),ot=A=>{k(B=>{const L=B.filter(O=>O.sessionId!==A);return H===A&&(L.length>0?te(L[0].sessionId):q0()),L})},st=(A,B)=>{const L=Date.now();k(O=>O.map(K=>K.sessionId===A?{...K,label:B,gmtModified:L}:K)),q(O=>O.map(K=>K.id===A?{...K,label:B}:K))},ut=A=>{jr({url:e,token:t,CSRFToken:c},{...A,...Ze,restult:0},()=>{r0(Ze.queryId,0)})},ct=A=>{const B=A.new_name,L=a.data.label;B&&B!==L?a.async_renameConversation(B).then(()=>{a.fn_renameItemInList(B),v(!1)}).catch(()=>{}):v(!1)},ar=A=>{a.async_deleteConversation().then(()=>{a.fn_removeItemFromList(),i(!1)}).catch(()=>{})},n0=(A,B)=>{switch(console.log(A,B),A){case"close_remove":i(!1);break;case"close_rename":v(!1);break;case"ok_rename":ct(B);break;case"ok_remove":ar();break}},tt=async({url:A,params:B,replacePredataFunction:L})=>{var O,K;try{const J=await Je.post(A,B,{headers:{Authorization:t}}),ne=(K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.data;ne&&L(ne)}catch(J){console.log("error",J)}},Ia=async A=>{var B;try{const L=await Je.get(`${hr()}/index/knowledgeBase/file/getFileStatusByUids?uids=${A.data.uids}`,{headers:{Authorization:t}});return console.log("resslkdjgalsg",L),(B=L==null?void 0:L.data)==null?void 0:B.data}catch{}},Rr=async A=>{var B;if(hi.includes(A.file_type)){const L=(B=A.metadata)!=null&&B.source?`${vr}${A.metadata.source}`:A.url||A.convertedFilePath||A.filePath;_({...A,parse_url:L}),b("preview"),f(!0);return}try{const L=await Ia({data:{uids:A.uid},config:{url:hr(),token:t,enableMock:!1}});if(L!=null&&L.length){const O=L[0];_({...A,parse_url:O.convertedFilePath}),b("preview"),f(!0)}}catch{}},lt=He(!1),E0=(A,B)=>{var L,O,K,J,ne,re,Ce;switch(console.log(`[Event] ${A}`,B),A){case"TempKnowledgeBase":lt.current=B;break;case"reference_file:click":if(B.file_type==="image")return;if(!B.parse_url){if(!B.uid)return B.references?void 0:Me.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8");Rr(B);return}_({...B,file_type:B.type,file_name:B.file}),b("preview"),f(!0);break;case"conversations:load_more":{y.length<z&&!U&&Pe(D+1);break}case"retrieve-sql-data:pagingation_click":const{page:ye,pageSize:ze,fetchUrl:Ne,source:xe,replacePredataFunction:X}=B;tt({url:`${e}${Ne}`,replacePredataFunction:X,params:{pageNo:ye,pageSize:ze,convertedFilePath:xe,stream:!1}});break;case"web_referenceFile_title:click":if(!((L=B==null?void 0:B.data)!=null&&L.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(B.data.link,"_blank");break;case"conversation:item_click":N0(B);break;case"files:finished_animation_complete":me([]);break;case"conversation:create":q0();break;case"conversation:new_assistant_change":V(B.assistantId);break;case"conversations:rename_icon_clicked":m({data:B,async_renameConversation:ie=>it(B.sessionId,ie),fn_renameItemInList:ie=>st(B.sessionId,ie)}),v(!0);break;case"conversations:delete_icon_clicked":m({data:B,async_deleteConversation:()=>U0(B.sessionId),async_refreshConversationList:nr,fn_removeItemFromList:()=>ot(B.sessionId)}),i(!0);break;case"sender:send":c0(B,B.clearFn);break;case"sender:send_recommandQuestion":{const ie=((B==null?void 0:B.content)??"").toString();if(!ie)break;c0({content:ie},()=>{});break}case"chatbox:follow_up_question_click":{const ie=((B==null?void 0:B.question)??(B==null?void 0:B.content)??"").toString();if(!ie)break;c0({content:ie},()=>{});break}case"sender:stop":Qe(),je&&(je.abort(),je=null),Ae&&(Ae(),Ae=null),$(ie=>({...ie,display:"ready",sender:"ready"})),me([]),f0==null||f0();break;case"sender:clear":(O=B.clearFn)==null||O.call(B);break;case"sender:configChange":B&&B.all&&de(B.all);break;case"sender:action_upload":We.current&&We.current.click();break;case"sender:action_history":O0(!0);break;case"uploaded_file:item_click":break;case"action_copy:click":B&&_o(B.content,B.event);break;case"chatbox:copy":{let ie=(B==null?void 0:B.content)||"";if(!ie)break;ie=ie.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,"");const Ue=async le=>{try{return await navigator.clipboard.writeText(le),Me.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},Q=le=>{const Oe=document.createElement("textarea");Oe.value=le,Oe.style.position="fixed",Oe.style.opacity="0",document.body.appendChild(Oe),Oe.focus(),Oe.select();try{document.execCommand("copy"),Me.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{Me.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(Oe)};Ue(ie).then(le=>{le||Q(ie)});break}case"chatbox:repeat":console.log(B,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),F0(B);break;case"action_thumbsup":M0(B);break;case"chatbox:like":M0({queryId:B==null?void 0:B.queryId,restult:B==null?void 0:B.result});break;case"action_thumbsdown":B.restult===0?sr({url:e,token:t,CSRFToken:c},{queryId:B.queryId},()=>{r0(B.queryId,null)}):(S0(B),I0(!0));break;case"chatbox:dislike":(B==null?void 0:B.result)===0?sr({url:e,token:t,CSRFToken:c},{queryId:B.queryId},()=>{r0(B.queryId,null)}):(S0({queryId:B==null?void 0:B.queryId}),I0(!0));break;case"action_retrive_tag":d==null||d("action_retrive_tag",B);break;case"referenceFile_view":d==null||d("referenceFile_view",B);break;case"referenceFile_question":console.log(B,"zhezhhzhzh"),Rr(B.data||B),d==null||d("referenceFile_question",B);break;case"referenceFile_download":d==null||d("referenceFile_download",B);break;case"references:click":case"knowledge_base_view_all:click":{const ie=()=>A==="references:click"?w(Qo,{type:"referencelist",data:B,token:t,eventsEmit:d,is_download:y0}):w(Zo,{fileData:B,token:t}),Ue=new CustomEvent("aichat:right_set_content",{detail:{content:w(ie,{})}});window.dispatchEvent(Ue);const Q=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(Q);break}case"retrive_tag:click":d==null||d("retrive_tag:click",B);break;case"fileManager:change":{typeof(B==null?void 0:B.setUploadedFiles)=="function"&&(Ge.current=B.setUploadedFiles,D0.current=B.removeFile,pe.current=B==null?void 0:B.senderConfig,_0.current=Array.isArray(B==null?void 0:B.uploadedFiles)?B.uploadedFiles:[],Array.isArray(B==null?void 0:B.uploadedFiles)&&w0(B.uploadedFiles),console.log("[DEBUG] fileManager:change \u4E8B\u4EF6\u89E6\u53D1\uFF0CsetUploadedFilesRef \u5DF2\u8BBE\u7F6E",{hasSetUploadedFiles:!!Ge.current,uploadedFilesCount:((K=B==null?void 0:B.uploadedFiles)==null?void 0:K.length)||0,pendingFilesCount:((J=B==null?void 0:B.uploadedFiles)==null?void 0:J.length)||0,hasSenderConfig:!!(B!=null&&B.senderConfig),senderConfig:B==null?void 0:B.senderConfig,upload_number_limit:(ne=B==null?void 0:B.senderConfig)==null?void 0:ne.upload_number_limit,upload_size_limit:(re=B==null?void 0:B.senderConfig)==null?void 0:re.upload_size_limit}));break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",B);const ie=(Ce=B==null?void 0:B.file)==null?void 0:Ce.uid;if(!ie){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",B);break}const Ue=[...(se==null?void 0:se.messages)||[]].reverse().find(le=>le.istype==="user"),Q=Ue==null?void 0:Ue.queryId;Xe(ie,Q);break}case"uploaded_file:remove_batch":break;default:d==null||d(A,B)}},Ra=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:w(ki,{size:16}),enabled:!0,component:w(Eo,{data:y,assistantList:S,activedItem:H||"",hasMore:y.length<z,loadingMore:U,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:E0,styles:E.theme})}],Nr=we.useCallback(()=>w(To,{eventsEmit:E0,assistantList:S,styles:E,selectedId:Ke,onSelectAssistant:u0,productLogo:o==null?void 0:o.productLogo}),[E0,S,E,Ke,o==null?void 0:o.productLogo]),Na={...we.useMemo(()=>({AiChatBox:(A,B)=>{var ze,Ne,xe;const L=B===(((ze=se==null?void 0:se.messages)==null?void 0:ze.length)||0)-1;let O="ready";if(L)if(A.status!==void 0)switch(A.status){case 0:O="thinking";break;case 1:O="processing";break;case 2:O="ready";break;case 3:O="error";break;case 4:O="thinking";break;default:O=Y.display}else O=Y.display;let K=[];if(Array.isArray(T))K=T;else if(typeof T=="string")try{K=JSON.parse(T)||[]}catch{K=[]}const J=(()=>{const X=A==null?void 0:A.reference;if(!X)return"[]";if(typeof X=="string")try{return JSON.parse(X),X}catch{return"[]"}try{return JSON.stringify(X)}catch{return"[]"}})(),ne=(()=>{const X=A==null?void 0:A.webReference;if(!X)return"[]";if(typeof X=="string")try{return JSON.parse(X),X}catch{return"[]"}try{return JSON.stringify(X)}catch{return"[]"}})(),re=(()=>{const X=A==null?void 0:A.graphReference;if(!X)return"[]";if(typeof X=="string")try{return JSON.parse(X),X}catch{return"[]"}try{return JSON.stringify(X)}catch{return"[]"}})(),Ce=A==null?void 0:A.databaseReference,ye=(()=>{var ie,Ue,Q;if(A!=null&&A.chainRespTime||(ie=A==null?void 0:A.reply)!=null&&ie.chainRespTime)return(A==null?void 0:A.chainRespTime)??((Ue=A==null?void 0:A.reply)==null?void 0:Ue.chainRespTime);const X=(A==null?void 0:A.chain)||((Q=A==null?void 0:A.reply)==null?void 0:Q.chain);if(Array.isArray(X)&&X.length>0){const le=X.reduce((Oe,Ve)=>{const m0=(Ve==null?void 0:Ve.chainRespTime)??(Ve==null?void 0:Ve.respTime);return m0!=null&&m0>0?Oe+m0:Oe},0);return le>0?le:void 0}})();return w(Vr,{...A,token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",referenceMode:"button",reference:J,webReference:ne,graphReference:re,databaseReference:Ce,contentType:"stream",displayStatus:O,eventsEmit:E0,isLast:L&&(A==null?void 0:A.istype)==="ai",followUpQuestions:L&&(A==null?void 0:A.istype)==="ai"?K:[],defaultAnswer:((Ne=se==null?void 0:se.searchConfigDTO)==null?void 0:Ne.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:y0,styles:E,enableThoughtChain:!0,chain:A==null?void 0:A.chain,thoughtChainNodes:A==null?void 0:A.thoughtChainNodes,thoughtChainStatus:A==null?void 0:A.status,enableCot:(A==null?void 0:A.enableCot)??((xe=A==null?void 0:A.reply)==null?void 0:xe.enableCot),chainRespTime:ye},`${(A==null?void 0:A.queryId)||(A==null?void 0:A.id)||B}-${(A==null?void 0:A.istype)||"unknown"}`)},LogoBox:A=>A&&A.LogoBox===null?null:A&&typeof A.LogoBox=="function"?w(A.LogoBox,{}):w("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>w(qo,{}),DisplayError:()=>w(Ho,{}),AppError:()=>w(Uo,{msg:"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25",subMsg:"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),AppLoading:()=>{var A,B;return w(Mo,{title:(A=o==null?void 0:o.appLoadingConfig)==null?void 0:A.title,subtitle:((B=o==null?void 0:o.appLoadingConfig)==null?void 0:B.subtitle)||""})},UserChatBox:(A,B)=>w(Vr,{token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",...A,referenceMode:"button",contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:E0,styles:E,fileManagerData:_e,currentFiles:A==null?void 0:A.currentFiles},`${(A==null?void 0:A.queryId)||(A==null?void 0:A.id)||B}-user`),WelcomeComponent:Nr}),[Nr,se,Y.display,E0,E,y0,_e]),...o.CustomComponents||{}};Ee(()=>{ue(A=>{const B=Array.isArray(A.switchs)?A.switchs.map(L=>L.name==="reasoning"?{...L,enabled:!0}:L):[];return{...A,switchs:B}})},[]);const Ta=Fe(()=>_e.uploadedFiles||[],[_e]),{FileDisplayTools:Pa}=ui({fileManagerData:{uploadedFiles:Ta},styles:E,eventsEmit:E0});return w(Mi,{locale:h,children:ee("div",{style:{height:"100%",minWidth:"1116px",overflow:"hidden"},children:[w("input",{ref:We,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.md,.json,.csv,.zip,.rar,.7z",style:{display:"none"},onChange:A=>{const B=A.target.files;if(B&&B.length>0){console.log("[DEBUG] handleFileSelect \u89E6\u53D1",{filesCount:B.length,hasSetUploadedFilesRef:!!Ge.current,hasSenderConfig:!!pe.current,dynamicSenderConfig:De,dynamicSenderConfigKeys:De?Object.keys(De):[],senderConfigRef:pe.current,senderConfigRefKeys:pe.current?Object.keys(pe.current):[]});const L=Array.from(B);let O=pe.current;(!O||O.upload_size_limit===void 0&&O.upload_number_limit===void 0&&(!O.upload_file_type_limit||O.upload_file_type_limit.length===0))&&(O=De);const K=_0.current||[];console.log("[DEBUG] \u9A8C\u8BC1\u914D\u7F6E\u68C0\u67E5",{configSource:O,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,existingFilesCount:K.length,newFilesCount:L.length});const J=O&&(O.upload_size_limit!==void 0||O.upload_number_limit!==void 0&&O.upload_number_limit>0||O.upload_file_type_limit&&O.upload_file_type_limit.length>0);if(console.log("[DEBUG] \u914D\u7F6E\u68C0\u67E5\u7ED3\u679C",{hasUploadLimitConfig:J,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,upload_file_type_limit:O==null?void 0:O.upload_file_type_limit}),J){const ne={upload_size_limit:O.upload_size_limit,upload_number_limit:O.upload_number_limit,upload_file_type_limit:O.upload_file_type_limit,upload_limit_message:O.upload_limit_message};console.log("[DEBUG] \u6267\u884C\u6587\u4EF6\u9A8C\u8BC1",{uploadConfig:ne,existingFilesCount:K.length,newFilesCount:L.length,totalCount:K.length+L.length});const re=li(L,K,ne);if(console.log("[DEBUG] \u9A8C\u8BC1\u7ED3\u679C",{valid:re.valid,errors:re.errors,rejectedFilesCount:re.rejectedFiles.length}),!re.valid){di(re);const Ce=L.filter(ye=>!re.rejectedFiles.includes(ye));if(Ce.length===0){We.current&&(We.current.value="");return}L.splice(0,L.length,...Ce)}}if(Ge.current){const ne=L.map(re=>({file:re,type:re.type.startsWith("image/")?"image":"document",status:"pending",name:re.name}));console.log("[DEBUG] \u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ne),Ge.current(ne)}else console.warn("[DEBUG] setUploadedFilesRef \u672A\u8BBE\u7F6E\uFF0C\u5EF6\u8FDF\u91CD\u8BD5"),setTimeout(()=>{if(Ge.current){const ne=L.map(re=>({file:re,type:re.type.startsWith("image/")?"image":"document",status:"pending",name:re.name}));console.log("[DEBUG] \u5EF6\u8FDF\u540E\u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ne),Ge.current(ne)}else console.error("[DEBUG] \u5EF6\u8FDF\u540E setUploadedFilesRef \u4ECD\u672A\u8BBE\u7F6E")},100)}We.current&&(We.current.value="")}}),w(r,{...o,status:Y,chatData:se,sidebar:Ra,recommandQuestions:[],eventsEmit:E0,styles:E,senderConfig:De,fileUploadStatus:ge,CustomComponents:Na,activeSessionId:H,scrollOld:s,rightbarWidth:"400px",locale:h,messages:n,disclaimer:o.disclaimer??fe.disclaimer,chatHeader:{title:(se==null?void 0:se.label)||fe.chatHeader.newConversation,tools:Pa}}),w(ci,{open:k0,feedBackList:L0,setOpen:I0,handleConfirm:ut}),w($o,{isModalOpen:l,handleOk:n0,handleCancel:()=>n0("close_rename"),data:(a==null?void 0:a.data)||{}}),w(Wo,{isModalOpen:g,handleOk:n0,handleCancel:()=>n0("close_remove"),data:(a==null?void 0:a.data)||{}}),w(Jt,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:w(aa,{autoFocus:!1,onClose:()=>f(!1),open:x,width:F==="graphPreview"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,children:F==="preview"&&w(ba,{curFileInfo:C,onClose:f,token:t})})})]})})}}var vt={exports:{}},gt={exports:{}},es=gt.exports,dn;function ce(){return dn||(dn=1,(function(r,u){(function(t,e){r.exports=e()})(es,function(){var t=t||(function(e,p){var c;if(typeof window<"u"&&window.crypto&&(c=window.crypto),typeof self<"u"&&self.crypto&&(c=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window<"u"&&window.msCrypto&&(c=window.msCrypto),!c&&typeof ur<"u"&&ur.crypto&&(c=ur.crypto),!c&&typeof Di=="function")try{c=_i}catch{}var d=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||(function(){function x(){}return function(f){var F;return x.prototype=f,F=new x,x.prototype=null,F}})(),h={},n=h.lib={},o=n.Base=(function(){return{extend:function(x){var f=s(this);return x&&f.mixIn(x),(!f.hasOwnProperty("init")||this.init===f.init)&&(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var f in x)x.hasOwnProperty(f)&&(this[f]=x[f]);x.hasOwnProperty("toString")&&(this.toString=x.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),E=n.WordArray=o.extend({init:function(x,f){x=this.words=x||[],f!=p?this.sigBytes=f:this.sigBytes=x.length*4},toString:function(x){return(x||v).stringify(this)},concat:function(x){var f=this.words,F=x.words,b=this.sigBytes,C=x.sigBytes;if(this.clamp(),b%4)for(var _=0;_<C;_++){var y=F[_>>>2]>>>24-_%4*8&255;f[b+_>>>2]|=y<<24-(b+_)%4*8}else for(var k=0;k<C;k+=4)f[b+k>>>2]=F[k>>>2];return this.sigBytes+=C,this},clamp:function(){var x=this.words,f=this.sigBytes;x[f>>>2]&=4294967295<<32-f%4*8,x.length=e.ceil(f/4)},clone:function(){var x=o.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var f=[],F=0;F<x;F+=4)f.push(d());return new E.init(f,x)}}),l=h.enc={},v=l.Hex={stringify:function(x){for(var f=x.words,F=x.sigBytes,b=[],C=0;C<F;C++){var _=f[C>>>2]>>>24-C%4*8&255;b.push((_>>>4).toString(16)),b.push((_&15).toString(16))}return b.join("")},parse:function(x){for(var f=x.length,F=[],b=0;b<f;b+=2)F[b>>>3]|=parseInt(x.substr(b,2),16)<<24-b%8*4;return new E.init(F,f/2)}},g=l.Latin1={stringify:function(x){for(var f=x.words,F=x.sigBytes,b=[],C=0;C<F;C++){var _=f[C>>>2]>>>24-C%4*8&255;b.push(String.fromCharCode(_))}return b.join("")},parse:function(x){for(var f=x.length,F=[],b=0;b<f;b++)F[b>>>2]|=(x.charCodeAt(b)&255)<<24-b%4*8;return new E.init(F,f)}},i=l.Utf8={stringify:function(x){try{return decodeURIComponent(escape(g.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return g.parse(unescape(encodeURIComponent(x)))}},a=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new E.init,this._nDataBytes=0},_append:function(x){typeof x=="string"&&(x=i.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes},_process:function(x){var f,F=this._data,b=F.words,C=F.sigBytes,_=this.blockSize,y=_*4,k=C/y;x?k=e.ceil(k):k=e.max((k|0)-this._minBufferSize,0);var D=k*_,R=e.min(D*4,C);if(D){for(var I=0;I<D;I+=_)this._doProcessBlock(b,I);f=b.splice(0,D),F.sigBytes-=R}return new E.init(f,R)},clone:function(){var x=o.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});n.Hasher=a.extend({cfg:o.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset()},reset:function(){a.reset.call(this),this._doReset()},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var f=this._doFinalize();return f},blockSize:16,_createHelper:function(x){return function(f,F){return new x.init(F).finalize(f)}},_createHmacHelper:function(x){return function(f,F){return new m.HMAC.init(x,F).finalize(f)}}});var m=h.algo={};return h})(Math);return t})})(gt)),gt.exports}var mt={exports:{}},ts=mt.exports,xn;function rr(){return xn||(xn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ts,function(t){return(function(e){var p=t,c=p.lib,d=c.Base,s=c.WordArray,h=p.x64={};h.Word=d.extend({init:function(n,o){this.high=n,this.low=o}}),h.WordArray=d.extend({init:function(n,o){n=this.words=n||[],o!=e?this.sigBytes=o:this.sigBytes=n.length*8},toX32:function(){for(var n=this.words,o=n.length,E=[],l=0;l<o;l++){var v=n[l];E.push(v.high),E.push(v.low)}return s.create(E,this.sigBytes)},clone:function(){for(var n=d.clone.call(this),o=n.words=this.words.slice(0),E=o.length,l=0;l<E;l++)o[l]=o[l].clone();return n}})})(),t})})(mt)),mt.exports}var Ct={exports:{}},rs=Ct.exports,fn;function ns(){return fn||(fn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(rs,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,p=e.lib,c=p.WordArray,d=c.init,s=c.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var n=h.byteLength,o=[],E=0;E<n;E++)o[E>>>2]|=h[E]<<24-E%4*8;d.call(this,o,n)}else d.apply(this,arguments)};s.prototype=c}})(),t.lib.WordArray})})(Ct)),Ct.exports}var yt={exports:{}},as=yt.exports,pn;function is(){return pn||(pn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(as,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.enc;d.Utf16=d.Utf16BE={stringify:function(h){for(var n=h.words,o=h.sigBytes,E=[],l=0;l<o;l+=2){var v=n[l>>>2]>>>16-l%4*8&65535;E.push(String.fromCharCode(v))}return E.join("")},parse:function(h){for(var n=h.length,o=[],E=0;E<n;E++)o[E>>>1]|=h.charCodeAt(E)<<16-E%2*16;return c.create(o,n*2)}},d.Utf16LE={stringify:function(h){for(var n=h.words,o=h.sigBytes,E=[],l=0;l<o;l+=2){var v=s(n[l>>>2]>>>16-l%4*8&65535);E.push(String.fromCharCode(v))}return E.join("")},parse:function(h){for(var n=h.length,o=[],E=0;E<n;E++)o[E>>>1]|=s(h.charCodeAt(E)<<16-E%2*16);return c.create(o,n*2)}};function s(h){return h<<8&4278255360|h>>>8&16711935}})(),t.enc.Utf16})})(yt)),yt.exports}var Ft={exports:{}},os=Ft.exports,hn;function T0(){return hn||(hn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(os,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.enc;d.Base64={stringify:function(h){var n=h.words,o=h.sigBytes,E=this._map;h.clamp();for(var l=[],v=0;v<o;v+=3)for(var g=n[v>>>2]>>>24-v%4*8&255,i=n[v+1>>>2]>>>24-(v+1)%4*8&255,a=n[v+2>>>2]>>>24-(v+2)%4*8&255,m=g<<16|i<<8|a,x=0;x<4&&v+x*.75<o;x++)l.push(E.charAt(m>>>6*(3-x)&63));var f=E.charAt(64);if(f)for(;l.length%4;)l.push(f);return l.join("")},parse:function(h){var n=h.length,o=this._map,E=this._reverseMap;if(!E){E=this._reverseMap=[];for(var l=0;l<o.length;l++)E[o.charCodeAt(l)]=l}var v=o.charAt(64);if(v){var g=h.indexOf(v);g!==-1&&(n=g)}return s(h,n,E)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(h,n,o){for(var E=[],l=0,v=0;v<n;v++)if(v%4){var g=o[h.charCodeAt(v-1)]<<v%4*2,i=o[h.charCodeAt(v)]>>>6-v%4*2,a=g|i;E[l>>>2]|=a<<24-l%4*8,l++}return c.create(E,l)}})(),t.enc.Base64})})(Ft)),Ft.exports}var Et={exports:{}},ss=Et.exports,vn;function us(){return vn||(vn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ss,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.enc;d.Base64url={stringify:function(h,n){n===void 0&&(n=!0);var o=h.words,E=h.sigBytes,l=n?this._safe_map:this._map;h.clamp();for(var v=[],g=0;g<E;g+=3)for(var i=o[g>>>2]>>>24-g%4*8&255,a=o[g+1>>>2]>>>24-(g+1)%4*8&255,m=o[g+2>>>2]>>>24-(g+2)%4*8&255,x=i<<16|a<<8|m,f=0;f<4&&g+f*.75<E;f++)v.push(l.charAt(x>>>6*(3-f)&63));var F=l.charAt(64);if(F)for(;v.length%4;)v.push(F);return v.join("")},parse:function(h,n){n===void 0&&(n=!0);var o=h.length,E=n?this._safe_map:this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var v=0;v<E.length;v++)l[E.charCodeAt(v)]=v}var g=E.charAt(64);if(g){var i=h.indexOf(g);i!==-1&&(o=i)}return s(h,o,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(h,n,o){for(var E=[],l=0,v=0;v<n;v++)if(v%4){var g=o[h.charCodeAt(v-1)]<<v%4*2,i=o[h.charCodeAt(v)]>>>6-v%4*2,a=g|i;E[l>>>2]|=a<<24-l%4*8,l++}return c.create(E,l)}})(),t.enc.Base64url})})(Et)),Et.exports}var Bt={exports:{}},cs=Bt.exports,gn;function P0(){return gn||(gn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(cs,function(t){return(function(e){var p=t,c=p.lib,d=c.WordArray,s=c.Hasher,h=p.algo,n=[];(function(){for(var i=0;i<64;i++)n[i]=e.abs(e.sin(i+1))*4294967296|0})();var o=h.MD5=s.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(i,a){for(var m=0;m<16;m++){var x=a+m,f=i[x];i[x]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360}var F=this._hash.words,b=i[a+0],C=i[a+1],_=i[a+2],y=i[a+3],k=i[a+4],D=i[a+5],R=i[a+6],I=i[a+7],z=i[a+8],M=i[a+9],U=i[a+10],G=i[a+11],Z=i[a+12],q=i[a+13],H=i[a+14],te=i[a+15],T=F[0],P=F[1],S=F[2],N=F[3];T=E(T,P,S,N,b,7,n[0]),N=E(N,T,P,S,C,12,n[1]),S=E(S,N,T,P,_,17,n[2]),P=E(P,S,N,T,y,22,n[3]),T=E(T,P,S,N,k,7,n[4]),N=E(N,T,P,S,D,12,n[5]),S=E(S,N,T,P,R,17,n[6]),P=E(P,S,N,T,I,22,n[7]),T=E(T,P,S,N,z,7,n[8]),N=E(N,T,P,S,M,12,n[9]),S=E(S,N,T,P,U,17,n[10]),P=E(P,S,N,T,G,22,n[11]),T=E(T,P,S,N,Z,7,n[12]),N=E(N,T,P,S,q,12,n[13]),S=E(S,N,T,P,H,17,n[14]),P=E(P,S,N,T,te,22,n[15]),T=l(T,P,S,N,C,5,n[16]),N=l(N,T,P,S,R,9,n[17]),S=l(S,N,T,P,G,14,n[18]),P=l(P,S,N,T,b,20,n[19]),T=l(T,P,S,N,D,5,n[20]),N=l(N,T,P,S,U,9,n[21]),S=l(S,N,T,P,te,14,n[22]),P=l(P,S,N,T,k,20,n[23]),T=l(T,P,S,N,M,5,n[24]),N=l(N,T,P,S,H,9,n[25]),S=l(S,N,T,P,y,14,n[26]),P=l(P,S,N,T,z,20,n[27]),T=l(T,P,S,N,q,5,n[28]),N=l(N,T,P,S,_,9,n[29]),S=l(S,N,T,P,I,14,n[30]),P=l(P,S,N,T,Z,20,n[31]),T=v(T,P,S,N,D,4,n[32]),N=v(N,T,P,S,z,11,n[33]),S=v(S,N,T,P,G,16,n[34]),P=v(P,S,N,T,H,23,n[35]),T=v(T,P,S,N,C,4,n[36]),N=v(N,T,P,S,k,11,n[37]),S=v(S,N,T,P,I,16,n[38]),P=v(P,S,N,T,U,23,n[39]),T=v(T,P,S,N,q,4,n[40]),N=v(N,T,P,S,b,11,n[41]),S=v(S,N,T,P,y,16,n[42]),P=v(P,S,N,T,R,23,n[43]),T=v(T,P,S,N,M,4,n[44]),N=v(N,T,P,S,Z,11,n[45]),S=v(S,N,T,P,te,16,n[46]),P=v(P,S,N,T,_,23,n[47]),T=g(T,P,S,N,b,6,n[48]),N=g(N,T,P,S,I,10,n[49]),S=g(S,N,T,P,H,15,n[50]),P=g(P,S,N,T,D,21,n[51]),T=g(T,P,S,N,Z,6,n[52]),N=g(N,T,P,S,y,10,n[53]),S=g(S,N,T,P,U,15,n[54]),P=g(P,S,N,T,C,21,n[55]),T=g(T,P,S,N,z,6,n[56]),N=g(N,T,P,S,te,10,n[57]),S=g(S,N,T,P,R,15,n[58]),P=g(P,S,N,T,q,21,n[59]),T=g(T,P,S,N,k,6,n[60]),N=g(N,T,P,S,G,10,n[61]),S=g(S,N,T,P,_,15,n[62]),P=g(P,S,N,T,M,21,n[63]),F[0]=F[0]+T|0,F[1]=F[1]+P|0,F[2]=F[2]+S|0,F[3]=F[3]+N|0},_doFinalize:function(){var i=this._data,a=i.words,m=this._nDataBytes*8,x=i.sigBytes*8;a[x>>>5]|=128<<24-x%32;var f=e.floor(m/4294967296),F=m;a[(x+64>>>9<<4)+15]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,a[(x+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,i.sigBytes=(a.length+1)*4,this._process();for(var b=this._hash,C=b.words,_=0;_<4;_++){var y=C[_];C[_]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}return b},clone:function(){var i=s.clone.call(this);return i._hash=this._hash.clone(),i}});function E(i,a,m,x,f,F,b){var C=i+(a&m|~a&x)+f+b;return(C<<F|C>>>32-F)+a}function l(i,a,m,x,f,F,b){var C=i+(a&x|m&~x)+f+b;return(C<<F|C>>>32-F)+a}function v(i,a,m,x,f,F,b){var C=i+(a^m^x)+f+b;return(C<<F|C>>>32-F)+a}function g(i,a,m,x,f,F,b){var C=i+(m^(a|~x))+f+b;return(C<<F|C>>>32-F)+a}p.MD5=s._createHelper(o),p.HmacMD5=s._createHmacHelper(o)})(Math),t.MD5})})(Bt)),Bt.exports}var At={exports:{}},ls=At.exports,mn;function _a(){return mn||(mn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ls,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=p.Hasher,s=e.algo,h=[],n=s.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,E){for(var l=this._hash.words,v=l[0],g=l[1],i=l[2],a=l[3],m=l[4],x=0;x<80;x++){if(x<16)h[x]=o[E+x]|0;else{var f=h[x-3]^h[x-8]^h[x-14]^h[x-16];h[x]=f<<1|f>>>31}var F=(v<<5|v>>>27)+m+h[x];x<20?F+=(g&i|~g&a)+1518500249:x<40?F+=(g^i^a)+1859775393:x<60?F+=(g&i|g&a|i&a)-1894007588:F+=(g^i^a)-899497514,m=a,a=i,i=g<<30|g>>>2,g=v,v=F}l[0]=l[0]+v|0,l[1]=l[1]+g|0,l[2]=l[2]+i|0,l[3]=l[3]+a|0,l[4]=l[4]+m|0},_doFinalize:function(){var o=this._data,E=o.words,l=this._nDataBytes*8,v=o.sigBytes*8;return E[v>>>5]|=128<<24-v%32,E[(v+64>>>9<<4)+14]=Math.floor(l/4294967296),E[(v+64>>>9<<4)+15]=l,o.sigBytes=E.length*4,this._process(),this._hash},clone:function(){var o=d.clone.call(this);return o._hash=this._hash.clone(),o}});e.SHA1=d._createHelper(n),e.HmacSHA1=d._createHmacHelper(n)})(),t.SHA1})})(At)),At.exports}var bt={exports:{}},ds=bt.exports,Cn;function Sr(){return Cn||(Cn=1,(function(r,u){(function(t,e){r.exports=e(ce())})(ds,function(t){return(function(e){var p=t,c=p.lib,d=c.WordArray,s=c.Hasher,h=p.algo,n=[],o=[];(function(){function v(m){for(var x=e.sqrt(m),f=2;f<=x;f++)if(!(m%f))return!1;return!0}function g(m){return(m-(m|0))*4294967296|0}for(var i=2,a=0;a<64;)v(i)&&(a<8&&(n[a]=g(e.pow(i,1/2))),o[a]=g(e.pow(i,1/3)),a++),i++})();var E=[],l=h.SHA256=s.extend({_doReset:function(){this._hash=new d.init(n.slice(0))},_doProcessBlock:function(v,g){for(var i=this._hash.words,a=i[0],m=i[1],x=i[2],f=i[3],F=i[4],b=i[5],C=i[6],_=i[7],y=0;y<64;y++){if(y<16)E[y]=v[g+y]|0;else{var k=E[y-15],D=(k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3,R=E[y-2],I=(R<<15|R>>>17)^(R<<13|R>>>19)^R>>>10;E[y]=D+E[y-7]+I+E[y-16]}var z=F&b^~F&C,M=a&m^a&x^m&x,U=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),G=(F<<26|F>>>6)^(F<<21|F>>>11)^(F<<7|F>>>25),Z=_+G+z+o[y]+E[y],q=U+M;_=C,C=b,b=F,F=f+Z|0,f=x,x=m,m=a,a=Z+q|0}i[0]=i[0]+a|0,i[1]=i[1]+m|0,i[2]=i[2]+x|0,i[3]=i[3]+f|0,i[4]=i[4]+F|0,i[5]=i[5]+b|0,i[6]=i[6]+C|0,i[7]=i[7]+_|0},_doFinalize:function(){var v=this._data,g=v.words,i=this._nDataBytes*8,a=v.sigBytes*8;return g[a>>>5]|=128<<24-a%32,g[(a+64>>>9<<4)+14]=e.floor(i/4294967296),g[(a+64>>>9<<4)+15]=i,v.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v}});p.SHA256=s._createHelper(l),p.HmacSHA256=s._createHmacHelper(l)})(Math),t.SHA256})})(bt)),bt.exports}var Dt={exports:{}},xs=Dt.exports,yn;function fs(){return yn||(yn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),Sr())})(xs,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=e.algo,s=d.SHA256,h=d.SHA224=s.extend({_doReset:function(){this._hash=new c.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var n=s._doFinalize.call(this);return n.sigBytes-=4,n}});e.SHA224=s._createHelper(h),e.HmacSHA224=s._createHmacHelper(h)})(),t.SHA224})})(Dt)),Dt.exports}var _t={exports:{}},ps=_t.exports,Fn;function wa(){return Fn||(Fn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr())})(ps,function(t){return(function(){var e=t,p=e.lib,c=p.Hasher,d=e.x64,s=d.Word,h=d.WordArray,n=e.algo;function o(){return s.create.apply(s,arguments)}var E=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],l=[];(function(){for(var g=0;g<80;g++)l[g]=o()})();var v=n.SHA512=c.extend({_doReset:function(){this._hash=new h.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(g,i){for(var a=this._hash.words,m=a[0],x=a[1],f=a[2],F=a[3],b=a[4],C=a[5],_=a[6],y=a[7],k=m.high,D=m.low,R=x.high,I=x.low,z=f.high,M=f.low,U=F.high,G=F.low,Z=b.high,q=b.low,H=C.high,te=C.low,T=_.high,P=_.low,S=y.high,N=y.low,W=k,V=D,Y=R,$=I,ae=z,fe=M,e0=U,De=G,ue=Z,ge=q,me=H,Ie=te,Xe=T,Ye=P,Qe=S,a0=N,Re=0;Re<80;Re++){var Se,_e,Ke=l[Re];if(Re<16)_e=Ke.high=g[i+Re*2]|0,Se=Ke.low=g[i+Re*2+1]|0;else{var u0=l[Re-15],j=u0.high,de=u0.low,Be=(j>>>1|de<<31)^(j>>>8|de<<24)^j>>>7,Ge=(de>>>1|j<<31)^(de>>>8|j<<24)^(de>>>7|j<<25),D0=l[Re-2],We=D0.high,pe=D0.low,_0=(We>>>19|pe<<13)^(We<<3|pe>>>29)^We>>>6,z0=(pe>>>19|We<<13)^(pe<<3|We>>>29)^(pe>>>6|We<<26),w0=l[Re-7],Ze=w0.high,S0=w0.low,k0=l[Re-16],I0=k0.high,L0=k0.low;Se=Ge+S0,_e=Be+Ze+(Se>>>0<Ge>>>0?1:0),Se=Se+z0,_e=_e+_0+(Se>>>0<z0>>>0?1:0),Se=Se+L0,_e=_e+I0+(Se>>>0<L0>>>0?1:0),Ke.high=_e,Ke.low=Se}var Z0=ue&me^~ue&Xe,J0=ge&Ie^~ge&Ye,O0=W&Y^W&ae^Y&ae,t0=V&$^V&fe^$&fe,i0=(W>>>28|V<<4)^(W<<30|V>>>2)^(W<<25|V>>>7),x0=(V>>>28|W<<4)^(V<<30|W>>>2)^(V<<25|W>>>7),f0=(ue>>>14|ge<<18)^(ue>>>18|ge<<14)^(ue<<23|ge>>>9),et=(ge>>>14|ue<<18)^(ge>>>18|ue<<14)^(ge<<23|ue>>>9),Te=E[Re],se=Te.high,y0=Te.low,Pe=a0+et,je=Qe+f0+(Pe>>>0<a0>>>0?1:0),Pe=Pe+J0,je=je+Z0+(Pe>>>0<J0>>>0?1:0),Pe=Pe+y0,je=je+se+(Pe>>>0<y0>>>0?1:0),Pe=Pe+Se,je=je+_e+(Pe>>>0<Se>>>0?1:0),Ae=x0+t0,qe=i0+O0+(Ae>>>0<x0>>>0?1:0);Qe=Xe,a0=Ye,Xe=me,Ye=Ie,me=ue,Ie=ge,ge=De+Pe|0,ue=e0+je+(ge>>>0<De>>>0?1:0)|0,e0=ae,De=fe,ae=Y,fe=$,Y=W,$=V,V=Pe+Ae|0,W=je+qe+(V>>>0<Pe>>>0?1:0)|0}D=m.low=D+V,m.high=k+W+(D>>>0<V>>>0?1:0),I=x.low=I+$,x.high=R+Y+(I>>>0<$>>>0?1:0),M=f.low=M+fe,f.high=z+ae+(M>>>0<fe>>>0?1:0),G=F.low=G+De,F.high=U+e0+(G>>>0<De>>>0?1:0),q=b.low=q+ge,b.high=Z+ue+(q>>>0<ge>>>0?1:0),te=C.low=te+Ie,C.high=H+me+(te>>>0<Ie>>>0?1:0),P=_.low=P+Ye,_.high=T+Xe+(P>>>0<Ye>>>0?1:0),N=y.low=N+a0,y.high=S+Qe+(N>>>0<a0>>>0?1:0)},_doFinalize:function(){var g=this._data,i=g.words,a=this._nDataBytes*8,m=g.sigBytes*8;i[m>>>5]|=128<<24-m%32,i[(m+128>>>10<<5)+30]=Math.floor(a/4294967296),i[(m+128>>>10<<5)+31]=a,g.sigBytes=i.length*4,this._process();var x=this._hash.toX32();return x},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g},blockSize:1024/32});e.SHA512=c._createHelper(v),e.HmacSHA512=c._createHmacHelper(v)})(),t.SHA512})})(_t)),_t.exports}var wt={exports:{}},hs=wt.exports,En;function vs(){return En||(En=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr(),wa())})(hs,function(t){return(function(){var e=t,p=e.x64,c=p.Word,d=p.WordArray,s=e.algo,h=s.SHA512,n=s.SHA384=h.extend({_doReset:function(){this._hash=new d.init([new c.init(3418070365,3238371032),new c.init(1654270250,914150663),new c.init(2438529370,812702999),new c.init(355462360,4144912697),new c.init(1731405415,4290775857),new c.init(2394180231,1750603025),new c.init(3675008525,1694076839),new c.init(1203062813,3204075428)])},_doFinalize:function(){var o=h._doFinalize.call(this);return o.sigBytes-=16,o}});e.SHA384=h._createHelper(n),e.HmacSHA384=h._createHmacHelper(n)})(),t.SHA384})})(wt)),wt.exports}var St={exports:{}},gs=St.exports,Bn;function ms(){return Bn||(Bn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr())})(gs,function(t){return(function(e){var p=t,c=p.lib,d=c.WordArray,s=c.Hasher,h=p.x64,n=h.Word,o=p.algo,E=[],l=[],v=[];(function(){for(var a=1,m=0,x=0;x<24;x++){E[a+5*m]=(x+1)*(x+2)/2%64;var f=m%5,F=(2*a+3*m)%5;a=f,m=F}for(var a=0;a<5;a++)for(var m=0;m<5;m++)l[a+5*m]=m+(2*a+3*m)%5*5;for(var b=1,C=0;C<24;C++){for(var _=0,y=0,k=0;k<7;k++){if(b&1){var D=(1<<k)-1;D<32?y^=1<<D:_^=1<<D-32}b&128?b=b<<1^113:b<<=1}v[C]=n.create(_,y)}})();var g=[];(function(){for(var a=0;a<25;a++)g[a]=n.create()})();var i=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],m=0;m<25;m++)a[m]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,m){for(var x=this._state,f=this.blockSize/2,F=0;F<f;F++){var b=a[m+2*F],C=a[m+2*F+1];b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360;var _=x[F];_.high^=C,_.low^=b}for(var y=0;y<24;y++){for(var k=0;k<5;k++){for(var D=0,R=0,I=0;I<5;I++){var _=x[k+5*I];D^=_.high,R^=_.low}var z=g[k];z.high=D,z.low=R}for(var k=0;k<5;k++)for(var M=g[(k+4)%5],U=g[(k+1)%5],G=U.high,Z=U.low,D=M.high^(G<<1|Z>>>31),R=M.low^(Z<<1|G>>>31),I=0;I<5;I++){var _=x[k+5*I];_.high^=D,_.low^=R}for(var q=1;q<25;q++){var D,R,_=x[q],H=_.high,te=_.low,T=E[q];T<32?(D=H<<T|te>>>32-T,R=te<<T|H>>>32-T):(D=te<<T-32|H>>>64-T,R=H<<T-32|te>>>64-T);var P=g[l[q]];P.high=D,P.low=R}var S=g[0],N=x[0];S.high=N.high,S.low=N.low;for(var k=0;k<5;k++)for(var I=0;I<5;I++){var q=k+5*I,_=x[q],W=g[q],V=g[(k+1)%5+5*I],Y=g[(k+2)%5+5*I];_.high=W.high^~V.high&Y.high,_.low=W.low^~V.low&Y.low}var _=x[0],$=v[y];_.high^=$.high,_.low^=$.low}},_doFinalize:function(){var a=this._data,m=a.words;this._nDataBytes*8;var x=a.sigBytes*8,f=this.blockSize*32;m[x>>>5]|=1<<24-x%32,m[(e.ceil((x+1)/f)*f>>>5)-1]|=128,a.sigBytes=m.length*4,this._process();for(var F=this._state,b=this.cfg.outputLength/8,C=b/8,_=[],y=0;y<C;y++){var k=F[y],D=k.high,R=k.low;D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,_.push(R),_.push(D)}return new d.init(_,b)},clone:function(){for(var a=s.clone.call(this),m=a._state=this._state.slice(0),x=0;x<25;x++)m[x]=m[x].clone();return a}});p.SHA3=s._createHelper(i),p.HmacSHA3=s._createHmacHelper(i)})(Math),t.SHA3})})(St)),St.exports}var kt={exports:{}},Cs=kt.exports,An;function ys(){return An||(An=1,(function(r,u){(function(t,e){r.exports=e(ce())})(Cs,function(t){/** @preserve
|
|
184
184
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
185
185
|
|
|
186
186
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -193,4 +193,4 @@ import{jsx as w,jsxs as ee,Fragment as at}from"react/jsx-runtime";import*as d0 f
|
|
|
193
193
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
194
194
|
* derived from CryptoJS.mode.CTR
|
|
195
195
|
* Jan Hruby jhruby.web@gmail.com
|
|
196
|
-
*/return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function p(s){if((s>>24&255)===255){var h=s>>16&255,n=s>>8&255,o=s&255;h===255?(h=0,n===255?(n=0,o===255?o=0:++o):++n):++h,s=0,s+=h<<16,s+=n<<8,s+=o}else s+=1<<24;return s}function c(s){return(s[0]=p(s[0]))===0&&(s[1]=p(s[1])),s}var d=e.Encryptor=e.extend({processBlock:function(s,h){var n=this._cipher,o=n.blockSize,E=this._iv,l=this._counter;E&&(l=this._counter=E.slice(0),this._iv=void 0),c(l);var v=l.slice(0);n.encryptBlock(v,0);for(var g=0;g<o;g++)s[h+g]^=v[g]}});return e.Decryptor=d,e})(),t.mode.CTRGladman})})(Lt)),Lt.exports}var Ot={exports:{}},Rs=Ot.exports,Rn;function Ns(){return Rn||(Rn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Rs,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),p=e.Encryptor=e.extend({processBlock:function(c,d){var s=this._cipher,h=s.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),s.encryptBlock(o,0);for(var E=0;E<h;E++)c[d+E]^=o[E]}});return e.Decryptor=p,e})(),t.mode.OFB})})(Ot)),Ot.exports}var Mt={exports:{}},Ts=Mt.exports,Nn;function Ps(){return Nn||(Nn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Ts,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(p,c){this._cipher.encryptBlock(p,c)}}),e.Decryptor=e.extend({processBlock:function(p,c){this._cipher.decryptBlock(p,c)}}),e})(),t.mode.ECB})})(Mt)),Mt.exports}var qt={exports:{}},zs=qt.exports,Tn;function Ls(){return Tn||(Tn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(zs,function(t){return t.pad.AnsiX923={pad:function(e,p){var c=e.sigBytes,d=p*4,s=d-c%d,h=c+s-1;e.clamp(),e.words[h>>>2]|=s<<24-h%4*8,e.sigBytes+=s},unpad:function(e){var p=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=p}},t.pad.Ansix923})})(qt)),qt.exports}var Ut={exports:{}},Os=Ut.exports,Pn;function Ms(){return Pn||(Pn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Os,function(t){return t.pad.Iso10126={pad:function(e,p){var c=p*4,d=c-e.sigBytes%c;e.concat(t.lib.WordArray.random(d-1)).concat(t.lib.WordArray.create([d<<24],1))},unpad:function(e){var p=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=p}},t.pad.Iso10126})})(Ut)),Ut.exports}var Ht={exports:{}},qs=Ht.exports,zn;function Us(){return zn||(zn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(qs,function(t){return t.pad.Iso97971={pad:function(e,p){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,p)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})})(Ht)),Ht.exports}var $t={exports:{}},Hs=$t.exports,Ln;function $s(){return Ln||(Ln=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Hs,function(t){return t.pad.ZeroPadding={pad:function(e,p){var c=p*4;e.clamp(),e.sigBytes+=c-(e.sigBytes%c||c)},unpad:function(e){for(var p=e.words,c=e.sigBytes-1,c=e.sigBytes-1;c>=0;c--)if(p[c>>>2]>>>24-c%4*8&255){e.sigBytes=c+1;break}}},t.pad.ZeroPadding})})($t)),$t.exports}var Wt={exports:{}},Ws=Wt.exports,On;function js(){return On||(On=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Ws,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})})(Wt)),Wt.exports}var jt={exports:{}},Vs=jt.exports,Mn;function Ks(){return Mn||(Mn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Vs,function(t){return(function(e){var p=t,c=p.lib,d=c.CipherParams,s=p.enc,h=s.Hex,n=p.format;n.Hex={stringify:function(o){return o.ciphertext.toString(h)},parse:function(o){var E=h.parse(o);return d.create({ciphertext:E})}}})(),t.format.Hex})})(jt)),jt.exports}var Vt={exports:{}},Gs=Vt.exports,qn;function Xs(){return qn||(qn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(Gs,function(t){return(function(){var e=t,p=e.lib,c=p.BlockCipher,d=e.algo,s=[],h=[],n=[],o=[],E=[],l=[],v=[],g=[],i=[],a=[];(function(){for(var f=[],F=0;F<256;F++)F<128?f[F]=F<<1:f[F]=F<<1^283;for(var b=0,C=0,F=0;F<256;F++){var _=C^C<<1^C<<2^C<<3^C<<4;_=_>>>8^_&255^99,s[b]=_,h[_]=b;var y=f[b],k=f[y],D=f[k],R=f[_]*257^_*16843008;n[b]=R<<24|R>>>8,o[b]=R<<16|R>>>16,E[b]=R<<8|R>>>24,l[b]=R;var R=D*16843009^k*65537^y*257^b*16843008;v[_]=R<<24|R>>>8,g[_]=R<<16|R>>>16,i[_]=R<<8|R>>>24,a[_]=R,b?(b=y^f[f[f[D^y]]],C^=f[f[C]]):b=C=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],x=d.AES=c.extend({_doReset:function(){var f;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,b=F.words,C=F.sigBytes/4,_=this._nRounds=C+6,y=(_+1)*4,k=this._keySchedule=[],D=0;D<y;D++)D<C?k[D]=b[D]:(f=k[D-1],D%C?C>6&&D%C==4&&(f=s[f>>>24]<<24|s[f>>>16&255]<<16|s[f>>>8&255]<<8|s[f&255]):(f=f<<8|f>>>24,f=s[f>>>24]<<24|s[f>>>16&255]<<16|s[f>>>8&255]<<8|s[f&255],f^=m[D/C|0]<<24),k[D]=k[D-C]^f);for(var R=this._invKeySchedule=[],I=0;I<y;I++){var D=y-I;if(I%4)var f=k[D];else var f=k[D-4];I<4||D<=4?R[I]=f:R[I]=v[s[f>>>24]]^g[s[f>>>16&255]]^i[s[f>>>8&255]]^a[s[f&255]]}}},encryptBlock:function(f,F){this._doCryptBlock(f,F,this._keySchedule,n,o,E,l,s)},decryptBlock:function(f,F){var b=f[F+1];f[F+1]=f[F+3],f[F+3]=b,this._doCryptBlock(f,F,this._invKeySchedule,v,g,i,a,h);var b=f[F+1];f[F+1]=f[F+3],f[F+3]=b},_doCryptBlock:function(f,F,b,C,_,y,k,D){for(var R=this._nRounds,I=f[F]^b[0],z=f[F+1]^b[1],M=f[F+2]^b[2],U=f[F+3]^b[3],G=4,Z=1;Z<R;Z++){var q=C[I>>>24]^_[z>>>16&255]^y[M>>>8&255]^k[U&255]^b[G++],H=C[z>>>24]^_[M>>>16&255]^y[U>>>8&255]^k[I&255]^b[G++],te=C[M>>>24]^_[U>>>16&255]^y[I>>>8&255]^k[z&255]^b[G++],T=C[U>>>24]^_[I>>>16&255]^y[z>>>8&255]^k[M&255]^b[G++];I=q,z=H,M=te,U=T}var q=(D[I>>>24]<<24|D[z>>>16&255]<<16|D[M>>>8&255]<<8|D[U&255])^b[G++],H=(D[z>>>24]<<24|D[M>>>16&255]<<16|D[U>>>8&255]<<8|D[I&255])^b[G++],te=(D[M>>>24]<<24|D[U>>>16&255]<<16|D[I>>>8&255]<<8|D[z&255])^b[G++],T=(D[U>>>24]<<24|D[I>>>16&255]<<16|D[z>>>8&255]<<8|D[M&255])^b[G++];f[F]=q,f[F+1]=H,f[F+2]=te,f[F+3]=T},keySize:256/32});e.AES=c._createHelper(x)})(),t.AES})})(Vt)),Vt.exports}var Kt={exports:{}},Ys=Kt.exports,Un;function Qs(){return Un||(Un=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(Ys,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=p.BlockCipher,s=e.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],o=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],E=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],v=s.DES=d.extend({_doReset:function(){for(var m=this._key,x=m.words,f=[],F=0;F<56;F++){var b=h[F]-1;f[F]=x[b>>>5]>>>31-b%32&1}for(var C=this._subKeys=[],_=0;_<16;_++){for(var y=C[_]=[],k=o[_],F=0;F<24;F++)y[F/6|0]|=f[(n[F]-1+k)%28]<<31-F%6,y[4+(F/6|0)]|=f[28+(n[F+24]-1+k)%28]<<31-F%6;y[0]=y[0]<<1|y[0]>>>31;for(var F=1;F<7;F++)y[F]=y[F]>>>(F-1)*4+3;y[7]=y[7]<<5|y[7]>>>27}for(var D=this._invSubKeys=[],F=0;F<16;F++)D[F]=C[15-F]},encryptBlock:function(m,x){this._doCryptBlock(m,x,this._subKeys)},decryptBlock:function(m,x){this._doCryptBlock(m,x,this._invSubKeys)},_doCryptBlock:function(m,x,f){this._lBlock=m[x],this._rBlock=m[x+1],g.call(this,4,252645135),g.call(this,16,65535),i.call(this,2,858993459),i.call(this,8,16711935),g.call(this,1,1431655765);for(var F=0;F<16;F++){for(var b=f[F],C=this._lBlock,_=this._rBlock,y=0,k=0;k<8;k++)y|=E[k][((_^b[k])&l[k])>>>0];this._lBlock=_,this._rBlock=C^y}var D=this._lBlock;this._lBlock=this._rBlock,this._rBlock=D,g.call(this,1,1431655765),i.call(this,8,16711935),i.call(this,2,858993459),g.call(this,16,65535),g.call(this,4,252645135),m[x]=this._lBlock,m[x+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function g(m,x){var f=(this._lBlock>>>m^this._rBlock)&x;this._rBlock^=f,this._lBlock^=f<<m}function i(m,x){var f=(this._rBlock>>>m^this._lBlock)&x;this._lBlock^=f,this._rBlock^=f<<m}e.DES=d._createHelper(v);var a=s.TripleDES=d.extend({_doReset:function(){var m=this._key,x=m.words;if(x.length!==2&&x.length!==4&&x.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var f=x.slice(0,2),F=x.length<4?x.slice(0,2):x.slice(2,4),b=x.length<6?x.slice(0,2):x.slice(4,6);this._des1=v.createEncryptor(c.create(f)),this._des2=v.createEncryptor(c.create(F)),this._des3=v.createEncryptor(c.create(b))},encryptBlock:function(m,x){this._des1.encryptBlock(m,x),this._des2.decryptBlock(m,x),this._des3.encryptBlock(m,x)},decryptBlock:function(m,x){this._des3.decryptBlock(m,x),this._des2.encryptBlock(m,x),this._des1.decryptBlock(m,x)},keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=d._createHelper(a)})(),t.TripleDES})})(Kt)),Kt.exports}var Gt={exports:{}},Zs=Gt.exports,Hn;function Js(){return Hn||(Hn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(Zs,function(t){return(function(){var e=t,p=e.lib,c=p.StreamCipher,d=e.algo,s=d.RC4=c.extend({_doReset:function(){for(var o=this._key,E=o.words,l=o.sigBytes,v=this._S=[],g=0;g<256;g++)v[g]=g;for(var g=0,i=0;g<256;g++){var a=g%l,m=E[a>>>2]>>>24-a%4*8&255;i=(i+v[g]+m)%256;var x=v[g];v[g]=v[i],v[i]=x}this._i=this._j=0},_doProcessBlock:function(o,E){o[E]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var o=this._S,E=this._i,l=this._j,v=0,g=0;g<4;g++){E=(E+1)%256,l=(l+o[E])%256;var i=o[E];o[E]=o[l],o[l]=i,v|=o[(o[E]+o[l])%256]<<24-g*8}return this._i=E,this._j=l,v}e.RC4=c._createHelper(s);var n=d.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)h.call(this)}});e.RC4Drop=c._createHelper(n)})(),t.RC4})})(Gt)),Gt.exports}var Xt={exports:{}},eu=Xt.exports,$n;function tu(){return $n||($n=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(eu,function(t){return(function(){var e=t,p=e.lib,c=p.StreamCipher,d=e.algo,s=[],h=[],n=[],o=d.Rabbit=c.extend({_doReset:function(){for(var l=this._key.words,v=this.cfg.iv,g=0;g<4;g++)l[g]=(l[g]<<8|l[g]>>>24)&16711935|(l[g]<<24|l[g]>>>8)&4278255360;var i=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],a=this._C=[l[2]<<16|l[2]>>>16,l[0]&4294901760|l[1]&65535,l[3]<<16|l[3]>>>16,l[1]&4294901760|l[2]&65535,l[0]<<16|l[0]>>>16,l[2]&4294901760|l[3]&65535,l[1]<<16|l[1]>>>16,l[3]&4294901760|l[0]&65535];this._b=0;for(var g=0;g<4;g++)E.call(this);for(var g=0;g<8;g++)a[g]^=i[g+4&7];if(v){var m=v.words,x=m[0],f=m[1],F=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,C=F>>>16|b&4294901760,_=b<<16|F&65535;a[0]^=F,a[1]^=C,a[2]^=b,a[3]^=_,a[4]^=F,a[5]^=C,a[6]^=b,a[7]^=_;for(var g=0;g<4;g++)E.call(this)}},_doProcessBlock:function(l,v){var g=this._X;E.call(this),s[0]=g[0]^g[5]>>>16^g[3]<<16,s[1]=g[2]^g[7]>>>16^g[5]<<16,s[2]=g[4]^g[1]>>>16^g[7]<<16,s[3]=g[6]^g[3]>>>16^g[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,l[v+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var l=this._X,v=this._C,g=0;g<8;g++)h[g]=v[g];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<h[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<h[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<h[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<h[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<h[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<h[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<h[6]>>>0?1:0)|0,this._b=v[7]>>>0<h[7]>>>0?1:0;for(var g=0;g<8;g++){var i=l[g]+v[g],a=i&65535,m=i>>>16,x=((a*a>>>17)+a*m>>>15)+m*m,f=((i&4294901760)*i|0)+((i&65535)*i|0);n[g]=x^f}l[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,l[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,l[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,l[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,l[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,l[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,l[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,l[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.Rabbit=c._createHelper(o)})(),t.Rabbit})})(Xt)),Xt.exports}var Yt={exports:{}},ru=Yt.exports,Wn;function nu(){return Wn||(Wn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(ru,function(t){return(function(){var e=t,p=e.lib,c=p.StreamCipher,d=e.algo,s=[],h=[],n=[],o=d.RabbitLegacy=c.extend({_doReset:function(){var l=this._key.words,v=this.cfg.iv,g=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],i=this._C=[l[2]<<16|l[2]>>>16,l[0]&4294901760|l[1]&65535,l[3]<<16|l[3]>>>16,l[1]&4294901760|l[2]&65535,l[0]<<16|l[0]>>>16,l[2]&4294901760|l[3]&65535,l[1]<<16|l[1]>>>16,l[3]&4294901760|l[0]&65535];this._b=0;for(var a=0;a<4;a++)E.call(this);for(var a=0;a<8;a++)i[a]^=g[a+4&7];if(v){var m=v.words,x=m[0],f=m[1],F=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,C=F>>>16|b&4294901760,_=b<<16|F&65535;i[0]^=F,i[1]^=C,i[2]^=b,i[3]^=_,i[4]^=F,i[5]^=C,i[6]^=b,i[7]^=_;for(var a=0;a<4;a++)E.call(this)}},_doProcessBlock:function(l,v){var g=this._X;E.call(this),s[0]=g[0]^g[5]>>>16^g[3]<<16,s[1]=g[2]^g[7]>>>16^g[5]<<16,s[2]=g[4]^g[1]>>>16^g[7]<<16,s[3]=g[6]^g[3]>>>16^g[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,l[v+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var l=this._X,v=this._C,g=0;g<8;g++)h[g]=v[g];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<h[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<h[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<h[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<h[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<h[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<h[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<h[6]>>>0?1:0)|0,this._b=v[7]>>>0<h[7]>>>0?1:0;for(var g=0;g<8;g++){var i=l[g]+v[g],a=i&65535,m=i>>>16,x=((a*a>>>17)+a*m>>>15)+m*m,f=((i&4294901760)*i|0)+((i&65535)*i|0);n[g]=x^f}l[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,l[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,l[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,l[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,l[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,l[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,l[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,l[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.RabbitLegacy=c._createHelper(o)})(),t.RabbitLegacy})})(Yt)),Yt.exports}var Qt={exports:{}},au=Qt.exports,jn;function iu(){return jn||(jn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(au,function(t){return(function(){var e=t,p=e.lib,c=p.BlockCipher,d=e.algo;const s=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],n=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function E(a,m){let x=m>>24&255,f=m>>16&255,F=m>>8&255,b=m&255,C=a.sbox[0][x]+a.sbox[1][f];return C=C^a.sbox[2][F],C=C+a.sbox[3][b],C}function l(a,m,x){let f=m,F=x,b;for(let C=0;C<s;++C)f=f^a.pbox[C],F=E(a,f)^F,b=f,f=F,F=b;return b=f,f=F,F=b,F=F^a.pbox[s],f=f^a.pbox[s+1],{left:f,right:F}}function v(a,m,x){let f=m,F=x,b;for(let C=s+1;C>1;--C)f=f^a.pbox[C],F=E(a,f)^F,b=f,f=F,F=b;return b=f,f=F,F=b,F=F^a.pbox[1],f=f^a.pbox[0],{left:f,right:F}}function g(a,m,x){for(let _=0;_<4;_++){a.sbox[_]=[];for(let y=0;y<256;y++)a.sbox[_][y]=n[_][y]}let f=0;for(let _=0;_<s+2;_++)a.pbox[_]=h[_]^m[f],f++,f>=x&&(f=0);let F=0,b=0,C=0;for(let _=0;_<s+2;_+=2)C=l(a,F,b),F=C.left,b=C.right,a.pbox[_]=F,a.pbox[_+1]=b;for(let _=0;_<4;_++)for(let y=0;y<256;y+=2)C=l(a,F,b),F=C.left,b=C.right,a.sbox[_][y]=F,a.sbox[_][y+1]=b;return!0}var i=d.Blowfish=c.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var a=this._keyPriorReset=this._key,m=a.words,x=a.sigBytes/4;g(o,m,x)}},encryptBlock:function(a,m){var x=l(o,a[m],a[m+1]);a[m]=x.left,a[m+1]=x.right},decryptBlock:function(a,m){var x=v(o,a[m],a[m+1]);a[m]=x.left,a[m+1]=x.right},blockSize:64/32,keySize:128/32,ivSize:64/32});e.Blowfish=c._createHelper(i)})(),t.Blowfish})})(Qt)),Qt.exports}var ou=vt.exports,Vn;function su(){return Vn||(Vn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr(),ns(),is(),T0(),us(),P0(),_a(),Sr(),fs(),wa(),vs(),ms(),ys(),kr(),Bs(),b0(),$e(),_s(),Ss(),Is(),Ns(),Ps(),Ls(),Ms(),Us(),$s(),js(),Ks(),Xs(),Qs(),Js(),tu(),nu(),iu())})(ou,function(t){return t})})(vt)),vt.exports}var uu=su();const Sa=Gn(uu);Sa.enc.Utf8.parse("1234567890123456");Sa.enc.Utf8.parse("1234567890123456");const Ir={login:{usernamePlaceholder:"\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordPlaceholder:"\u8F93\u5165\u5BC6\u7801",verifyCodePlaceholder:"\u8F93\u5165\u9A8C\u8BC1\u7801",usernameRequired:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordRequired:"\u8BF7\u8F93\u5165\u5BC6\u7801",verifyCodeRequired:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",submit:"\u767B\u5F55",errorFallback:"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"},register:{labels:{username:"\u7528\u6237\u540D",phone:"\u624B\u673A\u53F7",email:"\u90AE\u7BB1",password:"\u5BC6\u7801",confirmPassword:"\u786E\u8BA4\u5BC6\u7801",verifyCode:"\u9A8C\u8BC1\u7801"},placeholders:{username:"\u8F93\u5165\u7528\u6237\u540D\u5B57",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8F93\u5165\u9A8C\u8BC1\u7801"},required:{username:"\u8BF7\u8F93\u5165\u540D\u79F0",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8BF7\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"},cancel:"\u53D6\u6D88",submit:"\u6CE8\u518C",passwordConfirmMismatch:"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4!"}},cu={login:{usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",verifyCodePlaceholder:"Enter verification code",usernameRequired:"Please enter username",passwordRequired:"Please enter password",verifyCodeRequired:"Please enter verification code",submit:"Sign in",errorFallback:"Login failed, please try again later."},register:{labels:{username:"Username",phone:"Phone",email:"Email",password:"Password",confirmPassword:"Confirm password",verifyCode:"Verification code"},placeholders:{username:"Enter username",phone:"Enter phone number",email:"Enter email",password:"Enter password",confirmPassword:"Confirm password",verifyCode:"Enter verification code"},required:{username:"Please enter username",phone:"Please enter phone number",email:"Please enter email",password:"Please enter password",confirmPassword:"Please confirm password",verifyCode:"Please enter verification code"},cancel:"Cancel",submit:"Register",passwordConfirmMismatch:"Passwords do not match."}},lu={login:{usernamePlaceholder:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",passwordPlaceholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",verifyCodePlaceholder:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B",usernameRequired:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",passwordRequired:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",verifyCodeRequired:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submit:"\u30ED\u30B0\u30A4\u30F3",errorFallback:"\u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"},register:{labels:{username:"\u30E6\u30FC\u30B6\u30FC\u540D",phone:"\u96FB\u8A71\u756A\u53F7",email:"\u30E1\u30FC\u30EB",password:"\u30D1\u30B9\u30EF\u30FC\u30C9",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9"},placeholders:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B"},required:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",submit:"\u767B\u9332",passwordConfirmMismatch:"\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002"}},du={zh:Ir,en:cu,ja:lu};function xu(r,u){const t=du[r]??Ir;return u?{...t,...u}:t}const ka=we.createContext({locale:"zh",messages:Ir});function qu(){return we.useContext(ka)}function Uu({locale:r,messages:u,children:t}){const e=we.useMemo(()=>({locale:r,messages:xu(r,u)}),[r,u]);return we.createElement(ka.Provider,{value:e},t)}export{Da as D,Uu as L,ka as a,xu as g,qu as u,Mu as w};
|
|
196
|
+
*/return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function p(s){if((s>>24&255)===255){var h=s>>16&255,n=s>>8&255,o=s&255;h===255?(h=0,n===255?(n=0,o===255?o=0:++o):++n):++h,s=0,s+=h<<16,s+=n<<8,s+=o}else s+=1<<24;return s}function c(s){return(s[0]=p(s[0]))===0&&(s[1]=p(s[1])),s}var d=e.Encryptor=e.extend({processBlock:function(s,h){var n=this._cipher,o=n.blockSize,E=this._iv,l=this._counter;E&&(l=this._counter=E.slice(0),this._iv=void 0),c(l);var v=l.slice(0);n.encryptBlock(v,0);for(var g=0;g<o;g++)s[h+g]^=v[g]}});return e.Decryptor=d,e})(),t.mode.CTRGladman})})(Lt)),Lt.exports}var Ot={exports:{}},Rs=Ot.exports,Rn;function Ns(){return Rn||(Rn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Rs,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),p=e.Encryptor=e.extend({processBlock:function(c,d){var s=this._cipher,h=s.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),s.encryptBlock(o,0);for(var E=0;E<h;E++)c[d+E]^=o[E]}});return e.Decryptor=p,e})(),t.mode.OFB})})(Ot)),Ot.exports}var Mt={exports:{}},Ts=Mt.exports,Nn;function Ps(){return Nn||(Nn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Ts,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(p,c){this._cipher.encryptBlock(p,c)}}),e.Decryptor=e.extend({processBlock:function(p,c){this._cipher.decryptBlock(p,c)}}),e})(),t.mode.ECB})})(Mt)),Mt.exports}var qt={exports:{}},zs=qt.exports,Tn;function Ls(){return Tn||(Tn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(zs,function(t){return t.pad.AnsiX923={pad:function(e,p){var c=e.sigBytes,d=p*4,s=d-c%d,h=c+s-1;e.clamp(),e.words[h>>>2]|=s<<24-h%4*8,e.sigBytes+=s},unpad:function(e){var p=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=p}},t.pad.Ansix923})})(qt)),qt.exports}var Ut={exports:{}},Os=Ut.exports,Pn;function Ms(){return Pn||(Pn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Os,function(t){return t.pad.Iso10126={pad:function(e,p){var c=p*4,d=c-e.sigBytes%c;e.concat(t.lib.WordArray.random(d-1)).concat(t.lib.WordArray.create([d<<24],1))},unpad:function(e){var p=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=p}},t.pad.Iso10126})})(Ut)),Ut.exports}var Ht={exports:{}},qs=Ht.exports,zn;function Us(){return zn||(zn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(qs,function(t){return t.pad.Iso97971={pad:function(e,p){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,p)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})})(Ht)),Ht.exports}var $t={exports:{}},Hs=$t.exports,Ln;function $s(){return Ln||(Ln=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Hs,function(t){return t.pad.ZeroPadding={pad:function(e,p){var c=p*4;e.clamp(),e.sigBytes+=c-(e.sigBytes%c||c)},unpad:function(e){for(var p=e.words,c=e.sigBytes-1,c=e.sigBytes-1;c>=0;c--)if(p[c>>>2]>>>24-c%4*8&255){e.sigBytes=c+1;break}}},t.pad.ZeroPadding})})($t)),$t.exports}var Wt={exports:{}},Ws=Wt.exports,On;function js(){return On||(On=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Ws,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})})(Wt)),Wt.exports}var jt={exports:{}},Vs=jt.exports,Mn;function Ks(){return Mn||(Mn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),$e())})(Vs,function(t){return(function(e){var p=t,c=p.lib,d=c.CipherParams,s=p.enc,h=s.Hex,n=p.format;n.Hex={stringify:function(o){return o.ciphertext.toString(h)},parse:function(o){var E=h.parse(o);return d.create({ciphertext:E})}}})(),t.format.Hex})})(jt)),jt.exports}var Vt={exports:{}},Gs=Vt.exports,qn;function Xs(){return qn||(qn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(Gs,function(t){return(function(){var e=t,p=e.lib,c=p.BlockCipher,d=e.algo,s=[],h=[],n=[],o=[],E=[],l=[],v=[],g=[],i=[],a=[];(function(){for(var f=[],F=0;F<256;F++)F<128?f[F]=F<<1:f[F]=F<<1^283;for(var b=0,C=0,F=0;F<256;F++){var _=C^C<<1^C<<2^C<<3^C<<4;_=_>>>8^_&255^99,s[b]=_,h[_]=b;var y=f[b],k=f[y],D=f[k],R=f[_]*257^_*16843008;n[b]=R<<24|R>>>8,o[b]=R<<16|R>>>16,E[b]=R<<8|R>>>24,l[b]=R;var R=D*16843009^k*65537^y*257^b*16843008;v[_]=R<<24|R>>>8,g[_]=R<<16|R>>>16,i[_]=R<<8|R>>>24,a[_]=R,b?(b=y^f[f[f[D^y]]],C^=f[f[C]]):b=C=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],x=d.AES=c.extend({_doReset:function(){var f;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,b=F.words,C=F.sigBytes/4,_=this._nRounds=C+6,y=(_+1)*4,k=this._keySchedule=[],D=0;D<y;D++)D<C?k[D]=b[D]:(f=k[D-1],D%C?C>6&&D%C==4&&(f=s[f>>>24]<<24|s[f>>>16&255]<<16|s[f>>>8&255]<<8|s[f&255]):(f=f<<8|f>>>24,f=s[f>>>24]<<24|s[f>>>16&255]<<16|s[f>>>8&255]<<8|s[f&255],f^=m[D/C|0]<<24),k[D]=k[D-C]^f);for(var R=this._invKeySchedule=[],I=0;I<y;I++){var D=y-I;if(I%4)var f=k[D];else var f=k[D-4];I<4||D<=4?R[I]=f:R[I]=v[s[f>>>24]]^g[s[f>>>16&255]]^i[s[f>>>8&255]]^a[s[f&255]]}}},encryptBlock:function(f,F){this._doCryptBlock(f,F,this._keySchedule,n,o,E,l,s)},decryptBlock:function(f,F){var b=f[F+1];f[F+1]=f[F+3],f[F+3]=b,this._doCryptBlock(f,F,this._invKeySchedule,v,g,i,a,h);var b=f[F+1];f[F+1]=f[F+3],f[F+3]=b},_doCryptBlock:function(f,F,b,C,_,y,k,D){for(var R=this._nRounds,I=f[F]^b[0],z=f[F+1]^b[1],M=f[F+2]^b[2],U=f[F+3]^b[3],G=4,Z=1;Z<R;Z++){var q=C[I>>>24]^_[z>>>16&255]^y[M>>>8&255]^k[U&255]^b[G++],H=C[z>>>24]^_[M>>>16&255]^y[U>>>8&255]^k[I&255]^b[G++],te=C[M>>>24]^_[U>>>16&255]^y[I>>>8&255]^k[z&255]^b[G++],T=C[U>>>24]^_[I>>>16&255]^y[z>>>8&255]^k[M&255]^b[G++];I=q,z=H,M=te,U=T}var q=(D[I>>>24]<<24|D[z>>>16&255]<<16|D[M>>>8&255]<<8|D[U&255])^b[G++],H=(D[z>>>24]<<24|D[M>>>16&255]<<16|D[U>>>8&255]<<8|D[I&255])^b[G++],te=(D[M>>>24]<<24|D[U>>>16&255]<<16|D[I>>>8&255]<<8|D[z&255])^b[G++],T=(D[U>>>24]<<24|D[I>>>16&255]<<16|D[z>>>8&255]<<8|D[M&255])^b[G++];f[F]=q,f[F+1]=H,f[F+2]=te,f[F+3]=T},keySize:256/32});e.AES=c._createHelper(x)})(),t.AES})})(Vt)),Vt.exports}var Kt={exports:{}},Ys=Kt.exports,Un;function Qs(){return Un||(Un=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(Ys,function(t){return(function(){var e=t,p=e.lib,c=p.WordArray,d=p.BlockCipher,s=e.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],o=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],E=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],v=s.DES=d.extend({_doReset:function(){for(var m=this._key,x=m.words,f=[],F=0;F<56;F++){var b=h[F]-1;f[F]=x[b>>>5]>>>31-b%32&1}for(var C=this._subKeys=[],_=0;_<16;_++){for(var y=C[_]=[],k=o[_],F=0;F<24;F++)y[F/6|0]|=f[(n[F]-1+k)%28]<<31-F%6,y[4+(F/6|0)]|=f[28+(n[F+24]-1+k)%28]<<31-F%6;y[0]=y[0]<<1|y[0]>>>31;for(var F=1;F<7;F++)y[F]=y[F]>>>(F-1)*4+3;y[7]=y[7]<<5|y[7]>>>27}for(var D=this._invSubKeys=[],F=0;F<16;F++)D[F]=C[15-F]},encryptBlock:function(m,x){this._doCryptBlock(m,x,this._subKeys)},decryptBlock:function(m,x){this._doCryptBlock(m,x,this._invSubKeys)},_doCryptBlock:function(m,x,f){this._lBlock=m[x],this._rBlock=m[x+1],g.call(this,4,252645135),g.call(this,16,65535),i.call(this,2,858993459),i.call(this,8,16711935),g.call(this,1,1431655765);for(var F=0;F<16;F++){for(var b=f[F],C=this._lBlock,_=this._rBlock,y=0,k=0;k<8;k++)y|=E[k][((_^b[k])&l[k])>>>0];this._lBlock=_,this._rBlock=C^y}var D=this._lBlock;this._lBlock=this._rBlock,this._rBlock=D,g.call(this,1,1431655765),i.call(this,8,16711935),i.call(this,2,858993459),g.call(this,16,65535),g.call(this,4,252645135),m[x]=this._lBlock,m[x+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function g(m,x){var f=(this._lBlock>>>m^this._rBlock)&x;this._rBlock^=f,this._lBlock^=f<<m}function i(m,x){var f=(this._rBlock>>>m^this._lBlock)&x;this._lBlock^=f,this._rBlock^=f<<m}e.DES=d._createHelper(v);var a=s.TripleDES=d.extend({_doReset:function(){var m=this._key,x=m.words;if(x.length!==2&&x.length!==4&&x.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var f=x.slice(0,2),F=x.length<4?x.slice(0,2):x.slice(2,4),b=x.length<6?x.slice(0,2):x.slice(4,6);this._des1=v.createEncryptor(c.create(f)),this._des2=v.createEncryptor(c.create(F)),this._des3=v.createEncryptor(c.create(b))},encryptBlock:function(m,x){this._des1.encryptBlock(m,x),this._des2.decryptBlock(m,x),this._des3.encryptBlock(m,x)},decryptBlock:function(m,x){this._des3.decryptBlock(m,x),this._des2.encryptBlock(m,x),this._des1.decryptBlock(m,x)},keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=d._createHelper(a)})(),t.TripleDES})})(Kt)),Kt.exports}var Gt={exports:{}},Zs=Gt.exports,Hn;function Js(){return Hn||(Hn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(Zs,function(t){return(function(){var e=t,p=e.lib,c=p.StreamCipher,d=e.algo,s=d.RC4=c.extend({_doReset:function(){for(var o=this._key,E=o.words,l=o.sigBytes,v=this._S=[],g=0;g<256;g++)v[g]=g;for(var g=0,i=0;g<256;g++){var a=g%l,m=E[a>>>2]>>>24-a%4*8&255;i=(i+v[g]+m)%256;var x=v[g];v[g]=v[i],v[i]=x}this._i=this._j=0},_doProcessBlock:function(o,E){o[E]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var o=this._S,E=this._i,l=this._j,v=0,g=0;g<4;g++){E=(E+1)%256,l=(l+o[E])%256;var i=o[E];o[E]=o[l],o[l]=i,v|=o[(o[E]+o[l])%256]<<24-g*8}return this._i=E,this._j=l,v}e.RC4=c._createHelper(s);var n=d.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)h.call(this)}});e.RC4Drop=c._createHelper(n)})(),t.RC4})})(Gt)),Gt.exports}var Xt={exports:{}},eu=Xt.exports,$n;function tu(){return $n||($n=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(eu,function(t){return(function(){var e=t,p=e.lib,c=p.StreamCipher,d=e.algo,s=[],h=[],n=[],o=d.Rabbit=c.extend({_doReset:function(){for(var l=this._key.words,v=this.cfg.iv,g=0;g<4;g++)l[g]=(l[g]<<8|l[g]>>>24)&16711935|(l[g]<<24|l[g]>>>8)&4278255360;var i=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],a=this._C=[l[2]<<16|l[2]>>>16,l[0]&4294901760|l[1]&65535,l[3]<<16|l[3]>>>16,l[1]&4294901760|l[2]&65535,l[0]<<16|l[0]>>>16,l[2]&4294901760|l[3]&65535,l[1]<<16|l[1]>>>16,l[3]&4294901760|l[0]&65535];this._b=0;for(var g=0;g<4;g++)E.call(this);for(var g=0;g<8;g++)a[g]^=i[g+4&7];if(v){var m=v.words,x=m[0],f=m[1],F=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,C=F>>>16|b&4294901760,_=b<<16|F&65535;a[0]^=F,a[1]^=C,a[2]^=b,a[3]^=_,a[4]^=F,a[5]^=C,a[6]^=b,a[7]^=_;for(var g=0;g<4;g++)E.call(this)}},_doProcessBlock:function(l,v){var g=this._X;E.call(this),s[0]=g[0]^g[5]>>>16^g[3]<<16,s[1]=g[2]^g[7]>>>16^g[5]<<16,s[2]=g[4]^g[1]>>>16^g[7]<<16,s[3]=g[6]^g[3]>>>16^g[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,l[v+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var l=this._X,v=this._C,g=0;g<8;g++)h[g]=v[g];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<h[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<h[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<h[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<h[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<h[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<h[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<h[6]>>>0?1:0)|0,this._b=v[7]>>>0<h[7]>>>0?1:0;for(var g=0;g<8;g++){var i=l[g]+v[g],a=i&65535,m=i>>>16,x=((a*a>>>17)+a*m>>>15)+m*m,f=((i&4294901760)*i|0)+((i&65535)*i|0);n[g]=x^f}l[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,l[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,l[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,l[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,l[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,l[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,l[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,l[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.Rabbit=c._createHelper(o)})(),t.Rabbit})})(Xt)),Xt.exports}var Yt={exports:{}},ru=Yt.exports,Wn;function nu(){return Wn||(Wn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(ru,function(t){return(function(){var e=t,p=e.lib,c=p.StreamCipher,d=e.algo,s=[],h=[],n=[],o=d.RabbitLegacy=c.extend({_doReset:function(){var l=this._key.words,v=this.cfg.iv,g=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],i=this._C=[l[2]<<16|l[2]>>>16,l[0]&4294901760|l[1]&65535,l[3]<<16|l[3]>>>16,l[1]&4294901760|l[2]&65535,l[0]<<16|l[0]>>>16,l[2]&4294901760|l[3]&65535,l[1]<<16|l[1]>>>16,l[3]&4294901760|l[0]&65535];this._b=0;for(var a=0;a<4;a++)E.call(this);for(var a=0;a<8;a++)i[a]^=g[a+4&7];if(v){var m=v.words,x=m[0],f=m[1],F=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,C=F>>>16|b&4294901760,_=b<<16|F&65535;i[0]^=F,i[1]^=C,i[2]^=b,i[3]^=_,i[4]^=F,i[5]^=C,i[6]^=b,i[7]^=_;for(var a=0;a<4;a++)E.call(this)}},_doProcessBlock:function(l,v){var g=this._X;E.call(this),s[0]=g[0]^g[5]>>>16^g[3]<<16,s[1]=g[2]^g[7]>>>16^g[5]<<16,s[2]=g[4]^g[1]>>>16^g[7]<<16,s[3]=g[6]^g[3]>>>16^g[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,l[v+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var l=this._X,v=this._C,g=0;g<8;g++)h[g]=v[g];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<h[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<h[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<h[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<h[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<h[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<h[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<h[6]>>>0?1:0)|0,this._b=v[7]>>>0<h[7]>>>0?1:0;for(var g=0;g<8;g++){var i=l[g]+v[g],a=i&65535,m=i>>>16,x=((a*a>>>17)+a*m>>>15)+m*m,f=((i&4294901760)*i|0)+((i&65535)*i|0);n[g]=x^f}l[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,l[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,l[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,l[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,l[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,l[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,l[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,l[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.RabbitLegacy=c._createHelper(o)})(),t.RabbitLegacy})})(Yt)),Yt.exports}var Qt={exports:{}},au=Qt.exports,jn;function iu(){return jn||(jn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),T0(),P0(),b0(),$e())})(au,function(t){return(function(){var e=t,p=e.lib,c=p.BlockCipher,d=e.algo;const s=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],n=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function E(a,m){let x=m>>24&255,f=m>>16&255,F=m>>8&255,b=m&255,C=a.sbox[0][x]+a.sbox[1][f];return C=C^a.sbox[2][F],C=C+a.sbox[3][b],C}function l(a,m,x){let f=m,F=x,b;for(let C=0;C<s;++C)f=f^a.pbox[C],F=E(a,f)^F,b=f,f=F,F=b;return b=f,f=F,F=b,F=F^a.pbox[s],f=f^a.pbox[s+1],{left:f,right:F}}function v(a,m,x){let f=m,F=x,b;for(let C=s+1;C>1;--C)f=f^a.pbox[C],F=E(a,f)^F,b=f,f=F,F=b;return b=f,f=F,F=b,F=F^a.pbox[1],f=f^a.pbox[0],{left:f,right:F}}function g(a,m,x){for(let _=0;_<4;_++){a.sbox[_]=[];for(let y=0;y<256;y++)a.sbox[_][y]=n[_][y]}let f=0;for(let _=0;_<s+2;_++)a.pbox[_]=h[_]^m[f],f++,f>=x&&(f=0);let F=0,b=0,C=0;for(let _=0;_<s+2;_+=2)C=l(a,F,b),F=C.left,b=C.right,a.pbox[_]=F,a.pbox[_+1]=b;for(let _=0;_<4;_++)for(let y=0;y<256;y+=2)C=l(a,F,b),F=C.left,b=C.right,a.sbox[_][y]=F,a.sbox[_][y+1]=b;return!0}var i=d.Blowfish=c.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var a=this._keyPriorReset=this._key,m=a.words,x=a.sigBytes/4;g(o,m,x)}},encryptBlock:function(a,m){var x=l(o,a[m],a[m+1]);a[m]=x.left,a[m+1]=x.right},decryptBlock:function(a,m){var x=v(o,a[m],a[m+1]);a[m]=x.left,a[m+1]=x.right},blockSize:64/32,keySize:128/32,ivSize:64/32});e.Blowfish=c._createHelper(i)})(),t.Blowfish})})(Qt)),Qt.exports}var ou=vt.exports,Vn;function su(){return Vn||(Vn=1,(function(r,u){(function(t,e,p){r.exports=e(ce(),rr(),ns(),is(),T0(),us(),P0(),_a(),Sr(),fs(),wa(),vs(),ms(),ys(),kr(),Bs(),b0(),$e(),_s(),Ss(),Is(),Ns(),Ps(),Ls(),Ms(),Us(),$s(),js(),Ks(),Xs(),Qs(),Js(),tu(),nu(),iu())})(ou,function(t){return t})})(vt)),vt.exports}var uu=su();const Sa=ra(uu);Sa.enc.Utf8.parse("1234567890123456");Sa.enc.Utf8.parse("1234567890123456");const Ir={login:{usernamePlaceholder:"\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordPlaceholder:"\u8F93\u5165\u5BC6\u7801",verifyCodePlaceholder:"\u8F93\u5165\u9A8C\u8BC1\u7801",usernameRequired:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordRequired:"\u8BF7\u8F93\u5165\u5BC6\u7801",verifyCodeRequired:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",submit:"\u767B\u5F55",errorFallback:"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"},register:{labels:{username:"\u7528\u6237\u540D",phone:"\u624B\u673A\u53F7",email:"\u90AE\u7BB1",password:"\u5BC6\u7801",confirmPassword:"\u786E\u8BA4\u5BC6\u7801",verifyCode:"\u9A8C\u8BC1\u7801"},placeholders:{username:"\u8F93\u5165\u7528\u6237\u540D\u5B57",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8F93\u5165\u9A8C\u8BC1\u7801"},required:{username:"\u8BF7\u8F93\u5165\u540D\u79F0",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8BF7\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"},cancel:"\u53D6\u6D88",submit:"\u6CE8\u518C",passwordConfirmMismatch:"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4!"}},cu={login:{usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",verifyCodePlaceholder:"Enter verification code",usernameRequired:"Please enter username",passwordRequired:"Please enter password",verifyCodeRequired:"Please enter verification code",submit:"Sign in",errorFallback:"Login failed, please try again later."},register:{labels:{username:"Username",phone:"Phone",email:"Email",password:"Password",confirmPassword:"Confirm password",verifyCode:"Verification code"},placeholders:{username:"Enter username",phone:"Enter phone number",email:"Enter email",password:"Enter password",confirmPassword:"Confirm password",verifyCode:"Enter verification code"},required:{username:"Please enter username",phone:"Please enter phone number",email:"Please enter email",password:"Please enter password",confirmPassword:"Please confirm password",verifyCode:"Please enter verification code"},cancel:"Cancel",submit:"Register",passwordConfirmMismatch:"Passwords do not match."}},lu={login:{usernamePlaceholder:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",passwordPlaceholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",verifyCodePlaceholder:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B",usernameRequired:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",passwordRequired:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",verifyCodeRequired:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submit:"\u30ED\u30B0\u30A4\u30F3",errorFallback:"\u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"},register:{labels:{username:"\u30E6\u30FC\u30B6\u30FC\u540D",phone:"\u96FB\u8A71\u756A\u53F7",email:"\u30E1\u30FC\u30EB",password:"\u30D1\u30B9\u30EF\u30FC\u30C9",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9"},placeholders:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B"},required:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",submit:"\u767B\u9332",passwordConfirmMismatch:"\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002"}},du={zh:Ir,en:cu,ja:lu};function xu(r,u){const t=du[r]??Ir;return u?{...t,...u}:t}const ka=we.createContext({locale:"zh",messages:Ir});function Uu(){return we.useContext(ka)}function Hu({locale:r,messages:u,children:t}){const e=we.useMemo(()=>({locale:r,messages:xu(r,u)}),[r,u]);return we.createElement(ka.Provider,{value:e},t)}export{Da as D,Hu as L,ka as a,xu as g,Uu as u,qu as w};
|