@intent-hq/web 2.387.1 → 2.387.2

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 (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{CB-znH8P.js → -lHTHpP1.js} +2 -2
  3. package/web/app/immutable/chunks/{D6Q-N0-R.js → 008oakff.js} +2 -2
  4. package/web/app/immutable/chunks/{CV7mOfKN.js → 0x2uouHf.js} +1 -1
  5. package/web/app/immutable/chunks/{FhJRiT1S.js → 50A7Z_-B.js} +2 -2
  6. package/web/app/immutable/chunks/{DCkRL43S.js → 5PJaIC3r.js} +1 -1
  7. package/web/app/immutable/chunks/{CzRhnymD.js → 9-uroABC.js} +1 -1
  8. package/web/app/immutable/chunks/{D9Hjcszu.js → AOZzp8ty.js} +3 -3
  9. package/web/app/immutable/chunks/{DrStWuxU.js → AYY4LgeX.js} +1 -1
  10. package/web/app/immutable/chunks/{Da6yJ5JS.js → B-zoUUuH.js} +1 -1
  11. package/web/app/immutable/chunks/{Btsk8yXd.js → B00JHs7f.js} +1 -1
  12. package/web/app/immutable/chunks/{B9guVudk.js → B0ezV3l2.js} +1 -1
  13. package/web/app/immutable/chunks/{DujtjgwV.js → B3MH86Vn.js} +1 -1
  14. package/web/app/immutable/chunks/{CSdAdmLZ.js → B3TMsgS_.js} +1 -1
  15. package/web/app/immutable/chunks/{C4S7j2UJ.js → B43V2T0m.js} +1 -1
  16. package/web/app/immutable/chunks/{4T0RCl9z.js → B8xvO_6_.js} +1 -1
  17. package/web/app/immutable/chunks/{CP7zJE2f.js → B9y0cZhw.js} +1 -1
  18. package/web/app/immutable/chunks/{CffZor2V.js → BCXPUO8b.js} +1 -1
  19. package/web/app/immutable/chunks/{CGPxDdZI.js → BCvggkji.js} +1 -1
  20. package/web/app/immutable/chunks/{oVV8Q_Hb.js → BDNdgg66.js} +1 -1
  21. package/web/app/immutable/chunks/{CXkLsKgj.js → BDWHrJG-.js} +2 -2
  22. package/web/app/immutable/chunks/{Bd8IVx5H.js → BDlra3t9.js} +1 -1
  23. package/web/app/immutable/chunks/{Dcnwzgw6.js → BDt9E5uz.js} +1 -1
  24. package/web/app/immutable/chunks/{BoGNoNFW.js → BIRGsT3P.js} +1 -1
  25. package/web/app/immutable/chunks/{C9wBKZsV.js → BI_DusvG.js} +1 -1
  26. package/web/app/immutable/chunks/{CA_3gGLy.js → BJexyObh.js} +1 -1
  27. package/web/app/immutable/chunks/{BGh7-lCM.js → BL-MsXUm.js} +7 -7
  28. package/web/app/immutable/chunks/{nOvpikoA.js → BLkSfPBb.js} +1 -1
  29. package/web/app/immutable/chunks/{B0tiGTFc.js → BPQAdw1o.js} +1 -1
  30. package/web/app/immutable/chunks/{ptqq1hqu.js → BRKRniXi.js} +1 -1
  31. package/web/app/immutable/chunks/{5j6plyZH.js → BRjGoMQ9.js} +1 -1
  32. package/web/app/immutable/chunks/{cKeJwK9J.js → BSE7V9gR.js} +1 -1
  33. package/web/app/immutable/chunks/{BtUFJg3H.js → BUV-totk.js} +1 -1
  34. package/web/app/immutable/chunks/{yMNZVIZN.js → BUuO1cTh.js} +2 -2
  35. package/web/app/immutable/chunks/{NpwlBTfT.js → BWPNcv11.js} +1 -1
  36. package/web/app/immutable/chunks/{aoPstOyp.js → BXLAqQEF.js} +2 -2
  37. package/web/app/immutable/chunks/{B2Bshsum.js → Be8Ashad.js} +1 -1
  38. package/web/app/immutable/chunks/{DIcuhccs.js → Beo-CJDg.js} +1 -1
  39. package/web/app/immutable/chunks/{D0hLqQX-.js → BgLEGr1h.js} +1 -1
  40. package/web/app/immutable/chunks/{BWmQYGJo.js → BherRhQp.js} +1 -1
  41. package/web/app/immutable/chunks/{BgV6mURq.js → Bjf7hugP.js} +2 -2
  42. package/web/app/immutable/chunks/{CfK5RUHZ.js → BkMXle2_.js} +1 -1
  43. package/web/app/immutable/chunks/{BpNCDrL-.js → Bksce3O_.js} +1 -1
  44. package/web/app/immutable/chunks/{WoPFTWyQ.js → BsTFmNb9.js} +1 -1
  45. package/web/app/immutable/chunks/{DJKfrY8C.js → BxLkg7uH.js} +2 -2
  46. package/web/app/immutable/chunks/{eJwA1uvO.js → Bxy-dKiU.js} +1 -1
  47. package/web/app/immutable/chunks/{DL95yZo7.js → C2bGK2Dk.js} +2 -2
  48. package/web/app/immutable/chunks/{D9M659lc.js → C4iGtRjS.js} +1 -1
  49. package/web/app/immutable/chunks/{CwGPCWH6.js → C8xlptKa.js} +1 -1
  50. package/web/app/immutable/chunks/{D67AA9yd.js → CAaPJl7G.js} +1 -1
  51. package/web/app/immutable/chunks/{CzFfpwQB.js → CAgbd5Ti.js} +1 -1
  52. package/web/app/immutable/chunks/{DTtB67Qo.js → CBkBKkDd.js} +4 -4
  53. package/web/app/immutable/chunks/{BHqyzGtP.js → CElnCtuM.js} +1 -1
  54. package/web/app/immutable/chunks/{DC1CSztK.js → CI8Lw58b.js} +1 -1
  55. package/web/app/immutable/chunks/{whliLT1v.js → CJ1JqFmW.js} +1 -1
  56. package/web/app/immutable/chunks/{D-6Jv2pD.js → CQLtSEV2.js} +1 -1
  57. package/web/app/immutable/chunks/{tU2KtqMG.js → CQjRAr0U.js} +1 -1
  58. package/web/app/immutable/chunks/{BKpfaDrr.js → CR20hpZS.js} +1 -1
  59. package/web/app/immutable/chunks/{B_5X6pL_.js → CS6vI0me.js} +1 -1
  60. package/web/app/immutable/chunks/{DINctf8I.js → CSvryKTi.js} +1 -1
  61. package/web/app/immutable/chunks/{CkXORNl2.js → CV2tYqJV.js} +1 -1
  62. package/web/app/immutable/chunks/{Dx1ZiLP_.js → CVhzAujT.js} +1 -1
  63. package/web/app/immutable/chunks/{DMlhLPB0.js → CWsF2_VC.js} +1 -1
  64. package/web/app/immutable/chunks/{Ccr7s0GQ.js → CcT7kKD0.js} +1 -1
  65. package/web/app/immutable/chunks/{Caqb9E2M.js → Ccr5qYxN.js} +1 -1
  66. package/web/app/immutable/chunks/{BKqd3SpJ.js → CdaZbV8l.js} +3 -3
  67. package/web/app/immutable/chunks/{DzI8RUwZ.js → Ce0BIIDa.js} +1 -1
  68. package/web/app/immutable/chunks/{BfhnpOE4.js → CfbxOJat.js} +1 -1
  69. package/web/app/immutable/chunks/{D8BzOeFD.js → CfhdjjBQ.js} +1 -1
  70. package/web/app/immutable/chunks/{DW_seDlm.js → CkSfh61f.js} +1 -1
  71. package/web/app/immutable/chunks/{C8guha5a.js → CmbDm8yU.js} +1 -1
  72. package/web/app/immutable/chunks/{Ddc7chXR.js → CnskB1XE.js} +1 -1
  73. package/web/app/immutable/chunks/{CQU55hIk.js → Cof8gmNK.js} +1 -1
  74. package/web/app/immutable/chunks/{Cn034oEm.js → Cp82YYua.js} +1 -1
  75. package/web/app/immutable/chunks/{DQZhKtkC.js → CsxKvalJ.js} +1 -1
  76. package/web/app/immutable/chunks/{KlNP4OZJ.js → CuNu9amm.js} +1 -1
  77. package/web/app/immutable/chunks/{BP6IQXl5.js → CvHiGYhL.js} +1 -1
  78. package/web/app/immutable/chunks/{BlaJXdkI.js → Cw2Jpa3G.js} +2 -2
  79. package/web/app/immutable/chunks/{-hGB5JIm.js → CyTx9--U.js} +1 -1
  80. package/web/app/immutable/chunks/{4EMyw6Bc.js → D1O8c-XE.js} +1 -1
  81. package/web/app/immutable/chunks/{BAVqPace.js → D2F02ltW.js} +1 -1
  82. package/web/app/immutable/chunks/{YFBzMq6w.js → D353gQK9.js} +1 -1
  83. package/web/app/immutable/chunks/{Dgmou2n8.js → D4HnBWIz.js} +1 -1
  84. package/web/app/immutable/chunks/{Ck3g194G.js → D6kOheez.js} +1 -1
  85. package/web/app/immutable/chunks/{Bt9izmhQ.js → D8nUBH9m.js} +1 -1
  86. package/web/app/immutable/chunks/{CHKOALDI.js → DABB0YKb.js} +1 -1
  87. package/web/app/immutable/chunks/{BDSbC3H_.js → DKUSDh19.js} +1 -1
  88. package/web/app/immutable/chunks/{Bf-yBg_f.js → DMEYEHEJ.js} +1 -1
  89. package/web/app/immutable/chunks/{Be5fV6fq.js → DQdW3cIp.js} +1 -1
  90. package/web/app/immutable/chunks/{CB2VKTMK.js → DTp2ogAW.js} +1 -1
  91. package/web/app/immutable/chunks/{D9MZU0Xg.js → DVdxemX2.js} +1 -1
  92. package/web/app/immutable/chunks/{B-9zOddN.js → DXAvNH3m.js} +1 -1
  93. package/web/app/immutable/chunks/{BhFMyG47.js → DYtAW_JF.js} +1 -1
  94. package/web/app/immutable/chunks/{cHm1EnSF.js → DZ5jcXxx.js} +3 -3
  95. package/web/app/immutable/chunks/{Dde5tnWd.js → DgXUCDp0.js} +2 -2
  96. package/web/app/immutable/chunks/{D83yV23-.js → DiGF1QZI.js} +1 -1
  97. package/web/app/immutable/chunks/{B1lrKll_.js → DjWdAsv4.js} +4 -4
  98. package/web/app/immutable/chunks/{CLvqNeoi.js → DkM6pApv.js} +1 -1
  99. package/web/app/immutable/chunks/{D57Jyp6W.js → DmBIaaw1.js} +1 -1
  100. package/web/app/immutable/chunks/{C7JeHEH2.js → DoOGebPl.js} +1 -1
  101. package/web/app/immutable/chunks/{D55LTeKe.js → DsP8kMCe.js} +1 -1
  102. package/web/app/immutable/chunks/{BpPZlehu.js → DwHRyZvZ.js} +1 -1
  103. package/web/app/immutable/chunks/{BevVqXi3.js → DzEQS47t.js} +1 -1
  104. package/web/app/immutable/chunks/{DqfdHjn7.js → DzX7N4dl.js} +1 -1
  105. package/web/app/immutable/chunks/{DLs3P_Wt.js → E-oQnJBy.js} +1 -1
  106. package/web/app/immutable/chunks/{BEuhalzY.js → E0h7d-uJ.js} +1 -1
  107. package/web/app/immutable/chunks/{BJfXDnA-.js → E4QyIuMc.js} +1 -1
  108. package/web/app/immutable/chunks/{CXCilPkm.js → N6CYAKjU.js} +3 -3
  109. package/web/app/immutable/chunks/{BpiO5nnh.js → Q--Jdcqq.js} +1 -1
  110. package/web/app/immutable/chunks/{BWq8kRZa.js → Q2Fhc9xf.js} +1 -1
  111. package/web/app/immutable/chunks/{CnqyGFOt.js → SUc3hjvu.js} +1 -1
  112. package/web/app/immutable/chunks/{D8bY4ERR.js → WIpix-jK.js} +4 -4
  113. package/web/app/immutable/chunks/{bs-TVtqR.js → a8KDQTjI.js} +1 -1
  114. package/web/app/immutable/chunks/{C_-0Y1ed.js → c-b7vp56.js} +1 -1
  115. package/web/app/immutable/chunks/{BsCPiCkz.js → cLiNexV2.js} +1 -1
  116. package/web/app/immutable/chunks/{C7dAe4yg.js → ddYZXH0s.js} +1 -1
  117. package/web/app/immutable/chunks/{C4JyfUH_.js → gs8EHWKj.js} +1 -1
  118. package/web/app/immutable/chunks/{CxCmx5S0.js → iYBWUn-Y.js} +1 -1
  119. package/web/app/immutable/chunks/{D_j4wRX_.js → jrJ2dWK7.js} +3 -3
  120. package/web/app/immutable/chunks/{BgKaGgl0.js → kPePSbed.js} +1 -1
  121. package/web/app/immutable/chunks/{C64UuXDx.js → lthgBKpc.js} +1 -1
  122. package/web/app/immutable/chunks/{BQmS_6pd.js → q1hD1wA_.js} +1 -1
  123. package/web/app/immutable/chunks/{B9iclnD1.js → sRkVH83r.js} +1 -1
  124. package/web/app/immutable/chunks/{BteojGYq.js → t7OX0H3A.js} +1 -1
  125. package/web/app/immutable/chunks/{84z5wXrw.js → tdkdPDHZ.js} +1 -1
  126. package/web/app/immutable/chunks/{7lcZWflB.js → ujrHKn1R.js} +3 -3
  127. package/web/app/immutable/chunks/{Yz7dkp3Z.js → yvEwd65w.js} +1 -1
  128. package/web/app/immutable/chunks/{2S2jdRaL.js → zec4sHtD.js} +1 -1
  129. package/web/app/immutable/entry/{app.TFdw1N9t.js → app.CiEe3jVw.js} +2 -2
  130. package/web/app/immutable/entry/start.lgb00fUy.js +1 -0
  131. package/web/app/immutable/nodes/{0.D7LoWNFt.js → 0.Rx4EZM26.js} +1 -1
  132. package/web/app/immutable/nodes/{1.T820Pcdi.js → 1.CTGLcOWT.js} +1 -1
  133. package/web/app/immutable/nodes/{10.TooAJmth.js → 10.B1s4o90R.js} +1 -1
  134. package/web/app/immutable/nodes/{11.YCt8uKtA.js → 11.BwS8WTYv.js} +1 -1
  135. package/web/app/immutable/nodes/{15.BaajVSfs.js → 15.aeOKe3S4.js} +1 -1
  136. package/web/app/immutable/nodes/{19.BBw49idM.js → 19.p0y9h6Bd.js} +2 -2
  137. package/web/app/immutable/nodes/{2.CXHTT9vG.js → 2.DmLTCsKI.js} +1 -1
  138. package/web/app/immutable/nodes/{3.CafUSpEU.js → 3.CIGlwKH6.js} +1 -1
  139. package/web/app/immutable/nodes/{4.wtpkgmx_.js → 4.xsZADnG7.js} +1 -1
  140. package/web/app/immutable/nodes/{5.D26Atcdx.js → 5.DISXcTBo.js} +1 -1
  141. package/web/app/immutable/nodes/{6.uEepPxKF.js → 6.BBw6C3qe.js} +1 -1
  142. package/web/app/immutable/nodes/{7.D-r8R1wS.js → 7.D_jGH1JW.js} +1 -1
  143. package/web/app/immutable/nodes/{8.ELuFvMEz.js → 8.C9qcwGHA.js} +1 -1
  144. package/web/app/immutable/nodes/{9.tuk9n1NJ.js → 9.CKMXXqjg.js} +2 -2
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.CSPHmABT.js +0 -1
@@ -1,4 +1,4 @@
1
- import{g as Fe}from"./BoGNoNFW.js";import{ap as Me,a5 as xe,ar as Ke,bc as We,bb as Ye,be as Ve,bd as Ue,b9 as He,b7 as Xe,b2 as je,aN as Ge,aF as qe,aE as Je,az as Ze,aj as Qe,ai as $e,ak as et,S as tt,R as st,K as rt,k as it,I as at,f as nt,g as ot,e as ct,b as u,W as P,aW as X,ag as lt,aD as ut,B as ht,ay as y,r as gt,am as dt,aU as pt,ab as ft,x as bt,aT as St,p as xt,X as Le,ae as Lt,af as mt,aK as yt,z as wt,a3 as Et,ah as me,b6 as kt,aL as _t}from"./B1lrKll_.js";import{G as Dt}from"./-xK_vQQs.js";function Tt(e){return Array.isArray(e)}function Nt(e){if(Me(e))return e;const a=xe(e);if(!It(e))return{};if(Tt(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ke(e)){const s=e,c=s.constructor;return new c(s.buffer,s.byteOffset,s.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const s=e,c=s.buffer,g=s.byteOffset,t=s.byteLength,h=new ArrayBuffer(t),x=new Uint8Array(c,g,t);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const s=e.constructor,c=new s(e.valueOf());return a==="[object String]"?Ct(c,e):se(c,e),c}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const s=e,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,c}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const s=e,c=new Map;return s.forEach((g,t)=>{c.set(t,g)}),c}if(a==="[object Set]"){const s=e,c=new Set;return s.forEach(g=>{c.add(g)}),c}if(a==="[object Arguments]"){const s=e,c={};return se(c,s),c.length=s.length,c[Symbol.iterator]=s[Symbol.iterator],c}const o={};return vt(o,e),se(o,e),Ot(o,e),o}function It(e){switch(xe(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case Ye:case We:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Ot(e,a){const o=Object.getOwnPropertySymbols(a);for(let s=0;s<o.length;s++){const c=o[s];Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}}function Ct(e,a){const o=a.valueOf().length;for(const s in a)Object.hasOwn(a,s)&&(Number.isNaN(Number(s))||Number(s)>=o)&&(e[s]=a[s])}function vt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(C,d,i,l){for(i=i||{},l=C.length;l--;i[C[l]]=d);return i},"o"),a=[1,15],o=[1,7],s=[1,13],c=[1,14],g=[1,19],t=[1,16],h=[1,17],x=[1,18],L=[8,30],b=[8,10,21,28,29,30,31,39,43,46],f=[1,23],m=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(d,i,l,p,E,r,K){var n=r.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",r[n-1]),p.setHierarchy(r[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",r[n]),typeof r[n].length=="number"?this.$=r[n]:this.$=[r[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",r[n-1]),this.$=[r[n-1]].concat(r[n]);break;case 14:p.getLogger().debug("Rule: link: ",r[n],d),this.$={edgeTypeStr:r[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",r[n-3],r[n-1],r[n]),this.$={edgeTypeStr:r[n],label:r[n-1]};break;case 18:const F=parseInt(r[n]),Y=p.generateId();this.$={id:Y,type:"space",label:"",width:F,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",r[n-2],r[n-1],r[n]," typestr: ",r[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(r[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(r[n-1].edgeTypeStr),Z=p.edgeStrToThickness(r[n-1].edgeTypeStr),D=p.edgeStrToPattern(r[n-1].edgeTypeStr);this.$=[{id:r[n-2].id,label:r[n-2].label,type:r[n-2].type,directions:r[n-2].directions},{id:r[n-2].id+"-"+r[n].id,start:r[n-2].id,end:r[n].id,label:r[n-1].label,type:"edge",thickness:Z,pattern:D,directions:r[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[n-1],r[n]),this.$={id:r[n-1].id,label:r[n-1].label,type:p.typeStr2Type(r[n-1].typeStr),directions:r[n-1].directions,widthInColumns:parseInt(r[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",r[n]),this.$={id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",r[n]),this.$={type:"column-setting",columns:r[n]==="auto"?-1:parseInt(r[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",r[n-2],r[n-1]),p.generateId(),this.$={...r[n-2],type:"composite",children:r[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",r[n-2],r[n-1],r[n]);const z=p.generateId();this.$={id:z,type:"composite",label:"",children:r[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",r[n]),this.$={id:r[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[n-1],r[n]),this.$={id:r[n-1],label:r[n].label,typeStr:r[n].typeStr,directions:r[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",r[n]),this.$=[r[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",r[n-1],r[n]),this.$=[r[n-1]].concat(r[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",r[n-2],r[n-1],r[n]),this.$={typeStr:r[n-2]+r[n],label:r[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[n-3],r[n-2]," #3:",r[n-1],r[n]),this.$={typeStr:r[n-3]+r[n],label:r[n-2],directions:r[n-1]};break;case 35:case 36:this.$={type:"classDef",id:r[n-1].trim(),css:r[n].trim()};break;case 37:this.$={type:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:this.$={type:"applyStyles",id:r[n-1].trim(),stylesStr:r[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:s,29:c,31:g,39:t,43:h,46:x}),e(b,[2,16],{14:22,15:f,16:m}),e(b,[2,17]),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,22]),e(w,[2,25],{27:[1,25]}),e(b,[2,26]),{19:26,26:12,31:g},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:g},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:m,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(b,[2,28]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(b,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(d,i){if(i.recoverable)this.trace(d);else{var l=new Error(d);throw l.hash=i,l}},"parseError"),parse:u(function(d){var i=this,l=[0],p=[],E=[null],r=[],K=this.table,n="",F=0,Y=0,J=2,V=1,Z=r.slice.call(arguments,1),D=Object.create(this.lexer),z={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(z.yy[Q]=this.yy[Q]);D.setInput(d,z.yy),z.yy.lexer=D,z.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;r.push($);var Re=D.options&&D.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(I){l.length=l.length-2*I,E.length=E.length-I,r.length=r.length-I}u(Pe,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,v,ee,M={},U,B,pe,H;;){if(R=l[l.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),v=K[R]&&K[R][N]),typeof v>"u"||!v.length||!v[0]){var te="";H=[];for(U in K[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(F+1)+`:
1
+ import{g as Fe}from"./BIRGsT3P.js";import{ap as Me,a5 as xe,ar as Ke,bc as We,bb as Ye,be as Ve,bd as Ue,b9 as He,b7 as Xe,b2 as je,aN as Ge,aF as qe,aE as Je,az as Ze,aj as Qe,ai as $e,ak as et,S as tt,R as st,K as rt,k as it,I as at,f as nt,g as ot,e as ct,b as u,W as P,aW as X,ag as lt,aD as ut,B as ht,ay as y,r as gt,am as dt,aU as pt,ab as ft,x as bt,aT as St,p as xt,X as Le,ae as Lt,af as mt,aK as yt,z as wt,a3 as Et,ah as me,b6 as kt,aL as _t}from"./DjWdAsv4.js";import{G as Dt}from"./-xK_vQQs.js";function Tt(e){return Array.isArray(e)}function Nt(e){if(Me(e))return e;const a=xe(e);if(!It(e))return{};if(Tt(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ke(e)){const s=e,c=s.constructor;return new c(s.buffer,s.byteOffset,s.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const s=e,c=s.buffer,g=s.byteOffset,t=s.byteLength,h=new ArrayBuffer(t),x=new Uint8Array(c,g,t);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const s=e.constructor,c=new s(e.valueOf());return a==="[object String]"?Ct(c,e):se(c,e),c}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const s=e,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,c}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const s=e,c=new Map;return s.forEach((g,t)=>{c.set(t,g)}),c}if(a==="[object Set]"){const s=e,c=new Set;return s.forEach(g=>{c.add(g)}),c}if(a==="[object Arguments]"){const s=e,c={};return se(c,s),c.length=s.length,c[Symbol.iterator]=s[Symbol.iterator],c}const o={};return vt(o,e),se(o,e),Ot(o,e),o}function It(e){switch(xe(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case Ye:case We:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Ot(e,a){const o=Object.getOwnPropertySymbols(a);for(let s=0;s<o.length;s++){const c=o[s];Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}}function Ct(e,a){const o=a.valueOf().length;for(const s in a)Object.hasOwn(a,s)&&(Number.isNaN(Number(s))||Number(s)>=o)&&(e[s]=a[s])}function vt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(C,d,i,l){for(i=i||{},l=C.length;l--;i[C[l]]=d);return i},"o"),a=[1,15],o=[1,7],s=[1,13],c=[1,14],g=[1,19],t=[1,16],h=[1,17],x=[1,18],L=[8,30],b=[8,10,21,28,29,30,31,39,43,46],f=[1,23],m=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(d,i,l,p,E,r,K){var n=r.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",r[n-1]),p.setHierarchy(r[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",r[n]),typeof r[n].length=="number"?this.$=r[n]:this.$=[r[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",r[n-1]),this.$=[r[n-1]].concat(r[n]);break;case 14:p.getLogger().debug("Rule: link: ",r[n],d),this.$={edgeTypeStr:r[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",r[n-3],r[n-1],r[n]),this.$={edgeTypeStr:r[n],label:r[n-1]};break;case 18:const F=parseInt(r[n]),Y=p.generateId();this.$={id:Y,type:"space",label:"",width:F,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",r[n-2],r[n-1],r[n]," typestr: ",r[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(r[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(r[n-1].edgeTypeStr),Z=p.edgeStrToThickness(r[n-1].edgeTypeStr),D=p.edgeStrToPattern(r[n-1].edgeTypeStr);this.$=[{id:r[n-2].id,label:r[n-2].label,type:r[n-2].type,directions:r[n-2].directions},{id:r[n-2].id+"-"+r[n].id,start:r[n-2].id,end:r[n].id,label:r[n-1].label,type:"edge",thickness:Z,pattern:D,directions:r[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[n-1],r[n]),this.$={id:r[n-1].id,label:r[n-1].label,type:p.typeStr2Type(r[n-1].typeStr),directions:r[n-1].directions,widthInColumns:parseInt(r[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",r[n]),this.$={id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",r[n]),this.$={type:"column-setting",columns:r[n]==="auto"?-1:parseInt(r[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",r[n-2],r[n-1]),p.generateId(),this.$={...r[n-2],type:"composite",children:r[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",r[n-2],r[n-1],r[n]);const z=p.generateId();this.$={id:z,type:"composite",label:"",children:r[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",r[n]),this.$={id:r[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[n-1],r[n]),this.$={id:r[n-1],label:r[n].label,typeStr:r[n].typeStr,directions:r[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",r[n]),this.$=[r[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",r[n-1],r[n]),this.$=[r[n-1]].concat(r[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",r[n-2],r[n-1],r[n]),this.$={typeStr:r[n-2]+r[n],label:r[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[n-3],r[n-2]," #3:",r[n-1],r[n]),this.$={typeStr:r[n-3]+r[n],label:r[n-2],directions:r[n-1]};break;case 35:case 36:this.$={type:"classDef",id:r[n-1].trim(),css:r[n].trim()};break;case 37:this.$={type:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:this.$={type:"applyStyles",id:r[n-1].trim(),stylesStr:r[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:s,29:c,31:g,39:t,43:h,46:x}),e(b,[2,16],{14:22,15:f,16:m}),e(b,[2,17]),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,22]),e(w,[2,25],{27:[1,25]}),e(b,[2,26]),{19:26,26:12,31:g},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:g},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:m,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(b,[2,28]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(b,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(d,i){if(i.recoverable)this.trace(d);else{var l=new Error(d);throw l.hash=i,l}},"parseError"),parse:u(function(d){var i=this,l=[0],p=[],E=[null],r=[],K=this.table,n="",F=0,Y=0,J=2,V=1,Z=r.slice.call(arguments,1),D=Object.create(this.lexer),z={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(z.yy[Q]=this.yy[Q]);D.setInput(d,z.yy),z.yy.lexer=D,z.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;r.push($);var Re=D.options&&D.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(I){l.length=l.length-2*I,E.length=E.length-I,r.length=r.length-I}u(Pe,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,v,ee,M={},U,B,pe,H;;){if(R=l[l.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),v=K[R]&&K[R][N]),typeof v>"u"||!v.length||!v[0]){var te="";H=[];for(U in K[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(F+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(F+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(v[0]){case 1:l.push(N),E.push(D.yytext),r.push(D.yylloc),l.push(v[1]),N=null,Y=D.yyleng,n=D.yytext,F=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[v[1]][1],M.$=E[E.length-B],M._$={first_line:r[r.length-(B||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(B||1)].first_column,last_column:r[r.length-1].last_column},Re&&(M._$.range=[r[r.length-(B||1)].range[0],r[r.length-1].range[1]]),ee=this.performAction.apply(M,[n,Y,F,z.yy,v[1],E,r].concat(Z)),typeof ee<"u")return ee;B&&(l=l.slice(0,-1*B*2),E=E.slice(0,-1*B),r=r.slice(0,-1*B)),l.push(this.productions_[v[1]][0]),E.push(M.$),r.push(M._$),pe=K[l[l.length-2]][l[l.length-1]],l.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var C={EOF:1,parseError:u(function(i,l){if(this.yy.parser)this.yy.parser.parseError(i,l);else throw new Error(i)},"parseError"),setInput:u(function(d,i){return this.yy=i||this.yy||{},this._input=d,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:u(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var i=d.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:u(function(d){var i=d.length,l=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=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),l.length-1&&(this.yylineno-=l.length-1);var E=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:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(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:u(function(d){this.unput(this.match.slice(d))},"less"),pastInput:u(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var d=this.pastInput(),i=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{f as D}from"./0Kw0mmSW.js";import{Jx as o,Er as E,DO as O,m as A,vq as _,v0 as C,gb as H,D4 as L,Dm as P,Fr as R,D8 as x}from"./D5wnbxHp.js";import{ba as p}from"./BJbm_MWC.js";import{d as F}from"./B0Z-1lwJ.js";import{n as q}from"./DJKfrY8C.js";import{o as B,e as W}from"./WoPFTWyQ.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function K(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function $(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&K(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function I(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await D.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(x(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(E(n)),o.dispatch(O(A,n)),o.dispatch(_("chief")));const d=c?"/":W(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await q(d):await B(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(C(s,{agentId:n}));const f=await $(n,a,t);f&&T(n,a);const i=f||await I(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||F("chat:open-message",b)},w)}export{ee as openMessage,I as seekConversationToMessage};
1
+ import{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{f as D}from"./0Kw0mmSW.js";import{Jx as o,Er as E,DO as O,m as A,vq as _,v0 as C,gb as H,D4 as L,Dm as P,Fr as R,D8 as x}from"./D5wnbxHp.js";import{ba as p}from"./BJbm_MWC.js";import{d as F}from"./B0Z-1lwJ.js";import{n as q}from"./BxLkg7uH.js";import{o as B,e as W}from"./BsTFmNb9.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function K(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function $(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&K(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function I(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await D.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(x(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(E(n)),o.dispatch(O(A,n)),o.dispatch(_("chief")));const d=c?"/":W(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await q(d):await B(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(C(s,{agentId:n}));const f=await $(n,a,t);f&&T(n,a);const i=f||await I(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||F("chat:open-message",b)},w)}export{ee as openMessage,I as seekConversationToMessage};
@@ -1,4 +1,4 @@
1
- var G_=Object.defineProperty;var Ng=n=>{throw TypeError(n)};var V_=(n,r,a)=>r in n?G_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>V_(n,typeof r!="symbol"?r+"":r,a),K_=(n,r,a)=>r.has(n)||Ng("Cannot "+a);var Ao=(n,r,a)=>(K_(n,r,"read from private field"),a?a.call(n):r.get(n)),Bg=(n,r,a)=>r.has(n)?Ng("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as fn,bo as X,bw as vn,bp as pf,b as hn,bm as u,bq as Nr,bs as ge,br as Li}from"./YLhFQnIu.js";import{bs as mn,a5 as I,bf as fs,bA as b,W as p,bn as _n,aA as Z,aB as E,ca as ae,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as m,bl as de,be as pn,b_ as L,bO as j,c5 as ot,bH as w,bV as _e,bj as qs,bk as ro,b$ as dn,ai as Ud,aj as ps,bo as Vl,br as Tr,c0 as Ot,cb as ql,ak as Q_,aw as bi,a as J_}from"./3SdAC2_C.js";import{i as B}from"./YeOAvjnW.js";import{k as Ci}from"./CBbdbU2x.js";import{g as On,i as Y_,I as eo,p as Lo,e as Eo}from"./oBIu7LTI.js";import{n as Bt,l as ma,c as to,j as Wg,k as Do,h as X_}from"./FLpsgWeB.js";import{b as ff,e as zd,f as xe,s as Ue,c as jt,g as gs}from"./BQhBnAuP.js";import{b as Z_}from"./goTpbPhD.js";import{b as _r}from"./Dn334wJv.js";import{m as ew,U as tw,Z as nw,X as rw,Y as aw,I as Ug,o as sw,l as ow,a2 as iw,x as zg,$ as lw,a0 as jg,r as cw,s as dw}from"./7lcZWflB.js";import{Jx as F,fp as uw,eX as gw,f4 as pw,eY as fw,f2 as vw,f1 as hw,e_ as mw,f0 as _w,eZ as ww,rv as bw,c7 as yw,i as ki,J6 as Iw,Dd as vf,Di as Sw,Dk as Gg,Dh as $w,Dj as kw,vE as xw,vG as Cw,Cq as hf,cq as Pw,co as Rw,Bz as Aw,bF as Tw,A4 as Mw,Cf as id,v0 as Ew,cr as Vg,dC as qw,dD as Lw,Cp as Hw,em as Ow,CJ as Dw,CI as Fw,CN as Nw,CM as Bw,cR as Ww,cU as Uw,nD as zw,es as jw,wS as Gw,CO as Vw,wU as Kw,CP as Qw,cV as Jw,cW as Yw,nL as Xw,Ai as Zw,Is as eb,Ah as tb,Du as nb,wn as rb,wo as ab,z0 as sb,z4 as ld,wj as ob,wk as ib,rT as lb,rg as cb,re as db,f$ as ub,HQ as gb,Ll as pb,GN as fb,go as vb,p3 as hb,Jl as mb,ok as _b,A3 as wb,fu as Kg,r3 as Qg,fn as bb,fm as yb,tC as Ib,g4 as Jg,rf as Sb,ff as $b,Ca as kb,m as xb,nM as Cb,zI as Pb,y_ as Rb,EA as Ab,Ep as Yg,xi as Tb,xj as Xg,u$ as Zg,p4 as Mb,DG as Eb,gk as qb,g2 as Lb,eV as Hb,cN as Ob,A7 as Db,Lq as Fb,Cv as Nb,LI as Bb,y3 as Wb,gb as Ub,fe as zb,cM as jb,cJ as Gb,cI as Vb,vs as Kb,xp as Qb,xn as Jb,cG as Yb,cF as Xb,z6 as Zb,z1 as ey,xo as ty}from"./D5wnbxHp.js";import{a as jd}from"./CC7to1B5.js";import{aM as ny,aL as ry,bg as ay,a7 as sy,aD as oy,aO as iy,M as mf,a0 as _f,b8 as ly,b2 as cy,as as ep,P as yl,b0 as tp,a$ as np,a_ as rp}from"./D8bY4ERR.js";import{l as wf,G as dy,I as Rd,at as uy,b1 as Ll,a9 as bf,S as gy,aW as cd,aq as py,aJ as fy,C as vy,z as yf,s as hy,A as my,v as _y,a$ as wy,aH as If,aG as Sf,aI as by,j as ap,aM as dd,aT as sp,aS as Il,aU as op,Q as ip,d as yy,e as Iy,ax as Sy,V as lp,aE as $y,c as ky,m as xy,aV as cp,ap as Cy,aw as dp,a as Py,aA as Ry,ad as up,aD as Ay,aX as gp,a_ as pp,n as fp,ae as Ty,R as My,ay as vp,am as Ey,O as qy,as as Ly,h as Hy,q as Oy,$ as ud,_ as Dy,aC as hp,a8 as Fy,f as Ny,i as By,a6 as Wy,ac as Uy}from"./DW_seDlm.js";import{f as zy,o as jy,E as Gy,C as Vy,m as Ky,a2 as mp,aa as Qy,K as Jy,e as Yy,y as Xy}from"./0Kw0mmSW.js";import{g as Ri}from"./DypB-Dwi.js";import{dW as Bl,cU as $f,O as kf,W as Zy,bv as eI,aF as xf,dH as Cf,aU as qo,e8 as tI,dw as Pf,aw as Gd,dV as Vd,aN as Rf,cP as nI,V as ha,a3 as Xs,B as rI,a7 as aI,a4 as sI,M as oI,a6 as iI,ar as lI,aG as Af,aO as Hl,b6 as cI,ay as Tf,r as dI,n as Ad,H as uI,dY as gI,aQ as pI,aK as fI,c9 as vI,aW as hI,bM as mI,bK as _I,bL as wI,c8 as bI,c7 as yI,cN as II,cM as SI,aS as $I,bb as kI,bd as xI,bg as CI,bc as PI,bl as RI,bf as AI,be as TI,bh as MI,bi as EI,bk as qI,bj as LI,ax as HI,cj as OI,ck as DI,dv as FI,du as NI,a$ as BI,G as WI,b3 as UI,cf as zI,C as _p,d0 as jI,ba as ds,b$ as GI,X as VI,bq as KI,E as QI,ad as JI,t as YI,cW as XI,d3 as wp,Q as bp,dt as ZI,cQ as gd}from"./BJbm_MWC.js";import{u as Mf,a as Sl,ag as eS,x as tS,ad as Ef,af as nS,ac as qf,a4 as rS,F as yp,D as aS,e as sS,n as oS,s as iS,m as lS,Y as cS,k as dS}from"./CSdAdmLZ.js";import{a2 as uS,b5 as gS,cM as pS,a_ as fS,b4 as vS,c2 as hS,c9 as mS,w as _S,x as wS,cd as bS}from"./CxCmx5S0.js";import{n as yS,P as Lf,F as IS,ai as SS,r as $S,ac as kS}from"./BUsnh1ZW.js";import{I as xS,s as CS,H as Ip}from"./Bqd7fdCF.js";import{e as PS}from"./CL3a4Hm1.js";import{e as RS,f as AS}from"./BfQFKWzJ.js";import{s as TS,o as Zs,b as MS,g as Wl,d as ES,l as yi}from"./CIyUrgF0.js";import{a5 as qS,a7 as LS,D as HS,N as OS,ac as Sp,X as Hf,i as DS,r as ur,v as Ai,u as ea,p as xi,x as wr,S as Kd,m as Kl,s as Ho,y as Ti,o as ao,n as so,t as $p,aa as oo,w as io,a9 as Qd,q as _a,z as Oo,J as Td,_ as kp,g as FS,F as NS,U as Of,I as Df,a8 as Ff,a6 as Ol,O as BS,E as Nf,V as WS,A as US,b as zS,ab as jS,ad as $l,G as GS,e as pd,l as VS,C as KS,f as Ys,j as xp,H as us,Q as QS,d as kl,c as JS,a as Cp,h as YS,L as XS,Y as Pp,a4 as fd,a1 as Rp,a0 as ZS,a3 as Ap,$ as Tp,T as e$,B as t$,k as n$,a2 as r$,K as a$,R as s$,P as o$,W as i$}from"./BevVqXi3.js";import{m as l$}from"./Dms_DO28.js";import{g as Bf}from"./Co9CFvqw.js";import{b as c$}from"./COVS9Crf.js";import{g as d$}from"./VcnbZvDh.js";import{a as u$}from"./BvjgIPau.js";import{q as Wf,d as gr,r as g$,e as Ul,j as p$,g as Md,i as f$,f as Ed,c as v$,A as h$,O as Mp,k as m$}from"./CA_3gGLy.js";import{P as _$}from"./BtchneSc.js";import{e as w$}from"./6NStP9u7.js";import{b as b$,a as y$,g as I$,c as S$,i as $$}from"./BRRnx9NG.js";import{R as k$,g as x$,W as xl,c as C$}from"./Ddc7chXR.js";import"./kvtKUeBe.js";import"./KtEuoG00.js";import{t as Mi}from"./CrpUtGFn.js";import{F as P$,h as R$}from"./DJivXy66.js";import"./WvHbj6rB.js";import{C as A$,e as Dr,L as T$,l as Ql,d as Jl,K as Yl,h as Jd,M as Xl,S as Fa}from"./ItBm4ElA.js";import{D as M$}from"./BLMhg4vm.js";import{f as Ep}from"./D7AX9X0W.js";import"./DU3vNstz.js";import{i as Uf}from"./BjLb7AHW.js";import{h as qp,i as Lp,g as Hp,P as Op,C as E$,m as Dl,R as q$}from"./CZB2ndi9.js";import{f as $t,ae as L$}from"./Cw2fqKk9.js";import{F as gt,bs as H$,cd as O$,aw as Na,a2 as zf,c9 as D$,bf as F$,be as N$,bg as B$,aO as Dp,aj as vd,aB as hd,bB as jf,d3 as zl,cF as W$,aM as Fp,cb as Np,cK as jl,bu as U$,aS as z$,d0 as j$,a8 as Gf,ac as G$,ag as V$,cr as K$,ba as Q$,aC as Vf,cT as Bp,cz as J$,ax as Y$,cD as X$,c3 as Z$}from"./gwv5JQYH.js";import{c as Kf}from"./ChTqQfQN.js";import"./D48_y-cl.js";import{c as Tt}from"./DwGyIIXK.js";import{a4 as Qf,bf as ek,aq as tk,k as nk,X as rk,V as ak,a1 as sk,Y as ok,bv as ik,U as lk,a0 as ck,ag as dk}from"./CV7mOfKN.js";import{d as Gl,f as uk,e as gk}from"./BJfXDnA-.js";import{A as pk}from"./DPjr22dV.js";import{D as fk}from"./BLhJfI63.js";import"./CIWQMI37.js";import{a as vk,C as hk}from"./CggFXl4B.js";import"./CGdXewiA.js";import{C as mk}from"./Bj4IsLvN.js";import{h as qd,r as _k,a as wk}from"./FhJRiT1S.js";import{s as bk}from"./zxxqPN9_.js";import{I as yk,a as Jf}from"./DkERMj5B.js";import{L as Ik}from"./DwiE5WsI.js";import{g as Sk,f as $k,b as kk}from"./mUNs8NSR.js";import{s as Ei,g as Yn,i as xk,j as Ck,e as Wp,r as Up,f as Pk,d as Rk,a as md,h as Ak}from"./oVV8Q_Hb.js";import{i as zp,a as Tk}from"./Bu13V5mO.js";import{seekConversationToMessage as jp}from"./C64UuXDx.js";import{l as Xt,o as _d,h as Yd,n as Ld,q as Mk}from"./DIEHuZ8f.js";import{o as Ek}from"./Dde5tnWd.js";import{A as Yf}from"./BaOiWDrc.js";import{b as Xf}from"./CfaCrhAh.js";import{h as qk,f as Zf,w as Lk,g as Hk,Q as Ok,O as Dk,M as Fk,l as ev,m as Nk,J as tv,s as nv}from"./Bsdq-idi.js";import{selectCurrentWorkspaceTabId as wd}from"./L3K71tUU.js";import{o as Bk}from"./WoPFTWyQ.js";import{d as Wk}from"./B0Z-1lwJ.js";import{P as Uk}from"./CfIVswBm.js";import{g as zk}from"./DCkRL43S.js";import{H as rv,M as jk,y as Gk,J as Vk,g as Kk,i as Qk,u as Jk,e as av,c as sv,d as Yk}from"./CwCTYQp7.js";import{c as Xk,h as Xd,f as ov,Q as Zk}from"./Idk978zJ.js";import{t as ex}from"./DAsc1V4f.js";import{s as tx}from"./BsieX9dN.js";import{i as iv}from"./DWqaYE81.js";import{d as nx,i as rx,r as ax}from"./_3Ca9E4W.js";import{g as sx}from"./Hi2H4bj8.js";var ox=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ix=E("<div><!></div>");function lv(n,r){if(new.target)return fn({component:lv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,ox);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=ix();ff(g,f=>({"data-slot":"card-header",class:f,...l}),[()=>zd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",mk,i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}var lx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),cx=E("<div><!></div>");function cv(n,r){if(new.target)return fn({component:cv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,lx);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=cx();ff(g,f=>({"data-slot":"card-title",class:f,...l}),[()=>zd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}const Cl=xS.CHAT_MEDIA,bd=TS().min(1).max(512);Zs({workspaceId:bd,agentId:bd,draftId:Wl(),principalId:bd,media:MS(yS).min(1).max(20)}).strict();const dx=Zs({sessionId:Wl()}).strict();dx.extend({control:ES("action",[Zs({action:yi("readiness")}).strict(),Zs({action:yi("export"),request:RS}).strict(),Zs({action:yi("transcribe"),request:AS}).strict(),Zs({action:yi("release"),jobId:Wl()}).strict(),Zs({action:yi("adopt"),jobId:Wl()}).strict()])}).strict();function Zd(n,r,a,i=async(c,l)=>typeof window>"u"||CS(window)!=="electron"?{ok:!1,error:"unavailable"}:PS().invoke(c,l)){let c=null,l=null,v=!1;async function g(){v=!0,a.removeEventListener("abort",_);const k=c;c=null,k&&await i(Cl.CLOSE,{sessionId:k}).catch(()=>{})}const _=()=>{g()};a.addEventListener("abort",_,{once:!0});const f=()=>{if(v||a.aborted||!r())throw new Error("media-send-retired")};async function P(){if(f(),c)return c;if(l)return l;l=(async()=>{const k=await i(Cl.BEGIN,n);if(!k.ok)throw new Error("media-export-unavailable");c=k.value.sessionId;try{return f(),c}catch(W){throw await g(),W}})();try{return await l}finally{l=null}}async function S(k){const W=await P();f();const O=await i(Cl.CONTROL,{sessionId:W,control:k});return f(),O}return{service:{exportMedia:k=>S({action:"export",request:k}),adoptMediaJob:k=>S({action:"adopt",jobId:k}),transcribeMedia:k=>S({action:"transcribe",request:k}),releaseMediaJob:async k=>c?await i(Cl.CONTROL,{sessionId:c,control:{action:"release",jobId:k}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>S({action:"readiness"})}}const yd=new Set;async function ux(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:v,agentId:g}=i,_=Ri(F.state),f=Bl.select(F.state,v),P=$f.select(F.state),S=wf(),q=JSON.stringify([_,v,g]);if(!_||!f||!P||l.wsId!==v||yd.has(q))return!1;yd.add(q);const k=new AbortController,W=()=>k.abort();a.addEventListener("abort",W,{once:!0});const O=()=>!a.aborted&&!k.signal.aborted&&Ri(F.state)===_&&Bl.select(F.state,v)===f&&bf(S)&&r.isCurrentDraft(i),T=F.getReadableState().subscribe(()=>{O()||k.abort()});let D=null;try{if(!O()||uS(c))return!1;const K=Mf(i.attachments),se=Lf(IS(v,g),K,c.map(fe=>({contextItemId:fe.id,attachmentId:fe.attachmentId,path:fe.path}))),C=new Set([...se.images,...se.clips].map(fe=>fe.contextItemId));if(K.some(([fe])=>!C.has(fe))||se.images.some(fe=>fe.mediaError)||se.clips.some(fe=>fe.mediaError)||!SS(l.text,se))throw new Error("invalid-evidence");if(D=n.warm?.take(i,k.signal)??null,!await r.flushDraft(i)||!O())return!1;const x=await zy.agents.get(g,v);if(!O())return!1;if(!x||x.workspaceId!==v||x.retiredAt||x.pendingDeleteAt||x.status==="deleted")throw new Error("unavailable");const Q=se.clips.flatMap(fe=>fe.media?[fe.media]:[]);Q.length&&!D&&(D=Zd({workspaceId:v,agentId:g,draftId:crypto.randomUUID(),principalId:P.principal.id,media:Q},O,k.signal));const pe=dy(c,se),Te=Rd(pe),he=await uy({workspaceId:v,agentId:g,evidence:se,clickedItems:c,sendItems:pe,clickedPayload:{...l,contextItems:pe,imageBlocks:Te.imageBlocks,fileBlocks:Te.fileBlocks},binding:S,service:D?.service??null,current:O,onRecord:()=>{}});return!he||!O()?!1:Ll(F,g,he)}catch{return O()&&F.dispatch(uw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",W),await D?.dispose(),yd.delete(q)}}const dv=1e4,Gp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Vp(n){return qS(n.messageMetadata)}function gx(n,r){if(n.some(Vp)){const a=n[0];return a&&!Vp(a)&&Kp(a,r)?[a.id]:[]}return n.filter(a=>Kp(a,r)).map(a=>a.id)}function px(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Kp(n,r){return!n.requeuedAfterFailure&&LS(n,r)}function fx(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,v=r.blocked||r.interrupted,g=r.timeoutMs??dv;let _=n.prediction;if(_){const k=new Set(i.map(D=>D.id)),W=_.ids.filter(D=>k.has(D)&&!c.has(D)),O=l-_.startedAt>=g,T=n.wasBusy&&!a;!W.length||O||v&&!a||T?_=null:W.length!==_.ids.length&&(_={..._,ids:W})}const f=n.wasBusy&&!a,P=n.wasBusy?n.busySince:a?l:null,S=n.wasBusy&&n.preempted||P!==null&&r.directSendAt!==null&&r.directSendAt>P;if(!_&&f&&!v&&!S){const k=gx(i,l).filter(W=>!c.has(W));k.length&&(_={ids:k,startedAt:l})}const q={wasBusy:a,busySince:a?P:null,preempted:a&&S,prediction:_};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class vx{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(v=>{c=setTimeout(()=>v(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function hx(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Qp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var mx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function uv(n,r){if(new.target)return fn({component:uv,...n});mn(r,!0);const a=()=>ge(P,"$typing$",i),[i,c]=Nr();let l=X(r,"workspaceId",7),v=X(r,"agentId",7),g=X(r,"class",7,"");const _=Bn(""),f=Bn("");ae(()=>{_.set(l())}),ae(()=>{f.set(v())});const P=gS(_,f),S=o(()=>w$(a()));var q={get workspaceId(){return l()},set workspaceId(D){l(D),Z()},get agentId(){return v()},set agentId(D){v(D),Z()},get class(){return g()},set class(D=""){g(D),Z()},$set:vn,$on:(D,K)=>hn(r,D,K)},k=Wt(),W=ye(k);{var O=D=>{var K=mx(),se=I(K),C=I(se);_$(C,{get people(){return a()},size:12,decorative:!0}),b(se);var x=m(se,2),Q=de(x,!0);pn(2),b(K),L(()=>{xe(K,1,`${Wf} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(S))}),p(D,K)};B(W,D=>{e(S)&&D(O)})}p(n,k);var T=_n(q);return c(),T}const _x=50,wx=5e3,bx=500,yx=()=>({authority:()=>Ri(F.state),persistSnapshot:py,dispatch:n=>F.dispatch(n),ownerView:n=>fy.withStore(F)(n)});function Ix(n){const r=n.store??yx(),a=crypto.randomUUID();let i=_e(!1),c=_e(!1),l=_e(!1),v=null,g=null,_=0,f=!1,P=null,S=null,q=null,k=0,W=null,O=null;const T={};let D,K=_e([]),se=null,C=0,x="",Q=0,pe="";const Te=()=>{const N=n.workspaceId(),R=n.agentId();if(!N||!R||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||f)return null;const qe=n.inputValue(),H=fe(),Y=D?.shared,J=Y?.workspaceId===N&&Y.agentId===R?Y.lifetime:null,Se=JSON.stringify([re,N,R,k,J,H.map(z=>[z.id,z.attachmentId,z.path])]);Se!==pe&&(pe=Se,Q+=1);const He=JSON.stringify([re,N,R,qe,H,k]);return He!==x&&(x=He,C+=1),{authority:re,ownerId:a,workspaceId:N,agentId:R,text:qe,attachments:JSON.parse(JSON.stringify(H)),generation:C,attachmentEpoch:Q}};let he=null;const fe=()=>eS(n.contextItems(),tS(n.contextItems(),e(K))),Le=N=>{if(D=N,!N||f)return;const R=N.restore;if(O&&R?.requestId===O.requestId&&R.status!=="pending"){const{apply:H}=O;O=null,w(c,!1),R.status==="restored"&&w(K,R.draft?.attachments??[]),H(R)}const re=N.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(se!==H){se=H;const Y=he??v,J=Y&&n.inputValue()===Y.text&&JSON.stringify(fe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(_+=1,q&&clearTimeout(q),w(K,re.snapshot.attachments),he=v={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(K))},n.setInputValue(re.snapshot.text),n.setContextItems(Sl(e(K))),n.applyEditorContent(re.snapshot.text))}}ot(Te);const qe=[];for(const H of N.saves){if(H.status==="pending")continue;qe.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}qe.length>0&&queueMicrotask(()=>r.dispatch(vw(a,qe)))},ue=(N,R,re)=>{const qe=crypto.randomUUID();O={requestId:qe,apply:re},w(c,!0),r.dispatch(mw(a,qe,N,R))},oe=()=>{O&&(O=null,w(c,!1),r.dispatch(ww(a)))},Me=()=>{const N=W;N&&(W=null,r.dispatch(_w(a)),D?.saves.some(R=>R.id===N)||delete T[N])};r.dispatch(gw(a));const ie=r.ownerView(a).subscribe(N=>ot(()=>Le(N))),ee=()=>{S&&(clearTimeout(S),S=null),w(l,!1)},Ae=()=>{W&&(W=null,r.dispatch(hw(a)))};ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId();if(!N){ot(()=>{_+=1,g=null,oe(),P&&clearTimeout(P),P=null,ee(),q&&clearTimeout(q),q=null,w(i,!1),Ae()});return}if(!R||!re)return;const qe=`${R}\0${re}`;if(g===qe)return;const H=g!==null;g=qe;const Y=++_;ot(()=>{v=null,he=null,se=null,w(K,[]),P&&clearTimeout(P),ee(),q&&(clearTimeout(q),q=null),H&&(Ae(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=gy(R,re);if(J){w(K,J.attachments),w(i,!1);const He=n.contextItems().length>0,z=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),He||n.setContextItems(Sl(J.attachments)),n.applyEditorContent(J.text),v={text:J.text,attachmentsJson:Ie},ue(R,re,Ce=>{if(Ce.status!=="restored")return;const De=Ce.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const at=De?.text??"",lt=De?.attachments??[],Oe=JSON.stringify(lt);cd(R,re,{text:at,attachments:lt});const $e=n.inputValue()===z&&JSON.stringify(fe())===Ie;He||!$e||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),Oe!==Ie&&n.setContextItems(Sl(lt)),v={text:at,attachmentsJson:Oe})});return}w(i,!0),S=setTimeout(()=>{S=null,(n.active?.()??!0)&&w(l,!0)},bx),P=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),ee())},wx);const Se=()=>{!(n.active?.()??!0)||g!==qe||_!==Y||(P&&clearTimeout(P),w(i,!1),ee())};ue(R,re,He=>{if(He.status!=="restored"){Se();return}const z=He.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Sl(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},_x)),v===null){const Ce=z?.text??"",De=z?.attachments??[];v={text:Ce,attachmentsJson:JSON.stringify(De)},cd(R,re,{text:Ce,attachments:De})}Se()})})}),ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId(),qe=e(i);if(!N){ot(Me);return}if(!R||!re)return;const H=n.inputValue(),Y=fe();if(ot(Te),ot(Me),qe||v===null&&!H&&Y.length===0)return;const J=JSON.stringify(Y);if(v!==null&&v.text===H&&v.attachmentsJson===J)return;JSON.stringify(e(K))!==J&&w(K,Y);const Se=`${R}\0${re}`,He=k,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){g===Se&&k===He&&(v={text:H,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},ot(()=>{W=z,r.dispatch(pw(a,z,{authority:r.authority?.()??void 0,workspaceId:R,agentId:re,text:H,attachments:Y,rollback:v?{text:v.text,attachments:JSON.parse(v.attachmentsJson)}:null}))})}),ae(()=>()=>{f=!0,P&&clearTimeout(P),S&&clearTimeout(S),q&&clearTimeout(q),Ae(),ie(),r.dispatch(fw(a))});const Ee=N=>{const R=Te();return R!==null&&R.authority===N.authority&&R.ownerId===N.ownerId&&R.workspaceId===N.workspaceId&&R.agentId===N.agentId&&R.generation===N.generation&&R.text===N.text&&JSON.stringify(R.attachments)===JSON.stringify(N.attachments)};return{captureDraft:Te,isCurrentDraft:Ee,updateAttachmentScreen(N,R,re){return!Ee(N)||!N.attachments.some(qe=>qe.id===R)?null:(w(K,N.attachments.map(qe=>qe.id===R?{...qe,screen:structuredClone(re)}:qe)),Te())},async flushDraft(N){if(!Ee(N))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,N.workspaceId,N.agentId,N,N.authority),Ee(N)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(_+=1,k+=1,oe(),P&&(clearTimeout(P),P=null),q&&(clearTimeout(q),q=null),w(i,!1),ee(),Me(),g!==null){const[N,R]=g.split("\0");cd(N,R,{text:"",attachments:[]}),he=null,w(K,[]),v={text:"",attachmentsJson:"[]"}}}}}function qi(n){if(!n)return null;const r=Lf(JSON.stringify([n.workspaceId,n.agentId]),Mf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function Sx(n,r,a){const i=F.state.principal.snapshot,c=()=>Ri(F.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,v=Zd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await v.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(_=>_.sourceId===r.source.id)??{ready:!1}}finally{await v.dispose()}}function Jp(n){let r=_e(null),a=_e(!1),i=_e(!1),c=null,l=!0,v=0,g=null;qs(()=>{l=!1,v++}),ae(()=>{const S=n.capture();e(r)&&(!S||S.authority!==e(r).capture.authority||S.ownerId!==e(r).capture.ownerId||S.workspaceId!==e(r).capture.workspaceId||S.agentId!==e(r).capture.agentId||S.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function _(S){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),k=qi(q),W=k?.clips.find(K=>K.contextItemId===S);if(!q||!W?.media||!k)return;const O=vy({workspaceId:q.workspaceId,agentId:q.agentId,clip:W,evidence:k,marks:k.marks}),T=yf(q.workspaceId,W.path);if(!O||!T)return;const D=++v;c=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||v!==D||!n.drafts.isCurrentDraft(q))return;const K=await(n.prepareOutput??Sx)(q,W.media,n.drafts);if(!l||v!==D||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:se,...C}=O;w(r,{capture:q,contextItemId:S,snapshot:{...C,openId:crypto.randomUUID(),mediaUrl:T,output:K,deleteReady:!0}})}catch{l&&v===D&&w(i,!0)}finally{l&&v===D&&w(a,!1)}}async function f(S){const q=crypto.randomUUID(),k=e(r),W=n.drafts.captureDraft();if(!k||!W||W.authority!==k.capture.authority||W.ownerId!==k.capture.ownerId||W.workspaceId!==k.capture.workspaceId||W.agentId!==k.capture.agentId||W.attachmentEpoch!==k.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const O=qi(W),T=O?.clips.find(Q=>Q.contextItemId===k.contextItemId);if(!O||!T?.media)return{requestId:q,result:"stale-source"};const K=g?.openId===k.snapshot.openId&&g.inputRevision===S.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...S,revision:T.media.saved?.revision??0}:S,se=$S(T.media,{openId:k.snapshot.openId,...k.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:W.workspaceId,agentId:W.agentId},sourceId:S.sourceId,sourceRevision:S.sourceRevision,expectedEditRevision:K.revision,edit:K});if(se.status!=="saved")return{requestId:q,result:se.status==="invalid-edit"?"failed":se.status};const C=kS({...O,clips:O.clips.map(Q=>Q.id===T.id?{...Q,media:se.media}:Q)})[k.contextItemId],x=n.drafts.updateAttachmentScreen(W,k.contextItemId,C);if(!x)return{requestId:q,result:"stale-source"};g={openId:k.snapshot.openId,media:se.media,inputRevision:S.revision};try{if(!n.drafts.isCurrentDraft(x))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(x);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==k.snapshot.openId||!Q||Q.attachmentEpoch!==k.capture.attachmentEpoch||Q.authority!==x.authority||Q.ownerId!==x.ownerId||Q.workspaceId!==x.workspaceId||Q.agentId!==x.agentId||JSON.stringify(Q.attachments.find(pe=>pe.id===k.contextItemId)?.screen)!==JSON.stringify(C)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:se.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function P(S){return n.disabled()||!n.onRemove(S)?!1:(e(r)?.contextItemId===S&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:_,save:f,remove:P,close(){w(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var $x=E('<p role="alert"> </p>'),kx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),xx=E("<!> <!> <!>",1);function gv(n,r){if(new.target)return fn({component:gv,...n});mn(r,!0);let a=X(r,"capture",7),i=X(r,"drafts",7),c=X(r,"disabled",7,!1),l=X(r,"onRemove",7),v=X(r,"controllerFactory",7,Jp),g=X(r,"beforeOpen",7),_=X(r,"onReviewChange",7);const f=ot(()=>v()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:C=>l()(C),beforeOpen:()=>g()?.()??Promise.resolve()}));ae(()=>{const C=f.opening,x=f.session;ot(()=>_()?.(C,x?.snapshot.output?.ready?{openId:x.snapshot.openId,capture:x.capture}:null))});const P=o(hy),S=o(()=>qi(a())),q=o(()=>e(S)?.clips.map(C=>({id:C.contextItemId,kind:"clip",owner:"evidence",duration:Ep(C.durationMs),recording:!1,url:a()?yf(a().workspaceId,C.path):void 0,...C.media?.saved?{summary:my(C.media.saved)}:{}}))??[]);let k=_e(null);var W={get capture(){return a()},set capture(C){a(C),Z()},get drafts(){return i()},set drafts(C){i(C),Z()},get disabled(){return c()},set disabled(C=!1){c(C),Z()},get onRemove(){return l()},set onRemove(C){l(C),Z()},get controllerFactory(){return v()},set controllerFactory(C=Jp){v(C),Z()},get beforeOpen(){return g()},set beforeOpen(C){g(C),Z()},get onReviewChange(){return _()},set onReviewChange(C){_(C),Z()},$set:vn,$on:(C,x)=>hn(r,C,x)},O=xx(),T=ye(O);{let C=o(()=>c()||f.opening);HS(T,{get items(){return e(q)},get labels(){return e(P)},get disabled(){return e(C)},onEdit:x=>void f.open(x),onMarkUp:x=>void f.open(x),get onRemove(){return f.remove}})}var D=m(T,2);{var K=C=>{var x=$x(),Q=de(x,!0);L(pe=>j(Q,pe),[()=>u.dock_captureEditor_saveFailed_label()]),p(C,x)};B(D,C=>{f.problem&&C(K)})}var se=m(D,2);{let C=o(()=>!!f.session),x=o(()=>u.dock_captureEditor_recording_title({duration:f.session?Ep(f.session.snapshot.durationMs??0):""}));A$(se,{get open(){return e(C)},size:"editor",showCloseButton:!1,get title(){return e(x)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>f.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),f.restoreFocus()},get contentRef(){return e(k)},set contentRef(Q){w(k,Q,!0)},children:(Q,pe)=>{var Te=Wt(),he=ye(Te);{var fe=Le=>{var ue=Wt(),oe=ye(ue);Ci(oe,()=>f.session.snapshot.openId,Me=>{var ie=kx(),ee=I(ie);M$(ee,{get snapshot(){return f.session.snapshot},get shortcutDialog(){return e(k)},onClose:()=>f.close(),get onSave(){return f.save},onDelete:async()=>!!f.session&&f.remove(f.session.contextItemId)}),b(ie),p(Me,ie)}),p(Le,ue)};B(he,Le=>{f.session&&Le(fe)})}p(Q,Te)},$$slots:{default:!0}})}return p(n,O),_n(W)}const Pl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function Cx(n){let r=_e(!1),a=_e(!1),i=_e(null),c=!1,l=0,v=null,g=null;async function _(S){S.abort.abort(),S.slot?.cancel(),await S.native?.dispose()}async function f(){l++;const S=g;g=null,S&&await _(S)}ro(()=>{const S=()=>{w(r,document.hasFocus(),!0)};return S(),window.addEventListener("focus",S),window.addEventListener("blur",S),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",S)}});const P=F.getReadableState().subscribe(()=>{g&&!g.current()&&f()});return qs(()=>{c=!0,P(),f()}),ae(()=>{const S=n.capture(),q=S?Pl(S):"",k=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);ot(()=>{if(!k||!S){f();return}if(g?.key===q)return;if(v===q){f();return}f();const O=qi(S)?.clips.flatMap(Te=>!Te.mediaError&&Te.media?[Te.media]:[])??[],T=O[0],D=F.state.principal.snapshot,K=Bl.select(F.state,S.workspaceId);if(!T||!D||!K||n.drafts.gateActive)return;const se=wf(),C=new AbortController,x=()=>!c&&!C.signal.aborted&&Ri(F.state)===S.authority&&Bl.select(F.state,S.workspaceId)===K&&bf(se)&&!!n.capture()&&Pl(n.capture())===q,Q={key:q,capture:S,abort:C,native:null,slot:null,current:x};g=Q;const pe=l;n.drafts.flushDraft(S).then(async Te=>{if(!(g!==Q||pe!==l||!x())){if(!Te){v=q,await f();return}Q.native=Zd({workspaceId:S.workspaceId,agentId:S.agentId,draftId:crypto.randomUUID(),principalId:D.principal.id,media:structuredClone(O)},x,C.signal),Q.slot=_y(Q.native.service),v=q,Q.slot.warm(q,T,x)}}).catch(()=>{g===Q&&f()})})}),{cancel:f,async beforeEditorOpen(){w(a,!0),v=null,await f()},editorState(S,q){w(a,S,!0);const k=q?Pl(q.capture):null;q&&e(i)?.openId!==q.openId&&(v=null),w(i,q&&k?{openId:q.openId,key:k}:null)},take(S,q){const k=g;if(!k?.native||!k.slot||k.key!==Pl(S)||!k.current())return f(),null;g=null,l++;const W=k.native,O=k.slot,T=()=>k.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...W.service,takePreparedRecording:D=>O.take(k.key,D,()=>!q.aborted&&k.current())},async dispose(){q.removeEventListener("abort",T),await _(k)}}}}}var Px=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function pv(n,r){if(new.target)return fn({component:pv,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Px(),c=I(i),l=de(c,!0);return b(i),L(v=>j(l,v),[()=>u.chat_draftGate_loading_label()]),p(n,i),_n(a)}var Rx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Hd(n,r){if(new.target)return fn({component:Hd,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Rx(),c=m(I(i),2),l=de(c,!0);return pn(2),b(i),L((v,g)=>{Ue(i,"aria-label",v),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),_n(a)}function Ax(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Tx(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Mx(n,r){return r&&n.includes(r)?r:null}function Yp(n,r,a){return r-n<=a}const Ex=.2;function Xp(n,r,a){const i=Math.max(0,a-r),c=n-Ex*r;return Math.min(Math.max(0,c),i)}function qx(n,r,a){return n!==null&&a&&n===r}function Lx(n){return n?bw(n)&&yw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Hx(n){const r=[],a=new Set;let i,c;for(const D of n.messages){if(D.agentId&&D.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(D.id))continue;a.add(D.id),n.breakBeforeMessageIds?.has(D.id)&&(i=void 0,c=void 0);const K=OS(D);if(K?.kind!=="turn-failure")c=void 0;else{const se=i?.seq!==void 0&&D.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(D.seq)&&D.seq===i.seq+1;(!c||!se)&&(c={key:JSON.stringify([n.agentId,"notice",D.id]),anchorMessageId:D.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:D.id,reason:K.reason,timestamp:D.timestamp}),c.recordedFailureCount+=1}i=D}const l=new Map;for(const D of n.queue){if(!D.requeuedAfterFailure)continue;const K=D.turnId||void 0,se=JSON.stringify([n.agentId,K?"turn":"queue",K??D.id]);let C=l.get(se);C||(C={key:se,correlation:K?"turn":"queue-entry",turnId:K,queueIds:[],state:"queued"},l.set(se,C)),C.queueIds.includes(D.id)||C.queueIds.push(D.id)}const v=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,_=g?.status===ki.Error,f=n.transientError||_&&g.stopReason||null,P=_&&!f,S=_&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=S?Sp(S):null,k=q&&f&&f===g?.stopReason?r.flatMap(D=>D.records).filter(D=>D.reason===f&&Sp(D.timestamp)===q):[],W=k.length===1?k[0].messageId:void 0,T=(g?kf(g):!1)?"attempting":v.length?"queued":f||P?"action-needed":"inactive";return{history:r,queueRecovery:v,current:{state:T,error:f,needsFallbackReason:P,timestamp:S,noticeId:W}}}function Ox(n,r){const a=n.hiddenTail[0]?.id,i=Hx({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(_=>_.messageId!==c)})).filter(g=>g.records.length>0),v=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(_=>_.messageId).filter(_=>!v.has(_))))}}var Dx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Fx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Nx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Bx=E('<div class="mb-5"><!></div>'),Wx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Ux=E("<!> <!>",1),zx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),jx=E("<!> <span> </span>",1),Gx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function fv(n,r){if(new.target)return fn({component:fv,...n});mn(r,!0);const a=()=>ge(k,"$userOverrides$",v),i=()=>ge(q,"$specialists$",v),c=()=>ge(D,"$isGitHubAuth$",v),l=()=>ge(K,"$recentSpecialistIds$",v),[v,g]=Nr();let _=X(r,"onSpecialistChange",7),f=X(r,"session",7),P=X(r,"workspaceId",7);const S=Bn(P()??"");ae(()=>S.set(P()??""));const q=Qf(S),k=ek();ae(()=>{a()});const W=o(()=>{if(!f()||Zy(f()))return null;const N=f().metadata?.specialist||f().agentMetadata?.specialist;return N&&i().find(R=>R.id===N)||null});async function O(N){N?await Gl({specialist:N,hash:"specialists"}):await Gl({view:"create-specialist"})}let T=_e(!1);const D=tk(),K=pS(),se=o(()=>Iw(nk(i(),c()),l()));let C=_e(!1);const x=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(W)?.name??u.chat_shared_general_fallback()),pe=o(()=>e(W)?.description??u.chat_shared_noSpecializedBehavior_label()),Te=o(()=>e(W)?e(W).defaultBehaviorPrompt||"":e(x));var he={get onSpecialistChange(){return _()},set onSpecialistChange(N){_(N),Z()},get session(){return f()},set session(N){f(N),Z()},get workspaceId(){return P()},set workspaceId(N){P(N),Z()},$set:vn,$on:(N,R)=>hn(r,N,R)},fe=Gx(),Le=I(fe);{var ue=N=>{var R=Bx(),re=I(R);fk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(C)},set open(Y){w(C,Y,!0)},trigger:(Y,J)=>{let Se=()=>(J?.()).props;{let He=o(()=>zd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));$t(Y,Li(Se,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(He)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Dx(),De=ye(Ce),at=I(De);{let ze=o(()=>e(W)?.id??null),Ze=o(()=>e(W)?.icon??null);pk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(ze)},get icon(){return e(Ze)}})}b(De);var lt=m(De,2),Oe=I(lt),$e=de(Oe,!0),V=m(Oe,2),ne=de(V,!0);b(lt);var Fe=m(lt,2),me=I(Fe);gt(me,{get icon(){return Na},size:10}),b(Fe),L(()=>{j($e,e(Q)),j(ne,e(pe))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=Nx(),Se=I(J),He=I(Se),z=de(He,!0),Ie=m(He,2),Ce=de(Ie,!0);b(Se);var De=m(Se,2),at=I(De);{let $e=o(()=>e(W)?.id??null);ew(at,{get specialists(){return e(se)},get value(){return e($e)},onchange:V=>{w(C,!1),_()?.(V)}})}b(De);var lt=m(De,2),Oe=I(lt);Tt(Oe,()=>Dr,($e,V)=>{V($e,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(C,!1),O()},children:(ne,Fe)=>{var me=Fx(),ze=ye(me),Ze=I(ze);gt(Ze,{get icon(){return O$},size:12}),b(ze);var ut=m(ze,2),mt=de(ut,!0);L(dt=>j(mt,dt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(ne,me)},$$slots:{default:!0}})}),b(lt),b(J),L(($e,V)=>{j(z,$e),j(Ce,V)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),b(R),p(N,R)};B(Le,N=>{_()&&N(ue)})}var oe=m(Le,2);{var Me=N=>{var R=Wt(),re=ye(R);{let qe=o(()=>u.chat_specialistSelector_prompt_label());Tt(re,()=>hk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(qe)},children:(J,Se)=>{var He=Ux(),z=ye(He);Tt(z,()=>lv,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wt(),$e=ye(Oe);Tt($e,()=>cv,(V,ne)=>{ne(V,{class:"type-caption font-medium",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>u.chat_specialistSelector_prompt_label()]),p(Fe,ze)},$$slots:{default:!0}})}),p(at,Oe)},$$slots:{default:!0}})});var Ie=m(z,2);Tt(Ie,()=>vk,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wx(),$e=ye(Oe),V=de($e,!0),ne=m($e,2);$t(ne,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Fe,ze)},$$slots:{default:!0}}),L(()=>{xe($e,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(V,e(Te))}),p(at,Oe)},$$slots:{default:!0}})}),p(J,He)},$$slots:{default:!0}})})}p(N,R)},ie=N=>{var R=zx(),re=de(R,!0);L(()=>j(re,e(Te))),p(N,R)};B(oe,N=>{e(W)?N(Me):N(ie,-1)})}var ee=m(oe,2);{var Ae=N=>{$t(N,{variant:"ghost-light",size:"sm",onclick:()=>O(e(W).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(R,re)=>{var qe=jx(),H=ye(qe);gt(H,{get icon(){return H$},size:12,class:"opacity-60"});var Y=m(H,2),J=de(Y,!0);L(Se=>j(J,Se),[()=>u.chat_regularAgentWelcome_customize_label()]),p(R,qe)},$$slots:{default:!0}})};B(ee,N=>{e(W)&&N(Ae)})}b(fe),p(n,fe);var Ee=_n(he);return g(),Ee}var Vx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Kx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Qx=E('<span class="type-caption"> </span>'),Jx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Yx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function eu(n,r){if(new.target)return fn({component:eu,...n});mn(r,!0);let a=X(r,"prompts",7),i=X(r,"onSelect",7),c=X(r,"onEdit",7),l=X(r,"compact",7,!1),v=X(r,"showShortcutHints",7,!1),g=X(r,"reserveShortcutHintSpace",7,!1),_=X(r,"workspaceId",7);const P=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",S=p$.replace("text-ui","type-caption");function q(x){i()(x)}function k(x,Q){x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),q(Q))}function W(x,Q){x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x})}function O(x,Q){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x}))}function T(x){return x<3}var D={get prompts(){return a()},set prompts(x){a(x),Z()},get onSelect(){return i()},set onSelect(x){i(x),Z()},get onEdit(){return c()},set onEdit(x){c(x),Z()},get compact(){return l()},set compact(x=!1){l(x),Z()},get showShortcutHints(){return v()},set showShortcutHints(x=!1){v(x),Z()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(x=!1){g(x),Z()},get workspaceId(){return _()},set workspaceId(x){_(x),Z()},$set:vn,$on:(x,Q)=>hn(r,x,Q)},K=Wt(),se=ye(K);{var C=x=>{var Q=Yx(),pe=I(Q);{const Te=(fe,Le)=>{let ue=()=>(Le?.()).item,oe=()=>(Le?.()).index;const Me=o(()=>ay(ue())),ie=o(()=>e(Me)[0]?.type==="text"?e(Me)[0].content:"");var ee=Jx(),Ae=I(ee),Ee=I(Ae);gt(Ee,{get icon(){return zf},size:16,get class(){return gr}}),b(Ae);var N=m(Ae,2),R=I(N),re=de(R,!0),qe=m(R);On(qe,17,()=>e(Me).slice(e(ie)?1:0),Y_,(z,Ie)=>{var Ce=Wt(),De=ye(Ce);{var at=Oe=>{const $e=o(()=>ry(e(Ie).url));var V=Vx(),ne=de(V,!0);L(()=>{Ue(V,"href",e($e)),Ue(V,"title",e($e)),j(ne,e(Ie).label)}),ps("click",V,Fe=>W(Fe,e($e))),ps("keydown",V,Fe=>O(Fe,e($e))),p(Oe,V)},lt=Oe=>{var $e=dn();L(()=>j($e,e(Ie).content)),p(Oe,$e)};B(De,Oe=>{e(Ie).type==="link"?Oe(at):Oe(lt,-1)})}p(z,Ce)}),b(N);var H=m(N,2);{var Y=z=>{var Ie=Kx();let Ce;var De=de(Ie);L(()=>{Ce=xe(Ie,1,`${S??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!v()}),Ue(Ie,"aria-hidden",v()?void 0:"true"),Ue(Ie,"data-hint-visible",v()),j(De,`${P}${oe()+1}`)}),p(z,Ie)},J=o(()=>T(oe())&&(v()||g()));B(H,z=>{e(J)&&z(Y)})}var Se=m(H,2);{var He=z=>{L$(z,{side:"top",delayDuration:300,trigger:De=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());$t(De,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:lt=>{lt.stopPropagation(),c()(ue())},get"aria-label"(){return e(at)},children:(lt,Oe)=>{gt(lt,{get icon(){return D$},size:"xs"})},$$slots:{default:!0}})}},content:De=>{var at=Qx(),lt=de(at,!0);L(Oe=>j(lt,Oe),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(De,at)},$$slots:{trigger:!0,content:!0}})};B(Se,z=>{c()&&z(He)})}b(ee),L(z=>{xe(ee,1,`${Wf} ${g$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),xe(Ae,1,`${Ul??""} mt-px self-start`),Ue(R,"aria-label",z),j(re,e(ie))},[()=>ny(ue())]),ps("click",R,z=>{z.stopPropagation(),q(ue())}),ps("keydown",R,z=>k(z,ue())),p(fe,ee)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");T$(pe,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Te,$$slots:{row:!0}})}b(Q),Bt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Bt(2,Q,()=>to,()=>({tier:"fast"})),p(x,Q)};B(se,x=>{a().length>0&&x(C)})}return p(n,K),_n(D)}Ud(["click","keydown"]);var Xx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function vv(n,r){if(new.target)return fn({component:vv,...n});mn(r,!0);let a=X(r,"onSelect",7),i=X(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function v(q){const k=e(c).find(W=>W.label===q);k&&a()(k.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),Z()},get compact(){return i()},set compact(q=!1){i(q),Z()},$set:vn,$on:(q,k)=>hn(r,q,k)},_=Xx(),f=I(_),P=de(f,!0),S=m(f,2);return eu(S,{get prompts(){return e(l)},onSelect:v,get compact(){return i()}}),b(_),L(q=>j(P,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,_),_n(g)}const tu=2e3,Zx=4e3,e1=Zx-tu-2;function t1(n,r=tu){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const v=(l.contentBlocks??[]).filter(_=>_.type==="text").map(_=>_.text||_.content||"").join(""),g=(l.role==="assistant"?tw(v).cleanedContent:v).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function n1(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
1
+ var G_=Object.defineProperty;var Ng=n=>{throw TypeError(n)};var V_=(n,r,a)=>r in n?G_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>V_(n,typeof r!="symbol"?r+"":r,a),K_=(n,r,a)=>r.has(n)||Ng("Cannot "+a);var Ao=(n,r,a)=>(K_(n,r,"read from private field"),a?a.call(n):r.get(n)),Bg=(n,r,a)=>r.has(n)?Ng("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as fn,bo as X,bw as vn,bp as pf,b as hn,bm as u,bq as Nr,bs as ge,br as Li}from"./YLhFQnIu.js";import{bs as mn,a5 as I,bf as fs,bA as b,W as p,bn as _n,aA as Z,aB as E,ca as ae,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as m,bl as de,be as pn,b_ as L,bO as j,c5 as ot,bH as w,bV as _e,bj as qs,bk as ro,b$ as dn,ai as Ud,aj as ps,bo as Vl,br as Tr,c0 as Ot,cb as ql,ak as Q_,aw as bi,a as J_}from"./3SdAC2_C.js";import{i as B}from"./YeOAvjnW.js";import{k as Ci}from"./CBbdbU2x.js";import{g as On,i as Y_,I as eo,p as Lo,e as Eo}from"./oBIu7LTI.js";import{n as Bt,l as ma,c as to,j as Wg,k as Do,h as X_}from"./FLpsgWeB.js";import{b as ff,e as zd,f as xe,s as Ue,c as jt,g as gs}from"./BQhBnAuP.js";import{b as Z_}from"./goTpbPhD.js";import{b as _r}from"./Dn334wJv.js";import{m as ew,U as tw,Z as nw,X as rw,Y as aw,I as Ug,o as sw,l as ow,a2 as iw,x as zg,$ as lw,a0 as jg,r as cw,s as dw}from"./ujrHKn1R.js";import{Jx as F,fp as uw,eX as gw,f4 as pw,eY as fw,f2 as vw,f1 as hw,e_ as mw,f0 as _w,eZ as ww,rv as bw,c7 as yw,i as ki,J6 as Iw,Dd as vf,Di as Sw,Dk as Gg,Dh as $w,Dj as kw,vE as xw,vG as Cw,Cq as hf,cq as Pw,co as Rw,Bz as Aw,bF as Tw,A4 as Mw,Cf as id,v0 as Ew,cr as Vg,dC as qw,dD as Lw,Cp as Hw,em as Ow,CJ as Dw,CI as Fw,CN as Nw,CM as Bw,cR as Ww,cU as Uw,nD as zw,es as jw,wS as Gw,CO as Vw,wU as Kw,CP as Qw,cV as Jw,cW as Yw,nL as Xw,Ai as Zw,Is as eb,Ah as tb,Du as nb,wn as rb,wo as ab,z0 as sb,z4 as ld,wj as ob,wk as ib,rT as lb,rg as cb,re as db,f$ as ub,HQ as gb,Ll as pb,GN as fb,go as vb,p3 as hb,Jl as mb,ok as _b,A3 as wb,fu as Kg,r3 as Qg,fn as bb,fm as yb,tC as Ib,g4 as Jg,rf as Sb,ff as $b,Ca as kb,m as xb,nM as Cb,zI as Pb,y_ as Rb,EA as Ab,Ep as Yg,xi as Tb,xj as Xg,u$ as Zg,p4 as Mb,DG as Eb,gk as qb,g2 as Lb,eV as Hb,cN as Ob,A7 as Db,Lq as Fb,Cv as Nb,LI as Bb,y3 as Wb,gb as Ub,fe as zb,cM as jb,cJ as Gb,cI as Vb,vs as Kb,xp as Qb,xn as Jb,cG as Yb,cF as Xb,z6 as Zb,z1 as ey,xo as ty}from"./D5wnbxHp.js";import{a as jd}from"./CC7to1B5.js";import{aM as ny,aL as ry,bg as ay,a7 as sy,aD as oy,aO as iy,M as mf,a0 as _f,b8 as ly,b2 as cy,as as ep,P as yl,b0 as tp,a$ as np,a_ as rp}from"./WIpix-jK.js";import{l as wf,G as dy,I as Rd,at as uy,b1 as Ll,a9 as bf,S as gy,aW as cd,aq as py,aJ as fy,C as vy,z as yf,s as hy,A as my,v as _y,a$ as wy,aH as If,aG as Sf,aI as by,j as ap,aM as dd,aT as sp,aS as Il,aU as op,Q as ip,d as yy,e as Iy,ax as Sy,V as lp,aE as $y,c as ky,m as xy,aV as cp,ap as Cy,aw as dp,a as Py,aA as Ry,ad as up,aD as Ay,aX as gp,a_ as pp,n as fp,ae as Ty,R as My,ay as vp,am as Ey,O as qy,as as Ly,h as Hy,q as Oy,$ as ud,_ as Dy,aC as hp,a8 as Fy,f as Ny,i as By,a6 as Wy,ac as Uy}from"./CkSfh61f.js";import{f as zy,o as jy,E as Gy,C as Vy,m as Ky,a2 as mp,aa as Qy,K as Jy,e as Yy,y as Xy}from"./0Kw0mmSW.js";import{g as Ri}from"./DypB-Dwi.js";import{dW as Bl,cU as $f,O as kf,W as Zy,bv as eI,aF as xf,dH as Cf,aU as qo,e8 as tI,dw as Pf,aw as Gd,dV as Vd,aN as Rf,cP as nI,V as ha,a3 as Xs,B as rI,a7 as aI,a4 as sI,M as oI,a6 as iI,ar as lI,aG as Af,aO as Hl,b6 as cI,ay as Tf,r as dI,n as Ad,H as uI,dY as gI,aQ as pI,aK as fI,c9 as vI,aW as hI,bM as mI,bK as _I,bL as wI,c8 as bI,c7 as yI,cN as II,cM as SI,aS as $I,bb as kI,bd as xI,bg as CI,bc as PI,bl as RI,bf as AI,be as TI,bh as MI,bi as EI,bk as qI,bj as LI,ax as HI,cj as OI,ck as DI,dv as FI,du as NI,a$ as BI,G as WI,b3 as UI,cf as zI,C as _p,d0 as jI,ba as ds,b$ as GI,X as VI,bq as KI,E as QI,ad as JI,t as YI,cW as XI,d3 as wp,Q as bp,dt as ZI,cQ as gd}from"./BJbm_MWC.js";import{u as Mf,a as Sl,ag as eS,x as tS,ad as Ef,af as nS,ac as qf,a4 as rS,F as yp,D as aS,e as sS,n as oS,s as iS,m as lS,Y as cS,k as dS}from"./B3TMsgS_.js";import{a2 as uS,b5 as gS,cM as pS,a_ as fS,b4 as vS,c2 as hS,c9 as mS,w as _S,x as wS,cd as bS}from"./iYBWUn-Y.js";import{n as yS,P as Lf,F as IS,ai as SS,r as $S,ac as kS}from"./BUsnh1ZW.js";import{I as xS,s as CS,H as Ip}from"./Bqd7fdCF.js";import{e as PS}from"./CL3a4Hm1.js";import{e as RS,f as AS}from"./BfQFKWzJ.js";import{s as TS,o as Zs,b as MS,g as Wl,d as ES,l as yi}from"./CIyUrgF0.js";import{a5 as qS,a7 as LS,D as HS,N as OS,ac as Sp,X as Hf,i as DS,r as ur,v as Ai,u as ea,p as xi,x as wr,S as Kd,m as Kl,s as Ho,y as Ti,o as ao,n as so,t as $p,aa as oo,w as io,a9 as Qd,q as _a,z as Oo,J as Td,_ as kp,g as FS,F as NS,U as Of,I as Df,a8 as Ff,a6 as Ol,O as BS,E as Nf,V as WS,A as US,b as zS,ab as jS,ad as $l,G as GS,e as pd,l as VS,C as KS,f as Ys,j as xp,H as us,Q as QS,d as kl,c as JS,a as Cp,h as YS,L as XS,Y as Pp,a4 as fd,a1 as Rp,a0 as ZS,a3 as Ap,$ as Tp,T as e$,B as t$,k as n$,a2 as r$,K as a$,R as s$,P as o$,W as i$}from"./DzEQS47t.js";import{m as l$}from"./Dms_DO28.js";import{g as Bf}from"./Co9CFvqw.js";import{b as c$}from"./COVS9Crf.js";import{g as d$}from"./VcnbZvDh.js";import{a as u$}from"./BvjgIPau.js";import{q as Wf,d as gr,r as g$,e as Ul,j as p$,g as Md,i as f$,f as Ed,c as v$,A as h$,O as Mp,k as m$}from"./BJexyObh.js";import{P as _$}from"./BtchneSc.js";import{e as w$}from"./6NStP9u7.js";import{b as b$,a as y$,g as I$,c as S$,i as $$}from"./BRRnx9NG.js";import{R as k$,g as x$,W as xl,c as C$}from"./CnskB1XE.js";import"./kvtKUeBe.js";import"./KtEuoG00.js";import{t as Mi}from"./CrpUtGFn.js";import{F as P$,h as R$}from"./DJivXy66.js";import"./WvHbj6rB.js";import{C as A$,e as Dr,L as T$,l as Ql,d as Jl,K as Yl,h as Jd,M as Xl,S as Fa}from"./ItBm4ElA.js";import{D as M$}from"./BLMhg4vm.js";import{f as Ep}from"./D7AX9X0W.js";import"./DU3vNstz.js";import{i as Uf}from"./BjLb7AHW.js";import{h as qp,i as Lp,g as Hp,P as Op,C as E$,m as Dl,R as q$}from"./CZB2ndi9.js";import{f as $t,ae as L$}from"./Cw2fqKk9.js";import{F as gt,bs as H$,cd as O$,aw as Na,a2 as zf,c9 as D$,bf as F$,be as N$,bg as B$,aO as Dp,aj as vd,aB as hd,bB as jf,d3 as zl,cF as W$,aM as Fp,cb as Np,cK as jl,bu as U$,aS as z$,d0 as j$,a8 as Gf,ac as G$,ag as V$,cr as K$,ba as Q$,aC as Vf,cT as Bp,cz as J$,ax as Y$,cD as X$,c3 as Z$}from"./gwv5JQYH.js";import{c as Kf}from"./ChTqQfQN.js";import"./D48_y-cl.js";import{c as Tt}from"./DwGyIIXK.js";import{a4 as Qf,bf as ek,aq as tk,k as nk,X as rk,V as ak,a1 as sk,Y as ok,bv as ik,U as lk,a0 as ck,ag as dk}from"./0x2uouHf.js";import{d as Gl,f as uk,e as gk}from"./E4QyIuMc.js";import{A as pk}from"./DPjr22dV.js";import{D as fk}from"./BLhJfI63.js";import"./CIWQMI37.js";import{a as vk,C as hk}from"./CggFXl4B.js";import"./CGdXewiA.js";import{C as mk}from"./Bj4IsLvN.js";import{h as qd,r as _k,a as wk}from"./50A7Z_-B.js";import{s as bk}from"./zxxqPN9_.js";import{I as yk,a as Jf}from"./DkERMj5B.js";import{L as Ik}from"./DwiE5WsI.js";import{g as Sk,f as $k,b as kk}from"./mUNs8NSR.js";import{s as Ei,g as Yn,i as xk,j as Ck,e as Wp,r as Up,f as Pk,d as Rk,a as md,h as Ak}from"./BDNdgg66.js";import{i as zp,a as Tk}from"./Bu13V5mO.js";import{seekConversationToMessage as jp}from"./lthgBKpc.js";import{l as Xt,o as _d,h as Yd,n as Ld,q as Mk}from"./DIEHuZ8f.js";import{o as Ek}from"./DgXUCDp0.js";import{A as Yf}from"./BaOiWDrc.js";import{b as Xf}from"./CfaCrhAh.js";import{h as qk,f as Zf,w as Lk,g as Hk,Q as Ok,O as Dk,M as Fk,l as ev,m as Nk,J as tv,s as nv}from"./Bsdq-idi.js";import{selectCurrentWorkspaceTabId as wd}from"./L3K71tUU.js";import{o as Bk}from"./BsTFmNb9.js";import{d as Wk}from"./B0Z-1lwJ.js";import{P as Uk}from"./CfIVswBm.js";import{g as zk}from"./5PJaIC3r.js";import{H as rv,M as jk,y as Gk,J as Vk,g as Kk,i as Qk,u as Jk,e as av,c as sv,d as Yk}from"./CwCTYQp7.js";import{c as Xk,h as Xd,f as ov,Q as Zk}from"./Idk978zJ.js";import{t as ex}from"./DAsc1V4f.js";import{s as tx}from"./BsieX9dN.js";import{i as iv}from"./DWqaYE81.js";import{d as nx,i as rx,r as ax}from"./_3Ca9E4W.js";import{g as sx}from"./Hi2H4bj8.js";var ox=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ix=E("<div><!></div>");function lv(n,r){if(new.target)return fn({component:lv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,ox);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=ix();ff(g,f=>({"data-slot":"card-header",class:f,...l}),[()=>zd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",mk,i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}var lx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),cx=E("<div><!></div>");function cv(n,r){if(new.target)return fn({component:cv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,lx);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=cx();ff(g,f=>({"data-slot":"card-title",class:f,...l}),[()=>zd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}const Cl=xS.CHAT_MEDIA,bd=TS().min(1).max(512);Zs({workspaceId:bd,agentId:bd,draftId:Wl(),principalId:bd,media:MS(yS).min(1).max(20)}).strict();const dx=Zs({sessionId:Wl()}).strict();dx.extend({control:ES("action",[Zs({action:yi("readiness")}).strict(),Zs({action:yi("export"),request:RS}).strict(),Zs({action:yi("transcribe"),request:AS}).strict(),Zs({action:yi("release"),jobId:Wl()}).strict(),Zs({action:yi("adopt"),jobId:Wl()}).strict()])}).strict();function Zd(n,r,a,i=async(c,l)=>typeof window>"u"||CS(window)!=="electron"?{ok:!1,error:"unavailable"}:PS().invoke(c,l)){let c=null,l=null,v=!1;async function g(){v=!0,a.removeEventListener("abort",_);const k=c;c=null,k&&await i(Cl.CLOSE,{sessionId:k}).catch(()=>{})}const _=()=>{g()};a.addEventListener("abort",_,{once:!0});const f=()=>{if(v||a.aborted||!r())throw new Error("media-send-retired")};async function P(){if(f(),c)return c;if(l)return l;l=(async()=>{const k=await i(Cl.BEGIN,n);if(!k.ok)throw new Error("media-export-unavailable");c=k.value.sessionId;try{return f(),c}catch(W){throw await g(),W}})();try{return await l}finally{l=null}}async function S(k){const W=await P();f();const O=await i(Cl.CONTROL,{sessionId:W,control:k});return f(),O}return{service:{exportMedia:k=>S({action:"export",request:k}),adoptMediaJob:k=>S({action:"adopt",jobId:k}),transcribeMedia:k=>S({action:"transcribe",request:k}),releaseMediaJob:async k=>c?await i(Cl.CONTROL,{sessionId:c,control:{action:"release",jobId:k}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>S({action:"readiness"})}}const yd=new Set;async function ux(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:v,agentId:g}=i,_=Ri(F.state),f=Bl.select(F.state,v),P=$f.select(F.state),S=wf(),q=JSON.stringify([_,v,g]);if(!_||!f||!P||l.wsId!==v||yd.has(q))return!1;yd.add(q);const k=new AbortController,W=()=>k.abort();a.addEventListener("abort",W,{once:!0});const O=()=>!a.aborted&&!k.signal.aborted&&Ri(F.state)===_&&Bl.select(F.state,v)===f&&bf(S)&&r.isCurrentDraft(i),T=F.getReadableState().subscribe(()=>{O()||k.abort()});let D=null;try{if(!O()||uS(c))return!1;const K=Mf(i.attachments),se=Lf(IS(v,g),K,c.map(fe=>({contextItemId:fe.id,attachmentId:fe.attachmentId,path:fe.path}))),C=new Set([...se.images,...se.clips].map(fe=>fe.contextItemId));if(K.some(([fe])=>!C.has(fe))||se.images.some(fe=>fe.mediaError)||se.clips.some(fe=>fe.mediaError)||!SS(l.text,se))throw new Error("invalid-evidence");if(D=n.warm?.take(i,k.signal)??null,!await r.flushDraft(i)||!O())return!1;const x=await zy.agents.get(g,v);if(!O())return!1;if(!x||x.workspaceId!==v||x.retiredAt||x.pendingDeleteAt||x.status==="deleted")throw new Error("unavailable");const Q=se.clips.flatMap(fe=>fe.media?[fe.media]:[]);Q.length&&!D&&(D=Zd({workspaceId:v,agentId:g,draftId:crypto.randomUUID(),principalId:P.principal.id,media:Q},O,k.signal));const pe=dy(c,se),Te=Rd(pe),he=await uy({workspaceId:v,agentId:g,evidence:se,clickedItems:c,sendItems:pe,clickedPayload:{...l,contextItems:pe,imageBlocks:Te.imageBlocks,fileBlocks:Te.fileBlocks},binding:S,service:D?.service??null,current:O,onRecord:()=>{}});return!he||!O()?!1:Ll(F,g,he)}catch{return O()&&F.dispatch(uw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",W),await D?.dispose(),yd.delete(q)}}const dv=1e4,Gp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Vp(n){return qS(n.messageMetadata)}function gx(n,r){if(n.some(Vp)){const a=n[0];return a&&!Vp(a)&&Kp(a,r)?[a.id]:[]}return n.filter(a=>Kp(a,r)).map(a=>a.id)}function px(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Kp(n,r){return!n.requeuedAfterFailure&&LS(n,r)}function fx(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,v=r.blocked||r.interrupted,g=r.timeoutMs??dv;let _=n.prediction;if(_){const k=new Set(i.map(D=>D.id)),W=_.ids.filter(D=>k.has(D)&&!c.has(D)),O=l-_.startedAt>=g,T=n.wasBusy&&!a;!W.length||O||v&&!a||T?_=null:W.length!==_.ids.length&&(_={..._,ids:W})}const f=n.wasBusy&&!a,P=n.wasBusy?n.busySince:a?l:null,S=n.wasBusy&&n.preempted||P!==null&&r.directSendAt!==null&&r.directSendAt>P;if(!_&&f&&!v&&!S){const k=gx(i,l).filter(W=>!c.has(W));k.length&&(_={ids:k,startedAt:l})}const q={wasBusy:a,busySince:a?P:null,preempted:a&&S,prediction:_};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class vx{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(v=>{c=setTimeout(()=>v(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function hx(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Qp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var mx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function uv(n,r){if(new.target)return fn({component:uv,...n});mn(r,!0);const a=()=>ge(P,"$typing$",i),[i,c]=Nr();let l=X(r,"workspaceId",7),v=X(r,"agentId",7),g=X(r,"class",7,"");const _=Bn(""),f=Bn("");ae(()=>{_.set(l())}),ae(()=>{f.set(v())});const P=gS(_,f),S=o(()=>w$(a()));var q={get workspaceId(){return l()},set workspaceId(D){l(D),Z()},get agentId(){return v()},set agentId(D){v(D),Z()},get class(){return g()},set class(D=""){g(D),Z()},$set:vn,$on:(D,K)=>hn(r,D,K)},k=Wt(),W=ye(k);{var O=D=>{var K=mx(),se=I(K),C=I(se);_$(C,{get people(){return a()},size:12,decorative:!0}),b(se);var x=m(se,2),Q=de(x,!0);pn(2),b(K),L(()=>{xe(K,1,`${Wf} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(S))}),p(D,K)};B(W,D=>{e(S)&&D(O)})}p(n,k);var T=_n(q);return c(),T}const _x=50,wx=5e3,bx=500,yx=()=>({authority:()=>Ri(F.state),persistSnapshot:py,dispatch:n=>F.dispatch(n),ownerView:n=>fy.withStore(F)(n)});function Ix(n){const r=n.store??yx(),a=crypto.randomUUID();let i=_e(!1),c=_e(!1),l=_e(!1),v=null,g=null,_=0,f=!1,P=null,S=null,q=null,k=0,W=null,O=null;const T={};let D,K=_e([]),se=null,C=0,x="",Q=0,pe="";const Te=()=>{const N=n.workspaceId(),R=n.agentId();if(!N||!R||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||f)return null;const qe=n.inputValue(),H=fe(),Y=D?.shared,J=Y?.workspaceId===N&&Y.agentId===R?Y.lifetime:null,Se=JSON.stringify([re,N,R,k,J,H.map(z=>[z.id,z.attachmentId,z.path])]);Se!==pe&&(pe=Se,Q+=1);const He=JSON.stringify([re,N,R,qe,H,k]);return He!==x&&(x=He,C+=1),{authority:re,ownerId:a,workspaceId:N,agentId:R,text:qe,attachments:JSON.parse(JSON.stringify(H)),generation:C,attachmentEpoch:Q}};let he=null;const fe=()=>eS(n.contextItems(),tS(n.contextItems(),e(K))),Le=N=>{if(D=N,!N||f)return;const R=N.restore;if(O&&R?.requestId===O.requestId&&R.status!=="pending"){const{apply:H}=O;O=null,w(c,!1),R.status==="restored"&&w(K,R.draft?.attachments??[]),H(R)}const re=N.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(se!==H){se=H;const Y=he??v,J=Y&&n.inputValue()===Y.text&&JSON.stringify(fe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(_+=1,q&&clearTimeout(q),w(K,re.snapshot.attachments),he=v={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(K))},n.setInputValue(re.snapshot.text),n.setContextItems(Sl(e(K))),n.applyEditorContent(re.snapshot.text))}}ot(Te);const qe=[];for(const H of N.saves){if(H.status==="pending")continue;qe.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}qe.length>0&&queueMicrotask(()=>r.dispatch(vw(a,qe)))},ue=(N,R,re)=>{const qe=crypto.randomUUID();O={requestId:qe,apply:re},w(c,!0),r.dispatch(mw(a,qe,N,R))},oe=()=>{O&&(O=null,w(c,!1),r.dispatch(ww(a)))},Me=()=>{const N=W;N&&(W=null,r.dispatch(_w(a)),D?.saves.some(R=>R.id===N)||delete T[N])};r.dispatch(gw(a));const ie=r.ownerView(a).subscribe(N=>ot(()=>Le(N))),ee=()=>{S&&(clearTimeout(S),S=null),w(l,!1)},Ae=()=>{W&&(W=null,r.dispatch(hw(a)))};ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId();if(!N){ot(()=>{_+=1,g=null,oe(),P&&clearTimeout(P),P=null,ee(),q&&clearTimeout(q),q=null,w(i,!1),Ae()});return}if(!R||!re)return;const qe=`${R}\0${re}`;if(g===qe)return;const H=g!==null;g=qe;const Y=++_;ot(()=>{v=null,he=null,se=null,w(K,[]),P&&clearTimeout(P),ee(),q&&(clearTimeout(q),q=null),H&&(Ae(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=gy(R,re);if(J){w(K,J.attachments),w(i,!1);const He=n.contextItems().length>0,z=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),He||n.setContextItems(Sl(J.attachments)),n.applyEditorContent(J.text),v={text:J.text,attachmentsJson:Ie},ue(R,re,Ce=>{if(Ce.status!=="restored")return;const De=Ce.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const at=De?.text??"",lt=De?.attachments??[],Oe=JSON.stringify(lt);cd(R,re,{text:at,attachments:lt});const $e=n.inputValue()===z&&JSON.stringify(fe())===Ie;He||!$e||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),Oe!==Ie&&n.setContextItems(Sl(lt)),v={text:at,attachmentsJson:Oe})});return}w(i,!0),S=setTimeout(()=>{S=null,(n.active?.()??!0)&&w(l,!0)},bx),P=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),ee())},wx);const Se=()=>{!(n.active?.()??!0)||g!==qe||_!==Y||(P&&clearTimeout(P),w(i,!1),ee())};ue(R,re,He=>{if(He.status!=="restored"){Se();return}const z=He.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Sl(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},_x)),v===null){const Ce=z?.text??"",De=z?.attachments??[];v={text:Ce,attachmentsJson:JSON.stringify(De)},cd(R,re,{text:Ce,attachments:De})}Se()})})}),ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId(),qe=e(i);if(!N){ot(Me);return}if(!R||!re)return;const H=n.inputValue(),Y=fe();if(ot(Te),ot(Me),qe||v===null&&!H&&Y.length===0)return;const J=JSON.stringify(Y);if(v!==null&&v.text===H&&v.attachmentsJson===J)return;JSON.stringify(e(K))!==J&&w(K,Y);const Se=`${R}\0${re}`,He=k,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){g===Se&&k===He&&(v={text:H,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},ot(()=>{W=z,r.dispatch(pw(a,z,{authority:r.authority?.()??void 0,workspaceId:R,agentId:re,text:H,attachments:Y,rollback:v?{text:v.text,attachments:JSON.parse(v.attachmentsJson)}:null}))})}),ae(()=>()=>{f=!0,P&&clearTimeout(P),S&&clearTimeout(S),q&&clearTimeout(q),Ae(),ie(),r.dispatch(fw(a))});const Ee=N=>{const R=Te();return R!==null&&R.authority===N.authority&&R.ownerId===N.ownerId&&R.workspaceId===N.workspaceId&&R.agentId===N.agentId&&R.generation===N.generation&&R.text===N.text&&JSON.stringify(R.attachments)===JSON.stringify(N.attachments)};return{captureDraft:Te,isCurrentDraft:Ee,updateAttachmentScreen(N,R,re){return!Ee(N)||!N.attachments.some(qe=>qe.id===R)?null:(w(K,N.attachments.map(qe=>qe.id===R?{...qe,screen:structuredClone(re)}:qe)),Te())},async flushDraft(N){if(!Ee(N))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,N.workspaceId,N.agentId,N,N.authority),Ee(N)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(_+=1,k+=1,oe(),P&&(clearTimeout(P),P=null),q&&(clearTimeout(q),q=null),w(i,!1),ee(),Me(),g!==null){const[N,R]=g.split("\0");cd(N,R,{text:"",attachments:[]}),he=null,w(K,[]),v={text:"",attachmentsJson:"[]"}}}}}function qi(n){if(!n)return null;const r=Lf(JSON.stringify([n.workspaceId,n.agentId]),Mf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function Sx(n,r,a){const i=F.state.principal.snapshot,c=()=>Ri(F.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,v=Zd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await v.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(_=>_.sourceId===r.source.id)??{ready:!1}}finally{await v.dispose()}}function Jp(n){let r=_e(null),a=_e(!1),i=_e(!1),c=null,l=!0,v=0,g=null;qs(()=>{l=!1,v++}),ae(()=>{const S=n.capture();e(r)&&(!S||S.authority!==e(r).capture.authority||S.ownerId!==e(r).capture.ownerId||S.workspaceId!==e(r).capture.workspaceId||S.agentId!==e(r).capture.agentId||S.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function _(S){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),k=qi(q),W=k?.clips.find(K=>K.contextItemId===S);if(!q||!W?.media||!k)return;const O=vy({workspaceId:q.workspaceId,agentId:q.agentId,clip:W,evidence:k,marks:k.marks}),T=yf(q.workspaceId,W.path);if(!O||!T)return;const D=++v;c=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||v!==D||!n.drafts.isCurrentDraft(q))return;const K=await(n.prepareOutput??Sx)(q,W.media,n.drafts);if(!l||v!==D||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:se,...C}=O;w(r,{capture:q,contextItemId:S,snapshot:{...C,openId:crypto.randomUUID(),mediaUrl:T,output:K,deleteReady:!0}})}catch{l&&v===D&&w(i,!0)}finally{l&&v===D&&w(a,!1)}}async function f(S){const q=crypto.randomUUID(),k=e(r),W=n.drafts.captureDraft();if(!k||!W||W.authority!==k.capture.authority||W.ownerId!==k.capture.ownerId||W.workspaceId!==k.capture.workspaceId||W.agentId!==k.capture.agentId||W.attachmentEpoch!==k.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const O=qi(W),T=O?.clips.find(Q=>Q.contextItemId===k.contextItemId);if(!O||!T?.media)return{requestId:q,result:"stale-source"};const K=g?.openId===k.snapshot.openId&&g.inputRevision===S.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...S,revision:T.media.saved?.revision??0}:S,se=$S(T.media,{openId:k.snapshot.openId,...k.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:W.workspaceId,agentId:W.agentId},sourceId:S.sourceId,sourceRevision:S.sourceRevision,expectedEditRevision:K.revision,edit:K});if(se.status!=="saved")return{requestId:q,result:se.status==="invalid-edit"?"failed":se.status};const C=kS({...O,clips:O.clips.map(Q=>Q.id===T.id?{...Q,media:se.media}:Q)})[k.contextItemId],x=n.drafts.updateAttachmentScreen(W,k.contextItemId,C);if(!x)return{requestId:q,result:"stale-source"};g={openId:k.snapshot.openId,media:se.media,inputRevision:S.revision};try{if(!n.drafts.isCurrentDraft(x))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(x);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==k.snapshot.openId||!Q||Q.attachmentEpoch!==k.capture.attachmentEpoch||Q.authority!==x.authority||Q.ownerId!==x.ownerId||Q.workspaceId!==x.workspaceId||Q.agentId!==x.agentId||JSON.stringify(Q.attachments.find(pe=>pe.id===k.contextItemId)?.screen)!==JSON.stringify(C)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:se.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function P(S){return n.disabled()||!n.onRemove(S)?!1:(e(r)?.contextItemId===S&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:_,save:f,remove:P,close(){w(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var $x=E('<p role="alert"> </p>'),kx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),xx=E("<!> <!> <!>",1);function gv(n,r){if(new.target)return fn({component:gv,...n});mn(r,!0);let a=X(r,"capture",7),i=X(r,"drafts",7),c=X(r,"disabled",7,!1),l=X(r,"onRemove",7),v=X(r,"controllerFactory",7,Jp),g=X(r,"beforeOpen",7),_=X(r,"onReviewChange",7);const f=ot(()=>v()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:C=>l()(C),beforeOpen:()=>g()?.()??Promise.resolve()}));ae(()=>{const C=f.opening,x=f.session;ot(()=>_()?.(C,x?.snapshot.output?.ready?{openId:x.snapshot.openId,capture:x.capture}:null))});const P=o(hy),S=o(()=>qi(a())),q=o(()=>e(S)?.clips.map(C=>({id:C.contextItemId,kind:"clip",owner:"evidence",duration:Ep(C.durationMs),recording:!1,url:a()?yf(a().workspaceId,C.path):void 0,...C.media?.saved?{summary:my(C.media.saved)}:{}}))??[]);let k=_e(null);var W={get capture(){return a()},set capture(C){a(C),Z()},get drafts(){return i()},set drafts(C){i(C),Z()},get disabled(){return c()},set disabled(C=!1){c(C),Z()},get onRemove(){return l()},set onRemove(C){l(C),Z()},get controllerFactory(){return v()},set controllerFactory(C=Jp){v(C),Z()},get beforeOpen(){return g()},set beforeOpen(C){g(C),Z()},get onReviewChange(){return _()},set onReviewChange(C){_(C),Z()},$set:vn,$on:(C,x)=>hn(r,C,x)},O=xx(),T=ye(O);{let C=o(()=>c()||f.opening);HS(T,{get items(){return e(q)},get labels(){return e(P)},get disabled(){return e(C)},onEdit:x=>void f.open(x),onMarkUp:x=>void f.open(x),get onRemove(){return f.remove}})}var D=m(T,2);{var K=C=>{var x=$x(),Q=de(x,!0);L(pe=>j(Q,pe),[()=>u.dock_captureEditor_saveFailed_label()]),p(C,x)};B(D,C=>{f.problem&&C(K)})}var se=m(D,2);{let C=o(()=>!!f.session),x=o(()=>u.dock_captureEditor_recording_title({duration:f.session?Ep(f.session.snapshot.durationMs??0):""}));A$(se,{get open(){return e(C)},size:"editor",showCloseButton:!1,get title(){return e(x)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>f.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),f.restoreFocus()},get contentRef(){return e(k)},set contentRef(Q){w(k,Q,!0)},children:(Q,pe)=>{var Te=Wt(),he=ye(Te);{var fe=Le=>{var ue=Wt(),oe=ye(ue);Ci(oe,()=>f.session.snapshot.openId,Me=>{var ie=kx(),ee=I(ie);M$(ee,{get snapshot(){return f.session.snapshot},get shortcutDialog(){return e(k)},onClose:()=>f.close(),get onSave(){return f.save},onDelete:async()=>!!f.session&&f.remove(f.session.contextItemId)}),b(ie),p(Me,ie)}),p(Le,ue)};B(he,Le=>{f.session&&Le(fe)})}p(Q,Te)},$$slots:{default:!0}})}return p(n,O),_n(W)}const Pl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function Cx(n){let r=_e(!1),a=_e(!1),i=_e(null),c=!1,l=0,v=null,g=null;async function _(S){S.abort.abort(),S.slot?.cancel(),await S.native?.dispose()}async function f(){l++;const S=g;g=null,S&&await _(S)}ro(()=>{const S=()=>{w(r,document.hasFocus(),!0)};return S(),window.addEventListener("focus",S),window.addEventListener("blur",S),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",S)}});const P=F.getReadableState().subscribe(()=>{g&&!g.current()&&f()});return qs(()=>{c=!0,P(),f()}),ae(()=>{const S=n.capture(),q=S?Pl(S):"",k=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);ot(()=>{if(!k||!S){f();return}if(g?.key===q)return;if(v===q){f();return}f();const O=qi(S)?.clips.flatMap(Te=>!Te.mediaError&&Te.media?[Te.media]:[])??[],T=O[0],D=F.state.principal.snapshot,K=Bl.select(F.state,S.workspaceId);if(!T||!D||!K||n.drafts.gateActive)return;const se=wf(),C=new AbortController,x=()=>!c&&!C.signal.aborted&&Ri(F.state)===S.authority&&Bl.select(F.state,S.workspaceId)===K&&bf(se)&&!!n.capture()&&Pl(n.capture())===q,Q={key:q,capture:S,abort:C,native:null,slot:null,current:x};g=Q;const pe=l;n.drafts.flushDraft(S).then(async Te=>{if(!(g!==Q||pe!==l||!x())){if(!Te){v=q,await f();return}Q.native=Zd({workspaceId:S.workspaceId,agentId:S.agentId,draftId:crypto.randomUUID(),principalId:D.principal.id,media:structuredClone(O)},x,C.signal),Q.slot=_y(Q.native.service),v=q,Q.slot.warm(q,T,x)}}).catch(()=>{g===Q&&f()})})}),{cancel:f,async beforeEditorOpen(){w(a,!0),v=null,await f()},editorState(S,q){w(a,S,!0);const k=q?Pl(q.capture):null;q&&e(i)?.openId!==q.openId&&(v=null),w(i,q&&k?{openId:q.openId,key:k}:null)},take(S,q){const k=g;if(!k?.native||!k.slot||k.key!==Pl(S)||!k.current())return f(),null;g=null,l++;const W=k.native,O=k.slot,T=()=>k.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...W.service,takePreparedRecording:D=>O.take(k.key,D,()=>!q.aborted&&k.current())},async dispose(){q.removeEventListener("abort",T),await _(k)}}}}}var Px=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function pv(n,r){if(new.target)return fn({component:pv,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Px(),c=I(i),l=de(c,!0);return b(i),L(v=>j(l,v),[()=>u.chat_draftGate_loading_label()]),p(n,i),_n(a)}var Rx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Hd(n,r){if(new.target)return fn({component:Hd,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Rx(),c=m(I(i),2),l=de(c,!0);return pn(2),b(i),L((v,g)=>{Ue(i,"aria-label",v),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),_n(a)}function Ax(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Tx(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Mx(n,r){return r&&n.includes(r)?r:null}function Yp(n,r,a){return r-n<=a}const Ex=.2;function Xp(n,r,a){const i=Math.max(0,a-r),c=n-Ex*r;return Math.min(Math.max(0,c),i)}function qx(n,r,a){return n!==null&&a&&n===r}function Lx(n){return n?bw(n)&&yw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Hx(n){const r=[],a=new Set;let i,c;for(const D of n.messages){if(D.agentId&&D.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(D.id))continue;a.add(D.id),n.breakBeforeMessageIds?.has(D.id)&&(i=void 0,c=void 0);const K=OS(D);if(K?.kind!=="turn-failure")c=void 0;else{const se=i?.seq!==void 0&&D.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(D.seq)&&D.seq===i.seq+1;(!c||!se)&&(c={key:JSON.stringify([n.agentId,"notice",D.id]),anchorMessageId:D.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:D.id,reason:K.reason,timestamp:D.timestamp}),c.recordedFailureCount+=1}i=D}const l=new Map;for(const D of n.queue){if(!D.requeuedAfterFailure)continue;const K=D.turnId||void 0,se=JSON.stringify([n.agentId,K?"turn":"queue",K??D.id]);let C=l.get(se);C||(C={key:se,correlation:K?"turn":"queue-entry",turnId:K,queueIds:[],state:"queued"},l.set(se,C)),C.queueIds.includes(D.id)||C.queueIds.push(D.id)}const v=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,_=g?.status===ki.Error,f=n.transientError||_&&g.stopReason||null,P=_&&!f,S=_&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=S?Sp(S):null,k=q&&f&&f===g?.stopReason?r.flatMap(D=>D.records).filter(D=>D.reason===f&&Sp(D.timestamp)===q):[],W=k.length===1?k[0].messageId:void 0,T=(g?kf(g):!1)?"attempting":v.length?"queued":f||P?"action-needed":"inactive";return{history:r,queueRecovery:v,current:{state:T,error:f,needsFallbackReason:P,timestamp:S,noticeId:W}}}function Ox(n,r){const a=n.hiddenTail[0]?.id,i=Hx({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(_=>_.messageId!==c)})).filter(g=>g.records.length>0),v=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(_=>_.messageId).filter(_=>!v.has(_))))}}var Dx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Fx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Nx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Bx=E('<div class="mb-5"><!></div>'),Wx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Ux=E("<!> <!>",1),zx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),jx=E("<!> <span> </span>",1),Gx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function fv(n,r){if(new.target)return fn({component:fv,...n});mn(r,!0);const a=()=>ge(k,"$userOverrides$",v),i=()=>ge(q,"$specialists$",v),c=()=>ge(D,"$isGitHubAuth$",v),l=()=>ge(K,"$recentSpecialistIds$",v),[v,g]=Nr();let _=X(r,"onSpecialistChange",7),f=X(r,"session",7),P=X(r,"workspaceId",7);const S=Bn(P()??"");ae(()=>S.set(P()??""));const q=Qf(S),k=ek();ae(()=>{a()});const W=o(()=>{if(!f()||Zy(f()))return null;const N=f().metadata?.specialist||f().agentMetadata?.specialist;return N&&i().find(R=>R.id===N)||null});async function O(N){N?await Gl({specialist:N,hash:"specialists"}):await Gl({view:"create-specialist"})}let T=_e(!1);const D=tk(),K=pS(),se=o(()=>Iw(nk(i(),c()),l()));let C=_e(!1);const x=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(W)?.name??u.chat_shared_general_fallback()),pe=o(()=>e(W)?.description??u.chat_shared_noSpecializedBehavior_label()),Te=o(()=>e(W)?e(W).defaultBehaviorPrompt||"":e(x));var he={get onSpecialistChange(){return _()},set onSpecialistChange(N){_(N),Z()},get session(){return f()},set session(N){f(N),Z()},get workspaceId(){return P()},set workspaceId(N){P(N),Z()},$set:vn,$on:(N,R)=>hn(r,N,R)},fe=Gx(),Le=I(fe);{var ue=N=>{var R=Bx(),re=I(R);fk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(C)},set open(Y){w(C,Y,!0)},trigger:(Y,J)=>{let Se=()=>(J?.()).props;{let He=o(()=>zd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));$t(Y,Li(Se,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(He)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Dx(),De=ye(Ce),at=I(De);{let ze=o(()=>e(W)?.id??null),Ze=o(()=>e(W)?.icon??null);pk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(ze)},get icon(){return e(Ze)}})}b(De);var lt=m(De,2),Oe=I(lt),$e=de(Oe,!0),V=m(Oe,2),ne=de(V,!0);b(lt);var Fe=m(lt,2),me=I(Fe);gt(me,{get icon(){return Na},size:10}),b(Fe),L(()=>{j($e,e(Q)),j(ne,e(pe))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=Nx(),Se=I(J),He=I(Se),z=de(He,!0),Ie=m(He,2),Ce=de(Ie,!0);b(Se);var De=m(Se,2),at=I(De);{let $e=o(()=>e(W)?.id??null);ew(at,{get specialists(){return e(se)},get value(){return e($e)},onchange:V=>{w(C,!1),_()?.(V)}})}b(De);var lt=m(De,2),Oe=I(lt);Tt(Oe,()=>Dr,($e,V)=>{V($e,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(C,!1),O()},children:(ne,Fe)=>{var me=Fx(),ze=ye(me),Ze=I(ze);gt(Ze,{get icon(){return O$},size:12}),b(ze);var ut=m(ze,2),mt=de(ut,!0);L(dt=>j(mt,dt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(ne,me)},$$slots:{default:!0}})}),b(lt),b(J),L(($e,V)=>{j(z,$e),j(Ce,V)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),b(R),p(N,R)};B(Le,N=>{_()&&N(ue)})}var oe=m(Le,2);{var Me=N=>{var R=Wt(),re=ye(R);{let qe=o(()=>u.chat_specialistSelector_prompt_label());Tt(re,()=>hk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(qe)},children:(J,Se)=>{var He=Ux(),z=ye(He);Tt(z,()=>lv,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wt(),$e=ye(Oe);Tt($e,()=>cv,(V,ne)=>{ne(V,{class:"type-caption font-medium",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>u.chat_specialistSelector_prompt_label()]),p(Fe,ze)},$$slots:{default:!0}})}),p(at,Oe)},$$slots:{default:!0}})});var Ie=m(z,2);Tt(Ie,()=>vk,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wx(),$e=ye(Oe),V=de($e,!0),ne=m($e,2);$t(ne,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Fe,ze)},$$slots:{default:!0}}),L(()=>{xe($e,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(V,e(Te))}),p(at,Oe)},$$slots:{default:!0}})}),p(J,He)},$$slots:{default:!0}})})}p(N,R)},ie=N=>{var R=zx(),re=de(R,!0);L(()=>j(re,e(Te))),p(N,R)};B(oe,N=>{e(W)?N(Me):N(ie,-1)})}var ee=m(oe,2);{var Ae=N=>{$t(N,{variant:"ghost-light",size:"sm",onclick:()=>O(e(W).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(R,re)=>{var qe=jx(),H=ye(qe);gt(H,{get icon(){return H$},size:12,class:"opacity-60"});var Y=m(H,2),J=de(Y,!0);L(Se=>j(J,Se),[()=>u.chat_regularAgentWelcome_customize_label()]),p(R,qe)},$$slots:{default:!0}})};B(ee,N=>{e(W)&&N(Ae)})}b(fe),p(n,fe);var Ee=_n(he);return g(),Ee}var Vx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Kx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Qx=E('<span class="type-caption"> </span>'),Jx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Yx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function eu(n,r){if(new.target)return fn({component:eu,...n});mn(r,!0);let a=X(r,"prompts",7),i=X(r,"onSelect",7),c=X(r,"onEdit",7),l=X(r,"compact",7,!1),v=X(r,"showShortcutHints",7,!1),g=X(r,"reserveShortcutHintSpace",7,!1),_=X(r,"workspaceId",7);const P=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",S=p$.replace("text-ui","type-caption");function q(x){i()(x)}function k(x,Q){x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),q(Q))}function W(x,Q){x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x})}function O(x,Q){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x}))}function T(x){return x<3}var D={get prompts(){return a()},set prompts(x){a(x),Z()},get onSelect(){return i()},set onSelect(x){i(x),Z()},get onEdit(){return c()},set onEdit(x){c(x),Z()},get compact(){return l()},set compact(x=!1){l(x),Z()},get showShortcutHints(){return v()},set showShortcutHints(x=!1){v(x),Z()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(x=!1){g(x),Z()},get workspaceId(){return _()},set workspaceId(x){_(x),Z()},$set:vn,$on:(x,Q)=>hn(r,x,Q)},K=Wt(),se=ye(K);{var C=x=>{var Q=Yx(),pe=I(Q);{const Te=(fe,Le)=>{let ue=()=>(Le?.()).item,oe=()=>(Le?.()).index;const Me=o(()=>ay(ue())),ie=o(()=>e(Me)[0]?.type==="text"?e(Me)[0].content:"");var ee=Jx(),Ae=I(ee),Ee=I(Ae);gt(Ee,{get icon(){return zf},size:16,get class(){return gr}}),b(Ae);var N=m(Ae,2),R=I(N),re=de(R,!0),qe=m(R);On(qe,17,()=>e(Me).slice(e(ie)?1:0),Y_,(z,Ie)=>{var Ce=Wt(),De=ye(Ce);{var at=Oe=>{const $e=o(()=>ry(e(Ie).url));var V=Vx(),ne=de(V,!0);L(()=>{Ue(V,"href",e($e)),Ue(V,"title",e($e)),j(ne,e(Ie).label)}),ps("click",V,Fe=>W(Fe,e($e))),ps("keydown",V,Fe=>O(Fe,e($e))),p(Oe,V)},lt=Oe=>{var $e=dn();L(()=>j($e,e(Ie).content)),p(Oe,$e)};B(De,Oe=>{e(Ie).type==="link"?Oe(at):Oe(lt,-1)})}p(z,Ce)}),b(N);var H=m(N,2);{var Y=z=>{var Ie=Kx();let Ce;var De=de(Ie);L(()=>{Ce=xe(Ie,1,`${S??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!v()}),Ue(Ie,"aria-hidden",v()?void 0:"true"),Ue(Ie,"data-hint-visible",v()),j(De,`${P}${oe()+1}`)}),p(z,Ie)},J=o(()=>T(oe())&&(v()||g()));B(H,z=>{e(J)&&z(Y)})}var Se=m(H,2);{var He=z=>{L$(z,{side:"top",delayDuration:300,trigger:De=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());$t(De,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:lt=>{lt.stopPropagation(),c()(ue())},get"aria-label"(){return e(at)},children:(lt,Oe)=>{gt(lt,{get icon(){return D$},size:"xs"})},$$slots:{default:!0}})}},content:De=>{var at=Qx(),lt=de(at,!0);L(Oe=>j(lt,Oe),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(De,at)},$$slots:{trigger:!0,content:!0}})};B(Se,z=>{c()&&z(He)})}b(ee),L(z=>{xe(ee,1,`${Wf} ${g$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),xe(Ae,1,`${Ul??""} mt-px self-start`),Ue(R,"aria-label",z),j(re,e(ie))},[()=>ny(ue())]),ps("click",R,z=>{z.stopPropagation(),q(ue())}),ps("keydown",R,z=>k(z,ue())),p(fe,ee)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");T$(pe,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Te,$$slots:{row:!0}})}b(Q),Bt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Bt(2,Q,()=>to,()=>({tier:"fast"})),p(x,Q)};B(se,x=>{a().length>0&&x(C)})}return p(n,K),_n(D)}Ud(["click","keydown"]);var Xx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function vv(n,r){if(new.target)return fn({component:vv,...n});mn(r,!0);let a=X(r,"onSelect",7),i=X(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function v(q){const k=e(c).find(W=>W.label===q);k&&a()(k.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),Z()},get compact(){return i()},set compact(q=!1){i(q),Z()},$set:vn,$on:(q,k)=>hn(r,q,k)},_=Xx(),f=I(_),P=de(f,!0),S=m(f,2);return eu(S,{get prompts(){return e(l)},onSelect:v,get compact(){return i()}}),b(_),L(q=>j(P,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,_),_n(g)}const tu=2e3,Zx=4e3,e1=Zx-tu-2;function t1(n,r=tu){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const v=(l.contentBlocks??[]).filter(_=>_.type==="text").map(_=>_.text||_.content||"").join(""),g=(l.role==="assistant"?tw(v).cleanedContent:v).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function n1(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
2
2
 
3
3
  `).slice(-tu),i=r.map(l=>l.trim()).filter(Boolean);if(i.length===0)return a;const c=`Suggested prompts:
4
4
  ${i.map(l=>`- ${l}`).join(`
@@ -1,4 +1,4 @@
1
- import{g as Ut}from"./KlNP4OZJ.js";import{s as Kt}from"./bs-TVtqR.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./B1lrKll_.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
1
+ import{g as Ut}from"./CuNu9amm.js";import{s as Kt}from"./a8KDQTjI.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./DjWdAsv4.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[T[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(n,l){return this.yy=l||this.yy||{},this._input=n,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:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var l=n.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var l=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=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),d.length-1&&(this.yylineno-=d.length-1);var _=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:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(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:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),l=new Array(n.length+1).join("-");return n+this.upcomingInput()+`