@intent-hq/web 2.310.3 → 2.310.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{lqs_HYEw.js → 1JT3Hvwn.js} +1 -1
- package/web/app/immutable/chunks/{Bpofk5Ge.js → 3XXjzHG3.js} +1 -1
- package/web/app/immutable/chunks/{BhWJ-mUa.js → 5lKAUCkv.js} +1 -1
- package/web/app/immutable/chunks/{C72YfPmr.js → 5mT5QCH0.js} +2 -2
- package/web/app/immutable/chunks/{WaYTk5P-.js → 9Pt4_UCK.js} +1 -1
- package/web/app/immutable/chunks/{DpbPS--w.js → AdEBgfMz.js} +1 -1
- package/web/app/immutable/chunks/{C87YV7yB.js → B-BihkPv.js} +4 -4
- package/web/app/immutable/chunks/{Dr9n9KYD.js → B31DSOXx.js} +1 -1
- package/web/app/immutable/chunks/{FTZaXc8b.js → B6i2HXcd.js} +1 -1
- package/web/app/immutable/chunks/{PR2rc_KV.js → B72MiU4f.js} +2 -2
- package/web/app/immutable/chunks/{_GDZ01fB.js → B7hiL__h.js} +1 -1
- package/web/app/immutable/chunks/{jU5_8m_P.js → B939T8ee.js} +1 -1
- package/web/app/immutable/chunks/{h6Xb9K7f.js → BAFIBxJn.js} +1 -1
- package/web/app/immutable/chunks/{D5gGhPeB.js → BHfh0Z1C.js} +1 -1
- package/web/app/immutable/chunks/{DICP2Iar.js → BI8wduE-.js} +1 -1
- package/web/app/immutable/chunks/{CUMlGGeg.js → BIU8-rPj.js} +1 -1
- package/web/app/immutable/chunks/{B7s4-XTz.js → BIiORJal.js} +4 -4
- package/web/app/immutable/chunks/{C_tu278J.js → BJKiZYvw.js} +1 -1
- package/web/app/immutable/chunks/{oEWQ7BWN.js → BNFZ_TXS.js} +1 -1
- package/web/app/immutable/chunks/{DWqMBuHP.js → BNXdIr_O.js} +1 -1
- package/web/app/immutable/chunks/{CcUMYVEM.js → BNsTgNha.js} +1 -1
- package/web/app/immutable/chunks/{DAmyup4Q.js → BPO8n77e.js} +2 -2
- package/web/app/immutable/chunks/{DLTK7s08.js → BR2WgFAY.js} +1 -1
- package/web/app/immutable/chunks/{BI_SwxaN.js → BRD3o4b9.js} +1 -1
- package/web/app/immutable/chunks/{YqBgboHy.js → BTjbZv4v.js} +1 -1
- package/web/app/immutable/chunks/{Dx4xDmS-.js → BVaDxTbw.js} +1 -1
- package/web/app/immutable/chunks/{kHJUvxPR.js → BXYHRMR5.js} +1 -1
- package/web/app/immutable/chunks/{B1s3oEqm.js → BZC0V7Vm.js} +2 -2
- package/web/app/immutable/chunks/{ry72TFIz.js → BZCsjPbo.js} +2 -2
- package/web/app/immutable/chunks/{X-Frg4xt.js → BdmhOhOr.js} +1 -1
- package/web/app/immutable/chunks/{BrV7vQ-C.js → BhEmEnro.js} +1 -1
- package/web/app/immutable/chunks/{CeijcUhC.js → BlOiaItm.js} +1 -1
- package/web/app/immutable/chunks/{Bhw4MKUW.js → BoADm99c.js} +1 -1
- package/web/app/immutable/chunks/{xPs_63iv.js → BqgH4F9Q.js} +1 -1
- package/web/app/immutable/chunks/{BHnD9zfx.js → BrrIbgjH.js} +1 -1
- package/web/app/immutable/chunks/{CPi1vTiT.js → BttTHeg3.js} +2 -2
- package/web/app/immutable/chunks/{NHQiGgbv.js → BwF5HhIs.js} +1 -1
- package/web/app/immutable/chunks/{ibC6Wlul.js → Bx1ulVFG.js} +1 -1
- package/web/app/immutable/chunks/{BYxB_o2p.js → BxV9jjnn.js} +1 -1
- package/web/app/immutable/chunks/{Dj7a19mR.js → C1CC06Ey.js} +1 -1
- package/web/app/immutable/chunks/{Q48HTbqK.js → C501DddF.js} +1 -1
- package/web/app/immutable/chunks/{wh3Y68il.js → C5AqVWW_.js} +1 -1
- package/web/app/immutable/chunks/{DR30pTuY.js → C5G0q6V9.js} +3 -3
- package/web/app/immutable/chunks/{CrdTEIp7.js → C5egmBj1.js} +1 -1
- package/web/app/immutable/chunks/{fyjA8lOg.js → C6Gqnk62.js} +1 -1
- package/web/app/immutable/chunks/{DAhqFWJw.js → C8qwdo8h.js} +1 -1
- package/web/app/immutable/chunks/{D2ffSQ9J.js → CAiJGbLo.js} +1 -1
- package/web/app/immutable/chunks/{DH-0T9oO.js → CF7FcFf9.js} +1 -1
- package/web/app/immutable/chunks/{CnIb6mve.js → CGnNcckt.js} +1 -1
- package/web/app/immutable/chunks/{B2JLNOy6.js → CHJhHJ8c.js} +1 -1
- package/web/app/immutable/chunks/{Bd0N6Q84.js → CK49eRBK.js} +1 -1
- package/web/app/immutable/chunks/{DhDem5lD.js → CMbRA5qt.js} +1 -1
- package/web/app/immutable/chunks/{BDPXN-l5.js → CNC6BMwU.js} +1 -1
- package/web/app/immutable/chunks/{DHf042m3.js → CPIehcPz.js} +1 -1
- package/web/app/immutable/chunks/{OEEtadht.js → CR2tijk0.js} +1 -1
- package/web/app/immutable/chunks/{D5XrjD_m.js → CR_mHSu4.js} +1 -1
- package/web/app/immutable/chunks/{DStbB4cJ.js → CSxLglEe.js} +1 -1
- package/web/app/immutable/chunks/{Cstq9SM5.js → CUzjOAua.js} +1 -1
- package/web/app/immutable/chunks/{BENBNSN7.js → CVH8gLyV.js} +1 -1
- package/web/app/immutable/chunks/{BakMVsPT.js → CVmHwhPc.js} +2 -2
- package/web/app/immutable/chunks/{bBO0iA4_.js → CYjqtZFX.js} +1 -1
- package/web/app/immutable/chunks/{Ci2_N-bK.js → CYpaiDaV.js} +1 -1
- package/web/app/immutable/chunks/{D7ePuUtq.js → CaBSUvc-.js} +1 -1
- package/web/app/immutable/chunks/{D2ojbL4J.js → CkwlIwj7.js} +1 -1
- package/web/app/immutable/chunks/{7xAw-BT0.js → CmaYPN9s.js} +1 -1
- package/web/app/immutable/chunks/{C3nOF7W6.js → CmqlgQan.js} +1 -1
- package/web/app/immutable/chunks/{CuzanJ4G.js → CoW30tTg.js} +1 -1
- package/web/app/immutable/chunks/{lG67Zx5D.js → CqR3T6Kd.js} +3 -3
- package/web/app/immutable/chunks/{DJ4er0zy.js → CrR4jweF.js} +1 -1
- package/web/app/immutable/chunks/{CQI-dvtu.js → CrWQjKj_.js} +3 -3
- package/web/app/immutable/chunks/{BGcL9rs9.js → CroKe-wc.js} +1 -1
- package/web/app/immutable/chunks/{YDWB9C4j.js → CsQkh7b3.js} +1 -1
- package/web/app/immutable/chunks/{CTaTQq2B.js → CvCSRZBy.js} +1 -1
- package/web/app/immutable/chunks/{BUlPMLws.js → CvOoeN0T.js} +1 -1
- package/web/app/immutable/chunks/{Ccfa6x-j.js → CxJcdmSd.js} +1 -1
- package/web/app/immutable/chunks/{DV_gHrZ4.js → D-0ZUYIk.js} +1 -1
- package/web/app/immutable/chunks/{Bn-4GS40.js → D-4XO7pN.js} +2 -2
- package/web/app/immutable/chunks/{CHFvnHJS.js → D4qyaNt3.js} +1 -1
- package/web/app/immutable/chunks/{iX-41BqF.js → D4z4ooVN.js} +1 -1
- package/web/app/immutable/chunks/{CVyfvlNb.js → DAg5pMRd.js} +1 -1
- package/web/app/immutable/chunks/{BmpVZmDT.js → DCuJDyNf.js} +1 -1
- package/web/app/immutable/chunks/{ap51LBWo.js → DI608D-i.js} +1 -1
- package/web/app/immutable/chunks/{EF47gh5F.js → DIiJKmmV.js} +1 -1
- package/web/app/immutable/chunks/{B53WwE3a.js → DJ1cdtAZ.js} +1 -1
- package/web/app/immutable/chunks/{DxBZwGJl.js → DKr5x03c.js} +1 -1
- package/web/app/immutable/chunks/{cMysCMc_.js → DL-yibpy.js} +1 -1
- package/web/app/immutable/chunks/{CK1qXB1I.js → DNlvdlMF.js} +1 -1
- package/web/app/immutable/chunks/{D9RktmhG.js → DPXd3fU6.js} +1 -1
- package/web/app/immutable/chunks/{Sd4DhpzB.js → DR0NE2_C.js} +1 -1
- package/web/app/immutable/chunks/{lh2cjQS1.js → DTCRTrPV.js} +1 -1
- package/web/app/immutable/chunks/{CiPifYNB.js → DTj6_2dz.js} +1 -1
- package/web/app/immutable/chunks/{BfZK-g4H.js → DXMKw2so.js} +1 -1
- package/web/app/immutable/chunks/{ClKsLSpN.js → DYZ36vW7.js} +1 -1
- package/web/app/immutable/chunks/{aloh9OcN.js → DeYZGX2s.js} +1 -1
- package/web/app/immutable/chunks/{lb9Uy5lM.js → Df6f-k6w.js} +1 -1
- package/web/app/immutable/chunks/{BRvgBsbx.js → Dgaq6o9Y.js} +1 -1
- package/web/app/immutable/chunks/{2rlMb19F.js → Dkq5Coq_.js} +1 -1
- package/web/app/immutable/chunks/{DM80xiYc.js → DmX5G2mi.js} +1 -1
- package/web/app/immutable/chunks/{BpXeqZkK.js → Dmhbab3K.js} +6 -6
- package/web/app/immutable/chunks/{C-1nTNwc.js → Dp1Yxyun.js} +1 -1
- package/web/app/immutable/chunks/{BP6OqM9o.js → DrZyb3e_.js} +1 -1
- package/web/app/immutable/chunks/{BFXzH5IE.js → DsgnOGWk.js} +1 -1
- package/web/app/immutable/chunks/{DPWD_Z0m.js → DxdqGRL1.js} +1 -1
- package/web/app/immutable/chunks/{CEXJj_TX.js → DzUxh_ps.js} +1 -1
- package/web/app/immutable/chunks/{Cl430GWg.js → ENpFvA2b.js} +5 -5
- package/web/app/immutable/chunks/{D3lH_sy-.js → F27tZ3Lo.js} +1 -1
- package/web/app/immutable/chunks/{B_mbXOka.js → IeOyBdV1.js} +1 -1
- package/web/app/immutable/chunks/{dpdLM1Cx.js → NtwUb2T_.js} +1 -1
- package/web/app/immutable/chunks/{ryFwnMjp.js → PtwmLAp4.js} +1 -1
- package/web/app/immutable/chunks/{B7VncZW5.js → WU_Tlex0.js} +1 -1
- package/web/app/immutable/chunks/{DqPGIq9m.js → _e7d73p6.js} +1 -1
- package/web/app/immutable/chunks/{BMMFveB2.js → ckbdI_sO.js} +6 -6
- package/web/app/immutable/chunks/{D9zTmP-H.js → eVx-WSd7.js} +1 -1
- package/web/app/immutable/chunks/{CLEySo6k.js → flwRPGfq.js} +1 -1
- package/web/app/immutable/chunks/{CNxOtEoC.js → iCXhZwLL.js} +1 -1
- package/web/app/immutable/chunks/{Dn1Hge9W.js → iU779rtf.js} +1 -1
- package/web/app/immutable/chunks/{CSiG9Hvp.js → lH4z0y-c.js} +1 -1
- package/web/app/immutable/chunks/{uOEty9O6.js → nRjRQ-e8.js} +1 -1
- package/web/app/immutable/chunks/{BfPWAh77.js → p-l1WyaF.js} +1 -1
- package/web/app/immutable/chunks/{DPjuFI2m.js → r8JiSeiY.js} +1 -1
- package/web/app/immutable/chunks/{Cd_IIsl2.js → uI2-sxxt.js} +1 -1
- package/web/app/immutable/chunks/{D-QdqmeZ.js → uK-hZG4d.js} +1 -1
- package/web/app/immutable/chunks/{6Z5k9P1U.js → v3BNQvm3.js} +4 -4
- package/web/app/immutable/chunks/{BSel_zEu.js → v5CNLLlH.js} +1 -1
- package/web/app/immutable/chunks/{D0gJOzJU.js → wUteoXUE.js} +1 -1
- package/web/app/immutable/chunks/{CCDTjxXZ.js → x5DAOZ-l.js} +1 -1
- package/web/app/immutable/entry/{app.np0VAfbg.js → app.9TYubmA2.js} +2 -2
- package/web/app/immutable/entry/start.DzrqTCos.js +1 -0
- package/web/app/immutable/nodes/{0.DoZAnEaT.js → 0.CwEPgBsQ.js} +1 -1
- package/web/app/immutable/nodes/{1.BfLNDde5.js → 1.DWK38N4h.js} +1 -1
- package/web/app/immutable/nodes/{10.WVRhKQHR.js → 10.DaUeIEdW.js} +1 -1
- package/web/app/immutable/nodes/{14.BGrxllXE.js → 14.2lmprMDP.js} +1 -1
- package/web/app/immutable/nodes/{16.CkZkKSWx.js → 16.COW42S3C.js} +2 -2
- package/web/app/immutable/nodes/{2.COM3w17g.js → 2.SI3oSw-U.js} +3 -3
- package/web/app/immutable/nodes/{3.BhRx3b1m.js → 3.BdAb9qv8.js} +1 -1
- package/web/app/immutable/nodes/{4.C02hhSi-.js → 4.BPPplmHC.js} +1 -1
- package/web/app/immutable/nodes/{5.Dgt2hWD3.js → 5.mnYZAvZj.js} +1 -1
- package/web/app/immutable/nodes/{6.KyP4WP5g.js → 6.DokpGs5-.js} +1 -1
- package/web/app/immutable/nodes/{7.BxnoAMeX.js → 7.7huKB9rr.js} +1 -1
- package/web/app/immutable/nodes/{8.CnlHpTsC.js → 8.Oo8AlOBc.js} +2 -2
- package/web/app/immutable/nodes/{9.CJ1_wepy.js → 9.DkJDLBQi.js} +1 -1
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.BGCfjmAX.js +0 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Y as ce,ag as q,ao as Ce}from"./DR30pTuY.js";import{bV as Le,cT as le,ck as ue,cj as ve}from"./Sd4DhpzB.js";import{Hq as p,Aj as we,bA as be,c as Fe,Jt as de,i3 as me,bM as ke,Ce as z,AK as Ge,f3 as Pe,yQ as xe,d$ as Ee,e$ as fe,d_ as _e,zg as Ve,J7 as Ue,u_ as Be}from"./CRwmdgt6.js";import{aB as Ae,dB as he,A as H,P as ge,ax as K}from"./KQTrHxko.js";import{ax as $e}from"./Bgegixo2.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{n as Q}from"./lfJ8pseq.js";import"./B8o4lNgr.js";import{bo as n}from"./7rNOGHzs.js";import"./DmsDslNo.js";import"./CQ4a5a4v.js";import"./D-cnPaTJ.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const j=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=j.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=j.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=j.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},Z={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&Z[i]&&Ke(Z[i],s)?Ie(Z[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function je(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const Ze={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return Ze[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return je(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
1
|
+
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Y as ce,ag as q,ao as Ce}from"./C5G0q6V9.js";import{bV as Le,cT as le,ck as ue,cj as ve}from"./DR0NE2_C.js";import{Hq as p,Aj as we,bA as be,c as Fe,Jt as de,i3 as me,bM as ke,Ce as z,AK as Ge,f3 as Pe,yQ as xe,d$ as Ee,e$ as fe,d_ as _e,zg as Ve,J7 as Ue,u_ as Be}from"./CRwmdgt6.js";import{aB as Ae,dB as he,A as H,P as ge,ax as K}from"./KQTrHxko.js";import{ax as $e}from"./Bgegixo2.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{n as Q}from"./lfJ8pseq.js";import"./B8o4lNgr.js";import{bo as n}from"./7rNOGHzs.js";import"./DmsDslNo.js";import"./CQ4a5a4v.js";import"./D-cnPaTJ.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const j=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=j.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=j.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=j.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},Z={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&Z[i]&&Ke(Z[i],s)?Ie(Z[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function je(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const Ze={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return Ze[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return je(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o}from"./
|
|
1
|
+
import{c as o}from"./ENpFvA2b.js";var c=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function p(){return!!i()?.mermaidCaptureSizes}o(p,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,p as shouldCaptureSizes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as on,b8 as Hn,X as cn,a1 as un,a as ln,aV as ue,ao as Nn,a5 as Pn,bf as Vn,a9 as Rn,bi as zn,a6 as qn,bg as Bn,c as d,a8 as Yt,bc as Zt,I as Zn,U as it,aN as ht,G as Xn,Y as Gn,w as jn,bC as Qn}from"./Cl430GWg.js";import{g as oe}from"./BJzHxIyr.js";import{b as Jn,t as Ne,c as Kn,a as tr,l as er}from"./wh3Y68il.js";import{i as nr}from"./Gi6I4Gst.js";function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function sr(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function ar(t){return"translate("+t+",0)"}function or(t){return"translate(0,"+t+")"}function cr(t){return e=>+t(e)}function ur(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function lr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,_=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",U=t===Gt||t===xe?ar:or;function C(Y){var z=r??(e.ticks?e.ticks.apply(e,n):e.domain()),q=i??(e.tickFormat?e.tickFormat.apply(e,n):sr),v=Math.max(s,0)+y,I=e.range(),R=+I[0]+F,E=+I[I.length-1]+F,B=(e.bandwidth?ur:cr)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(z,e).order(),p=k.exit(),A=k.enter().append("g").attr("class","tick"),x=k.select("line"),S=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(A),x=x.merge(A.append("line").attr("stroke","currentColor").attr(w+"2",_*s)),S=S.merge(A.append("text").attr("fill","currentColor").attr(w,_*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),S=S.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=B(M))?U(M+F):this.getAttribute("transform")}),A.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return U((D&&isFinite(D=D(M))?D:B(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+_*a+","+R+"H"+F+"V"+E+"H"+_*a:"M"+F+","+R+"V"+E:a?"M"+R+","+_*a+"V"+F+"H"+E+"V"+_*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return U(B(M)+F)}),x.attr(w+"2",_*s),S.attr(w,_*v).text(q),G.filter(lr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=B})}return C.scale=function(Y){return arguments.length?(e=Y,C):e},C.ticks=function(){return n=Array.from(arguments),C},C.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),C):n.slice()},C.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),C):r&&r.slice()},C.tickFormat=function(Y){return arguments.length?(i=Y,C):i},C.tickSize=function(Y){return arguments.length?(s=a=+Y,C):s},C.tickSizeInner=function(Y){return arguments.length?(s=+Y,C):s},C.tickSizeOuter=function(Y){return arguments.length?(a=+Y,C):a},C.tickPadding=function(Y){return arguments.length?(y=+Y,C):y},C.offset=function(Y){return arguments.length?(F=+Y,C):F},C}function fr(t){return fn(Gt,t)}function dr(t){return fn(xe,t)}const hr=Math.PI/180,mr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,gr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof mt)return pn(t);t instanceof on||(t=Hn(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function yr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,yr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>gr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kr(t){if(t instanceof mt)return new mt(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new mt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*mr;return new mt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function be(t,e,n,r){return arguments.length===1?kr(t):new mt(t,e,n,r??1)}function mt(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function pn(t){if(isNaN(t.h))return new ft(t.l,0,0,t.opacity);var e=t.h*hr;return new ft(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}cn(mt,be,un(ln,{brighter(t){return new mt(this.h,this.c,this.l+ne*(t??1),this.opacity)},darker(t){return new mt(this.h,this.c,this.l-ne*(t??1),this.opacity)},rgb(){return pn(this).rgb()}}));function pr(t){return function(e,n){var r=t((e=be(e)).h,(n=be(n)).h),i=ue(e.c,n.c),s=ue(e.l,n.l),a=ue(e.opacity,n.opacity);return function(y){return e.h=r(y),e.c=i(y),e.l=s(y),e.opacity=a(y),e+""}}}const vr=pr(Nn);function Tr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),t[n]=e.floor(i),t[r]=e.ceil(s),t}const ge=new Date,ye=new Date;function nt(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a<y-s?a:y},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s<a)||!(y>0))return F;let _;do F.push(_=new Date(+s)),e(s,y),t(s);while(_<s&&s<a);return F},i.filter=s=>nt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const It=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);It.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):It);It.range;const gt=1e3,ct=gt*60,yt=ct*60,kt=yt*24,Se=kt*7,Ve=kt*30,ke=kt*365,Tt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCSeconds());Tt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const xr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());xr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*yt)},(t,e)=>(e-t)/yt,t=>t.getHours());Pt.range;const br=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*yt)},(t,e)=>(e-t)/yt,t=>t.getUTCHours());br.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/kt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/kt,t=>t.getUTCDate()-1);_e.range;const wr=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/kt,t=>Math.floor(t/kt));wr.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),Dr=Mt(2),Mr=Mt(3),Et=Mt(4),Cr=Mt(5),Sr=Mt(6);wn.range;re.range;Dr.range;Mr.range;Et.range;Cr.range;Sr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const _r=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());_r.range;const pt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());pt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});pt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Yr(t,e,n,r,i,s){const a=[[Tt,1,gt],[Tt,5,5*gt],[Tt,15,15*gt],[Tt,30,30*gt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,yt],[i,3,3*yt],[i,6,6*yt],[i,12,12*yt],[r,1,kt],[r,2,2*kt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(_,w,U){const C=w<_;C&&([_,w]=[w,_]);const Y=U&&typeof U.range=="function"?U:F(_,w,U),z=Y?Y.range(_,+w+1):[];return C?z.reverse():z}function F(_,w,U){const C=Math.abs(w-_)/U,Y=Jn(([,,v])=>v).right(a,C);if(Y===a.length)return t.every(Ne(_/ke,w/ke,U));if(Y===0)return It.every(Math.max(Ne(_,w,U),1));const[z,q]=a[C/a[Y-1][2]<a[Y][2]/C?Y-1:Y];return z.every(q)}return[y,F]}const[Fr,Ur]=Yr(pt,Rt,zt,xt,Pt,Nt);function pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ve(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $t(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Ir(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,s=t.days,a=t.shortDays,y=t.months,F=t.shortMonths,_=Ot(i),w=Ht(i),U=Ot(s),C=Ht(s),Y=Ot(a),z=Ht(a),q=Ot(y),v=Ht(y),I=Ot(F),R=Ht(F),E={a:m,A:L,b:o,B:$,c:null,d:Xe,e:Xe,f:ei,g:fi,G:hi,H:Jr,I:Kr,j:ti,L:Dn,m:ni,M:ri,p:u,q:K,Q:Qe,s:Je,S:ii,u:si,U:ai,V:oi,w:ci,W:ui,x:null,X:null,y:li,Y:di,Z:mi,"%":je},B={a:l,A:O,b:H,B:j,c:null,d:Ge,e:Ge,f:pi,g:_i,G:Fi,H:gi,I:yi,j:ki,L:Cn,m:vi,M:Ti,p:N,q:J,Q:Qe,s:Je,S:xi,u:bi,U:wi,V:Di,w:Mi,W:Ci,x:null,X:null,y:Si,Y:Yi,Z:Ui,"%":je},G={a:x,A:S,b:M,B:D,c,d:Be,e:Be,f:Xr,g:qe,G:ze,H:Ze,I:Ze,j:zr,L:Zr,m:Rr,M:qr,p:A,q:Vr,Q:jr,s:Qr,S:Br,u:$r,U:Or,V:Hr,w:Wr,W:Nr,x:g,X:b,y:qe,Y:ze,Z:Pr,"%":Gr};E.x=T(n,E),E.X=T(r,E),E.c=T(e,E),B.x=T(n,B),B.X=T(r,B),B.c=T(e,B);function T(h,P){return function(V){var f=[],tt=-1,W=0,Q=h.length,X,st,at;for(V instanceof Date||(V=new Date(+V));++tt<Q;)h.charCodeAt(tt)===37&&(f.push(h.slice(W,tt)),(st=Re[X=h.charAt(++tt)])!=null?X=h.charAt(++tt):st=X==="e"?" ":"0",(at=P[X])&&(X=at(V,st)),f.push(X),W=tt+1);return f.push(h.slice(W,tt)),f.join("")}}function k(h,P){return function(V){var f=$t(1900,void 0,1),tt=p(f,h,V+="",0),W,Q;if(tt!=V.length)return null;if("Q"in f)return new Date(f.Q);if("s"in f)return new Date(f.s*1e3+("L"in f?f.L:0));if(P&&!("Z"in f)&&(f.Z=0),"p"in f&&(f.H=f.H%12+f.p*12),f.m===void 0&&(f.m="q"in f?f.q:0),"V"in f){if(f.V<1||f.V>53)return null;"w"in f||(f.w=1),"Z"in f?(W=ve($t(f.y,0,1)),Q=W.getUTCDay(),W=Q>4||Q===0?re.ceil(W):re(W),W=_e.offset(W,(f.V-1)*7),f.y=W.getUTCFullYear(),f.m=W.getUTCMonth(),f.d=W.getUTCDate()+(f.w+6)%7):(W=pe($t(f.y,0,1)),Q=W.getDay(),W=Q>4||Q===0?Vt.ceil(W):Vt(W),W=xt.offset(W,(f.V-1)*7),f.y=W.getFullYear(),f.m=W.getMonth(),f.d=W.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,P,V,f){for(var tt=0,W=P.length,Q=V.length,X,st;tt<W;){if(f>=Q)return-1;if(X=P.charCodeAt(tt++),X===37){if(X=P.charAt(tt++),st=G[X in Re?P.charAt(tt++):X],!st||(f=st(h,V,f))<0)return-1}else if(X!=V.charCodeAt(f++))return-1}return f}function A(h,P,V){var f=_.exec(P.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,P,V){var f=Y.exec(P.slice(V));return f?(h.w=z.get(f[0].toLowerCase()),V+f[0].length):-1}function S(h,P,V){var f=U.exec(P.slice(V));return f?(h.w=C.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,P,V){var f=I.exec(P.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,P,V){var f=q.exec(P.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,P,V){return p(h,e,P,V)}function g(h,P,V){return p(h,n,P,V)}function b(h,P,V){return p(h,r,P,V)}function m(h){return a[h.getDay()]}function L(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function $(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function O(h){return s[h.getUTCDay()]}function H(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function N(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var P=T(h+="",E);return P.toString=function(){return h},P},parse:function(h){var P=k(h+="",!1);return P.toString=function(){return h},P},utcFormat:function(h){var P=T(h+="",B);return P.toString=function(){return h},P},utcParse:function(h){var P=k(h+="",!0);return P.toString=function(){return h},P}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Lr=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(e)+i:i)}function Ar(t){return t.replace(Lr,"\\$&")}function Ot(t){return new RegExp("^(?:"+t.map(Ar).join("|")+")","i")}function Ht(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Nr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Pr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Gr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Qr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return Z(t.getDate(),e,2)}function Jr(t,e){return Z(t.getHours(),e,2)}function Kr(t,e){return Z(t.getHours()%12||12,e,2)}function ti(t,e){return Z(1+xt.count(pt(t),t),e,3)}function Dn(t,e){return Z(t.getMilliseconds(),e,3)}function ei(t,e){return Dn(t,e)+"000"}function ni(t,e){return Z(t.getMonth()+1,e,2)}function ri(t,e){return Z(t.getMinutes(),e,2)}function ii(t,e){return Z(t.getSeconds(),e,2)}function si(t){var e=t.getDay();return e===0?7:e}function ai(t,e){return Z(zt.count(pt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function oi(t,e){return t=Mn(t),Z(bt.count(pt(t),t)+(pt(t).getDay()===4),e,2)}function ci(t){return t.getDay()}function ui(t,e){return Z(Vt.count(pt(t)-1,t),e,2)}function li(t,e){return Z(t.getFullYear()%100,e,2)}function fi(t,e){return t=Mn(t),Z(t.getFullYear()%100,e,2)}function di(t,e){return Z(t.getFullYear()%1e4,e,4)}function hi(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function mi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Ge(t,e){return Z(t.getUTCDate(),e,2)}function gi(t,e){return Z(t.getUTCHours(),e,2)}function yi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function ki(t,e){return Z(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function pi(t,e){return Cn(t,e)+"000"}function vi(t,e){return Z(t.getUTCMonth()+1,e,2)}function Ti(t,e){return Z(t.getUTCMinutes(),e,2)}function xi(t,e){return Z(t.getUTCSeconds(),e,2)}function bi(t){var e=t.getUTCDay();return e===0?7:e}function wi(t,e){return Z(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?Et(t):Et.ceil(t)}function Di(t,e){return t=Sn(t),Z(Et.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Mi(t){return t.getUTCDay()}function Ci(t,e){return Z(re.count(wt(t)-1,t),e,2)}function Si(t,e){return Z(t.getUTCFullYear()%100,e,2)}function _i(t,e){return t=Sn(t),Z(t.getUTCFullYear()%100,e,2)}function Yi(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function Fi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Et(t):Et.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function Ui(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ii({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ii(t){return St=Ir(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Li(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,_){var w=Kn(),U=w.invert,C=w.domain,Y=_(".%L"),z=_(":%S"),q=_("%I:%M"),v=_("%I %p"),I=_("%a %d"),R=_("%b %d"),E=_("%B"),B=_("%Y");function G(T){return(F(T)<T?Y:y(T)<T?z:a(T)<T?q:s(T)<T?v:r(T)<T?i(T)<T?I:R:n(T)<T?E:B)(T)}return w.invert=function(T){return new Date(U(T))},w.domain=function(T){return arguments.length?C(Array.from(T,Li)):C().map(Ei)},w.ticks=function(T){var k=C();return t(k[0],k[k.length-1],T??10)},w.tickFormat=function(T,k){return k==null?G:_(k)},w.nice=function(T){var k=C();return(!T||typeof T.range!="function")&&(T=e(k[0],k[k.length-1],T??10)),T?C(Tr(k,T)):w},w.copy=function(){return tr(w,_n(t,e,n,r,i,s,a,y,F,_))},w}function Ai(){return nr.apply(_n(Fr,Ur,pt,Rt,zt,xt,Pt,Nt,Tt,ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var jt={exports:{}},Wi=jt.exports,Ke;function $i(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})(Wi,(function(){var n="day";return function(r,i,s){var a=function(_){return _.add(4-_.isoWeekday(),n)},y=i.prototype;y.isoWeekYear=function(){return a(this).year()},y.isoWeek=function(_){if(!this.$utils().u(_))return this.add(7*(_-this.isoWeek()),n);var w,U,C,Y,z=a(this),q=(w=this.isoWeekYear(),U=this.$u,C=(U?s.utc:s)().year(w).startOf("year"),Y=4-C.isoWeekday(),C.isoWeekday()>4&&(Y+=7),C.add(Y,n));return z.diff(q,"week")+1},y.isoWeekday=function(_){return this.$utils().u(_)?this.day()||7:this.day(this.day()%7?_:_-7)};var F=y.startOf;y.startOf=function(_,w){var U=this.$utils(),C=!!U.u(w)||w;return U.p(_)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(_,w)}}}))})(jt)),jt.exports}var Oi=$i();const Hi=oe(Oi);var Qt={exports:{}},Ni=Qt.exports,tn;function Pi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Ni,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},_=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(I){this[v]=+I}},U=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var R=I.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],C=function(v){var I=F[v];return I&&(I.indexOf?I:I.s.concat(I.f))},Y=function(v,I){var R,E=F.meridiem;if(E){for(var B=1;B<=24;B+=1)if(v.indexOf(E(B,0,I))>-1){R=B>12;break}}else R=v===(I?"pm":"PM");return R},z={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var I=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],I)for(var E=1;E<=31;E+=1)I(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var I=C("months"),R=(C("monthsShort")||I.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var I=C("months").indexOf(v)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=_(v)}],YYYY:[/\d{4}/,w("year")],Z:U,ZZ:U};function q(v){var I,R;I=v,R=F&&F.formats;for(var E=(v=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,S,M){var D=M&&M.toUpperCase();return S||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),B=E.length,G=0;G<B;G+=1){var T=E[G],k=z[T],p=k&&k[0],A=k&&k[1];E[G]=A?{regex:p,parser:A}:T.replace(/^\[|\]$/g,"")}return function(x){for(var S={},M=0,D=0;M<B;M+=1){var c=E[M];if(typeof c=="string")D+=c.length;else{var g=c.regex,b=c.parser,m=x.slice(D),L=g.exec(m)[0];b.call(S,L),x=x.replace(L,"")}}return(function(o){var $=o.afternoon;if($!==void 0){var u=o.hours;$?u<12&&(o.hours+=12):u===12&&(o.hours=0),delete o.afternoon}})(S),S}}return function(v,I,R){R.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(_=v.parseTwoDigitYear);var E=I.prototype,B=E.parse;E.parse=function(G){var T=G.date,k=G.utc,p=G.args;this.$u=k;var A=p[1];if(typeof A=="string"){var x=p[2]===!0,S=p[3]===!0,M=x||S,D=p[2];S&&(D=p[2]),F=this.$locale(),!x&&D&&(F=R.Ls[D]),this.$d=(function(m,L,o,$){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*m);var u=q(L)(m),K=u.year,l=u.month,O=u.day,H=u.hours,j=u.minutes,N=u.seconds,J=u.milliseconds,h=u.zone,P=u.week,V=new Date,f=O||(K||l?1:V.getDate()),tt=K||V.getFullYear(),W=0;K&&!l||(W=l>0?l-1:V.getMonth());var Q,X=H||0,st=j||0,at=N||0,vt=J||0;return h?new Date(Date.UTC(tt,W,f,X,st,at,vt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,W,f,X,st,at,vt)):(Q=new Date(tt,W,f,X,st,at,vt),P&&(Q=$(Q).week(P).toDate()),Q)}catch{return new Date("")}})(T,A,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(A)&&(this.$d=new Date("")),F={}}else if(A instanceof Array)for(var c=A.length,g=1;g<=c;g+=1){p[1]=A[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else B.call(this,G)}}}))})(Qt)),Qt.exports}var Vi=Pi();const Ri=oe(Vi);var Jt={exports:{}},zi=Jt.exports,en;function qi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(zi,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var _=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(U){switch(U){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return _.s(y.week(),U==="w"?1:2,"0");case"W":case"WW":return _.s(y.isoWeek(),U==="W"?1:2,"0");case"k":case"kk":return _.s(String(y.$H===0?24:y.$H),U==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return U}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var Bi=qi();const Zi=oe(Bi);var Kt={exports:{}},Xi=Kt.exports,nn;function Gi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Xi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,_=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,U=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,C={years:F,months:_,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof B},z=function(T,k,p){return new B(T,p,k.$l)},q=function(T){return r.p(T)+"s"},v=function(T){return T<0},I=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},B=(function(){function T(p,A,x){var S=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),A)return z(p*C[q(A)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){S.$d[q(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(A,x){return A+(p.$d[x]||0)*C[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=I(p/F),p%=F,this.$d.months=I(p/_),p%=_,this.$d.days=I(p/y),p%=y,this.$d.hours=I(p/a),p%=a,this.$d.minutes=I(p/s),p%=s,this.$d.seconds=I(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),A=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var S=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||A.negative||S.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",L=(b?"-":"")+"P"+p.format+A.format+S.format+m+M.format+D.format+g.format;return L==="P"||L==="-P"?"P0D":L},k.toJSON=function(){return this.toISOString()},k.format=function(p){var A=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return A.replace(U,(function(S,M){return M||String(x[S])}))},k.as=function(p){return this.$ms/C[q(p)]},k.get=function(p){var A=this.$ms,x=q(p);return x==="milliseconds"?A%=1e3:A=x==="weeks"?I(A/C[x]):this.$d[x],A||0},k.add=function(p,A,x){var S;return S=A?p*C[q(A)]:Y(p)?p.$ms:z(p,this).$ms,z(this.$ms+S*(x?-1:1),this)},k.subtract=function(p,A){return this.add(p,A,!0)},k.locale=function(p){var A=this.clone();return A.$l=p,A},k.clone=function(){return z(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(S,M){var D=p.locale();return z(S,{$l:D},M)},p.isDuration=Y;var A=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(S,M){return Y(S)?G(this,S,1):A.bind(this)(S,M)},k.prototype.subtract=function(S,M){return Y(S)?G(this,S,-1):x.bind(this)(S,M)}}}))})(Kt)),Kt.exports}var ji=Gi();const Qi=oe(ji);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],_=[1,33],w=[1,34],U=[1,9],C=[1,10],Y=[1,11],z=[1,12],q=[1,13],v=[1,14],I=[1,15],R=[1,16],E=[1,19],B=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],A=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,L,o,$){var u=o.length-1;switch(L){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:_,21:w,22:U,23:C,24:Y,25:z,26:q,27:v,28:I,29:R,30:E,31:B,33:G,35:T,36:k,37:24,38:p,40:A},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:_,21:w,22:U,23:C,24:Y,25:z,26:q,27:v,28:I,29:R,30:E,31:B,33:G,35:T,36:k,37:24,38:p,40:A},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],L=[null],o=[],$=this.table,u="",K=0,l=0,O=2,H=1,j=o.slice.call(arguments,1),N=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);N.setInput(c,J.yy),J.yy.lexer=N,J.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var P=N.yylloc;o.push(P);var V=N.options&&N.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,L.length=L.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||N.lex()||H,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var W,Q,X,st,at={},vt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((W===null||typeof W>"u")&&(W=tt()),X=$[Q]&&$[Q][W]),typeof X>"u"||!X.length||!X[0]){var ce="";Bt=[];for(vt in $[Q])this.terminals_[vt]&&vt>O&&Bt.push("'"+this.terminals_[vt]+"'");N.showPosition?ce="Parse error on line "+(K+1)+`:
|
|
1
|
+
import{R as on,b8 as Hn,X as cn,a1 as un,a as ln,aV as ue,ao as Nn,a5 as Pn,bf as Vn,a9 as Rn,bi as zn,a6 as qn,bg as Bn,c as d,a8 as Yt,bc as Zt,I as Zn,U as it,aN as ht,G as Xn,Y as Gn,w as jn,bC as Qn}from"./ENpFvA2b.js";import{g as oe}from"./BJzHxIyr.js";import{b as Jn,t as Ne,c as Kn,a as tr,l as er}from"./C5AqVWW_.js";import{i as nr}from"./Gi6I4Gst.js";function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function sr(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function ar(t){return"translate("+t+",0)"}function or(t){return"translate(0,"+t+")"}function cr(t){return e=>+t(e)}function ur(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function lr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,_=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",U=t===Gt||t===xe?ar:or;function C(Y){var z=r??(e.ticks?e.ticks.apply(e,n):e.domain()),q=i??(e.tickFormat?e.tickFormat.apply(e,n):sr),v=Math.max(s,0)+y,I=e.range(),R=+I[0]+F,E=+I[I.length-1]+F,B=(e.bandwidth?ur:cr)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(z,e).order(),p=k.exit(),A=k.enter().append("g").attr("class","tick"),x=k.select("line"),S=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(A),x=x.merge(A.append("line").attr("stroke","currentColor").attr(w+"2",_*s)),S=S.merge(A.append("text").attr("fill","currentColor").attr(w,_*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),S=S.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=B(M))?U(M+F):this.getAttribute("transform")}),A.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return U((D&&isFinite(D=D(M))?D:B(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+_*a+","+R+"H"+F+"V"+E+"H"+_*a:"M"+F+","+R+"V"+E:a?"M"+R+","+_*a+"V"+F+"H"+E+"V"+_*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return U(B(M)+F)}),x.attr(w+"2",_*s),S.attr(w,_*v).text(q),G.filter(lr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=B})}return C.scale=function(Y){return arguments.length?(e=Y,C):e},C.ticks=function(){return n=Array.from(arguments),C},C.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),C):n.slice()},C.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),C):r&&r.slice()},C.tickFormat=function(Y){return arguments.length?(i=Y,C):i},C.tickSize=function(Y){return arguments.length?(s=a=+Y,C):s},C.tickSizeInner=function(Y){return arguments.length?(s=+Y,C):s},C.tickSizeOuter=function(Y){return arguments.length?(a=+Y,C):a},C.tickPadding=function(Y){return arguments.length?(y=+Y,C):y},C.offset=function(Y){return arguments.length?(F=+Y,C):F},C}function fr(t){return fn(Gt,t)}function dr(t){return fn(xe,t)}const hr=Math.PI/180,mr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,gr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof mt)return pn(t);t instanceof on||(t=Hn(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function yr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,yr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>gr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kr(t){if(t instanceof mt)return new mt(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new mt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*mr;return new mt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function be(t,e,n,r){return arguments.length===1?kr(t):new mt(t,e,n,r??1)}function mt(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function pn(t){if(isNaN(t.h))return new ft(t.l,0,0,t.opacity);var e=t.h*hr;return new ft(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}cn(mt,be,un(ln,{brighter(t){return new mt(this.h,this.c,this.l+ne*(t??1),this.opacity)},darker(t){return new mt(this.h,this.c,this.l-ne*(t??1),this.opacity)},rgb(){return pn(this).rgb()}}));function pr(t){return function(e,n){var r=t((e=be(e)).h,(n=be(n)).h),i=ue(e.c,n.c),s=ue(e.l,n.l),a=ue(e.opacity,n.opacity);return function(y){return e.h=r(y),e.c=i(y),e.l=s(y),e.opacity=a(y),e+""}}}const vr=pr(Nn);function Tr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),t[n]=e.floor(i),t[r]=e.ceil(s),t}const ge=new Date,ye=new Date;function nt(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a<y-s?a:y},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s<a)||!(y>0))return F;let _;do F.push(_=new Date(+s)),e(s,y),t(s);while(_<s&&s<a);return F},i.filter=s=>nt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const It=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);It.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):It);It.range;const gt=1e3,ct=gt*60,yt=ct*60,kt=yt*24,Se=kt*7,Ve=kt*30,ke=kt*365,Tt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCSeconds());Tt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const xr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());xr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*gt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*yt)},(t,e)=>(e-t)/yt,t=>t.getHours());Pt.range;const br=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*yt)},(t,e)=>(e-t)/yt,t=>t.getUTCHours());br.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/kt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/kt,t=>t.getUTCDate()-1);_e.range;const wr=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/kt,t=>Math.floor(t/kt));wr.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),Dr=Mt(2),Mr=Mt(3),Et=Mt(4),Cr=Mt(5),Sr=Mt(6);wn.range;re.range;Dr.range;Mr.range;Et.range;Cr.range;Sr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const _r=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());_r.range;const pt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());pt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});pt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Yr(t,e,n,r,i,s){const a=[[Tt,1,gt],[Tt,5,5*gt],[Tt,15,15*gt],[Tt,30,30*gt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,yt],[i,3,3*yt],[i,6,6*yt],[i,12,12*yt],[r,1,kt],[r,2,2*kt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(_,w,U){const C=w<_;C&&([_,w]=[w,_]);const Y=U&&typeof U.range=="function"?U:F(_,w,U),z=Y?Y.range(_,+w+1):[];return C?z.reverse():z}function F(_,w,U){const C=Math.abs(w-_)/U,Y=Jn(([,,v])=>v).right(a,C);if(Y===a.length)return t.every(Ne(_/ke,w/ke,U));if(Y===0)return It.every(Math.max(Ne(_,w,U),1));const[z,q]=a[C/a[Y-1][2]<a[Y][2]/C?Y-1:Y];return z.every(q)}return[y,F]}const[Fr,Ur]=Yr(pt,Rt,zt,xt,Pt,Nt);function pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ve(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $t(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Ir(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,s=t.days,a=t.shortDays,y=t.months,F=t.shortMonths,_=Ot(i),w=Ht(i),U=Ot(s),C=Ht(s),Y=Ot(a),z=Ht(a),q=Ot(y),v=Ht(y),I=Ot(F),R=Ht(F),E={a:m,A:L,b:o,B:$,c:null,d:Xe,e:Xe,f:ei,g:fi,G:hi,H:Jr,I:Kr,j:ti,L:Dn,m:ni,M:ri,p:u,q:K,Q:Qe,s:Je,S:ii,u:si,U:ai,V:oi,w:ci,W:ui,x:null,X:null,y:li,Y:di,Z:mi,"%":je},B={a:l,A:O,b:H,B:j,c:null,d:Ge,e:Ge,f:pi,g:_i,G:Fi,H:gi,I:yi,j:ki,L:Cn,m:vi,M:Ti,p:N,q:J,Q:Qe,s:Je,S:xi,u:bi,U:wi,V:Di,w:Mi,W:Ci,x:null,X:null,y:Si,Y:Yi,Z:Ui,"%":je},G={a:x,A:S,b:M,B:D,c,d:Be,e:Be,f:Xr,g:qe,G:ze,H:Ze,I:Ze,j:zr,L:Zr,m:Rr,M:qr,p:A,q:Vr,Q:jr,s:Qr,S:Br,u:$r,U:Or,V:Hr,w:Wr,W:Nr,x:g,X:b,y:qe,Y:ze,Z:Pr,"%":Gr};E.x=T(n,E),E.X=T(r,E),E.c=T(e,E),B.x=T(n,B),B.X=T(r,B),B.c=T(e,B);function T(h,P){return function(V){var f=[],tt=-1,W=0,Q=h.length,X,st,at;for(V instanceof Date||(V=new Date(+V));++tt<Q;)h.charCodeAt(tt)===37&&(f.push(h.slice(W,tt)),(st=Re[X=h.charAt(++tt)])!=null?X=h.charAt(++tt):st=X==="e"?" ":"0",(at=P[X])&&(X=at(V,st)),f.push(X),W=tt+1);return f.push(h.slice(W,tt)),f.join("")}}function k(h,P){return function(V){var f=$t(1900,void 0,1),tt=p(f,h,V+="",0),W,Q;if(tt!=V.length)return null;if("Q"in f)return new Date(f.Q);if("s"in f)return new Date(f.s*1e3+("L"in f?f.L:0));if(P&&!("Z"in f)&&(f.Z=0),"p"in f&&(f.H=f.H%12+f.p*12),f.m===void 0&&(f.m="q"in f?f.q:0),"V"in f){if(f.V<1||f.V>53)return null;"w"in f||(f.w=1),"Z"in f?(W=ve($t(f.y,0,1)),Q=W.getUTCDay(),W=Q>4||Q===0?re.ceil(W):re(W),W=_e.offset(W,(f.V-1)*7),f.y=W.getUTCFullYear(),f.m=W.getUTCMonth(),f.d=W.getUTCDate()+(f.w+6)%7):(W=pe($t(f.y,0,1)),Q=W.getDay(),W=Q>4||Q===0?Vt.ceil(W):Vt(W),W=xt.offset(W,(f.V-1)*7),f.y=W.getFullYear(),f.m=W.getMonth(),f.d=W.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,P,V,f){for(var tt=0,W=P.length,Q=V.length,X,st;tt<W;){if(f>=Q)return-1;if(X=P.charCodeAt(tt++),X===37){if(X=P.charAt(tt++),st=G[X in Re?P.charAt(tt++):X],!st||(f=st(h,V,f))<0)return-1}else if(X!=V.charCodeAt(f++))return-1}return f}function A(h,P,V){var f=_.exec(P.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,P,V){var f=Y.exec(P.slice(V));return f?(h.w=z.get(f[0].toLowerCase()),V+f[0].length):-1}function S(h,P,V){var f=U.exec(P.slice(V));return f?(h.w=C.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,P,V){var f=I.exec(P.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,P,V){var f=q.exec(P.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,P,V){return p(h,e,P,V)}function g(h,P,V){return p(h,n,P,V)}function b(h,P,V){return p(h,r,P,V)}function m(h){return a[h.getDay()]}function L(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function $(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function O(h){return s[h.getUTCDay()]}function H(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function N(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var P=T(h+="",E);return P.toString=function(){return h},P},parse:function(h){var P=k(h+="",!1);return P.toString=function(){return h},P},utcFormat:function(h){var P=T(h+="",B);return P.toString=function(){return h},P},utcParse:function(h){var P=k(h+="",!0);return P.toString=function(){return h},P}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Lr=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(e)+i:i)}function Ar(t){return t.replace(Lr,"\\$&")}function Ot(t){return new RegExp("^(?:"+t.map(Ar).join("|")+")","i")}function Ht(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Nr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Pr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Gr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Qr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return Z(t.getDate(),e,2)}function Jr(t,e){return Z(t.getHours(),e,2)}function Kr(t,e){return Z(t.getHours()%12||12,e,2)}function ti(t,e){return Z(1+xt.count(pt(t),t),e,3)}function Dn(t,e){return Z(t.getMilliseconds(),e,3)}function ei(t,e){return Dn(t,e)+"000"}function ni(t,e){return Z(t.getMonth()+1,e,2)}function ri(t,e){return Z(t.getMinutes(),e,2)}function ii(t,e){return Z(t.getSeconds(),e,2)}function si(t){var e=t.getDay();return e===0?7:e}function ai(t,e){return Z(zt.count(pt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function oi(t,e){return t=Mn(t),Z(bt.count(pt(t),t)+(pt(t).getDay()===4),e,2)}function ci(t){return t.getDay()}function ui(t,e){return Z(Vt.count(pt(t)-1,t),e,2)}function li(t,e){return Z(t.getFullYear()%100,e,2)}function fi(t,e){return t=Mn(t),Z(t.getFullYear()%100,e,2)}function di(t,e){return Z(t.getFullYear()%1e4,e,4)}function hi(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function mi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Ge(t,e){return Z(t.getUTCDate(),e,2)}function gi(t,e){return Z(t.getUTCHours(),e,2)}function yi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function ki(t,e){return Z(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function pi(t,e){return Cn(t,e)+"000"}function vi(t,e){return Z(t.getUTCMonth()+1,e,2)}function Ti(t,e){return Z(t.getUTCMinutes(),e,2)}function xi(t,e){return Z(t.getUTCSeconds(),e,2)}function bi(t){var e=t.getUTCDay();return e===0?7:e}function wi(t,e){return Z(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?Et(t):Et.ceil(t)}function Di(t,e){return t=Sn(t),Z(Et.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Mi(t){return t.getUTCDay()}function Ci(t,e){return Z(re.count(wt(t)-1,t),e,2)}function Si(t,e){return Z(t.getUTCFullYear()%100,e,2)}function _i(t,e){return t=Sn(t),Z(t.getUTCFullYear()%100,e,2)}function Yi(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function Fi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Et(t):Et.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function Ui(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ii({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ii(t){return St=Ir(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Li(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,_){var w=Kn(),U=w.invert,C=w.domain,Y=_(".%L"),z=_(":%S"),q=_("%I:%M"),v=_("%I %p"),I=_("%a %d"),R=_("%b %d"),E=_("%B"),B=_("%Y");function G(T){return(F(T)<T?Y:y(T)<T?z:a(T)<T?q:s(T)<T?v:r(T)<T?i(T)<T?I:R:n(T)<T?E:B)(T)}return w.invert=function(T){return new Date(U(T))},w.domain=function(T){return arguments.length?C(Array.from(T,Li)):C().map(Ei)},w.ticks=function(T){var k=C();return t(k[0],k[k.length-1],T??10)},w.tickFormat=function(T,k){return k==null?G:_(k)},w.nice=function(T){var k=C();return(!T||typeof T.range!="function")&&(T=e(k[0],k[k.length-1],T??10)),T?C(Tr(k,T)):w},w.copy=function(){return tr(w,_n(t,e,n,r,i,s,a,y,F,_))},w}function Ai(){return nr.apply(_n(Fr,Ur,pt,Rt,zt,xt,Pt,Nt,Tt,ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var jt={exports:{}},Wi=jt.exports,Ke;function $i(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})(Wi,(function(){var n="day";return function(r,i,s){var a=function(_){return _.add(4-_.isoWeekday(),n)},y=i.prototype;y.isoWeekYear=function(){return a(this).year()},y.isoWeek=function(_){if(!this.$utils().u(_))return this.add(7*(_-this.isoWeek()),n);var w,U,C,Y,z=a(this),q=(w=this.isoWeekYear(),U=this.$u,C=(U?s.utc:s)().year(w).startOf("year"),Y=4-C.isoWeekday(),C.isoWeekday()>4&&(Y+=7),C.add(Y,n));return z.diff(q,"week")+1},y.isoWeekday=function(_){return this.$utils().u(_)?this.day()||7:this.day(this.day()%7?_:_-7)};var F=y.startOf;y.startOf=function(_,w){var U=this.$utils(),C=!!U.u(w)||w;return U.p(_)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(_,w)}}}))})(jt)),jt.exports}var Oi=$i();const Hi=oe(Oi);var Qt={exports:{}},Ni=Qt.exports,tn;function Pi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Ni,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},_=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(I){this[v]=+I}},U=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var R=I.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],C=function(v){var I=F[v];return I&&(I.indexOf?I:I.s.concat(I.f))},Y=function(v,I){var R,E=F.meridiem;if(E){for(var B=1;B<=24;B+=1)if(v.indexOf(E(B,0,I))>-1){R=B>12;break}}else R=v===(I?"pm":"PM");return R},z={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var I=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],I)for(var E=1;E<=31;E+=1)I(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var I=C("months"),R=(C("monthsShort")||I.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var I=C("months").indexOf(v)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=_(v)}],YYYY:[/\d{4}/,w("year")],Z:U,ZZ:U};function q(v){var I,R;I=v,R=F&&F.formats;for(var E=(v=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,S,M){var D=M&&M.toUpperCase();return S||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),B=E.length,G=0;G<B;G+=1){var T=E[G],k=z[T],p=k&&k[0],A=k&&k[1];E[G]=A?{regex:p,parser:A}:T.replace(/^\[|\]$/g,"")}return function(x){for(var S={},M=0,D=0;M<B;M+=1){var c=E[M];if(typeof c=="string")D+=c.length;else{var g=c.regex,b=c.parser,m=x.slice(D),L=g.exec(m)[0];b.call(S,L),x=x.replace(L,"")}}return(function(o){var $=o.afternoon;if($!==void 0){var u=o.hours;$?u<12&&(o.hours+=12):u===12&&(o.hours=0),delete o.afternoon}})(S),S}}return function(v,I,R){R.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(_=v.parseTwoDigitYear);var E=I.prototype,B=E.parse;E.parse=function(G){var T=G.date,k=G.utc,p=G.args;this.$u=k;var A=p[1];if(typeof A=="string"){var x=p[2]===!0,S=p[3]===!0,M=x||S,D=p[2];S&&(D=p[2]),F=this.$locale(),!x&&D&&(F=R.Ls[D]),this.$d=(function(m,L,o,$){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*m);var u=q(L)(m),K=u.year,l=u.month,O=u.day,H=u.hours,j=u.minutes,N=u.seconds,J=u.milliseconds,h=u.zone,P=u.week,V=new Date,f=O||(K||l?1:V.getDate()),tt=K||V.getFullYear(),W=0;K&&!l||(W=l>0?l-1:V.getMonth());var Q,X=H||0,st=j||0,at=N||0,vt=J||0;return h?new Date(Date.UTC(tt,W,f,X,st,at,vt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,W,f,X,st,at,vt)):(Q=new Date(tt,W,f,X,st,at,vt),P&&(Q=$(Q).week(P).toDate()),Q)}catch{return new Date("")}})(T,A,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(A)&&(this.$d=new Date("")),F={}}else if(A instanceof Array)for(var c=A.length,g=1;g<=c;g+=1){p[1]=A[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else B.call(this,G)}}}))})(Qt)),Qt.exports}var Vi=Pi();const Ri=oe(Vi);var Jt={exports:{}},zi=Jt.exports,en;function qi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(zi,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var _=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(U){switch(U){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return _.s(y.week(),U==="w"?1:2,"0");case"W":case"WW":return _.s(y.isoWeek(),U==="W"?1:2,"0");case"k":case"kk":return _.s(String(y.$H===0?24:y.$H),U==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return U}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var Bi=qi();const Zi=oe(Bi);var Kt={exports:{}},Xi=Kt.exports,nn;function Gi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Xi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,_=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,U=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,C={years:F,months:_,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof B},z=function(T,k,p){return new B(T,p,k.$l)},q=function(T){return r.p(T)+"s"},v=function(T){return T<0},I=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},B=(function(){function T(p,A,x){var S=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),A)return z(p*C[q(A)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){S.$d[q(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(A,x){return A+(p.$d[x]||0)*C[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=I(p/F),p%=F,this.$d.months=I(p/_),p%=_,this.$d.days=I(p/y),p%=y,this.$d.hours=I(p/a),p%=a,this.$d.minutes=I(p/s),p%=s,this.$d.seconds=I(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),A=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var S=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||A.negative||S.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",L=(b?"-":"")+"P"+p.format+A.format+S.format+m+M.format+D.format+g.format;return L==="P"||L==="-P"?"P0D":L},k.toJSON=function(){return this.toISOString()},k.format=function(p){var A=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return A.replace(U,(function(S,M){return M||String(x[S])}))},k.as=function(p){return this.$ms/C[q(p)]},k.get=function(p){var A=this.$ms,x=q(p);return x==="milliseconds"?A%=1e3:A=x==="weeks"?I(A/C[x]):this.$d[x],A||0},k.add=function(p,A,x){var S;return S=A?p*C[q(A)]:Y(p)?p.$ms:z(p,this).$ms,z(this.$ms+S*(x?-1:1),this)},k.subtract=function(p,A){return this.add(p,A,!0)},k.locale=function(p){var A=this.clone();return A.$l=p,A},k.clone=function(){return z(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(S,M){var D=p.locale();return z(S,{$l:D},M)},p.isDuration=Y;var A=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(S,M){return Y(S)?G(this,S,1):A.bind(this)(S,M)},k.prototype.subtract=function(S,M){return Y(S)?G(this,S,-1):x.bind(this)(S,M)}}}))})(Kt)),Kt.exports}var ji=Gi();const Qi=oe(ji);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],_=[1,33],w=[1,34],U=[1,9],C=[1,10],Y=[1,11],z=[1,12],q=[1,13],v=[1,14],I=[1,15],R=[1,16],E=[1,19],B=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],A=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,L,o,$){var u=o.length-1;switch(L){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:_,21:w,22:U,23:C,24:Y,25:z,26:q,27:v,28:I,29:R,30:E,31:B,33:G,35:T,36:k,37:24,38:p,40:A},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:_,21:w,22:U,23:C,24:Y,25:z,26:q,27:v,28:I,29:R,30:E,31:B,33:G,35:T,36:k,37:24,38:p,40:A},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],L=[null],o=[],$=this.table,u="",K=0,l=0,O=2,H=1,j=o.slice.call(arguments,1),N=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);N.setInput(c,J.yy),J.yy.lexer=N,J.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var P=N.yylloc;o.push(P);var V=N.options&&N.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,L.length=L.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||N.lex()||H,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var W,Q,X,st,at={},vt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((W===null||typeof W>"u")&&(W=tt()),X=$[Q]&&$[Q][W]),typeof X>"u"||!X.length||!X[0]){var ce="";Bt=[];for(vt in $[Q])this.terminals_[vt]&&vt>O&&Bt.push("'"+this.terminals_[vt]+"'");N.showPosition?ce="Parse error on line "+(K+1)+`:
|
|
2
2
|
`+N.showPosition()+`
|
|
3
3
|
Expecting `+Bt.join(", ")+", got '"+(this.terminals_[W]||W)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(W==H?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(ce,{text:N.match,token:this.terminals_[W]||W,line:N.yylineno,loc:P,expected:Bt})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+W);switch(X[0]){case 1:b.push(W),L.push(N.yytext),o.push(N.yylloc),b.push(X[1]),W=null,l=N.yyleng,u=N.yytext,K=N.yylineno,P=N.yylloc;break;case 2:if(ut=this.productions_[X[1]][1],at.$=L[L.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,X[1],L,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),L=L.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[X[1]][0]),L.push(at.$),o.push(at._$),He=$[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},S=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var L=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
|