@intent-hq/web 2.327.3 → 2.327.5

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.
Files changed (141) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BAcNJnHM.js → 0VyTRY65.js} +1 -1
  3. package/web/app/immutable/chunks/{D_YJY_Ty.js → 0jr8Bg7f.js} +1 -1
  4. package/web/app/immutable/chunks/{C1pMbnE7.js → 58w9tXyz.js} +1 -1
  5. package/web/app/immutable/chunks/{Bggzn0XP.js → 6StQr10j.js} +1 -1
  6. package/web/app/immutable/chunks/{FrlwlE8V.js → 71Mja2wo.js} +1 -1
  7. package/web/app/immutable/chunks/{D1zY3q4_.js → 9cyklBMv.js} +2 -2
  8. package/web/app/immutable/chunks/{D6G_--ry.js → B0FeUjOw.js} +1 -1
  9. package/web/app/immutable/chunks/{D3kn1fgc.js → B33BBg7L.js} +1 -1
  10. package/web/app/immutable/chunks/{CcurICQ5.js → B572BMbo.js} +1 -1
  11. package/web/app/immutable/chunks/{CViHflT5.js → B61Pw6nY.js} +1 -1
  12. package/web/app/immutable/chunks/{rr-r2USw.js → B6KhV2Bg.js} +1 -1
  13. package/web/app/immutable/chunks/{DTKsxP_g.js → B78ZCJrO.js} +1 -1
  14. package/web/app/immutable/chunks/{BcyJoTHB.js → B7vTVGVv.js} +1 -1
  15. package/web/app/immutable/chunks/{C1_2Nvwd.js → B9eYUVR5.js} +1 -1
  16. package/web/app/immutable/chunks/{COsr-D4q.js → BBJdulBO.js} +1 -1
  17. package/web/app/immutable/chunks/{DBMurqmQ.js → BF2dYTZa.js} +1 -1
  18. package/web/app/immutable/chunks/{AfJdOpGJ.js → BGviGCI9.js} +1 -1
  19. package/web/app/immutable/chunks/{BhbOznM0.js → BJjlHQnx.js} +1 -1
  20. package/web/app/immutable/chunks/{BveUtPGK.js → BMyBy8MH.js} +1 -1
  21. package/web/app/immutable/chunks/{B-lZ23N5.js → BO-jThCd.js} +1 -1
  22. package/web/app/immutable/chunks/{DgFSF7Q3.js → BTiFOdD0.js} +1 -1
  23. package/web/app/immutable/chunks/{B4Un96Br.js → BWKO1fTV.js} +1 -1
  24. package/web/app/immutable/chunks/{CwBEqZZ_.js → BZs8VpCk.js} +1 -1
  25. package/web/app/immutable/chunks/{CZe-BIqB.js → Bb7N8KKo.js} +1 -1
  26. package/web/app/immutable/chunks/{DeH8i2FV.js → BbbZMK1A.js} +1 -1
  27. package/web/app/immutable/chunks/{Bf7TqJG_.js → Bd3FOgJ5.js} +1 -1
  28. package/web/app/immutable/chunks/{DLgg2y1C.js → BfOD7ERB.js} +1 -1
  29. package/web/app/immutable/chunks/{DreRgY6W.js → Bg-whL5V.js} +1 -1
  30. package/web/app/immutable/chunks/{ckA-QIlc.js → BgDq477e.js} +1 -1
  31. package/web/app/immutable/chunks/{myjILdXe.js → Bk8FW95r.js} +1 -1
  32. package/web/app/immutable/chunks/{DagQHAoe.js → BlO4hQbr.js} +1 -1
  33. package/web/app/immutable/chunks/{B7Mop_jC.js → BlnCsgUT.js} +1 -1
  34. package/web/app/immutable/chunks/{r_aV6a4U.js → Bq3my5nc.js} +1 -1
  35. package/web/app/immutable/chunks/{B7gQ_nlj.js → BtAXWfJQ.js} +1 -1
  36. package/web/app/immutable/chunks/{CDQiwfpS.js → BuvFVaAY.js} +2 -2
  37. package/web/app/immutable/chunks/{35D9vOc6.js → ByCOW8do.js} +1 -1
  38. package/web/app/immutable/chunks/{C0k-qPFA.js → BzH_KBS3.js} +1 -1
  39. package/web/app/immutable/chunks/{D39ODeMy.js → C2uKsJY1.js} +2 -2
  40. package/web/app/immutable/chunks/{DlL4i-_c.js → C3Zzd9P9.js} +1 -1
  41. package/web/app/immutable/chunks/{BOvycfTx.js → C4GW1bio.js} +1 -1
  42. package/web/app/immutable/chunks/{WCqnCI0Y.js → C5wdd0eM.js} +1 -1
  43. package/web/app/immutable/chunks/{Bx_Kd6Zj.js → CC1lvkyY.js} +1 -1
  44. package/web/app/immutable/chunks/{r2-n1eEu.js → CDMQjeQI.js} +1 -1
  45. package/web/app/immutable/chunks/{CjjnLU79.js → CDuSWzGm.js} +1 -1
  46. package/web/app/immutable/chunks/{3MiSzwO_.js → CGyDAjHZ.js} +1 -1
  47. package/web/app/immutable/chunks/{CYjbCKOB.js → CIYx0ii6.js} +1 -1
  48. package/web/app/immutable/chunks/{GbJiak62.js → CMVV4erq.js} +1 -1
  49. package/web/app/immutable/chunks/{C9Oy0LtB.js → CMWbuQ77.js} +1 -1
  50. package/web/app/immutable/chunks/{s4jPNyw8.js → CP2MUsRz.js} +1 -1
  51. package/web/app/immutable/chunks/{B798GHK3.js → CTG5TYyy.js} +1 -1
  52. package/web/app/immutable/chunks/{B6EWkrDE.js → CTbAPBO1.js} +2 -2
  53. package/web/app/immutable/chunks/{KOIbPY1T.js → CVy7yS5O.js} +1 -1
  54. package/web/app/immutable/chunks/{CziMjc6R.js → CWPMHNwU.js} +3 -3
  55. package/web/app/immutable/chunks/{D3pYGmsv.js → CWRkcPxW.js} +2 -2
  56. package/web/app/immutable/chunks/{Cs3K9au3.js → CX1z_2lx.js} +1 -1
  57. package/web/app/immutable/chunks/{7ZTbeFDr.js → CZHScKIK.js} +1 -1
  58. package/web/app/immutable/chunks/{DcQP1f_r.js → Cageks4o.js} +3 -3
  59. package/web/app/immutable/chunks/{BneSomYW.js → CeqDBCoX.js} +1 -1
  60. package/web/app/immutable/chunks/{CuacBn4U.js → ChKWMNeW.js} +1 -1
  61. package/web/app/immutable/chunks/{C9vpFXDp.js → Cnj-ocZi.js} +1 -1
  62. package/web/app/immutable/chunks/{iXIypZcP.js → CoXtBEKL.js} +1 -1
  63. package/web/app/immutable/chunks/{BDj_hFdE.js → CoZvu7gw.js} +1 -1
  64. package/web/app/immutable/chunks/{BgfnWFwk.js → CrvlOH-I.js} +1 -1
  65. package/web/app/immutable/chunks/{DLFNuh8k.js → CsO2DeV8.js} +1 -1
  66. package/web/app/immutable/chunks/{CjREz2UM.js → CvDuI1Ad.js} +1 -1
  67. package/web/app/immutable/chunks/{zWlUYLxQ.js → CwBsjeRn.js} +1 -1
  68. package/web/app/immutable/chunks/{B9dGZuHJ.js → D-Xd8btl.js} +3 -3
  69. package/web/app/immutable/chunks/{DLrur9eT.js → D0h0gCpu.js} +3 -3
  70. package/web/app/immutable/chunks/{eq-q_IQg.js → D2YHDAng.js} +4 -4
  71. package/web/app/immutable/chunks/{BY3-E0yy.js → D2b0ISji.js} +1 -1
  72. package/web/app/immutable/chunks/{Dmz-4iVB.js → D3HFxkuH.js} +1 -1
  73. package/web/app/immutable/chunks/{CKlsIlGI.js → D4cQTEB9.js} +1 -1
  74. package/web/app/immutable/chunks/{ZNzwzylD.js → D4jYxNmQ.js} +3 -3
  75. package/web/app/immutable/chunks/{CroauewU.js → D7pisHI7.js} +1 -1
  76. package/web/app/immutable/chunks/{dD52HyjL.js → D8kh7QqM.js} +1 -1
  77. package/web/app/immutable/chunks/{TP_FEuf4.js → D9NH4H5p.js} +1 -1
  78. package/web/app/immutable/chunks/{DvJIE9F0.js → D9t8LDcF.js} +1 -1
  79. package/web/app/immutable/chunks/{CGpqxwcV.js → DB8SI3db.js} +1 -1
  80. package/web/app/immutable/chunks/{CjqwEdIV.js → DEtQTkN_.js} +1 -1
  81. package/web/app/immutable/chunks/{C_fXhDsq.js → DFEZ3HlX.js} +12 -12
  82. package/web/app/immutable/chunks/{U3vyCaVU.js → DFGQ_Wfv.js} +1 -1
  83. package/web/app/immutable/chunks/{BjtjqFpR.js → DFXvVPhW.js} +1 -1
  84. package/web/app/immutable/chunks/{B08wwvKU.js → DGtVq4eo.js} +1 -1
  85. package/web/app/immutable/chunks/{BLqcY2WP.js → DLxs6eHm.js} +1 -1
  86. package/web/app/immutable/chunks/{iFTOUkOI.js → DOMHFWTg.js} +2 -2
  87. package/web/app/immutable/chunks/{Bm0frbxK.js → DPX7q3j0.js} +1 -1
  88. package/web/app/immutable/chunks/{fDvN4TBM.js → DQ_XjzmE.js} +1 -1
  89. package/web/app/immutable/chunks/{CyLGGlF1.js → DR6SSU50.js} +4 -4
  90. package/web/app/immutable/chunks/{DFXVbPZk.js → DVrkIyN2.js} +1 -1
  91. package/web/app/immutable/chunks/{ZOCUfPRu.js → DaKr8JPs.js} +6 -6
  92. package/web/app/immutable/chunks/{3JpWDI-M.js → DbRrqEgU.js} +4 -4
  93. package/web/app/immutable/chunks/{Bg-m0Nfi.js → DfqvT9D7.js} +1 -1
  94. package/web/app/immutable/chunks/{DAB4KDZf.js → DgjMPJcg.js} +1 -1
  95. package/web/app/immutable/chunks/{uZRrd2pm.js → DkZvhlo2.js} +1 -1
  96. package/web/app/immutable/chunks/{CNynWE_u.js → DlSyd7Ta.js} +1 -1
  97. package/web/app/immutable/chunks/{BFK7BFQt.js → DlgmTqk6.js} +1 -1
  98. package/web/app/immutable/chunks/{TWLYZedM.js → Dq3wAazc.js} +1 -1
  99. package/web/app/immutable/chunks/{DOuKhcDi.js → DqMdEldm.js} +1 -1
  100. package/web/app/immutable/chunks/{CI3k0XZh.js → DrQhi0x7.js} +4 -4
  101. package/web/app/immutable/chunks/{-nlL-11J.js → Dv6-cB4g.js} +1 -1
  102. package/web/app/immutable/chunks/{D2bUbzxj.js → F0Vwotna.js} +1 -1
  103. package/web/app/immutable/chunks/{DfURqgI9.js → FfF-YfjO.js} +1 -1
  104. package/web/app/immutable/chunks/{B01nzMRs.js → GkbL_5B-.js} +1 -1
  105. package/web/app/immutable/chunks/{BtY5FIF5.js → HUDA8fiy.js} +1 -1
  106. package/web/app/immutable/chunks/{cSZBj2H1.js → MIydPOVw.js} +1 -1
  107. package/web/app/immutable/chunks/{ZWp2d2r6.js → O5KlKm48.js} +1 -1
  108. package/web/app/immutable/chunks/{3t4RuxC6.js → OsOeZocr.js} +2 -2
  109. package/web/app/immutable/chunks/{C6tQk-Lg.js → Rp4RZapB.js} +1 -1
  110. package/web/app/immutable/chunks/{k0Eu5yMT.js → Tl1rpQ5s.js} +1 -1
  111. package/web/app/immutable/chunks/{DkVStA3d.js → ZxSCdpsg.js} +1 -1
  112. package/web/app/immutable/chunks/{BZprW35U.js → aLLkObRk.js} +1 -1
  113. package/web/app/immutable/chunks/{UeWiMZOF.js → i2yMwGh_.js} +1 -1
  114. package/web/app/immutable/chunks/{E96eL6xW.js → jgnoBIlD.js} +1 -1
  115. package/web/app/immutable/chunks/{CRWxVPtt.js → oE7MOocS.js} +1 -1
  116. package/web/app/immutable/chunks/{tNRnW6ie.js → pHsrJNld.js} +1 -1
  117. package/web/app/immutable/chunks/{DZt8Gjbk.js → pLn5y1p2.js} +1 -1
  118. package/web/app/immutable/chunks/{DPWvmlFQ.js → qaQGm9A7.js} +1 -1
  119. package/web/app/immutable/chunks/{Dhbliv-K.js → uSNf4PjE.js} +1 -1
  120. package/web/app/immutable/chunks/{CrKwVRvT.js → vmfD6HOP.js} +1 -1
  121. package/web/app/immutable/chunks/{CP38gzl0.js → vxHpfx-7.js} +1 -1
  122. package/web/app/immutable/chunks/{DkZU9zgp.js → wQb33ERJ.js} +2 -2
  123. package/web/app/immutable/chunks/{AjPbGUJ_.js → zNPAm_g8.js} +1 -1
  124. package/web/app/immutable/entry/{app.DoEJogUG.js → app.uZOa5xAD.js} +2 -2
  125. package/web/app/immutable/entry/start._vSBTu19.js +1 -0
  126. package/web/app/immutable/nodes/{0.BtuyckLI.js → 0.5BN29aF9.js} +1 -1
  127. package/web/app/immutable/nodes/{1.BlE22l2r.js → 1.CScjxXfi.js} +1 -1
  128. package/web/app/immutable/nodes/{10.BZLSu1t9.js → 10.DVkuwBxJ.js} +1 -1
  129. package/web/app/immutable/nodes/{14.CP4eEnwP.js → 14.CQFNVlAh.js} +1 -1
  130. package/web/app/immutable/nodes/{17.DtGxkuYO.js → 17.N0O7ruOc.js} +2 -2
  131. package/web/app/immutable/nodes/{2.C6nyC7hb.js → 2.CahtYp3d.js} +12 -12
  132. package/web/app/immutable/nodes/{3.1uPqjsRC.js → 3.D_5wExma.js} +1 -1
  133. package/web/app/immutable/nodes/{4.BjOowzuW.js → 4.JCAab1Hg.js} +1 -1
  134. package/web/app/immutable/nodes/{5.Dy-YkbU6.js → 5.piNO_yu5.js} +1 -1
  135. package/web/app/immutable/nodes/{6.DR9-o0Dc.js → 6.DXnvvORl.js} +1 -1
  136. package/web/app/immutable/nodes/{7.BR2qXozN.js → 7.Cd-oGu-r.js} +1 -1
  137. package/web/app/immutable/nodes/{8.DxHPj0Oq.js → 8.DhDtXFsS.js} +13 -13
  138. package/web/app/immutable/nodes/{9.BHHxehGk.js → 9.C3bc0Vuy.js} +4 -4
  139. package/web/app/version.json +1 -1
  140. package/web/index.html +9 -9
  141. package/web/app/immutable/entry/start.C_iz1en-.js +0 -1
@@ -1,4 +1,4 @@
1
- import{p as xt}from"./myjILdXe.js";import{aZ as gt,U as $t,Y as bt,b0 as wt,V as Ct,a_ as vt,b as s,ay as O,aX as Dt,B as kt,r as Tt,q as U,W as Z,O as At,a6 as ot}from"./eq-q_IQg.js";import{p as Bt}from"./CFXA-WTd.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...At.cynefin,...Z().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),G={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,G),G.setDomains(t.domains),G.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,I=e/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*17)*m*2-m;d.push({x:c+p,y:o*I})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*31+7),R=p.x+h,V=f,_=i.x-h;D+=` C${R},${V} ${_},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,I=t/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*23)*m*2-m;d.push({x:o*I,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*37+11),R=f,V=p.y+h,_=f,z=i.y-h;D+=` C${R},${V} ${_},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,_t=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,_=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,_,V,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${V} ${_}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Q=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Q,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Q+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const Y=x.getBBox();Y.width>0&&($=Y.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(P=W.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,Y=-x/C,ht=$/C,et=M+Y*W,nt=P+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),Ft={draw:_t},Et=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return`
1
+ import{p as xt}from"./Bk8FW95r.js";import{aZ as gt,U as $t,Y as bt,b0 as wt,V as Ct,a_ as vt,b as s,ay as O,aX as Dt,B as kt,r as Tt,q as U,W as Z,O as At,a6 as ot}from"./D2YHDAng.js";import{p as Bt}from"./CFXA-WTd.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...At.cynefin,...Z().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),G={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,G),G.setDomains(t.domains),G.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,I=e/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*17)*m*2-m;d.push({x:c+p,y:o*I})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*31+7),R=p.x+h,V=f,_=i.x-h;D+=` C${R},${V} ${_},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,I=t/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*23)*m*2-m;d.push({x:o*I,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*37+11),R=f,V=p.y+h,_=f,z=i.y-h;D+=` C${R},${V} ${_},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,_t=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,_=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,_,V,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${V} ${_}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Q=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Q,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Q+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const Y=x.getBBox();Y.width>0&&($=Y.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(P=W.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,Y=-x/C,ht=$/C,et=M+Y*W,nt=P+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),Ft={draw:_t},Et=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return`
2
2
  .cynefinDomain {
3
3
  stroke: none;
4
4
  }
@@ -1,4 +1,4 @@
1
- var e1=Object.defineProperty;var t1=(t,e,r)=>e in t?e1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var se=(t,e,r)=>t1(t,typeof e!="symbol"?e+"":e,r);import{cB as ur,aT as r1,dq as Rl,_ as z0,Y as va,Z as n1,X as a1,a1 as i1,ab as s1,U as o1,dR as l1,M as c1,b9 as Dl,cE as o0,dp as Nl,aS as u1,aW as h1,cm as d1,c8 as m1,dj as Va,dL as p1,dE as f1,ay as Bn,al as g1,at as Si,dn as _l,dB as v1,dV as Ll,dU as b1}from"./De3HYtL6.js";import{D as Ns,bv as y1,bM as w1,aY as k1}from"./BhbOznM0.js";import{M as x1,F as n0}from"./DrH3w3jB.js";import{yn as fn,Ig as M,nz as ve,ny as Se,aM as S1,g as Ol,y as Re,be as l0,jV as Ai,lT as gn,aj as jt,lS as _s,m0 as Ls,lZ as Os,js as Pl,gl as Ya,GE as A1,sZ as T1,zI as M1,oB as E1,mF as vn,Bh as C1,iy as I1,ma as z1,lN as R1}from"./BoIGV7s7.js";import{bo as ne}from"./CNdlzZOD.js";import{t as rt}from"./HVSUZ4Kq.js";import{l as D1,d as xr}from"./Br_KUH7F.js";import{a as c0}from"./BdWqymET.js";import{o as me,r as Gt,e as u0,s as V,_ as Ke,l as h0,g as N1,n as Le,c as or,b as He,u as _1,d as L1}from"./CIyUrgF0.js";import{j as $l}from"./uXuxG9cN.js";import{w as O1}from"./C9ruBEtx.js";import{b as P1}from"./evMM8bqV.js";import{i as je}from"./BdQCA_Nv.js";import{l as ba,c as $1}from"./ChTqQfQN.js";import{ax as d0}from"./D3glRUn0.js";import{o as Sr}from"./DVe2mCXY.js";import{i as Ps}from"./BBy57-xG.js";import{f as Ti,B as Bl,C as ql,l as B1,y as Fl,r as q1,u as F1}from"./VxpSEzE0.js";const We=[];for(let t=0;t<256;++t)We.push((t+256).toString(16).slice(1));function H1(t,e=0){return(We[t[e+0]]+We[t[e+1]]+We[t[e+2]]+We[t[e+3]]+"-"+We[t[e+4]]+We[t[e+5]]+"-"+We[t[e+6]]+We[t[e+7]]+"-"+We[t[e+8]]+We[t[e+9]]+"-"+We[t[e+10]]+We[t[e+11]]+We[t[e+12]]+We[t[e+13]]+We[t[e+14]]+We[t[e+15]]).toLowerCase()}const U1=new Uint8Array(16);function W1(){return crypto.getRandomValues(U1)}function Mi(t,e,r){return crypto.randomUUID?crypto.randomUUID():G1(t)}function G1(t,e,r){t=t||{};const n=t.random??t.rng?.()??W1();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,H1(n)}function Ei(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=Ei({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?x1(r.replace(/\.git\/?$/,""),e):null}function f5(t,e){return t.type==="local"?t.plainFolder?"folder":"local":Ei(t,e)?.provider==="gitlab"?"gitlab":"github"}function Hl(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function g5(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=Hl(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function v5(t){return t.type==="local"&&t.path?t.path:void 0}const j1=["/.clones/","/.repo-cache/"];function b5(t){const e=t.replaceAll("\\","/");return j1.some(r=>e.includes(r))}function y5(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function V1(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function w5(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??V1(r)}}function k5(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,Hl(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const Y1="known-repos",K1=6e4;function X1({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=fn(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(fn(s),s);for(const s of e.repos)a.set(fn(s),s)}const i=[...a.values()].filter(s=>!r[fn(s)]);return n==="all"?i:i.slice(0,9)}function x5(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function S5({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<K1?"skip":"load"}function A5(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=Ei(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function Z1({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ns)?Ns:null;return s===null||!i(s)?null:s}const T5=M.createSelector(t=>t.workspaceInitializer.hydrated),M5=M.createSelector(t=>t.workspaceInitializer.compactFormState),E5=M.createSelector(t=>t.workspaceInitializer.onboardingFormState),C5=M.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),I5=M.createSelector(t=>t.workspaceInitializer.branchByRepo),z5=M.createSelector(t=>t.workspaceInitializer.defaultParentPath),R5=M.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),D5=M.createSelector((t,e)=>Se(t.workspaceInitializer.recentRepoRefreshes,e)),N5=M.createSelector((t,e)=>Se(t.workspaceInitializer.directoryStatusChecks,e)),_5=M.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),L5=M.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),O5=M.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),P5=M.createSelector(t=>t.workspaceInitializer.agentByRepo),$5=M.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),B5=M.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),q5=M.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),F5=M.createSelector((t,e)=>({restore:Se(t.workspaceInitializer.draftRestores,e),clear:Se(t.workspaceInitializer.draftClears,e)})),H5=M.createSelector((t,e,r)=>{const n=Se(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),U5=M.createSelector((t,e)=>Se(t.workspaceInitializer.initializationOutcomes,e)),W5=M.createSelector((t,e)=>Se(t.workspaceInitializer.initializationResumes,e)),G5=M.createSelector(t=>Z1({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:w1.select(t),orchestratorId:y1.select(t)?.id??null})),Q1=M.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=ur.select(t);return e&&r&&r1.select(t)?JSON.stringify([r,e]):null}),j5=M.createSelector(t=>{const e=Q1.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),J1=M.createSelector(t=>{const e=Se(t.workspaceInitializer.recentRepoRefreshes,Y1),r=ur.select(t);return X1({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),V5=M.createSelector(t=>Rl.select(t)?J1.select(t):[]),Y5=M.createSelector(t=>k1.select(t)||void 0),$s="workspace-debug-flags",bn={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class eh{constructor(){se(this,"flags");se(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return bn;try{const e=localStorage.getItem($s);if(e)return{...bn,...JSON.parse(e)}}catch(e){ba.error("Failed to load debug flags:",e)}return bn}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem($s,JSON.stringify(this.flags))}catch(e){ba.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...bn},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),ba.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const ya=new eh;function K5(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function th(t){return t.charAt(0).toUpperCase()+t.slice(1)}function X5(t){if(!t||t.trim().length===0)return ne.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ne.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ne.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ne.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ne.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ne.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ne.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ne.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ne.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ne.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ne.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ne.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ne.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ne.workspace_sidebarHeader_branchTooLong_error()}function Z5(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function Ka(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function Q5(t,e){return`${e}:${t.agentId??"manual"}`}function rh(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function nh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function ah(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function J5(t,e,r,n){const a=rh(t,e),i=n?` (origin/${n})`:"";return r?a===1?ne.workspace_sidebarChanges_addToPr_one({suffix:i}):ne.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ne.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ne.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function e3(t,e,r){const n=nh(t,e),a=r?` (origin/${r})`:"";return n===1?ne.workspace_sidebarChanges_undoPush_one({suffix:a}):ne.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function t3(t,e){const r=ah(t,e);return r===1?ne.workspace_sidebarChanges_undoCommit_one():ne.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function r3(t,e){return e===0&&t.length>0}function n3(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function a3(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function i3(t,e,r){return r?.path===t&&r?.staged===e}function s3(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function o3(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function ih(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function l3(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=ih(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:Ka(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Ci(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:Ka(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function c3(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??S1.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function sh(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function wa(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=z0(i),c=o.toLowerCase(),h=a.find(m=>!!o&&m.url.toLowerCase()===c||(i.resource||i.monitorAvailability?m.monitorIdentity===va(i):!m.resource&&!m.monitorAvailability&&(s?!m.crossRepo&&m.number===i.prNumber:m.crossRepo===i.repo&&m.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?va(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${n1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?va(i):void 0,url:o,htmlUrl:o,status:sh(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Ci(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Ci(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function u3(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const S of n)S.repoOwner&&S.repoName&&s.add(`${S.repoOwner}/${S.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(S=>S.crossRepo)){o=[];for(const S of t)S.crossRepo?s.has(S.crossRepo.toLowerCase())?c.push(S):h.push(S):o.push(S)}const m=[],g=[],v=[];for(const S of e){const C=S.repo.toLowerCase();z0(S)&&o.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&(!i||C===i)?m.push(S):z0(S)&&c.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&s.has(C)?g.push(S):v.push(S)}const w=wa(o,m,r),A=r?.split("/")[0],E=new Set([...w,...c,...h].map(S=>`${(S.crossRepo??r??"").toLowerCase()}#${S.number}`)),D=[...c];for(const S of n){if(!S.repoOwner||!S.repoName)continue;const C=`${S.repoOwner}/${S.repoName}`;for(const W of S.pullRequests??[]){const X=`${C.toLowerCase()}#${W.number}`;if(E.has(X))continue;E.add(X);const K=W.url||`https://github.com/${C}/pull/${W.number}`,T=i!==void 0&&C.toLowerCase()===i;D.push({number:W.number,title:a(W),url:K,htmlUrl:K,status:Ka(W.status),createdAt:W.createdAt,updatedAt:W.updatedAt,crossRepo:T?void 0:C,crossRepoDisplay:T?void 0:Ci(C,A)})}}return{own:w,otherRoots:wa(D,g,r),otherTracked:wa(h,v,r)}}function Bs(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function h3(t){const e=t.status==="merged"?ne.workspace_prSection_merged_label():t.status==="closed"?ne.workspace_prSection_closed_label():t.status==="draft"?ne.workspace_prSection_statusDraft_label():Bs(t)?ne.workspace_prSection_statusQueued_label():ne.workspace_prSection_statusOpen_label(),r=[a1(t)??e],n=Bs(t)?D1(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ne.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ne.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ne.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ne.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ne.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ne.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ne.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(th(a.mergeBlockedReason))),r.join(`
1
+ var e1=Object.defineProperty;var t1=(t,e,r)=>e in t?e1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var se=(t,e,r)=>t1(t,typeof e!="symbol"?e+"":e,r);import{cB as ur,aT as r1,dq as Rl,_ as z0,Y as va,Z as n1,X as a1,a1 as i1,ab as s1,U as o1,dR as l1,M as c1,b9 as Dl,cE as o0,dp as Nl,aS as u1,aW as h1,cm as d1,c8 as m1,dj as Va,dL as p1,dE as f1,ay as Bn,al as g1,at as Si,dn as _l,dB as v1,dV as Ll,dU as b1}from"./De3HYtL6.js";import{D as Ns,bv as y1,bM as w1,aY as k1}from"./BJjlHQnx.js";import{M as x1,F as n0}from"./DrH3w3jB.js";import{yn as fn,Ig as M,nz as ve,ny as Se,aM as S1,g as Ol,y as Re,be as l0,jV as Ai,lT as gn,aj as jt,lS as _s,m0 as Ls,lZ as Os,js as Pl,gl as Ya,GE as A1,sZ as T1,zI as M1,oB as E1,mF as vn,Bh as C1,iy as I1,ma as z1,lN as R1}from"./BoIGV7s7.js";import{bo as ne}from"./CNdlzZOD.js";import{t as rt}from"./HVSUZ4Kq.js";import{l as D1,d as xr}from"./Br_KUH7F.js";import{a as c0}from"./BdWqymET.js";import{o as me,r as Gt,e as u0,s as V,_ as Ke,l as h0,g as N1,n as Le,c as or,b as He,u as _1,d as L1}from"./CIyUrgF0.js";import{j as $l}from"./uXuxG9cN.js";import{w as O1}from"./C9ruBEtx.js";import{b as P1}from"./evMM8bqV.js";import{i as je}from"./BdQCA_Nv.js";import{l as ba,c as $1}from"./ChTqQfQN.js";import{ax as d0}from"./D3glRUn0.js";import{o as Sr}from"./DVe2mCXY.js";import{i as Ps}from"./BBy57-xG.js";import{f as Ti,B as Bl,C as ql,l as B1,y as Fl,r as q1,u as F1}from"./VxpSEzE0.js";const We=[];for(let t=0;t<256;++t)We.push((t+256).toString(16).slice(1));function H1(t,e=0){return(We[t[e+0]]+We[t[e+1]]+We[t[e+2]]+We[t[e+3]]+"-"+We[t[e+4]]+We[t[e+5]]+"-"+We[t[e+6]]+We[t[e+7]]+"-"+We[t[e+8]]+We[t[e+9]]+"-"+We[t[e+10]]+We[t[e+11]]+We[t[e+12]]+We[t[e+13]]+We[t[e+14]]+We[t[e+15]]).toLowerCase()}const U1=new Uint8Array(16);function W1(){return crypto.getRandomValues(U1)}function Mi(t,e,r){return crypto.randomUUID?crypto.randomUUID():G1(t)}function G1(t,e,r){t=t||{};const n=t.random??t.rng?.()??W1();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,H1(n)}function Ei(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=Ei({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?x1(r.replace(/\.git\/?$/,""),e):null}function f5(t,e){return t.type==="local"?t.plainFolder?"folder":"local":Ei(t,e)?.provider==="gitlab"?"gitlab":"github"}function Hl(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function g5(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=Hl(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function v5(t){return t.type==="local"&&t.path?t.path:void 0}const j1=["/.clones/","/.repo-cache/"];function b5(t){const e=t.replaceAll("\\","/");return j1.some(r=>e.includes(r))}function y5(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function V1(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function w5(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??V1(r)}}function k5(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,Hl(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const Y1="known-repos",K1=6e4;function X1({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=fn(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(fn(s),s);for(const s of e.repos)a.set(fn(s),s)}const i=[...a.values()].filter(s=>!r[fn(s)]);return n==="all"?i:i.slice(0,9)}function x5(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function S5({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<K1?"skip":"load"}function A5(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=Ei(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function Z1({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ns)?Ns:null;return s===null||!i(s)?null:s}const T5=M.createSelector(t=>t.workspaceInitializer.hydrated),M5=M.createSelector(t=>t.workspaceInitializer.compactFormState),E5=M.createSelector(t=>t.workspaceInitializer.onboardingFormState),C5=M.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),I5=M.createSelector(t=>t.workspaceInitializer.branchByRepo),z5=M.createSelector(t=>t.workspaceInitializer.defaultParentPath),R5=M.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),D5=M.createSelector((t,e)=>Se(t.workspaceInitializer.recentRepoRefreshes,e)),N5=M.createSelector((t,e)=>Se(t.workspaceInitializer.directoryStatusChecks,e)),_5=M.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),L5=M.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),O5=M.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),P5=M.createSelector(t=>t.workspaceInitializer.agentByRepo),$5=M.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),B5=M.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),q5=M.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),F5=M.createSelector((t,e)=>({restore:Se(t.workspaceInitializer.draftRestores,e),clear:Se(t.workspaceInitializer.draftClears,e)})),H5=M.createSelector((t,e,r)=>{const n=Se(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),U5=M.createSelector((t,e)=>Se(t.workspaceInitializer.initializationOutcomes,e)),W5=M.createSelector((t,e)=>Se(t.workspaceInitializer.initializationResumes,e)),G5=M.createSelector(t=>Z1({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:w1.select(t),orchestratorId:y1.select(t)?.id??null})),Q1=M.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=ur.select(t);return e&&r&&r1.select(t)?JSON.stringify([r,e]):null}),j5=M.createSelector(t=>{const e=Q1.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),J1=M.createSelector(t=>{const e=Se(t.workspaceInitializer.recentRepoRefreshes,Y1),r=ur.select(t);return X1({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),V5=M.createSelector(t=>Rl.select(t)?J1.select(t):[]),Y5=M.createSelector(t=>k1.select(t)||void 0),$s="workspace-debug-flags",bn={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class eh{constructor(){se(this,"flags");se(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return bn;try{const e=localStorage.getItem($s);if(e)return{...bn,...JSON.parse(e)}}catch(e){ba.error("Failed to load debug flags:",e)}return bn}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem($s,JSON.stringify(this.flags))}catch(e){ba.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...bn},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),ba.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const ya=new eh;function K5(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function th(t){return t.charAt(0).toUpperCase()+t.slice(1)}function X5(t){if(!t||t.trim().length===0)return ne.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ne.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ne.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ne.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ne.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ne.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ne.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ne.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ne.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ne.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ne.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ne.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ne.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ne.workspace_sidebarHeader_branchTooLong_error()}function Z5(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function Ka(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function Q5(t,e){return`${e}:${t.agentId??"manual"}`}function rh(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function nh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function ah(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function J5(t,e,r,n){const a=rh(t,e),i=n?` (origin/${n})`:"";return r?a===1?ne.workspace_sidebarChanges_addToPr_one({suffix:i}):ne.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ne.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ne.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function e3(t,e,r){const n=nh(t,e),a=r?` (origin/${r})`:"";return n===1?ne.workspace_sidebarChanges_undoPush_one({suffix:a}):ne.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function t3(t,e){const r=ah(t,e);return r===1?ne.workspace_sidebarChanges_undoCommit_one():ne.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function r3(t,e){return e===0&&t.length>0}function n3(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function a3(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function i3(t,e,r){return r?.path===t&&r?.staged===e}function s3(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function o3(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function ih(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function l3(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=ih(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:Ka(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Ci(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:Ka(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function c3(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??S1.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function sh(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function wa(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=z0(i),c=o.toLowerCase(),h=a.find(m=>!!o&&m.url.toLowerCase()===c||(i.resource||i.monitorAvailability?m.monitorIdentity===va(i):!m.resource&&!m.monitorAvailability&&(s?!m.crossRepo&&m.number===i.prNumber:m.crossRepo===i.repo&&m.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?va(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${n1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?va(i):void 0,url:o,htmlUrl:o,status:sh(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Ci(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Ci(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function u3(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const S of n)S.repoOwner&&S.repoName&&s.add(`${S.repoOwner}/${S.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(S=>S.crossRepo)){o=[];for(const S of t)S.crossRepo?s.has(S.crossRepo.toLowerCase())?c.push(S):h.push(S):o.push(S)}const m=[],g=[],v=[];for(const S of e){const C=S.repo.toLowerCase();z0(S)&&o.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&(!i||C===i)?m.push(S):z0(S)&&c.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&s.has(C)?g.push(S):v.push(S)}const w=wa(o,m,r),A=r?.split("/")[0],E=new Set([...w,...c,...h].map(S=>`${(S.crossRepo??r??"").toLowerCase()}#${S.number}`)),D=[...c];for(const S of n){if(!S.repoOwner||!S.repoName)continue;const C=`${S.repoOwner}/${S.repoName}`;for(const W of S.pullRequests??[]){const X=`${C.toLowerCase()}#${W.number}`;if(E.has(X))continue;E.add(X);const K=W.url||`https://github.com/${C}/pull/${W.number}`,T=i!==void 0&&C.toLowerCase()===i;D.push({number:W.number,title:a(W),url:K,htmlUrl:K,status:Ka(W.status),createdAt:W.createdAt,updatedAt:W.updatedAt,crossRepo:T?void 0:C,crossRepoDisplay:T?void 0:Ci(C,A)})}}return{own:w,otherRoots:wa(D,g,r),otherTracked:wa(h,v,r)}}function Bs(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function h3(t){const e=t.status==="merged"?ne.workspace_prSection_merged_label():t.status==="closed"?ne.workspace_prSection_closed_label():t.status==="draft"?ne.workspace_prSection_statusDraft_label():Bs(t)?ne.workspace_prSection_statusQueued_label():ne.workspace_prSection_statusOpen_label(),r=[a1(t)??e],n=Bs(t)?D1(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ne.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ne.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ne.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ne.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ne.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ne.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ne.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(th(a.mergeBlockedReason))),r.join(`
2
2
  `)}function d3(t,e){return e.has(t??"manual")}function m3(t,e){return{path:t.relativePath,additions:t.stats.additions,deletions:t.stats.deletions,staged:e,status:t.status,attribution:t.attribution?.agent?{agentId:t.attribution.agent.agentId,agentName:t.attribution.agent.agentName,sessionId:t.attribution.agent.sessionId,turnNumber:t.attribution.agent.turnNumber,timestamp:t.attribution.timestamp}:void 0}}const Ul=500;function p3(t,e=Ul){const r=Math.max(0,Math.floor(e));return t.length<=r?{visible:t,shown:t.length,hiddenCount:0}:{visible:t.slice(0,r),shown:r,hiddenCount:t.length-r}}function f3(t,e,r=Ul){let n=Math.max(0,Math.floor(r)),a=0,i=0;return{groups:t.map(o=>{if(e(o))return{group:o,visibleFiles:[]};const c=Math.min(n,o.files.length);return n-=c,a+=c,i+=o.files.length-c,{group:o,visibleFiles:c===o.files.length?o.files:o.files.slice(0,c)}}),shown:a,hiddenCount:i}}function g3(t){if(t.hiddenCount<=0)return"";const e=rt(t.shown),r=rt(t.shown+t.hiddenCount);return t.hiddenCount===1?ne.workspace_fileChanges_hiddenFiles_one({shown:e,total:r}):ne.workspace_fileChanges_hiddenFiles_many({shown:e,total:r,count:rt(t.hiddenCount)})}function oh(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function Xa(t){return t.startsWith("@")?t.slice(1):t}function lh(t,e,r,n){const a=t.fullPath||t.path||t.filename;if(a)return Xa(String(a));const i=[r,e,n.trim()].map(Xa).filter(Boolean),s=i.find(o=>o.includes("/"))??i[0];return s?i1(s).path:void 0}function ch(t){const e=t.line??t.startLine??t.range?.start;return typeof e=="number"&&Number.isFinite(e)?e:void 0}function uh(t){if(!t||t.getAttribute("data-mention")===null)return null;const e=t.getAttribute("data-type")||"",r=t.getAttribute("data-id")||"",n=t.getAttribute("data-label")||"",a=t.getAttribute("data-uri")||"",i=oh(t.getAttribute("data-meta")),s={type:e,id:r,label:n,uri:a,meta:i},o=a.startsWith("intent://")?a:typeof i.fullUrl=="string"&&i.fullUrl.startsWith("intent://")?i.fullUrl:void 0;if(o&&(s.intentUrl=o),e==="file"||e==="file-range"){const c=lh(i,n,r,t.textContent||"");c&&(s.filePath=c);const h=ch(i);h!==void 0&&(s.line=h)}else if(e==="folder"||e==="source-folder"){const c=i.fullPath||i.path||r||n,h=c?Xa(String(c)).replace(/\/+$/,""):"";h&&(s.folderPath=h)}else if(e==="note"||e==="note-range"){const c=i.noteId||r;c&&(s.note=i.isExternalLink&&i.workspaceId?{id:c,workspaceId:String(i.workspaceId)}:{id:c})}return s}function v3(t){return{sidebarTabId:"files",type:"file",filePath:`${t}/`}}function Ii(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lr=Ii();function Wl(t){Lr=t}var Ir={exec:()=>null};function Yr(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),a=e[n];return a||(a=t(n),e[n]=a),a}}function ce(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(Ye.caret,"$1"),r=r.replace(a,s),n},getRegex:()=>new RegExp(r,e)};return n}var hh=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ye={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Yr(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Yr(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Yr(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Yr(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Yr(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Yr(t=>new RegExp(`^ {0,${t}}>`))},dh=/^(?:[ \t]*(?:\n|$))+/,mh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ph=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,U0=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jl=ce(Gl).replace(/bull/g,zi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),gh=ce(Gl).replace(/bull/g,zi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ri=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,vh=/^[^\n]+/,Di=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,bh=ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Di).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yh=ce(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zi).getRegex(),qn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ni=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wh=ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ni).replace("tag",qn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vl=t=>ce(Ri).replace("hr",U0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qn).getRegex(),kh=Vl(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),xh=Vl(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Sh=ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",xh).getRegex(),_i={blockquote:Sh,code:mh,def:bh,fences:ph,heading:fh,hr:U0,html:wh,lheading:jl,list:yh,newline:dh,paragraph:kh,table:Ir,text:vh},qs=ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",U0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qn).getRegex(),Ah={..._i,lheading:gh,table:qs,paragraph:ce(Ri).replace("hr",U0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qn).getRegex()},Th={..._i,html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ni).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ir,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ce(Ri).replace("hr",U0).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",jl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Mh=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Eh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Yl=/^( {2,}|\\)\n(?!\s*$)/,Ch=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vt=/[\p{P}\p{S}]/u,m0=/[\s\p{P}\p{S}]/u,W0=/[^\s\p{P}\p{S}]/u,Ih=ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,m0).getRegex(),zh=/[\p{Pi}\p{Ps}"']/u,Kl=/(?!~)[\p{P}\p{S}]/u,Rh=/(?!~)[\s\p{P}\p{S}]/u,Dh=/(?:[^\s\p{P}\p{S}]|~)/u,Nh=ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",hh?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Xl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,_h=ce(Xl,"u").replace(/punct/g,Vt).getRegex(),Lh=ce(Xl,"u").replace(/punct/g,Kl).getRegex(),Oh=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ph=ce(Oh,"u").replace(/openQuote/g,zh).replace(/punct/g,Vt).getRegex(),Zl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$h=ce(Zl,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Vt).getRegex(),Bh=ce(Zl,"gu").replace(/notPunctSpace/g,Dh).replace(/punctSpace/g,Rh).replace(/punct/g,Kl).getRegex(),qh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Fh=ce(qh,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Vt).getRegex(),Hh=ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Vt).getRegex(),Uh="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Wh=ce(Uh,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Vt).getRegex(),Gh=ce(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Vt).getRegex(),jh="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Vh=ce(jh,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Vt).getRegex(),Yh=ce(/\\(punct)/,"gu").replace(/punct/g,Vt).getRegex(),Kh=ce(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xh=ce(Ni).replace("(?:-->|$)","-->").getRegex(),Zh=ce("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qh=ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Nn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ql=ce(/^!?\[(label)\]\[(ref)\]/).replace("label",Nn).replace("ref",Di).getRegex(),Jl=ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",Di).getRegex(),Jh=ce("reflink|nolink(?!\\()","g").replace("reflink",Ql).replace("nolink",Jl).getRegex(),Fs=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Li={_backpedal:Ir,anyPunctuation:Yh,autolink:Kh,blockSkip:Nh,br:Yl,code:Eh,del:Ir,delLDelim:Ir,delRDelim:Ir,emStrongLDelim:_h,emStrongRDelimAst:$h,emStrongRDelimUnd:Hh,escape:Mh,link:Qh,nolink:Jl,punctuation:Ih,reflink:Ql,reflinkSearch:Jh,tag:Zh,text:Ch,url:Ir},ed={...Li,emStrongLDelim:Ph,emStrongRDelimAst:Fh,emStrongRDelimUnd:Wh,link:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",Nn).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nn).getRegex()},Za={...Li,emStrongRDelimAst:Bh,emStrongLDelim:Lh,delLDelim:Gh,delRDelim:Vh,url:ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fs).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ce(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fs).getRegex()},td={...Za,br:ce(Yl).replace("{2,}","*").getRegex(),text:ce(Za.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},yn={normal:_i,gfm:Ah,pedantic:Th},x0={normal:Li,gfm:Za,breaks:td,pedantic:ed},rd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Hs=t=>rd[t];function Dt(t,e){if(e){if(Ye.escapeTest.test(t))return t.replace(Ye.escapeReplace,Hs)}else if(Ye.escapeTestNoEncode.test(t))return t.replace(Ye.escapeReplaceNoEncode,Hs);return t}function Us(t){try{t=encodeURI(t).replace(Ye.percentDecode,"%")}catch{return null}return t}function Ws(t,e){let r=t.replace(Ye.findPipe,(i,s,o)=>{let c=!1,h=s;for(;--h>=0&&o[h]==="\\";)c=!c;return c?"|":" |"}),n=r.split(Ye.splitPipe),a=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(Ye.slashPipe,"|");return n}function tr(t,e,r){let n=t.length;if(n===0)return"";let a=0;for(;a<n&&t.charAt(n-a-1)===e;)a++;return t.slice(0,n-a)}function Gs(t){let e=t.split(`
4
4
  `),r=e.length-1;for(;r>=0&&Ye.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`