antigravity-mobile-proxy 1.1.4 → 1.2.0

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 (192) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +13 -12
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +6 -0
  6. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  8. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page.js +3 -3
  16. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/api/v1/artifacts/[convId]/[filename]/route.js +1 -1
  19. package/.next/standalone/.next/server/app/api/v1/artifacts/[convId]/[filename]/route_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/api/v1/artifacts/[convId]/route_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/api/v1/artifacts/active/[filename]/route.js +1 -1
  22. package/.next/standalone/.next/server/app/api/v1/artifacts/active/[filename]/route_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/v1/artifacts/active/route.js +1 -1
  24. package/.next/standalone/.next/server/app/api/v1/artifacts/active/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/artifacts/route_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/api/v1/changes/accept-all/route_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/api/v1/changes/active/route.js +1 -1
  28. package/.next/standalone/.next/server/app/api/v1/changes/active/route_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/api/v1/changes/diff/route_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/api/v1/changes/reject-all/route_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/api/v1/chat/action/route_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/api/v1/chat/agent/route_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/api/v1/chat/approve/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/api/v1/chat/history/route_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/api/v1/chat/mode/route_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/chat/monitor/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/api/v1/chat/new/route_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/api/v1/chat/reject/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/v1/chat/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/v1/chat/state/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/v1/chat/stop/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/chat/stream/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/v1/conversations/active/route_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/conversations/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/api/v1/conversations/select/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/api/v1/debug/artifact-test/route.js +1 -0
  47. package/.next/standalone/.next/server/app/api/v1/debug/artifact-test/route.js.nft.json +1 -0
  48. package/.next/standalone/.next/server/app/api/v1/debug/artifact-test/route_client-reference-manifest.js +1 -0
  49. package/.next/standalone/.next/server/app/api/v1/debug/dom/route_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/api/v1/debug/scrape/route_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/api/v1/git/commit/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/git/diff/route_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/api/v1/git/push/route_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/api/v1/git/status/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/api/v1/health/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/v1/windows/cdp-start/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/windows/cdp-status/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/v1/windows/close/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/v1/windows/open/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/v1/windows/recent/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/v1/windows/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/v1/windows/select/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/v1/workspace/content/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/v1/workspace/files/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/debug/page.js +3 -3
  66. package/.next/standalone/.next/server/app/debug/page.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/debug/page_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/page.js +3 -3
  69. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/~offline/page.js +3 -3
  72. package/.next/standalone/.next/server/app/~offline/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/~offline/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app-paths-manifest.json +13 -12
  75. package/.next/standalone/.next/server/chunks/1565.js +1 -1
  76. package/.next/standalone/.next/server/chunks/8166.js +1 -1
  77. package/.next/standalone/.next/server/chunks/9814.js +3 -0
  78. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  79. package/.next/standalone/.next/server/pages/500.html +2 -2
  80. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  81. package/.next/static/chunks/366-0da170bc0fe1f16e.js +3 -0
  82. package/.next/static/chunks/8710-6b1b2eea72777418.js +1 -0
  83. package/.next/static/chunks/app/_global-error/page-3dc2621e09be9619.js +1 -0
  84. package/.next/static/chunks/app/_not-found/page-3dc2621e09be9619.js +1 -0
  85. package/.next/static/chunks/app/api/v1/artifacts/[convId]/[filename]/route-3dc2621e09be9619.js +1 -0
  86. package/.next/static/chunks/app/api/v1/artifacts/[convId]/route-3dc2621e09be9619.js +1 -0
  87. package/.next/static/chunks/app/api/v1/artifacts/active/[filename]/route-3dc2621e09be9619.js +1 -0
  88. package/.next/static/chunks/app/api/v1/artifacts/active/route-3dc2621e09be9619.js +1 -0
  89. package/.next/static/chunks/app/api/v1/artifacts/route-3dc2621e09be9619.js +1 -0
  90. package/.next/static/chunks/app/api/v1/changes/accept-all/route-3dc2621e09be9619.js +1 -0
  91. package/.next/static/chunks/app/api/v1/changes/active/route-3dc2621e09be9619.js +1 -0
  92. package/.next/static/chunks/app/api/v1/changes/diff/route-3dc2621e09be9619.js +1 -0
  93. package/.next/static/chunks/app/api/v1/changes/reject-all/route-3dc2621e09be9619.js +1 -0
  94. package/.next/static/chunks/app/api/v1/chat/action/route-3dc2621e09be9619.js +1 -0
  95. package/.next/static/chunks/app/api/v1/chat/agent/route-3dc2621e09be9619.js +1 -0
  96. package/.next/static/chunks/app/api/v1/chat/approve/route-3dc2621e09be9619.js +1 -0
  97. package/.next/static/chunks/app/api/v1/chat/history/route-3dc2621e09be9619.js +1 -0
  98. package/.next/static/chunks/app/api/v1/chat/mode/route-3dc2621e09be9619.js +1 -0
  99. package/.next/static/chunks/app/api/v1/chat/monitor/route-3dc2621e09be9619.js +1 -0
  100. package/.next/static/chunks/app/api/v1/chat/new/route-3dc2621e09be9619.js +1 -0
  101. package/.next/static/chunks/app/api/v1/chat/reject/route-3dc2621e09be9619.js +1 -0
  102. package/.next/static/chunks/app/api/v1/chat/route-3dc2621e09be9619.js +1 -0
  103. package/.next/static/chunks/app/api/v1/chat/state/route-3dc2621e09be9619.js +1 -0
  104. package/.next/static/chunks/app/api/v1/chat/stop/route-3dc2621e09be9619.js +1 -0
  105. package/.next/static/chunks/app/api/v1/chat/stream/route-3dc2621e09be9619.js +1 -0
  106. package/.next/static/chunks/app/api/v1/conversations/active/route-3dc2621e09be9619.js +1 -0
  107. package/.next/static/chunks/app/api/v1/conversations/route-3dc2621e09be9619.js +1 -0
  108. package/.next/static/chunks/app/api/v1/conversations/select/route-3dc2621e09be9619.js +1 -0
  109. package/.next/static/chunks/app/api/v1/debug/artifact-test/route-3dc2621e09be9619.js +1 -0
  110. package/.next/static/chunks/app/api/v1/debug/dom/route-3dc2621e09be9619.js +1 -0
  111. package/.next/static/chunks/app/api/v1/debug/scrape/route-3dc2621e09be9619.js +1 -0
  112. package/.next/static/chunks/app/api/v1/git/commit/route-3dc2621e09be9619.js +1 -0
  113. package/.next/static/chunks/app/api/v1/git/diff/route-3dc2621e09be9619.js +1 -0
  114. package/.next/static/chunks/app/api/v1/git/push/route-3dc2621e09be9619.js +1 -0
  115. package/.next/static/chunks/app/api/v1/git/status/route-3dc2621e09be9619.js +1 -0
  116. package/.next/static/chunks/app/api/v1/health/route-3dc2621e09be9619.js +1 -0
  117. package/.next/static/chunks/app/api/v1/windows/cdp-start/route-3dc2621e09be9619.js +1 -0
  118. package/.next/static/chunks/app/api/v1/windows/cdp-status/route-3dc2621e09be9619.js +1 -0
  119. package/.next/static/chunks/app/api/v1/windows/close/route-3dc2621e09be9619.js +1 -0
  120. package/.next/static/chunks/app/api/v1/windows/open/route-3dc2621e09be9619.js +1 -0
  121. package/.next/static/chunks/app/api/v1/windows/recent/route-3dc2621e09be9619.js +1 -0
  122. package/.next/static/chunks/app/api/v1/windows/route-3dc2621e09be9619.js +1 -0
  123. package/.next/static/chunks/app/api/v1/windows/select/route-3dc2621e09be9619.js +1 -0
  124. package/.next/static/chunks/app/api/v1/workspace/content/route-3dc2621e09be9619.js +1 -0
  125. package/.next/static/chunks/app/api/v1/workspace/files/route-3dc2621e09be9619.js +1 -0
  126. package/.next/static/chunks/app/{layout-7757590e84032b92.js → layout-8047c1c03b631ac3.js} +2 -2
  127. package/.next/static/chunks/app/not-found-3dc2621e09be9619.js +1 -0
  128. package/.next/static/chunks/app/page-04ba0cb0c37b893d.js +1 -0
  129. package/.next/static/chunks/next/dist/client/components/builtin/app-error-3dc2621e09be9619.js +1 -0
  130. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3dc2621e09be9619.js +1 -0
  131. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3dc2621e09be9619.js +1 -0
  132. package/.next/static/chunks/{webpack-503a6513e11f0c2a.js → webpack-fb7bae86ce0f828f.js} +1 -1
  133. package/.next/static/css/29db8a1a90fb87d6.css +1 -0
  134. package/.next/static/css/5eacd01f773eed7f.css +11 -0
  135. package/.next/static/css/ad4f1e7378df6d96.css +1 -0
  136. package/.next/static/v1.2.0/_buildManifest.js +1 -0
  137. package/package.json +17 -2
  138. package/public/sw.js +1 -1
  139. package/.next/standalone/.next/server/chunks/6368.js +0 -3
  140. package/.next/static/chunks/4855-d76c75aaf5497499.js +0 -1
  141. package/.next/static/chunks/7101-c5b762e6184b72a6.js +0 -3
  142. package/.next/static/chunks/app/_global-error/page-cc79d4c747fe87b0.js +0 -1
  143. package/.next/static/chunks/app/_not-found/page-cc79d4c747fe87b0.js +0 -1
  144. package/.next/static/chunks/app/api/v1/artifacts/[convId]/[filename]/route-cc79d4c747fe87b0.js +0 -1
  145. package/.next/static/chunks/app/api/v1/artifacts/[convId]/route-cc79d4c747fe87b0.js +0 -1
  146. package/.next/static/chunks/app/api/v1/artifacts/active/[filename]/route-cc79d4c747fe87b0.js +0 -1
  147. package/.next/static/chunks/app/api/v1/artifacts/active/route-cc79d4c747fe87b0.js +0 -1
  148. package/.next/static/chunks/app/api/v1/artifacts/route-cc79d4c747fe87b0.js +0 -1
  149. package/.next/static/chunks/app/api/v1/changes/accept-all/route-cc79d4c747fe87b0.js +0 -1
  150. package/.next/static/chunks/app/api/v1/changes/active/route-cc79d4c747fe87b0.js +0 -1
  151. package/.next/static/chunks/app/api/v1/changes/diff/route-cc79d4c747fe87b0.js +0 -1
  152. package/.next/static/chunks/app/api/v1/changes/reject-all/route-cc79d4c747fe87b0.js +0 -1
  153. package/.next/static/chunks/app/api/v1/chat/action/route-cc79d4c747fe87b0.js +0 -1
  154. package/.next/static/chunks/app/api/v1/chat/agent/route-cc79d4c747fe87b0.js +0 -1
  155. package/.next/static/chunks/app/api/v1/chat/approve/route-cc79d4c747fe87b0.js +0 -1
  156. package/.next/static/chunks/app/api/v1/chat/history/route-cc79d4c747fe87b0.js +0 -1
  157. package/.next/static/chunks/app/api/v1/chat/mode/route-cc79d4c747fe87b0.js +0 -1
  158. package/.next/static/chunks/app/api/v1/chat/monitor/route-cc79d4c747fe87b0.js +0 -1
  159. package/.next/static/chunks/app/api/v1/chat/new/route-cc79d4c747fe87b0.js +0 -1
  160. package/.next/static/chunks/app/api/v1/chat/reject/route-cc79d4c747fe87b0.js +0 -1
  161. package/.next/static/chunks/app/api/v1/chat/route-cc79d4c747fe87b0.js +0 -1
  162. package/.next/static/chunks/app/api/v1/chat/state/route-cc79d4c747fe87b0.js +0 -1
  163. package/.next/static/chunks/app/api/v1/chat/stop/route-cc79d4c747fe87b0.js +0 -1
  164. package/.next/static/chunks/app/api/v1/chat/stream/route-cc79d4c747fe87b0.js +0 -1
  165. package/.next/static/chunks/app/api/v1/conversations/active/route-cc79d4c747fe87b0.js +0 -1
  166. package/.next/static/chunks/app/api/v1/conversations/route-cc79d4c747fe87b0.js +0 -1
  167. package/.next/static/chunks/app/api/v1/conversations/select/route-cc79d4c747fe87b0.js +0 -1
  168. package/.next/static/chunks/app/api/v1/debug/dom/route-cc79d4c747fe87b0.js +0 -1
  169. package/.next/static/chunks/app/api/v1/debug/scrape/route-cc79d4c747fe87b0.js +0 -1
  170. package/.next/static/chunks/app/api/v1/git/commit/route-cc79d4c747fe87b0.js +0 -1
  171. package/.next/static/chunks/app/api/v1/git/diff/route-cc79d4c747fe87b0.js +0 -1
  172. package/.next/static/chunks/app/api/v1/git/push/route-cc79d4c747fe87b0.js +0 -1
  173. package/.next/static/chunks/app/api/v1/git/status/route-cc79d4c747fe87b0.js +0 -1
  174. package/.next/static/chunks/app/api/v1/health/route-cc79d4c747fe87b0.js +0 -1
  175. package/.next/static/chunks/app/api/v1/windows/cdp-start/route-cc79d4c747fe87b0.js +0 -1
  176. package/.next/static/chunks/app/api/v1/windows/cdp-status/route-cc79d4c747fe87b0.js +0 -1
  177. package/.next/static/chunks/app/api/v1/windows/close/route-cc79d4c747fe87b0.js +0 -1
  178. package/.next/static/chunks/app/api/v1/windows/open/route-cc79d4c747fe87b0.js +0 -1
  179. package/.next/static/chunks/app/api/v1/windows/recent/route-cc79d4c747fe87b0.js +0 -1
  180. package/.next/static/chunks/app/api/v1/windows/route-cc79d4c747fe87b0.js +0 -1
  181. package/.next/static/chunks/app/api/v1/windows/select/route-cc79d4c747fe87b0.js +0 -1
  182. package/.next/static/chunks/app/api/v1/workspace/content/route-cc79d4c747fe87b0.js +0 -1
  183. package/.next/static/chunks/app/api/v1/workspace/files/route-cc79d4c747fe87b0.js +0 -1
  184. package/.next/static/chunks/app/not-found-cc79d4c747fe87b0.js +0 -1
  185. package/.next/static/chunks/app/page-b59642b4851f2952.js +0 -1
  186. package/.next/static/chunks/next/dist/client/components/builtin/app-error-cc79d4c747fe87b0.js +0 -1
  187. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-cc79d4c747fe87b0.js +0 -1
  188. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cc79d4c747fe87b0.js +0 -1
  189. package/.next/static/css/742a8e5707969683.css +0 -1
  190. package/.next/static/css/a9fb7d1761d6ce7a.css +0 -1
  191. package/.next/static/v1.1.4/_buildManifest.js +0 -1
  192. /package/.next/static/{v1.1.4 → v1.2.0}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
- (()=>{var a={};a.id=8974,a.ids=[8974],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},293:(a,b,c)=>{"use strict";let d;c.d(b,{default:()=>aF});var e=c(8249),f=c(7484),g=Object.prototype.hasOwnProperty;let h=new WeakMap,i=()=>{},j=i(),k=Object,l=a=>a===j,m=(a,b)=>({...a,...b}),n={},o={},p="undefined",q=typeof document!=p,r=!1,s=(a,b)=>{let c=h.get(a);return[()=>!l(b)&&a.get(b)||n,d=>{if(!l(b)){let e=a.get(b);b in o||(o[b]=e),c[5](b,m(e,d),e||n)}},c[6],()=>!l(b)&&b in o?o[b]:!l(b)&&a.get(b)||n]},t=!0,[u,v]=[i,i],w={initFocus:a=>(q&&document.addEventListener("visibilitychange",a),u("focus",a),()=>{q&&document.removeEventListener("visibilitychange",a),v("focus",a)}),initReconnect:a=>{let b=()=>{t=!0,a()},c=()=>{t=!1};return u("online",b),u("offline",c),()=>{v("online",b),v("offline",c)}}},x=!f.useId,y=!0,z=y?f.useEffect:f.useLayoutEffect,A="u">typeof navigator&&navigator.connection,B=!y&&A&&(["slow-2g","2g"].includes(A.effectiveType)||A.saveData),C=new WeakMap,D=(a,b)=>a===`[object ${b}]`,E=0,F=a=>{let b,c,d=typeof a,e=k.prototype.toString.call(a),f=D(e,"Date"),g=D(e,"RegExp"),h=D(e,"Object");if(k(a)!==a||f||g)b=f?a.toJSON():"symbol"==d?a.toString():"string"==d?JSON.stringify(a):""+a;else{if(b=C.get(a))return b;if(b=++E+"~",C.set(a,b),Array.isArray(a)){for(c=0,b="@";c<a.length;c++)b+=F(a[c])+",";C.set(a,b)}if(h){b="#";let d=k.keys(a).sort();for(;!l(c=d.pop());)l(a[c])||(b+=c+":"+F(a[c])+",");C.set(a,b)}}return b},G=a=>{if("function"==typeof a)try{a=a()}catch(b){a=""}let b=a;return[a="string"==typeof a?a:(Array.isArray(a)?a.length:a)?F(a):"",b]},H=0,I=()=>++H;async function J(...a){let[b,c,d,e]=a,f=m({populateCache:!0,throwOnError:!0},"boolean"==typeof e?{revalidate:e}:e||{}),g=f.populateCache,i=f.rollbackOnError,k=f.optimisticData,n=f.throwOnError;if("function"==typeof c){let a=[];for(let d of b.keys())!/^\$(inf|sub)\$/.test(d)&&c(b.get(d)._k)&&a.push(d);return Promise.all(a.map(o))}return o(c);async function o(c){let e,[m]=G(c);if(!m)return;let[o,p]=s(b,m),[q,r,t,u]=h.get(b),v=()=>{let a=q[m];return("function"==typeof f.revalidate?f.revalidate(o().data,c):!1!==f.revalidate)&&(delete t[m],delete u[m],a&&a[0])?a[0](2).then(()=>o().data):o().data};if(a.length<3)return v();let w=d,x=!1,y=I();r[m]=[y,0];let z=!l(k),A=o(),B=A.data,C=A._c,D=l(C)?B:C;if(z&&p({data:k="function"==typeof k?k(D,B):k,_c:D}),"function"==typeof w)try{w=w(D)}catch(a){e=a,x=!0}if(w&&"function"==typeof w.then){let a;if(w=await w.catch(a=>{e=a,x=!0}),y!==r[m][0]){if(x)throw e;return w}x&&z&&(a=e,"function"==typeof i?i(a):!1!==i)&&(g=!0,p({data:D,_c:j}))}if(g&&!x&&("function"==typeof g?p({data:g(w,D),error:j,_c:j}):p({data:w,error:j,_c:j})),r[m][1]=I(),Promise.resolve(v()).then(()=>{p({_c:j})}),x){if(n)throw e;return}return w}}let K=(a,b)=>{for(let c in a)a[c][0]&&a[c][0](b)},L=(a,b)=>{if(!h.has(a)){let c=m(w,b),d=Object.create(null),e=J.bind(j,a),f=i,g=Object.create(null),k=(a,b)=>{let c=g[a]||[];return g[a]=c,c.push(b),()=>c.splice(c.indexOf(b),1)},l=(b,c,d)=>{a.set(b,c);let e=g[b];if(e)for(let a of e)a(c,d)},n=()=>{if(!h.has(a)&&(h.set(a,[d,Object.create(null),Object.create(null),Object.create(null),e,l,k]),!y)){let b=c.initFocus(setTimeout.bind(j,K.bind(j,d,0))),e=c.initReconnect(setTimeout.bind(j,K.bind(j,d,1)));f=()=>{b&&b(),e&&e(),h.delete(a)}}};return n(),[a,e,n,f]}return[a,h.get(a)[4]]},[M,N]=L(new Map),O=m({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:(a,b,c,d,e)=>{let f=c.errorRetryCount,g=e.retryCount,h=~~((Math.random()+.5)*(1<<(g<8?g:8)))*c.errorRetryInterval;(l(f)||!(g>f))&&setTimeout(d,h,e)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:B?5e3:3e3,compare:function a(b,c){var d,e;if(b===c)return!0;if(b&&c&&(d=b.constructor)===c.constructor){if(d===Date)return b.getTime()===c.getTime();if(d===RegExp)return b.toString()===c.toString();if(d===Array){if((e=b.length)===c.length)for(;e--&&a(b[e],c[e]););return -1===e}if(!d||"object"==typeof b){for(d in e=0,b)if(g.call(b,d)&&++e&&!g.call(c,d)||!(d in c)||!a(b[d],c[d]))return!1;return Object.keys(c).length===e}}return b!=b&&c!=c},isPaused:()=>!1,cache:M,mutate:N,fallback:{}},{isOnline:()=>t,isVisible:()=>{let a=q&&document.visibilityState;return l(a)||"hidden"!==a}}),P=(a,b)=>{let c=m(a,b);if(b){let{use:d,fallback:e}=a,{use:f,fallback:g}=b;d&&f&&(c.use=d.concat(f)),e&&g&&(c.fallback=m(e,g))}return c},Q=(0,f.createContext)({}),R=!1,S=R?window.__SWR_DEVTOOLS_USE__:[],T=()=>{let a=(0,f.useContext)(Q);return(0,f.useMemo)(()=>m(O,a),[a])},U=S.concat(a=>(b,c,d)=>{let e=c&&((...a)=>{let[d]=G(b),[,,,e]=h.get(M);if(d.startsWith("$inf$"))return c(...a);let f=e[d];return l(f)?c(...a):(delete e[d],f)});return a(b,e,d)});R&&(window.__SWR_DEVTOOLS_REACT__=f);var V=c(2237);let W=()=>{},X=W(),Y=(new WeakMap,f.use||(a=>{switch(a.status){case"pending":throw a;case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a.status="pending",a.then(b=>{a.status="fulfilled",a.value=b},b=>{a.status="rejected",a.reason=b}),a}})),Z={dedupe:!0},$=Promise.resolve(j),_=()=>i;k.defineProperty(a=>{let{value:b}=a,c=(0,f.useContext)(Q),d="function"==typeof b,e=(0,f.useMemo)(()=>d?b(c):b,[d,c,b]),g=(0,f.useMemo)(()=>d?e:P(c,e),[d,c,e]),h=e&&e.provider,i=(0,f.useRef)(j);h&&!i.current&&(i.current=L(h(g.cache||M),e));let k=i.current;return k&&(g.cache=k[0],g.mutate=k[1]),z(()=>{if(k)return k[2]&&k[2](),k[3]},[]),(0,f.createElement)(Q.Provider,m(a,{value:g}))},"defaultValue",{value:O});let aa=(d=(a,b,c)=>{let{cache:d,compare:e,suspense:g,fallbackData:i,revalidateOnMount:k,revalidateIfStale:n,refreshInterval:o,refreshWhenHidden:p,refreshWhenOffline:q,keepPreviousData:r,strictServerPrefetchWarning:t}=c,[u,v,w,A]=h.get(d),[B,C]=G(a),D=(0,f.useRef)(!1),E=(0,f.useRef)(!1),F=(0,f.useRef)(B),H=(0,f.useRef)(b),K=(0,f.useRef)(c),L=()=>K.current.isVisible()&&K.current.isOnline(),[M,N,O,P]=s(d,B),Q=(0,f.useRef)({}).current,R=l(i)?l(c.fallback)?j:c.fallback[B]:i,S=(a,b)=>{for(let c in Q)if("data"===c){if(!e(a[c],b[c])&&(!l(a[c])||!e(ae,b[c])))return!1}else if(b[c]!==a[c])return!1;return!0},T=!D.current,U=(0,f.useMemo)(()=>{let a=M(),c=P(),d=a=>{let c=m(a);return(delete c._k,(()=>{if(!B||!b||K.current.isPaused())return!1;if(T&&!l(k))return k;let a=l(R)?c.data:R;return l(a)||n})())?{isValidating:!0,isLoading:!0,...c}:c},e=d(a),f=a===c?e:d(c),g=e;return[()=>{let a=d(M());return S(a,g)?(g.data=a.data,g.isLoading=a.isLoading,g.isValidating=a.isValidating,g.error=a.error,g):(g=a,a)},()=>f]},[d,B]),W=(0,V.useSyncExternalStore)((0,f.useCallback)(a=>O(B,(b,c)=>{S(c,b)||a()}),[d,B]),U[0],U[1]),X=u[B]&&u[B].length>0,aa=W.data,ab=l(aa)?R&&"function"==typeof R.then?Y(R):R:aa,ac=W.error,ad=(0,f.useRef)(ab),ae=r?l(aa)?l(ad.current)?ab:ad.current:aa:ab,af=B&&l(ab),ag=(0,f.useRef)(null);y||(0,V.useSyncExternalStore)(_,()=>(ag.current=!1,ag),()=>(ag.current=!0,ag));let ah=ag.current;t&&ah&&!g&&af&&console.warn(`Missing pre-initiated data for serialized key "${B}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let ai=!(!B||!b||K.current.isPaused())&&(!X||!!l(ac))&&(T&&!l(k)?k:g?!l(ab)&&n:l(ab)||n),aj=T&&ai,ak=l(W.isValidating)?aj:W.isValidating,al=l(W.isLoading)?aj:W.isLoading,am=(0,f.useCallback)(async a=>{let b,d,f=H.current;if(!B||!f||E.current||K.current.isPaused())return!1;let g=!0,h=a||{},i=!w[B]||!h.dedupe,k=()=>x?!E.current&&B===F.current&&D.current:B===F.current,m={isValidating:!1,isLoading:!1},n=()=>{N(m)},o=()=>{let a=w[B];a&&a[1]===d&&delete w[B]},p={isValidating:!0};l(M().data)&&(p.isLoading=!0);try{if(i&&(N(p),c.loadingTimeout&&l(M().data)&&setTimeout(()=>{g&&k()&&K.current.onLoadingSlow(B,c)},c.loadingTimeout),w[B]=[f(C),I()]),[b,d]=w[B],b=await b,i&&setTimeout(o,c.dedupingInterval),!w[B]||w[B][1]!==d)return i&&k()&&K.current.onDiscarded(B),!1;m.error=j;let a=v[B];if(!l(a)&&(d<=a[0]||d<=a[1]||0===a[1]))return n(),i&&k()&&K.current.onDiscarded(B),!1;let h=M().data;m.data=e(h,b)?h:b,i&&k()&&K.current.onSuccess(b,B,c)}catch(c){o();let a=K.current,{shouldRetryOnError:b}=a;!a.isPaused()&&(m.error=c,i&&k())&&(a.onError(c,B,a),(!0===b||"function"==typeof b&&b(c))&&(!K.current.revalidateOnFocus||!K.current.revalidateOnReconnect||L())&&a.onErrorRetry(c,B,a,a=>{let b=u[B];b&&b[0]&&b[0](3,a)},{retryCount:(h.retryCount||0)+1,dedupe:!0}))}return g=!1,n(),!0},[B,d]),an=(0,f.useCallback)((...a)=>J(d,F.current,...a),[]);if(z(()=>{H.current=b,K.current=c,l(aa)||(ad.current=aa)}),z(()=>{var a;let b;if(!B)return;let c=am.bind(j,Z),d=0;K.current.revalidateOnFocus&&(d=Date.now()+K.current.focusThrottleInterval);let e=(a=(a,b={})=>{if(0==a){let a=Date.now();K.current.revalidateOnFocus&&a>d&&L()&&(d=a+K.current.focusThrottleInterval,c())}else if(1==a)K.current.revalidateOnReconnect&&L()&&c();else if(2==a)return am();else if(3==a)return am(b)},(b=u[B]||(u[B]=[])).push(a),()=>{let c=b.indexOf(a);c>=0&&(b[c]=b[b.length-1],b.pop())});if(E.current=!1,F.current=B,D.current=!0,N({_k:C}),ai&&!w[B])if(l(ab)||y)c();else setTimeout(c,1);return()=>{E.current=!0,e()}},[B]),z(()=>{let a;function b(){let b="function"==typeof o?o(M().data):o;b&&-1!==a&&(a=setTimeout(c,b))}function c(){!M().error&&(p||K.current.isVisible())&&(q||K.current.isOnline())?am(Z).then(b):b()}return b(),()=>{a&&(clearTimeout(a),a=-1)}},[o,p,q,B]),(0,f.useDebugValue)(ae),g){if(!x&&y&&af)throw Error("Fallback data is required when using Suspense in SSR.");af&&(H.current=b,K.current=c,E.current=!1);let a=A[B];if(Y(!l(a)&&af?an(a):$),!l(ac)&&af)throw ac;let d=af?am(Z):$;!l(ae)&&af&&(d.status="fulfilled",d.value=!0),Y(d)}return{mutate:an,get data(){return Q.data=!0,ae},get error(){return Q.error=!0,ac},get isValidating(){return Q.isValidating=!0,ak},get isLoading(){return Q.isLoading=!0,al}}},function(...a){let b=T(),[c,e,f]="function"==typeof a[1]?[a[0],a[1],a[2]||{}]:[a[0],null,(null===a[1]?a[2]:a[1])||{}],g=P(b,f),h=d,{use:i}=g,j=(i||[]).concat(U);for(let a=j.length;a--;)h=j[a](h);return h(c,e||g.fetcher||null,g)}),ab="/api/v1",ac=a=>fetch(a).then(a=>a.json()),ad={windows:`${ab}/windows`,cdpStatus:`${ab}/windows/cdp-status`,conversations:`${ab}/conversations`,recentProjects:`${ab}/windows/recent`,artifacts:`${ab}/artifacts/active`,changes:`${ab}/changes/active`,git:`${ab}/git/status`,workspace:`${ab}/workspace/files`,history:`${ab}/chat/history`,mode:`${ab}/chat/mode`,agent:`${ab}/chat/agent`,health:`${ab}/health`},ae="/api/v1",af="/api/v1";function ag(a){if(!a)return"";let b=new Date(a),c=Math.floor((Date.now()-b.getTime())/6e4);if(c<1)return"now";if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d} hr${1!==d?"s":""} ago`;let e=Math.floor(d/24);if(e<7)return`${e} day${1!==e?"s":""} ago`;let f=Math.floor(e/7);return`${f} wk${1!==f?"s":""} ago`}function ah({conversations:a,activeConversation:b,onSelect:c}){let[d,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(!1),j=(0,f.useRef)(null),k=(0,f.useCallback)(()=>{g(!1),i(!1)},[]),l=a.find(a=>a.active)||null,m=[...a.filter(a=>!a.active)].sort((a,b)=>a.mtime||b.mtime?a.mtime?b.mtime?new Date(b.mtime).getTime()-new Date(a.mtime).getTime():-1:1:0),n=h?m:m.slice(0,5),o=m.length-5;return(0,e.jsxs)("div",{ref:j,className:`conv-selector-wrapper ${d?"open":""}`,children:[(0,e.jsxs)("button",{className:"conv-selector-btn",onClick:()=>g(!d),title:"Switch conversation",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:b?.title?.substring(0,22)||"Select a conversation"}),(0,e.jsx)("svg",{className:"chevron",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`conv-dropdown ${d?"open":""}`,children:[(0,e.jsx)("div",{className:"conv-dropdown-header",children:"Select a conversation"}),(0,e.jsxs)("div",{className:"conv-dropdown-list",children:[l&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsx)("div",{className:"conv-section-label",children:"Current"}),(0,e.jsx)("button",{className:"conv-item active",onClick:()=>{-1!==l.index&&c(l.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[(0,e.jsx)("span",{className:"conv-item-title",children:l.title||"Untitled"}),l.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(l.mtime)}),(0,e.jsx)("span",{role:"button",tabIndex:0,className:"conv-item-action",title:"Current conversation",onClick:a=>a.stopPropagation(),onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&a.stopPropagation()},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,e.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,e.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,e.jsx)("path",{d:"M9 6V4h6v2"})]})})]})})]}),n.length>0&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsxs)("div",{className:"conv-section-label",children:["Recent",m.length>0&&(0,e.jsx)("span",{className:"conv-section-count",children:m.length})]}),n.map((a,b)=>{let d=a.title||a.id.substring(0,20)+"…";return(0,e.jsx)("button",{className:"conv-item",onClick:()=>{c(a.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[a.active&&(0,e.jsx)("span",{className:"conv-item-dot active"}),(0,e.jsx)("span",{className:"conv-item-title",children:d}),a.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(a.mtime)})]})},`conv-${b}`)}),!h&&o>0&&(0,e.jsxs)("button",{className:"conv-show-more",onClick:a=>{a.stopPropagation(),i(!0)},children:["Show ",o," more…"]})]}),0===a.length&&(0,e.jsx)("div",{className:"conv-dropdown-empty",children:"No conversations found"})]})]})]})}function ai({statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}){let[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(null),z=(0,f.useRef)(null),A=(0,f.useRef)(null),B=async()=>{let a=i.length>0?i[0].path:".";w(!0),y(null);try{let b=await m(a,!0);y({text:b.message||(b.success?"CDP started!":"Failed to start CDP"),type:b.success?"success":"error"})}catch{y({text:"Failed to start CDP server",type:"error"})}finally{w(!1)}},C=async a=>{a.preventDefault();let b=r.trim();if(b&&!t){u(!0),y(null);try{let a=await n(b);y({text:a.message||(a.success?"Window opened!":"Failed to open"),type:a.success?"success":"error"}),a.success&&s("")}catch{y({text:"Failed to open window",type:"error"})}finally{u(!1)}}},D=async(a,b,d)=>{if(d.stopPropagation(),!window.confirm(`Close window "${c[a]?.title||a}"?`))return;let e=await o(a,b);y({text:e.message||(e.success?"Closed!":"Failed to close"),type:e.success?"success":"error"})};return(0,e.jsxs)("header",{className:"header",children:[(0,e.jsx)("div",{className:"header-left",children:(0,e.jsx)("div",{className:"logo",children:(0,e.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"url(#header-gradient)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"header-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,e.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})})}),(0,e.jsxs)("div",{className:"header-right",children:[(0,e.jsx)(ah,{conversations:d,activeConversation:g,onSelect:k}),(0,e.jsxs)("div",{ref:z,className:`window-selector-wrapper ${p?"open":""}`,children:[(0,e.jsxs)("button",{className:"window-selector-btn",onClick:()=>q(!p),title:"Manage Antigravity windows",children:[(0,e.jsx)("span",{className:`cdp-indicator ${h.active?"active":"inactive"}`}),(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,e.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,e.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,e.jsx)("span",{style:{maxWidth:"120px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"bottom"},children:c.find(a=>a.active)?.title||"Windows"}),(0,e.jsx)("svg",{className:"chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`window-dropdown ${p?"open":""}`,children:[(0,e.jsxs)("div",{className:"wm-cdp-status",children:[(0,e.jsxs)("div",{className:"wm-cdp-info",children:[(0,e.jsx)("span",{className:`wm-cdp-dot ${h.active?"active":"inactive"}`}),(0,e.jsx)("span",{children:h.active?`CDP Active \xb7 ${h.windowCount} window${1!==h.windowCount?"s":""}`:"CDP Inactive"})]}),!h.active&&(0,e.jsxs)("button",{className:"wm-cdp-start-btn",onClick:B,disabled:v,title:"Start Antigravity with CDP",children:[v?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})}),v?"Starting...":"Start CDP"]})]}),(0,e.jsx)("div",{className:"window-dropdown-header",children:"Open Windows"}),c.map(a=>(0,e.jsxs)("div",{className:`window-item ${a.active?"active":""}`,children:[(0,e.jsxs)("button",{className:"window-item-select",onClick:()=>{j(a.index),q(!1)},children:[(0,e.jsx)("span",{className:"window-dot"}),(0,e.jsx)("span",{className:"window-item-title",children:a.title})]}),(0,e.jsx)("button",{className:"window-item-close",onClick:b=>D(a.index,a.targetId,b),title:`Close "${a.title}"`,children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},a.index)),0===c.length&&(0,e.jsx)("div",{style:{padding:"12px",color:"var(--text-muted)",fontSize:"12px"},children:"No windows detected"}),i.length>0&&(0,e.jsxs)("div",{className:"wm-recent-section",children:[(0,e.jsx)("div",{className:"wm-recent-header",children:"Recent Projects"}),i.map(a=>(0,e.jsxs)("button",{className:"wm-recent-item",onClick:async()=>{u(!0),y(null);try{let b=await n(a.path);y({text:b.message||(b.success?"Opened!":"Failed"),type:b.success?"success":"error"})}catch{y({text:"Failed to open",type:"error"})}finally{u(!1)}},disabled:t,title:a.path,children:[(0,e.jsx)("svg",{className:"wm-recent-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsxs)("div",{className:"wm-recent-info",children:[(0,e.jsx)("span",{className:"wm-recent-name",children:a.name}),(0,e.jsx)("span",{className:"wm-recent-path",children:a.path})]})]},a.path))]}),(0,e.jsxs)("div",{className:"wm-open-section",children:[(0,e.jsx)("div",{className:"wm-open-label",children:"Open New Window"}),(0,e.jsxs)("form",{className:"wm-open-form",onSubmit:C,children:[(0,e.jsx)("input",{ref:A,type:"text",className:"wm-open-input",value:r,onChange:a=>s(a.target.value),placeholder:"/path/to/project",disabled:t}),(0,e.jsx)("button",{type:"submit",className:"wm-open-btn",disabled:t||!r.trim(),title:"Open directory in Antigravity",children:t?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]}),x&&(0,e.jsx)("div",{className:`wm-action-message ${x.type}`,children:x.text})]})]}),(0,e.jsx)("button",{className:"icon-btn",onClick:l,title:"New Chat","aria-label":"New Chat",children:(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]})}function aj({onQuickPrompt:a}){return(0,e.jsxs)("div",{className:"welcome-screen",children:[(0,e.jsx)("div",{className:"welcome-icon",children:(0,e.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"url(#gradient)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,e.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}),(0,e.jsx)("h2",{children:"Antigravity Agent"}),(0,e.jsx)("p",{children:"Ask anything. The agent has access to your IDE — files, terminal, search, and more."}),(0,e.jsxs)("div",{className:"quick-prompts",children:[(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("What files are in the current workspace?"),children:"\uD83D\uDCC1 List workspace files"}),(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("Explain the architecture of this project"),children:"\uD83C\uDFD7️ Explain architecture"}),(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("Help me debug the most recent error"),children:"\uD83D\uDC1B Debug last error"})]})]})}function ak({content:a}){return(0,e.jsx)("div",{className:"user-message",children:(0,e.jsx)("div",{className:"message-content",children:a})})}let al={command:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',file:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',search:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',read:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',browser:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',mcp:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6M12 22v-6M4.93 4.93l4.24 4.24M14.83 14.83l4.24 4.24M2 12h6M22 12h-6M4.93 19.07l4.24-4.24M14.83 9.17l4.24-4.24"/><circle cx="12" cy="12" r="4"/></svg>'},am='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>';function an(a){let b=a.toLowerCase();return"deny"===b||"block"===b||"reject"===b?"permission-btn deny":"allow"===b||"allow once"===b||"allow this conversation"===b?"permission-btn allow":"tool-footer-btn"}function ao({data:a,onAction:b}){let c,d="permission required"===(c=(a.status||"").toLowerCase())?"permission":c.startsWith("running")||c.startsWith("editing")||c.startsWith("creating")||c.startsWith("search")?"running":c.startsWith("ran")||c.startsWith("edited")||c.startsWith("created")||c.startsWith("read")||c.startsWith("viewed")||c.startsWith("analyzed")||c.startsWith("wrote")||c.startsWith("replaced")||c.startsWith("deleted")?"done":c.includes("error")||c.includes("fail")?"error":c.startsWith("mcp")?"mcp":"running",f="permission"===d,g=f?am:al[a.type]||al.file,h=async c=>{if(b)return void b(a.id,c);try{await fetch("/api/v1/chat/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:a.id,buttonText:c})})}catch{}};return f?(0,e.jsxs)("div",{className:"permission-card","data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"permission-header",children:[(0,e.jsx)("span",{className:"permission-icon",dangerouslySetInnerHTML:{__html:am}}),(0,e.jsx)("span",{className:"permission-title",children:"Permission Required"})]}),a.path?(0,e.jsxs)("div",{className:"permission-description",children:["The agent needs access to: ",(0,e.jsx)("code",{className:"permission-path",children:a.path})]}):(0,e.jsx)("div",{className:"permission-description",children:"The agent is requesting your approval to proceed."}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"permission-actions",children:a.footerButtons.map((a,b)=>(0,e.jsx)("button",{className:an(a),onClick:()=>h(a),children:a},b))})]}):(0,e.jsxs)("div",{className:`tool-call-card ${d}`,"data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"tool-header",children:[(0,e.jsx)("span",{className:"tool-icon",dangerouslySetInnerHTML:{__html:g}}),(0,e.jsx)("span",{className:"tool-status-text",children:a.status}),a.path&&(0,e.jsx)("span",{className:"tool-path",title:a.path,children:a.path})]}),a.command&&(0,e.jsx)("div",{className:"tool-command",children:(0,e.jsx)("code",{children:a.command})}),(a.additions||a.deletions)&&(0,e.jsxs)("div",{className:"tool-file-changes",children:[a.additions&&(0,e.jsx)("span",{className:"tool-additions",children:a.additions}),a.deletions&&(0,e.jsx)("span",{className:"tool-deletions",children:a.deletions})]}),a.exitCode&&(0,e.jsx)("div",{className:"tool-exit-code",children:a.exitCode}),a.terminalOutput&&(0,e.jsx)("div",{className:"tool-terminal",children:a.terminalOutput}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"tool-footer-actions",children:a.footerButtons.map((a,b)=>(0,e.jsx)("button",{className:an(a),onClick:()=>h(a),children:a},b))})]})}function ap({time:a}){return(0,e.jsxs)("div",{className:"thinking-block",children:[(0,e.jsx)("span",{className:"thinking-icon",children:"\uD83D\uDCAD"}),(0,e.jsx)("span",{children:a})]})}function aq(){return(0,e.jsxs)("div",{className:"typing-indicator",children:[(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"})]})}function ar({content:a,steps:b,isStreaming:c,onRetry:d}){return(0,e.jsxs)("div",{className:`agent-message ${c?"streaming":""}`,children:[(0,e.jsxs)("div",{className:"agent-steps",children:[b.map((a,b)=>{switch(a.type){case"thinking":return(0,e.jsx)(ap,{time:a.data.time},`step-${b}`);case"tool_call":return(0,e.jsx)(ao,{data:a.data},`step-${b}`);case"hitl":case"notification":default:return null;case"file_change":return(0,e.jsxs)("div",{className:"file-change-indicator",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,e.jsx)("span",{className:"file-change-name",children:a.data.fileName})]},`step-${b}`);case"error":return(0,e.jsxs)("div",{className:"error-banner",children:[(0,e.jsxs)("div",{style:{marginBottom:!c&&d?"8px":"0"},children:["⚠️ ",String(a.data.message)]}),!c&&d&&(0,e.jsx)("button",{className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 transition-colors text-sm font-medium",onClick:d,children:"Try Again"})]},`step-${b}`)}}),c&&(0,e.jsx)(aq,{})]}),a&&(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:a}})]})}function as({messages:a,currentSteps:b,currentResponse:c,isStreaming:d,onRetry:f}){return(0,e.jsxs)(e.Fragment,{children:[a.map((a,b)=>"user"===a.role?(0,e.jsx)(ak,{content:a.content},`msg-${b}`):(0,e.jsx)(ar,{content:a.content,steps:a.steps||[],isStreaming:!1,onRetry:f},`msg-${b}`)),d&&(0,e.jsx)(ar,{content:c,steps:b,isStreaming:!0,onRetry:f})]})}function at({onSend:a,onStop:b,isStreaming:c,currentMode:d,onToggleMode:g,currentAgent:h,agents:i,isLoadingAgents:j,onFetchAgents:k,onSwitchAgent:l,onToggleArtifacts:m,artifactCount:n,artifactPanelOpen:o,onToggleChanges:p,changesCount:q,changesPanelOpen:r,onToggleGit:s,gitChangedCount:t,gitPanelOpen:u,onToggleWorkspace:v,workspacePanelOpen:w}){let[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),B=(0,f.useRef)(null),C=(0,f.useRef)(null),D=h?h.replace(/^(Claude\s+|Google\s+|OpenAI\s+)/i,"").substring(0,20):"Agent";return(0,e.jsxs)("footer",{className:"input-area",children:[(0,e.jsxs)("div",{className:"input-toolbar",children:[(0,e.jsxs)("div",{ref:C,className:"agent-selector-wrapper",children:[(0,e.jsxs)("button",{className:"agent-selector-btn",onClick:()=>{z||k(),A(!z)},title:h?`Agent: ${h} — Click to switch`:"Select AI agent","aria-label":`Switch agent (currently ${h||"unknown"})`,type:"button",children:[(0,e.jsx)("span",{className:"agent-icon",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 2a4 4 0 0 1 4 4v2a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4z"}),(0,e.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-3-3.87"}),(0,e.jsx)("path",{d:"M4 21v-2a4 4 0 0 1 3-3.87"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"1"}),(0,e.jsx)("path",{d:"M9 17h6"})]})}),(0,e.jsx)("span",{className:"agent-label",children:D}),(0,e.jsx)("svg",{className:`agent-chevron ${z?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`agent-dropdown ${z?"open":""}`,children:[(0,e.jsx)("div",{className:"agent-dropdown-header",children:"Select Agent"}),j?(0,e.jsxs)("div",{className:"agent-dropdown-loading",children:[(0,e.jsx)("span",{className:"wm-spinner"}),(0,e.jsx)("span",{children:"Loading agents..."})]}):0===i.length?(0,e.jsx)("div",{className:"agent-dropdown-empty",children:"No agents detected. Make sure the IDE has a workbench open."}):(0,e.jsx)("div",{className:"agent-dropdown-list",children:i.map((a,b)=>(0,e.jsxs)("button",{className:`agent-option ${a.active?"active":""} ${h===a.name?"current":""}`,onClick:()=>{l(a.name),A(!1)},type:"button",children:[(0,e.jsx)("span",{className:"agent-option-name",children:a.name}),a.description&&(0,e.jsx)("span",{className:"agent-option-desc",children:a.description}),(a.active||h===a.name)&&(0,e.jsx)("svg",{className:"agent-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})})]},b))})]})]}),(0,e.jsxs)("button",{className:`mode-toggle ${d}`,onClick:g,title:`Mode: ${"planning"===d?"Planning":"Fast"} — Click to switch`,"aria-label":`Switch mode (currently ${d})`,type:"button",children:[(0,e.jsx)("span",{className:"mode-icon",children:"planning"===d?"\uD83D\uDCCB":"⚡"}),(0,e.jsx)("span",{className:"mode-label",children:"planning"===d?"Plan":"Fast"})]}),(0,e.jsxs)("button",{className:`artifact-toggle-btn ${o?"active":""}`,onClick:m,title:`Artifacts${n>0?` (${n})`:""}`,"aria-label":"Toggle artifacts panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,e.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,e.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),n>0&&(0,e.jsx)("span",{className:"artifact-badge",children:n})]}),(0,e.jsxs)("button",{className:`changes-toggle-btn ${r?"active":""}`,onClick:p,title:`Changes${q>0?` (${q})`:""}`,"aria-label":"Toggle changes panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 20h9"}),(0,e.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),q>0&&(0,e.jsx)("span",{className:"changes-badge",children:q})]}),(0,e.jsxs)("button",{className:`git-toggle-btn ${u?"active":""}`,onClick:s,title:`Git${t>0?` (${t} changed)`:""}`,"aria-label":"Toggle git panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),"Git",t>0&&(0,e.jsx)("span",{className:"git-badge",children:t})]}),(0,e.jsxs)("button",{className:`workspace-toggle-btn ${w?"active":""}`,onClick:v,title:"Working Directory","aria-label":"Toggle working directory panel",type:"button",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),"Dir"]})]}),(0,e.jsxs)("div",{className:"input-wrapper",children:[(0,e.jsx)("textarea",{ref:B,value:x,onChange:a=>{y(a.target.value);let b=a.target;b.style.height="auto",b.style.height=Math.min(b.scrollHeight,150)+"px"},onKeyDown:d=>{if("Escape"===d.key&&c){d.preventDefault(),b();return}"Enter"===d.key&&(d.shiftKey||d.ctrlKey||d.metaKey)&&(d.preventDefault(),x.trim()?(a(x),y(""),B.current&&(B.current.style.height="auto")):c&&b())},placeholder:"Ask the Antigravity agent...",rows:1,"aria-label":"Chat message input",enterKeyHint:"enter",autoComplete:"off"}),(0,e.jsx)("button",{className:`send-btn${c&&x.trim()?" send-btn--interrupt":c?" send-btn--stop":""}`,onClick:()=>{x.trim()?(a(x),y(""),B.current&&(B.current.style.height="auto")):c&&b()},disabled:!c&&!x.trim(),"aria-label":c&&x.trim()?"Interrupt and send new message":c?"Stop generation":"Send message",title:c&&x.trim()?"Interrupt agent and send new message":c?"Stop generation (Esc)":"Send message",children:c&&!x.trim()?(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})}):(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,e.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(0,e.jsx)("div",{className:"input-hint",children:(0,e.jsx)("span",{children:"Shift+Enter to send \xb7 Enter for new line \xb7 Ctrl+N for new chat \xb7 Esc to stop"})})]})}function au({open:a,onClose:b,activeConversation:c,files:d}){let[g,h]=(0,f.useState)(null),[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)(!1),m=async a=>{l(!0),h(a);try{let b=await fetch(`/api/v1/artifacts/active/${encodeURIComponent(a)}`);if(!b.ok){let a=await b.json().catch(()=>({error:"Unknown error"}));j(`Error: ${a.error||b.statusText}`);return}let c=await b.text();j(c)}catch(a){j(`Error loading file: ${a.message}`)}finally{l(!1)}},n=a=>!1!==a.isFile&&/\.\w{1,5}$/.test(a.name);return(0,e.jsxs)("div",{className:`artifact-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"artifact-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Artifacts"})]}),c?(0,e.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:[(0,e.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.title||"Untitled"}),(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})]}):d.length>0?(0,e.jsx)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})}):(0,e.jsx)("div",{style:{padding:"24px 16px",textAlign:"center",color:"var(--text-muted)",fontSize:"13px"},children:"No active conversation"}),g?(0,e.jsxs)("div",{className:"artifact-viewer",children:[(0,e.jsxs)("div",{className:"artifact-viewer-header",children:[(0,e.jsx)("button",{className:"artifact-back-btn",onClick:()=>{h(null),j("")},children:"← Back"}),(0,e.jsx)("span",{className:"artifact-viewer-title",children:g})]}),(0,e.jsx)("div",{className:"artifact-viewer-body",children:k?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"Loading..."}):g.endsWith(".md")?(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:i.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.*$)/gim,"<li>$1</li>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br/>")}}):(0,e.jsx)("pre",{style:{margin:0,fontSize:"12px",lineHeight:1.6,color:"var(--text-secondary)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:i})})]}):(0,e.jsxs)("div",{className:"artifact-file-list",children:[d.map(a=>{var b;return(0,e.jsxs)("button",{className:`artifact-file-item ${!n(a)?"non-file":""}`,onClick:()=>{n(a)&&m(a.name)},disabled:!n(a),title:n(a)?`Open ${a.name}`:`${a.name} (IDE artifact — view in Antigravity)`,children:[(0,e.jsx)("span",{className:"artifact-file-icon",children:(a=>{if(n(a)){let b=a.name;return b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":b.endsWith(".ts")||b.endsWith(".tsx")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".js")||b.endsWith(".jsx")?"\uD83D\uDCDC":"\uD83D\uDCC4"}return"\uD83D\uDDBC️"})(a)}),(0,e.jsxs)("div",{style:{flex:1,overflow:"hidden"},children:[(0,e.jsx)("div",{className:"artifact-file-name",children:a.name}),(0,e.jsx)("div",{style:{fontSize:"10px",color:"var(--text-muted)"},children:(a=>{if(a.includes("T")||a.includes("-")){let b=new Date(a);if(!isNaN(b.getTime()))return b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})+" \xb7 "+b.toLocaleDateString()}return a})(a.mtime)})]}),(0,e.jsx)("span",{className:"artifact-file-size",children:(b=a.size)<=0?"":b<1024?`${b}B`:b<1048576?`${(b/1024).toFixed(1)}KB`:`${(b/1048576).toFixed(1)}MB`})]},a.name)}),0===d.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No artifacts in this conversation"})]})]})}function av({open:a,onClose:b,changes:c,onAcceptAll:d,onRejectAll:g,isAccepting:h,isRejecting:i}){let[j,k]=(0,f.useState)(null),[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(null),t=c.reduce((a,b)=>a+b.additions,0),u=c.reduce((a,b)=>a+b.deletions,0),v=async a=>{o(!0),k(a.filepath),q(a.filename),m([]);try{let b=await fetch(`/api/v1/changes/diff?filepath=${encodeURIComponent(a.filepath)}`),c=await b.json();c.diff?m(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(c.diff)):m([{type:"meta",content:c.message||"No diff available"}])}catch(a){m([{type:"meta",content:`Error: ${a.message}`}])}finally{o(!1)}},w=async()=>{s(null);let a=await d();a?.success?s({type:"success",text:"All changes accepted ✓"}):s({type:"error",text:a?.error||"Failed to accept changes"}),setTimeout(()=>s(null),3e3)},x=async()=>{s(null);let a=await g();a?.success?s({type:"success",text:"All changes rejected ✓"}):s({type:"error",text:a?.error||"Failed to reject changes"}),setTimeout(()=>s(null),3e3)},y=h||i;return(0,e.jsxs)("div",{className:`changes-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"changes-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Changes Overview"})]}),j?(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{k(null),m([]),q("")},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:p}),(0,e.jsx)("span",{className:"diff-viewer-path",children:j})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:n?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px",fontStyle:"italic"},children:"Loading diff..."}):0===l.length?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"No changes found"}):(0,e.jsx)("div",{className:"diff-lines",children:l.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"changes-summary",children:[(0,e.jsxs)("span",{className:"changes-count",children:[c.length," file",1!==c.length?"s":""," changed"]}),(0,e.jsxs)("div",{className:"changes-stats",children:[t>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",t]}),u>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",u]})]})]}),c.length>0&&(0,e.jsxs)("div",{className:"changes-action-bar",children:[(0,e.jsx)("button",{className:"changes-reject-all-btn",onClick:x,disabled:y,title:"Reject all file changes",children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Rejecting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),"Reject All"]})}),(0,e.jsx)("button",{className:"changes-accept-all-btn",onClick:w,disabled:y,title:"Accept all file changes",children:h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Accepting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Accept All"]})})]}),r&&(0,e.jsx)("div",{className:`changes-action-message changes-action-message--${r.type}`,children:r.text}),(0,e.jsxs)("div",{className:"changes-file-list",children:[c.map(a=>{var b;return(0,e.jsxs)("button",{className:"changes-file-item",onClick:()=>v(a),title:`View diff: ${a.filepath}`,children:[(0,e.jsx)("span",{className:"changes-file-icon",children:(b=a.filename).endsWith(".tsx")||b.endsWith(".jsx")?"⚛️":b.endsWith(".ts")||b.endsWith(".js")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":"\uD83D\uDCDD"}),(0,e.jsxs)("div",{className:"changes-file-info",children:[(0,e.jsx)("div",{className:"changes-file-name",children:a.filename}),(0,e.jsx)("div",{className:"changes-file-path",children:a.filepath})]}),(0,e.jsxs)("div",{className:"changes-file-diff",children:[a.additions>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",a.additions]}),a.deletions>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",a.deletions]})]})]},a.filepath)}),0===c.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No file changes in this conversation"})]})]})]})}let aw={modified:{label:"M",color:"#fbbf24"},added:{label:"A",color:"#34d399"},deleted:{label:"D",color:"#ef4444"},renamed:{label:"R",color:"#a78bfa"},copied:{label:"C",color:"#60a5fa"},untracked:{label:"U",color:"#94a3b8"},unmerged:{label:"!",color:"#f97316"}};function ax({status:a}){let{label:b,color:c}=aw[a]||{label:"?",color:"#94a3b8"};return(0,e.jsx)("span",{className:"git-file-status-badge",style:{color:c,borderColor:`${c}44`,background:`${c}18`},children:b})}function ay({open:a,onClose:b,gitStatus:c,onRefresh:d}){let[g,h]=(0,f.useState)("changes"),[i,j]=(0,f.useState)(null),[k,l]=(0,f.useState)([]),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),[s,t]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(null),y=(a,b)=>{x({text:a,type:b}),setTimeout(()=>x(null),4e3)},z=async()=>{if(q.trim()&&!s){t(!0);try{let a=await fetch("/api/v1/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:q.trim(),stageAll:!0})}),b=await a.json();b.success?(r(""),y("Committed successfully","success"),d()):y(b.error||"Commit failed","error")}catch(a){y(`Error: ${a.message}`,"error")}finally{t(!1)}}},A=async()=>{if(!u){v(!0);try{let a=await fetch("/api/v1/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),b=await a.json();b.success?(y("Pushed to origin","success"),d()):y(b.error||"Push failed","error")}catch(a){y(`Error: ${a.message}`,"error")}finally{v(!1)}}},B=async(a,b)=>{n(!0),j({path:a.path,staged:b,untracked:"untracked"===a.status}),l([]);try{let c=new URLSearchParams({filepath:a.path,staged:String(b),untracked:String("untracked"===a.status)}),d=await fetch(`/api/v1/git/diff?${c}`),e=await d.json();e.diff?l(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(e.diff)):l([{type:"meta",content:e.error||"No diff available"}])}catch(a){l([{type:"meta",content:`Error: ${a.message}`}])}finally{n(!1)}},C=async()=>{p(!0),d(),await new Promise(a=>setTimeout(a,600)),p(!1)},D=a=>a.endsWith(".tsx")||a.endsWith(".jsx")?"⚛️":a.endsWith(".ts")||a.endsWith(".js")?"\uD83D\uDCD8":a.endsWith(".css")||a.endsWith(".scss")?"\uD83C\uDFA8":a.endsWith(".md")?"\uD83D\uDCC4":a.endsWith(".json")?"\uD83D\uDCCB":a.endsWith(".py")?"\uD83D\uDC0D":a.endsWith(".go")?"\uD83D\uDD39":a.endsWith(".sh")?"⚙️":"\uD83D\uDCDD",E=a=>{let b=a.split("/");return b.length<=2?a:`…/${b.slice(-2).join("/")}`},F=c?(c.staged?.length||0)+(c.unstaged?.length||0)+(c.untracked?.length||0):0;return(0,e.jsxs)("div",{className:`git-panel ${a?"open":""}`,role:"complementary","aria-label":"Git Panel",children:[(0,e.jsxs)("div",{className:"git-panel-header",children:[(0,e.jsxs)("div",{className:"git-panel-title-row",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close git panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsxs)("div",{className:"git-panel-title",children:[(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),(0,e.jsx)("span",{children:"Git"})]}),(0,e.jsx)("button",{className:`git-refresh-btn ${o?"spinning":""}`,onClick:C,title:"Refresh git status",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,e.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),c?.isGitRepo&&(0,e.jsxs)("div",{className:"git-branch-bar",children:[(0,e.jsxs)("div",{className:"git-branch-badge",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,e.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,e.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,e.jsx)("span",{children:c.branch})]}),c.remoteBranch&&(0,e.jsxs)("div",{className:"git-sync-badges",children:[c.ahead>0&&(0,e.jsxs)("span",{className:"git-sync-badge git-sync-badge--ahead",children:["↑",c.ahead]}),c.behind>0&&(0,e.jsxs)("span",{className:"git-sync-badge git-sync-badge--behind",children:["↓",c.behind]}),0===c.ahead&&0===c.behind&&(0,e.jsx)("span",{className:"git-sync-badge git-sync-badge--synced",children:"✓ synced"})]}),c.stashCount>0&&(0,e.jsxs)("span",{className:"git-stash-badge",title:`${c.stashCount} stash entries`,children:["\uD83D\uDCE6 ",c.stashCount]})]})]}),c?.isGitRepo&&!i&&(0,e.jsxs)("div",{className:"git-commit-bar",children:[(0,e.jsx)("div",{className:"git-commit-input-row",children:(0,e.jsx)("textarea",{className:"git-commit-textarea",placeholder:"Commit message…",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.ctrlKey||a.metaKey)&&(a.preventDefault(),z())},rows:2,disabled:s})}),(0,e.jsxs)("div",{className:"git-commit-actions",children:[(0,e.jsxs)("button",{className:"git-commit-btn",onClick:z,disabled:!q.trim()||s,title:"Stage all & commit (Ctrl+Enter)",children:[s?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,e.jsx)("path",{d:"M12 2v7M12 15v7M2 12h7M15 12h7"})]}),s?"Committing…":"Commit All"]}),(0,e.jsxs)("button",{className:"git-push-btn",onClick:A,disabled:u||!c?.branch,title:c?.ahead>0?`Push ${c.ahead} commit(s)`:"Push to remote",children:[u?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,e.jsx)("polyline",{points:"5 12 12 5 19 12"})]}),u?"Pushing…":c?.ahead>0?`Push (${c.ahead})`:"Push"]})]}),w&&(0,e.jsxs)("div",{className:`git-action-feedback git-action-feedback--${w.type}`,children:["success"===w.type?(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("span",{children:w.text})]})]}),c&&!c.isGitRepo&&(0,e.jsxs)("div",{className:"git-not-repo",children:[(0,e.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),(0,e.jsx)("p",{children:"No git repository detected"}),(0,e.jsx)("span",{children:"Open a git project in the IDE"})]}),!c&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading git status…"})]}),i&&c?.isGitRepo&&(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{j(null),l([])},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:i.path.split("/").pop()}),(0,e.jsx)("span",{className:"diff-viewer-path",title:i.path,children:E(i.path)}),(0,e.jsx)("span",{className:`diff-viewer-badge ${i.staged?"staged":"unstaged"}`,children:i.staged?"staged":i.untracked?"untracked":"unstaged"})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:m?(0,e.jsx)("div",{className:"diff-loading",children:"Loading diff…"}):0===k.length?(0,e.jsx)("div",{className:"diff-empty",children:"No diff available"}):(0,e.jsx)("div",{className:"diff-lines",children:k.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}),c?.isGitRepo&&!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"git-summary-bar",children:[(0,e.jsxs)("span",{className:"git-summary-stat",children:[(0,e.jsx)("span",{className:"git-summary-dot git-summary-dot--changed"}),F," changed"]}),c.staged.length>0&&(0,e.jsxs)("span",{className:"git-summary-stat",children:[(0,e.jsx)("span",{className:"git-summary-dot git-summary-dot--staged"}),c.staged.length," staged"]})]}),(0,e.jsxs)("div",{className:"git-tabs",children:[(0,e.jsxs)("button",{className:`git-tab ${"changes"===g?"active":""}`,onClick:()=>h("changes"),children:["Changes",F>0&&(0,e.jsx)("span",{className:"git-tab-badge",children:F})]}),(0,e.jsxs)("button",{className:`git-tab ${"commits"===g?"active":""}`,onClick:()=>h("commits"),children:["Commits",c.commits.length>0&&(0,e.jsx)("span",{className:"git-tab-badge git-tab-badge--neutral",children:c.commits.length})]})]}),"changes"===g&&(0,e.jsxs)("div",{className:"git-file-list",children:[c.staged.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--staged"}),(0,e.jsx)("span",{children:"Staged Changes"}),(0,e.jsx)("span",{className:"git-section-count",children:c.staged.length})]}),c.staged.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item git-file-item--staged",onClick:()=>B(a,!0),title:`View staged diff: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(ax,{status:a.status})]},`staged-${b}`))]}),c.unstaged.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--unstaged"}),(0,e.jsx)("span",{children:"Changes"}),(0,e.jsx)("span",{className:"git-section-count",children:c.unstaged.length})]}),c.unstaged.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item",onClick:()=>B(a,!1),title:`View diff: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(ax,{status:a.status})]},`unstaged-${b}`))]}),c.untracked.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--untracked"}),(0,e.jsx)("span",{children:"Untracked"}),(0,e.jsx)("span",{className:"git-section-count",children:c.untracked.length})]}),c.untracked.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item git-file-item--untracked",onClick:()=>B(a,!1),title:`View file: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(ax,{status:"untracked"})]},`untracked-${b}`))]}),0===F&&(0,e.jsxs)("div",{className:"git-empty",children:[(0,e.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,e.jsx)("p",{children:"Working tree clean"}),(0,e.jsx)("span",{children:"No uncommitted changes"})]})]}),"commits"===g&&(0,e.jsx)("div",{className:"git-commit-list",children:0===c.commits.length?(0,e.jsx)("div",{className:"git-empty",children:(0,e.jsx)("p",{children:"No commits yet"})}):c.commits.map((a,b)=>(0,e.jsxs)("div",{className:"git-commit-item",children:[(0,e.jsx)("div",{className:"git-commit-hash",children:a.shortHash}),(0,e.jsxs)("div",{className:"git-commit-info",children:[(0,e.jsx)("div",{className:"git-commit-subject",children:a.subject}),(0,e.jsxs)("div",{className:"git-commit-meta",children:[(0,e.jsx)("span",{className:"git-commit-author",children:a.author}),(0,e.jsx)("span",{className:"git-commit-dot",children:"\xb7"}),(0,e.jsx)("span",{className:"git-commit-date",children:a.relativeDate})]})]})]},b))})]})]})}let az={ts:"\uD83D\uDCD8",tsx:"⚛️",js:"\uD83D\uDCDC",jsx:"⚛️",json:"\uD83D\uDCCB",md:"\uD83D\uDCC4",mdx:"\uD83D\uDCC4",css:"\uD83C\uDFA8",scss:"\uD83C\uDFA8",sass:"\uD83C\uDFA8",py:"\uD83D\uDC0D",go:"\uD83D\uDD39",rs:"\uD83E\uDD80",sh:"⚙️",bash:"⚙️",zsh:"⚙️",sql:"\uD83D\uDDC4️",graphql:"\uD83D\uDD37",gql:"\uD83D\uDD37",yaml:"\uD83D\uDCD0",yml:"\uD83D\uDCD0",toml:"\uD83D\uDCD0",env:"\uD83D\uDD11",svg:"\uD83D\uDDBC️",png:"\uD83D\uDDBC️",jpg:"\uD83D\uDDBC️",jpeg:"\uD83D\uDDBC️",gif:"\uD83D\uDDBC️",webp:"\uD83D\uDDBC️",lock:"\uD83D\uDD12",gitignore:"\uD83D\uDC41️"};function aA(a){return void 0===a?"":a<1024?`${a}B`:a<1048576?`${(a/1024).toFixed(1)}K`:`${(a/1048576).toFixed(1)}M`}function aB({node:a,depth:b,expandedPaths:c,onToggle:d,onFileOpen:g,selectedPath:h}){let i=c.has(a.path),j="dir"===a.type,k=h===a.path,l=12+14*b,m=(0,f.useCallback)(()=>{j?d(a.path):g(a)},[j,a,d,g]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{className:`workspace-tree-node ${j?"is-dir":"is-file"} ${k?"selected":""}`,style:{paddingLeft:l},onClick:m,title:j?i?"Collapse":"Expand":a.path,children:[j?(0,e.jsx)("svg",{className:`workspace-arrow ${i?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})}):(0,e.jsx)("span",{className:"workspace-arrow-spacer"}),(0,e.jsx)("span",{className:"workspace-node-icon",children:"dir"===a.type?"\uD83D\uDCC1":az[a.ext||""]||"\uD83D\uDCDD"}),(0,e.jsx)("span",{className:"workspace-node-name",children:a.name}),!j&&void 0!==a.size&&(0,e.jsx)("span",{className:"workspace-node-size",children:aA(a.size)}),j&&void 0!==a.children&&(0,e.jsx)("span",{className:"workspace-node-count",children:a.children.length})]}),j&&i&&a.children&&(0,e.jsx)("div",{className:"workspace-tree-children",children:0===a.children.length?(0,e.jsx)("div",{className:"workspace-empty-dir",style:{paddingLeft:l+14},children:"empty"}):a.children.map(a=>(0,e.jsx)(aB,{node:a,depth:b+1,expandedPaths:c,onToggle:d,onFileOpen:g,selectedPath:h},a.path))})]})}function aC({view:a,onClose:b,onCopyPath:c,workspacePath:d}){let[g,h]=(0,f.useState)(!1),i=a.content?a.content.split("\n").map((a,b)=>({num:b+1,text:a})):[];return(0,e.jsxs)("div",{className:"workspace-file-viewer",children:[(0,e.jsxs)("div",{className:"workspace-viewer-header",children:[(0,e.jsxs)("button",{className:"workspace-viewer-back",onClick:b,title:"Back to file tree",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"15 18 9 12 15 6"})}),(0,e.jsx)("span",{children:"Back"})]}),(0,e.jsxs)("div",{className:"workspace-viewer-title",children:[(0,e.jsx)("span",{className:"workspace-viewer-name",children:a.name}),a.lang&&"plaintext"!==a.lang&&(0,e.jsx)("span",{className:"workspace-viewer-lang",children:a.lang})]}),(0,e.jsxs)("div",{className:"workspace-viewer-actions",children:[a.content&&(0,e.jsx)("button",{className:"workspace-viewer-action-btn",onClick:()=>{a.content&&(navigator.clipboard.writeText(a.content).catch(()=>{}),h(!0),setTimeout(()=>h(!1),2e3))},title:"Copy file content",children:g?(0,e.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,e.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),(0,e.jsx)("button",{className:"workspace-viewer-action-btn",onClick:()=>{c(a.path)},title:"Copy file path",children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,e.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]})]}),(0,e.jsxs)("div",{className:"workspace-viewer-meta",children:[(0,e.jsx)("span",{className:"workspace-viewer-path",title:`${d}/${a.path}`,children:a.path}),!a.loading&&!a.error&&a.content&&(0,e.jsxs)("span",{className:"workspace-viewer-stats",children:[a.lines," lines \xb7 ",aA(a.size)]})]}),(0,e.jsxs)("div",{className:"workspace-viewer-body",children:[a.loading&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading…"})]}),!a.loading&&a.error&&(0,e.jsxs)("div",{className:"workspace-viewer-error",children:[(0,e.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("p",{children:a.error}),a.binary&&(0,e.jsx)("span",{children:"Binary files cannot be displayed as text."}),a.tooLarge&&(0,e.jsx)("span",{children:"Try opening the file directly in the IDE."})]}),!a.loading&&!a.error&&null!==a.content&&(0,e.jsx)("div",{className:"workspace-code-scroll",children:(0,e.jsx)("table",{className:"workspace-code-table",children:(0,e.jsx)("tbody",{children:i.map(({num:a,text:b})=>(0,e.jsxs)("tr",{className:"workspace-code-row",children:[(0,e.jsx)("td",{className:"workspace-line-num",children:a}),(0,e.jsx)("td",{className:"workspace-line-code",children:(0,e.jsx)("span",{children:b||"\xa0"})})]},a))})})})]})]})}function aD({open:a,onClose:b,workspaceTree:c,workspaceLoading:d,onRefresh:g}){let[h,i]=(0,f.useState)(new Set),[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(null),r=(0,f.useCallback)(a=>{i(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,f.useCallback)(a=>{let b=c?`${c.workspacePath}/${a}`:a;navigator.clipboard.writeText(b).catch(()=>{}),o(a),setTimeout(()=>o(null),2e3)},[c]),t=(0,f.useCallback)(async a=>{q({path:a.path,name:a.name,content:null,lang:"",lines:0,size:a.size||0,error:null,loading:!0});try{let b=await fetch(`/api/v1/workspace/content?path=${encodeURIComponent(a.path)}`),c=await b.json();!b.ok||c.error?q(a=>a?{...a,loading:!1,error:c.error||"Failed to load file",binary:c.binary,tooLarge:c.tooLarge}:null):q({path:a.path,name:c.name,content:c.content,lang:c.lang,lines:c.lines,size:c.size,error:null,loading:!1})}catch(a){q(b=>b?{...b,loading:!1,error:`Network error: ${a.message}`}:null)}},[]),u=async()=>{k(!0),g(),await new Promise(a=>setTimeout(a,700)),k(!1)},v=(0,f.useMemo)(()=>{if(!c)return[];var a=c.tree;if(!l)return a;let b=l.toLowerCase(),d=a=>{if(a.name.toLowerCase().includes(b))return a;if("dir"===a.type&&a.children){let b=a.children.map(d).filter(Boolean);if(b.length>0)return{...a,children:b}}return null};return a.map(d).filter(Boolean)},[c,l]),w=c?.rootLabel||c?.workspacePath?.split("/").pop()||"Workspace",x=c?.workspacePath||"",y=p?p.path:null;return(0,e.jsxs)("div",{className:`workspace-panel ${a?"open":""}`,role:"complementary","aria-label":"Workspace Panel",children:[p&&(0,e.jsx)(aC,{view:p,onClose:()=>q(null),onCopyPath:s,workspacePath:x}),!p&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"workspace-panel-header",children:[(0,e.jsxs)("div",{className:"workspace-panel-title-row",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close workspace panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsxs)("div",{className:"workspace-panel-title",children:[(0,e.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:"Working Directory"})]}),(0,e.jsx)("button",{className:`git-refresh-btn ${j?"spinning":""}`,onClick:u,title:"Refresh file tree",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,e.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),x&&(0,e.jsxs)("div",{className:"workspace-path-bar",title:x,children:[(0,e.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,e.jsx)("path",{d:"M12 2v4M12 18v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M2 12h4M18 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83"})]}),(0,e.jsx)("span",{className:"workspace-path-text",children:x})]})]}),c&&(0,e.jsxs)("div",{className:"workspace-search-bar",children:[(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,e.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,e.jsx)("input",{className:"workspace-search-input",type:"text",placeholder:`Filter in ${w}…`,value:l,onChange:a=>m(a.target.value)}),l&&(0,e.jsx)("button",{className:"workspace-search-clear",onClick:()=>m(""),title:"Clear filter",children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),d&&!c&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading workspace…"})]}),!d&&!c&&(0,e.jsxs)("div",{className:"git-not-repo",children:[(0,e.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsx)("p",{children:"No workspace detected"}),(0,e.jsx)("span",{children:"Open a project in the IDE"})]}),n&&(0,e.jsxs)("div",{className:"workspace-copy-toast",children:[(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Path copied!"]}),c&&(0,e.jsxs)("div",{className:"workspace-tree",children:[(0,e.jsxs)("div",{className:"workspace-root-label",children:[(0,e.jsx)("span",{className:"workspace-root-icon",children:"\uD83D\uDDC2️"}),(0,e.jsx)("span",{className:"workspace-root-name",children:w}),(0,e.jsx)("span",{className:"workspace-node-count",children:c.tree.length})]}),0===v.length?(0,e.jsx)("div",{className:"git-empty",children:(0,e.jsx)("p",{children:l?"No matches":"Directory is empty"})}):(0,e.jsx)("div",{className:"workspace-tree-list",children:v.map(a=>{let b,c;return(0,e.jsx)(aB,{node:a,depth:0,expandedPaths:l?new Set((b=[],c=a=>{"dir"===a.type&&(b.push(a.path),a.children?.forEach(c))},v.forEach(c),b)):h,onToggle:r,onFileOpen:t,selectedPath:y},a.path)})})]})]})]})}function aE({networkOnline:a,isConnected:b}){let[c,d]=(0,f.useState)(!1),[g,h]=(0,f.useState)(!1);return c?(0,e.jsxs)("div",{className:`network-banner ${g?"recovered":"offline"}`,role:"status","aria-live":"polite",children:[(0,e.jsx)("span",{className:"network-banner-pulse"}),g?"✅ Connection restored":a?"\uD83D\uDD04 Reconnecting to server…":"\uD83D\uDCE1 No network — waiting for connection…"]}):null}function aF(){let{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,selectWindow:j,selectConversation:k,startNewChat:l,startCdpServer:m,openNewWindow:n,closeWindowByIndex:o,networkOnline:p,isConnected:q,isLoadingHistory:r,showWelcome:s,messages:t,currentSteps:u,currentResponse:v,isStreaming:w,sendMessage:x,stopStreaming:y,currentMode:z,toggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,fetchAgentList:E,switchAgent:F,toggleArtifactPanel:G,artifactFiles:H,artifactPanelOpen:I,toggleChangesPanel:J,changeFiles:K,changesPanelOpen:L,acceptAllChanges:M,rejectAllChanges:N,isAccepting:O,isRejecting:P,gitStatus:Q,gitPanelOpen:R,gitChangedCount:S,toggleGitPanel:U,refreshGit:V,workspaceTree:W,workspacePanelOpen:X,workspaceLoading:Y,toggleWorkspacePanel:Z,refreshWorkspace:$,messagesEndRef:_}=function(){let[a,b]=(0,f.useState)([]),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)("Agent"),[j,k]=(0,f.useState)("connected"),[l,m]=(0,f.useState)(!0),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)([]),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)("planning"),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)([]),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(!1),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(!0),H=(0,f.useRef)(null),I=(0,f.useRef)(null),J=(0,f.useRef)(null),K=(0,f.useRef)(""),L=(0,f.useRef)([]),{mutate:M}=T(),N=(0,f.useCallback)(()=>{requestAnimationFrame(()=>{J.current?.scrollIntoView({behavior:"smooth"})})},[]),O=(0,f.useCallback)((a,b)=>{k(a),i(b)},[]),{data:P,mutate:Q}=aa(ad.health,ac,{refreshInterval:F?3e4:5e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,onSuccess:a=>{g(a.connected),F||G(!0),O(a.connected?"connected":"disconnected",a.connected?"Agent":!1===a.network?"Offline":"Reconnecting…")},onError:()=>{g(!1),O("disconnected",F?"Reconnecting…":"Offline")}}),{mutate:R}=aa(ad.mode,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.mode&&u(a.mode)}}),{mutate:S}=aa(ad.agent,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.agent&&w(a.agent)}}),{mutate:U}=aa(ad.history,ac,{revalidateOnFocus:!1,revalidateOnMount:!0,onSuccess:a=>{o(!1),a.turns&&a.turns.length>0?(m(!1),b(a.turns.map(a=>({role:a.role,content:a.content})))):m(!0)},onError:()=>{o(!1)}}),V=(0,f.useCallback)(()=>{o(!0),b([]),U()},[U]),{artifactFiles:W,artifactPanelOpen:X,toggleArtifactPanel:Y,openArtifactPanel:Z,loadArtifacts:$}=function(a){let[b,c]=(0,f.useState)(!1),{data:d,mutate:e}=aa(ad.artifacts,ac,{refreshInterval:b?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),g=d?.files||[];return{artifactFiles:g,artifactPanelOpen:b,toggleArtifactPanel:(0,f.useCallback)(()=>{c(a=>!a)},[]),openArtifactPanel:(0,f.useCallback)(()=>{c(!0)},[]),loadArtifacts:e}}(),{changeFiles:_,changesPanelOpen:ab,toggleChangesPanel:ag,loadChanges:ah,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al}=function(){let[a,b]=(0,f.useState)(!1),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),{data:h,mutate:i}=aa(ad.changes,ac,{refreshInterval:a?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),j=h?.changes||[],k=(0,f.useCallback)(()=>{b(a=>!a)},[]),l=(0,f.useCallback)(async()=>{d(!0);try{let a=await fetch("/api/v1/changes/accept-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{d(!1)}},[i]),m=(0,f.useCallback)(async()=>{g(!0);try{let a=await fetch("/api/v1/changes/reject-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{g(!1)}},[i]);return{changeFiles:j,changesPanelOpen:a,toggleChangesPanel:k,loadChanges:i,acceptAllChanges:l,rejectAllChanges:m,isAccepting:c,isRejecting:e}}(),{gitStatus:am,gitPanelOpen:an,gitChangedCount:ao,toggleGitPanel:ap,refreshGit:aq}=function(){let[a,b]=(0,f.useState)(!1),{data:c,mutate:d}=aa(ad.git,ac,{refreshInterval:a?4e3:15e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),e=c?.isGitRepo!==void 0?c:null,g=e?(e.staged?.length||0)+(e.unstaged?.length||0)+(e.untracked?.length||0):0;return{gitStatus:e,gitPanelOpen:a,gitChangedCount:g,toggleGitPanel:(0,f.useCallback)(()=>{b(a=>!a)},[]),refreshGit:(0,f.useCallback)(()=>{d()},[d])}}(),{workspaceTree:ar,workspacePanelOpen:as,workspaceLoading:at,toggleWorkspacePanel:au,refreshWorkspace:av}=function(){let[a,b]=(0,f.useState)(!1),{data:c,mutate:d,isLoading:e}=aa(ad.workspace,ac,{refreshInterval:a?5e3:6e4,revalidateOnFocus:a,revalidateOnReconnect:!0,dedupingInterval:3e3}),g=c?.workspacePath?c:null;return{workspaceTree:g,workspacePanelOpen:a,workspaceLoading:e,toggleWorkspacePanel:(0,f.useCallback)(()=>{b(a=>!a)},[]),refreshWorkspace:(0,f.useCallback)(()=>{d()},[d])}}(),{windows:aw,conversations:ax,activeConversation:ay,cdpStatus:az,recentProjects:aA,loadWindows:aB,selectWindow:aC,loadConversations:aD,selectConversation:aE,checkCdpStatus:aF,startCdpServer:aG,openNewWindow:aH,closeWindowByIndex:aI,loadRecentProjects:aJ}=function(a,b,c){let{data:d,mutate:e}=aa(ad.windows,ac,{revalidateOnFocus:!0}),g=d?.windows||[],{data:h,mutate:i}=aa(ad.cdpStatus,ac,{refreshInterval:15e3,revalidateOnFocus:!0}),j={active:h?.active??!1,windowCount:h?.windowCount??0,error:h?.error??null},{data:k,mutate:l}=aa(ad.conversations,ac,{revalidateOnFocus:!0}),m=k?.conversations||[],n=m.find(a=>a.active)||null,{data:o,mutate:p}=aa(ad.recentProjects,ac,{revalidateOnFocus:!0}),q=o?.recentProjects||[],r=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/cdp-start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a||".",killExisting:b||!1})}),d=await c.json();return d.success&&(i(),e()),d}catch(a){return{success:!1,message:a.message||"Failed to start CDP server"}}},[i,e]),s=(0,f.useCallback)(async a=>{try{let b=await fetch(`${ae}/windows/open`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a})}),c=await b.json();return c.success&&(e(),i()),c}catch(a){return{success:!1,message:a.message||"Failed to open window"}}},[e,i]),t=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b?{targetId:b}:{index:a})}),d=await c.json();return d.success&&(e(),i()),d}catch(a){return{success:!1,message:a.message||"Failed to close window"}}},[e,i]),u=(0,f.useCallback)(async d=>{try{b(!0),await fetch(`${ae}/windows/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:d})}),e(),a(),setTimeout(()=>l(),300),setTimeout(()=>l(),1500),c?.()}catch{}},[e,a,b,l,c]),v=(0,f.useCallback)(async d=>{try{let e=await fetch(`${ae}/conversations/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:d})});if((await e.json()).success){b(!1);let e=0,f=async()=>{e++;try{let b=await fetch(`${ae}/conversations`),f=(await b.json()).conversations||[],g=f.find(a=>a.active);if(g&&g.title===d||e>10){l({conversations:f},{revalidate:!1}),a(),c?.();return}}catch{}setTimeout(f,500)};f()}}catch{}},[a,b,l,c]);return{windows:g,conversations:m,activeConversation:n,cdpStatus:j,recentProjects:q,loadWindows:e,selectWindow:u,loadConversations:l,selectConversation:v,checkCdpStatus:i,startCdpServer:r,openNewWindow:s,closeWindowByIndex:t,loadRecentProjects:p}}(V,m,(0,f.useCallback)(()=>{$(),ah()},[$,ah])),aK=(0,f.useCallback)(async()=>{let a="planning"===t?"fast":"planning";u(a);try{let b=await fetch(`${af}/chat/mode`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:a})}),c=await b.json();c.mode&&u(c.mode),R()}catch{u(t)}},[t,R]),aL=(0,f.useCallback)(async()=>{A(!0);try{let a=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"list"})}),b=await a.json();b.agents&&y(b.agents),b.currentAgent&&w(b.currentAgent)}catch{}A(!1)},[]),aM=(0,f.useCallback)(async a=>{w(a);try{let b=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",agent:a})}),c=await b.json();c.agent?w(c.agent):c.success||w(v),S()}catch{w(v)}},[v,S]),aN=(0,f.useCallback)(a=>{let{type:b,...c}=a;switch(b){case"tool_call":q(a=>{let d,e=a.findIndex(a=>"tool_call"===a.type&&a.data?.id===c.id);return e>=0?(d=[...a])[e]={type:b,data:c}:d=[...a,{type:b,data:c}],L.current=d,d});break;case"thinking":case"hitl":case"error":case"notification":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d});break;case"file_change":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d}),$(),ah();break;case"response":s(c.content||""),K.current=c.content||"";break;case"status":O(c.isRunning?"streaming":"connected",c.isRunning?"Agent working...":"Agent");break;case"done":c.finalResponse&&(s(c.finalResponse),K.current=c.finalResponse),O("connected","Agent"),d(!1),$(),ah()}N()},[O,N,$,ah]),aO=(0,f.useCallback)(async a=>{if(!a.trim())return;H.current&&(H.current.abort(),H.current=null,fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})),I.current&&(await I.current,I.current=null),m(!1);let c=a.trim();b(a=>[...a,{role:"user",content:c}]),d(!0),q([]),s(""),K.current="",L.current=[],O("streaming","Agent typing...");let e=new AbortController;H.current=e,I.current=(async()=>{try{let a="",b=0;for(;b<=5;){let d=!1;try{let f={"Content-Type":"application/json"};a&&(f["Last-Event-ID"]=a);let g=(await fetch(`${af}/chat/stream`,{method:"POST",headers:f,body:JSON.stringify({message:c}),signal:e.signal})).body.getReader(),h=new TextDecoder,i="",j=!1;for(;;){let{done:b,value:c}=await g.read();if(b){d=!0;break}let e=(i+=h.decode(c,{stream:!0})).split("\n");for(let b of(i=e.pop(),e)){if(!b.startsWith(":")){if(b.startsWith("id: ")){a=b.slice(4).trim();continue}if(!b.startsWith("retry:")&&b.startsWith("data: "))try{let a=JSON.parse(b.slice(6));aN(a),"done"===a.type&&(j=!0)}catch{}}}if(j)break}if(j||!d||++b>5)break;console.warn(`[SSE] Stream dropped (attempt ${b}/5), reconnecting in 2000ms...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if("AbortError"===a.name||++b>5)throw a;console.warn(`[SSE] Fetch error (attempt ${b}/5):`,a.message),await new Promise(a=>setTimeout(a,2e3))}}}catch(a){"AbortError"!==a.name&&(q(b=>[...b,{type:"error",data:{message:a.message}}]),O("error","Error"))}finally{let a=K.current,c=[...L.current];d(!1),H.current===e&&(H.current=null),(a||c.length>0)&&b(b=>[...b,{role:"agent",content:a,steps:c}]),O("connected","Agent")}})(),await I.current},[aN,O]),aP=(0,f.useCallback)(async()=>{H.current&&H.current.abort(),b([]),q([]),s(""),m(!0);try{let a=await fetch(`${af}/chat/new`,{method:"POST"});(await a.json()).success&&O("connected","New Chat")}catch{}},[O]),aQ=(0,f.useCallback)(()=>{H.current&&(H.current.abort(),H.current=null),fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})},[]),aR=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/approve`,{method:"POST"}),O("streaming","Agent")}catch{}},[O]),aS=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/reject`,{method:"POST"})}catch{}},[]),aT=(0,f.useRef)(c);aT.current=c;let{isMonitoring:aU}=function(a={}){let{onEvent:b,onActivityStart:c,onActivityEnd:d,onTurnChange:e,onModeChange:g,onSync:h,autoConnect:i=!0}=a,[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(null),n=(0,f.useRef)(null),o=(0,f.useRef)(null),p=(0,f.useRef)(!1),q=(0,f.useRef)(b),r=(0,f.useRef)(c),s=(0,f.useRef)(d),t=(0,f.useRef)(e),u=(0,f.useRef)(g),v=(0,f.useRef)(h);q.current=b,r.current=c,s.current=d,t.current=e,u.current=g,v.current=h;let w=(0,f.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),n.current&&(n.current.abort(),n.current=null),k(!1),p.current=!1},[]),x=(0,f.useCallback)(async()=>{if(p.current||n.current)return;p.current=!0;let a=new AbortController;n.current=a;try{let b=await fetch("/api/v1/chat/monitor",{signal:a.signal});if(!b.ok||!b.body)throw Error(`Monitor connection failed: ${b.status}`);k(!0),p.current=!1;let c=b.body.getReader(),d=new TextDecoder,e="";for(;;){let{done:a,value:b}=await c.read();if(a)break;let f=(e+=d.decode(b,{stream:!0})).split("\n");for(let a of(e=f.pop(),f))if(!(a.startsWith(":")||a.startsWith("retry:")||a.startsWith("id:"))&&a.startsWith("data: "))try{let{type:b,...c}=JSON.parse(a.slice(6));switch(q.current?.({type:b,...c}),b){case"activity_start":r.current?.();break;case"activity_end":s.current?.(c);break;case"turn_change":t.current?.(c);break;case"mode_change":u.current?.(c);break;case"sync":m(Date.now()),v.current?.(c)}}catch{}}}catch(a){if("AbortError"===a.name)return;console.warn("[Monitor] Connection lost:",a.message)}finally{n.current=null,p.current=!1,k(!1),a.signal.aborted||(o.current=setTimeout(()=>{o.current=null,x()},3e3))}},[]);return{isMonitoring:j,lastSyncTime:l,connect:x,disconnect:w}}({autoConnect:!0,onActivityStart:()=>{C(!0),aT.current||(k("streaming"),i("Agent working..."))},onActivityEnd:()=>{C(!1),aT.current||(k("connected"),i("Agent"),U(),$(),ah())},onTurnChange:()=>{aT.current||(m(!1),U())},onModeChange:({newMode:a})=>{u(a)},onSync:a=>{"boolean"==typeof a.isRunning&&C(a.isRunning)},onEvent:a=>{aT.current||"tool_call"!==a.type&&"response"!==a.type&&"thinking"!==a.type&&"hitl"!==a.type&&"notification"!==a.type||aN(a)}});return{messages:a,isStreaming:c,isConnected:e,statusText:h,statusState:j,showWelcome:l,isLoadingHistory:n,currentSteps:p,currentResponse:r,windows:aw,conversations:ax,activeConversation:ay,artifactFiles:W,artifactPanelOpen:X,changeFiles:_,changesPanelOpen:ab,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al,gitStatus:am,gitPanelOpen:an,gitChangedCount:ao,toggleGitPanel:ap,refreshGit:aq,workspaceTree:ar,workspacePanelOpen:as,workspaceLoading:at,toggleWorkspacePanel:au,refreshWorkspace:av,currentMode:t,currentAgent:v,agents:x,isLoadingAgents:z,cdpStatus:az,recentProjects:aA,isAgentBusy:B,isMonitorConnected:D,networkOnline:F,sendMessage:aO,stopStreaming:aQ,startNewChat:aP,approve:aR,reject:aS,selectWindow:aC,selectConversation:aE,toggleArtifactPanel:Y,openArtifactPanel:Z,toggleChangesPanel:ag,toggleMode:aK,fetchAgentList:aL,switchAgent:aM,startCdpServer:aG,openNewWindow:aH,closeWindowByIndex:aI,messagesEndRef:J,setShowWelcome:m}}(),ab=(0,f.useCallback)(async()=>{try{await fetch("/api/v1/health"),window.location.reload()}catch{}},[]);return(0,e.jsxs)("div",{className:"app-container",children:[(0,e.jsx)(ai,{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}),(0,e.jsx)(aE,{networkOnline:p,isConnected:q}),(0,e.jsxs)("main",{className:"messages-area",role:"log","aria-live":"polite",children:[r?(0,e.jsxs)("div",{className:"history-loading",children:[(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"45%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"80%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"65%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"72%"}})]}),(0,e.jsx)("div",{className:"history-loading-header right",children:(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"35%"}})}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"90%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"55%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"68%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"40%"}})]}),(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"50%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"75%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"60%"}})]}),(0,e.jsx)("p",{className:"history-loading-text",children:"Loading conversation history…"})]}):s?(0,e.jsx)(aj,{onQuickPrompt:x}):(0,e.jsx)(as,{messages:t,currentSteps:u,currentResponse:v,isStreaming:w,onRetry:ab}),(0,e.jsx)("div",{ref:_})]}),(0,e.jsx)(at,{onSend:x,onStop:y,isStreaming:w,currentMode:z,onToggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,onFetchAgents:E,onSwitchAgent:F,onToggleArtifacts:G,artifactCount:H.length,artifactPanelOpen:I,onToggleChanges:J,changesCount:K.length,changesPanelOpen:L,onToggleGit:U,gitChangedCount:S,gitPanelOpen:R,onToggleWorkspace:Z,workspacePanelOpen:X}),(0,e.jsx)(au,{open:I,onClose:G,activeConversation:g,files:H}),(0,e.jsx)(av,{open:L,onClose:J,changes:K,onAcceptAll:M,onRejectAll:N,isAccepting:O,isRejecting:P}),(0,e.jsx)(ay,{open:R,onClose:U,gitStatus:Q,onRefresh:V}),(0,e.jsx)(aD,{open:X,onClose:Z,workspaceTree:W,workspaceLoading:Y,onRefresh:$})]})}},380:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23)),Promise.resolve().then(c.t.bind(c,440,23)),Promise.resolve().then(c.t.bind(c,4342,23)),Promise.resolve().then(c.t.bind(c,2265,23)),Promise.resolve().then(c.t.bind(c,5421,23)),Promise.resolve().then(c.t.bind(c,1335,23)),Promise.resolve().then(c.t.bind(c,664,23)),Promise.resolve().then(c.bind(c,4661))},722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},985:(a,b,c)=>{Promise.resolve().then(c.bind(c,7728))},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},1245:(a,b,c)=>{Promise.resolve().then(c.bind(c,6187))},2056:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>m,dynamic:()=>j,metadata:()=>k,viewport:()=>l});var d=c(5735),e=c(7014),f=c.n(e),g=c(9345),h=c.n(g);c(2704);var i=c(5026);let j="force-dynamic",k={title:"Antigravity Agent",description:"Chat with the Antigravity AI Agent from any browser",applicationName:"Antigravity Agent",manifest:"/manifest.json",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:"Antigravity Agent"},formatDetection:{telephone:!1}},l={width:"device-width",initialScale:1,maximumScale:1,viewportFit:"cover",themeColor:"#0a0a0f"};function m({children:a}){return(0,d.jsx)("html",{lang:"en",className:`${f().variable} ${h().variable}`,children:(0,d.jsxs)("body",{children:[a,(0,d.jsx)(i.default,{})]})})}},2237:(a,b,c)=>{"use strict";a.exports=c(6862)},2654:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23))},2704:()=>{},2918:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23))},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3502:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>L,handler:()=>N,routeModule:()=>M});var d=c(7553),e=c(4006),f=c(7798),g=c(4775),h=c(9373),i=c(3461),j=c(1020),k=c(6349),l=c(4365),m=c(6023),n=c(3747),o=c(4235),p=c(3938),q=c(261),r=c(6758),s=c(7243),t=c(6713),u=c(7527),v=c(2820),w=c(8216),x=c(7929),y=c(9551),z=c(9125),A=c(6439),B=c(7068),C=c(5547),D=c.n(C),E=c(1287),F=c(1494),G=c(722),H=c(753),I=c(3954),J={};for(let a in E)0>["default","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(J[a]=()=>E[a]);c.d(b,J);let K={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,9647)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/page.tsx"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,2056)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,5547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.bind(c,7548)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/not-found.tsx"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,5270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,8193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,L={require:c,loadChunk:()=>Promise.resolve()},M=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:K},distDir:".next",relativeProjectDir:""});async function N(a,b,d){var C;M.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let J=!!(0,h.getRequestMeta)(a,"minimalMode"),O="/page";"/index"===O&&(O="/");let P=await M.prepare(a,b,{srcPage:O,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,parsedUrl:ae,interceptionRoutePatterns:af,deploymentId:ag}=P,ah=(0,q.normalizeAppPath)(O),{isOnDemandRevalidate:ai}=P,aj=ad.experimental.ppr&&!ad.cacheComponents&&(0,I.isInterceptionRouteAppPath)(aa)?null:M.match(aa,$),ak=!!$.routes[aa],al=a.headers["user-agent"]||"",am=(0,t.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],aq=(0,r.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr);if(!(0,h.getRequestMeta)(a,"postponed")&&ar&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let b=[];for await(let c of a)b.push(c);let c=Buffer.concat(b).toString("utf8");(0,h.addRequestMeta)(a,"postponed",c)}let as=ar&&(null==(C=$.routes[ah]??$.dynamicRoutes[ah])?void 0:C.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?(0,h.getRequestMeta)(a,"postponed"):void 0,aw=as&&ap&&!ao;J&&(aw=aw&&!!av);let ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=(!an||!as)&&(!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots)),az=!!((aj||ak||$.routes[ah])&&!(an&&as)),aA=as&&!0===ad.cacheComponents,aB=!0===M.isDev||!az||"string"==typeof av||(aA&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aw&&!J:aw),aC=an&&as,aD=null;_||!az||aB||aq||av||aw||(aD=aa);let aE=aD;!aE&&M.isDev&&(aE=aa),M.isDev||_||!az||!ap||aw||(0,k.d)(a.headers);let aF={...E,tree:K,GlobalError:D(),handler:N,routeModule:M,__next_app__:L};X&&Y&&(0,o.setManifestsSingleton)({page:O,clientReferenceManifest:Y,serverActionsManifest:X});let aG=a.method||"GET",aH=(0,g.getTracer)(),aI=aH.getActiveScopeSpan(),aJ=async()=>((null==ac?void 0:ac.render404)?await ac.render404(a,b,ae,!1):b.end("This page could not be found"),null);try{let f=M.getVaryHeader(aa,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return M.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aH.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aG} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aG} ${O}`)})},m=(0,h.getRequestMeta)(a,"incrementalCache"),o=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let l={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aF,Component:(0,j.T)(aF),params:S,routeModule:M,page:O,postponed:f,shouldWaitOnAllReady:aC,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||aB,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,setCacheStatus:null==ac?void 0:ac.setCacheStatus,setIsrStatus:null==ac?void 0:ac.setIsrStatus,setReactDebugChannel:null==ac?void 0:ac.setReactDebugChannel,sendErrorsToBrowser:null==ac?void 0:ac.sendErrorsToBrowser,dir:c(3873).join(process.cwd(),M.relativeProjectDir),isDraftMode:_,botType:am,isOnDemandRevalidate:ai,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,images:ad.images,previewProps:$.preview,deploymentId:ag,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:m,cacheLifeProfiles:ad.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...at||au?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:at}:{},cacheComponents:!!ad.cacheComponents,experimental:{isRoutePPREnabled:as,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[],clientParamParsingOrigins:ad.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,B.parseMaxPostponedStateSize)(ad.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>M.onRequestError(a,b,d,e,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:M.isDev}};at&&(l.renderOpts.nextExport=!0,l.renderOpts.supportsDynamicResponse=!1,l.renderOpts.isDebugDynamicAccesses=at),i&&(l.renderOpts.supportsDynamicResponse=!1);let n=await k(e,l),{metadata:o}=n,{cacheControl:p,headers:q={},fetchTags:r,fetchMetrics:s}=o;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,az&&(null==p?void 0:p.revalidate)===0&&!M.isDev&&!as){let a=o.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
2
- see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:n,headers:q,rscData:o.flightData,postponed:o.postponed,status:o.statusCode,segmentData:o.segmentData},cacheControl:p}},p=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i,forceStaticRender:j=!1})=>{let k,l=!1===M.isDev,q=c||b.writableEnded;if(ai&&ab&&!f&&!J)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(k=(0,v.parseFallbackField)(aj.fallback)),k===v.FallbackMode.PRERENDER&&(0,t.isBot)(al)&&(!as||an)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(k!==v.FallbackMode.NOT_FOUND||f)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),!J&&k!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aE&&!q&&!_&&T&&(l||!ak)){if((l||aj)&&k===v.FallbackMode.NOT_FOUND){if(ad.experimental.adapterPath)return await aJ();throw new A.NoFallbackError}if(as&&(ad.cacheComponents?!aw:!ap)){let b=l&&"string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:ah,c=l&&(null==aj?void 0:aj.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null,f=await M.handleResponse({cacheKey:b,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:as,responseGenerator:async()=>o({span:i,postponed:void 0,fallbackRouteParams:c,forceStaticRender:!1}),waitUntil:d.waitUntil,isMinimalMode:J});if(null===f)return null;if(f)return delete f.cacheControl,f}}let r=ai||g||!av?void 0:av;if(aA&&!J&&m&&aw&&!j){let b=await m.get(aa,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(r=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=M.getResponseCache(a);try{await b.revalidate(aa,m,as,!1,a=>p({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if(at&&void 0!==r)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=l&&(null==aj?void 0:aj.fallbackRouteParams)&&(0,h.getRequestMeta)(a,"renderFallbackShell")?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null;return o({span:i,postponed:r,fallbackRouteParams:s,forceStaticRender:j})},q=async c=>{var f,g,i,j,k;let l,m=await M.handleResponse({cacheKey:aD,responseGenerator:a=>p({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil,isMinimalMode:J});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),M.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!m){if(aD)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;az&&!aw&&(!n||ao)&&(J||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=m;if(av)l={revalidate:0,expire:void 0};else if(aw)l={revalidate:0,expire:void 0};else if(!M.isDev)if(_)l={revalidate:0,expire:void 0};else if(az){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===u.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];J&&az&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let r=aA?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(q.headers){let a={...q.headers};for(let[c,d]of(J&&az||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=q.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(J&&az&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!q.status||ap&&as||(b.statusCode=q.status),!J&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),n&&!aw&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(ad.cacheComponents)return b.statusCode=404,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${q.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:m.cacheControl})}return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(q.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=q.html;if(!n||J||ap)return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:m.cacheControl});if(at)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let A=new TransformStream;return v.push(A.readable),o({span:c,postponed:q.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(A.writable)}).catch(a=>{A.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aI)return await aH.withPropagatedContext(a.headers,()=>aH.trace(i.BaseServerSpan.handleRequest,{spanName:`${aG} ${O}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aG,"http.target":a.url}},q));await q(aI)}catch(b){throw b instanceof A.NoFallbackError||await M.onRequestError(a,b,{routerKind:"App Router",routePath:O,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:az,isOnDemandRevalidate:ai})},!1,ac),b}}},3873:a=>{"use strict";a.exports=require("path")},3948:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23)),Promise.resolve().then(c.t.bind(c,5098,23)),Promise.resolve().then(c.t.bind(c,7644,23)),Promise.resolve().then(c.t.bind(c,3859,23)),Promise.resolve().then(c.t.bind(c,8099,23)),Promise.resolve().then(c.t.bind(c,6237,23)),Promise.resolve().then(c.t.bind(c,8562,23)),Promise.resolve().then(c.t.bind(c,6675,23))},3954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},5026:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx","default")},6055:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(8868);let e=async a=>[{type:"image/x-icon",sizes:"16x16",url:(0,d.fillMetadataSegment)(".",await a.params,"favicon.ico")+"?603d046c9a6fdfbb"}]},6187:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx","default")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6862:(a,b,c)=>{"use strict";var d=c(7484),e="function"==typeof Object.is?Object.is:function(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},f=d.useState,g=d.useEffect,h=d.useLayoutEffect,i=d.useDebugValue;function j(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!e(a,c)}catch(a){return!0}}var k="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(a,b){return b()}:function(a,b){var c=b(),d=f({inst:{value:c,getSnapshot:b}}),e=d[0].inst,k=d[1];return h(function(){e.value=c,e.getSnapshot=b,j(e)&&k({inst:e})},[a,c,b]),g(function(){return j(e)&&k({inst:e}),a(function(){j(e)&&k({inst:e})})},[a]),i(c),c};b.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:k},7068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},7548:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",backgroundColor:"#0a0a0f",color:"#888",fontFamily:"system-ui, sans-serif",margin:0},children:[(0,d.jsx)("h1",{style:{fontSize:"3rem",margin:0,color:"#fff"},children:"404"}),(0,d.jsx)("p",{style:{fontSize:"1.1rem",marginTop:"0.5rem"},children:"Page not found"})]})}},7728:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(8249),e=c(7484),f=c(1220);function g(){let[a,b]=(0,e.useState)(null),[c,g]=(0,e.useState)(!1),[h]=(0,e.useState)(()=>!1),[i]=(0,e.useState)(()=>!1),j=(0,e.useCallback)(async()=>{if(a){try{await a.prompt();let b=await a.userChoice;"accepted"===b.outcome&&g(!1)}catch(a){console.error("PWA install error:",a)}b(null)}},[a]),k=(0,e.useCallback)(()=>{g(!1),localStorage.setItem("pwa-install-dismissed",Date.now().toString())},[]);return!c||i?null:(0,d.jsxs)("div",{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,padding:"12px 16px",background:"linear-gradient(135deg, rgba(20, 20, 35, 0.98), rgba(30, 25, 50, 0.98))",backdropFilter:"blur(20px)",borderTop:"1px solid rgba(139, 92, 246, 0.3)",display:"flex",alignItems:"center",gap:"12px",animation:"slideUp 0.3s ease-out",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.4)"},children:[(0,d.jsx)("style",{children:`
1
+ (()=>{var a={};a.id=8974,a.ids=[8974],a.modules={66:a=>{class b{constructor(a){void 0===a.data&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function c(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function d(a,...b){let c=Object.create(null);for(let b in a)c[b]=a[b];return b.forEach(function(a){for(let b in a)c[b]=a[b]}),c}class e{constructor(a,b){this.buffer="",this.classPrefix=b.classPrefix,a.walk(this)}addText(a){this.buffer+=c(a)}openNode(a){if(!a.scope)return;let b=((a,{prefix:b})=>{if(a.startsWith("language:"))return a.replace("language:","language-");if(a.includes(".")){let c=a.split(".");return[`${b}${c.shift()}`,...c.map((a,b)=>`${a}${"_".repeat(b+1)}`)].join(" ")}return`${b}${a}`})(a.scope,{prefix:this.classPrefix});this.span(b)}closeNode(a){a.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}let f=(a={})=>{let b={children:[]};return Object.assign(b,a),b};class g{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){let b=f({scope:a});this.add(b),this.stack.push(b)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,b){return"string"==typeof b?a.addText(b):b.children&&(a.openNode(b),b.children.forEach(b=>this._walk(a,b)),a.closeNode(b)),a}static _collapse(a){"string"==typeof a||a.children&&(a.children.every(a=>"string"==typeof a)?a.children=[a.children.join("")]:a.children.forEach(a=>{g._collapse(a)}))}}class h extends g{constructor(a){super(),this.options=a}addText(a){""!==a&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,b){let c=a.root;b&&(c.scope=`language:${b}`),this.add(c)}toHTML(){return new e(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function i(a){return a?"string"==typeof a?a:a.source:null}function j(a){return m("(?=",a,")")}function k(a){return m("(?:",a,")*")}function l(a){return m("(?:",a,")?")}function m(...a){return a.map(a=>i(a)).join("")}function n(...a){let b;return"("+(("object"==typeof(b=a[a.length-1])&&b.constructor===Object?(a.splice(a.length-1,1),b):{}).capture?"":"?:")+a.map(a=>i(a)).join("|")+")"}function o(a){return RegExp(a.toString()+"|").exec("").length-1}let p=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function q(a,{joinWith:b}){let c=0;return a.map(a=>{let b=c+=1,d=i(a),e="";for(;d.length>0;){let a=p.exec(d);if(!a){e+=d;break}e+=d.substring(0,a.index),d=d.substring(a.index+a[0].length),"\\"===a[0][0]&&a[1]?e+="\\"+String(Number(a[1])+b):(e+=a[0],"("===a[0]&&c++)}return e}).map(a=>`(${a})`).join(b)}let r="[a-zA-Z]\\w*",s="[a-zA-Z_]\\w*",t="\\b\\d+(\\.\\d+)?",u="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",w={begin:"\\\\[\\s\\S]",relevance:0},x=function(a,b,c={}){let e=d({scope:"comment",begin:a,end:b,contains:[]},c);e.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let f=n("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return e.contains.push({begin:m(/[ ]+/,"(",f,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),e},y=x("//","$"),z=x("/\\*","\\*/"),A=x("#","$");var B=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[w]},BACKSLASH_ESCAPE:w,BINARY_NUMBER_MODE:{scope:"number",begin:v,relevance:0},BINARY_NUMBER_RE:v,COMMENT:x,C_BLOCK_COMMENT_MODE:z,C_LINE_COMMENT_MODE:y,C_NUMBER_MODE:{scope:"number",begin:u,relevance:0},C_NUMBER_RE:u,END_SAME_AS_BEGIN:function(a){return Object.assign(a,{"on:begin":(a,b)=>{b.data._beginMatch=a[1]},"on:end":(a,b)=>{b.data._beginMatch!==a[1]&&b.ignoreMatch()}})},HASH_COMMENT_MODE:A,IDENT_RE:r,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+s,relevance:0},NUMBER_MODE:{scope:"number",begin:t,relevance:0},NUMBER_RE:t,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[w]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[w,{begin:/\[/,end:/\]/,relevance:0,contains:[w]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(a={})=>{let b=/^#![ ]*\//;return a.binary&&(a.begin=m(b,/.*\b/,a.binary,/\b.*/)),d({scope:"meta",begin:b,end:/$/,relevance:0,"on:begin":(a,b)=>{0!==a.index&&b.ignoreMatch()}},a)},TITLE_MODE:{scope:"title",begin:r,relevance:0},UNDERSCORE_IDENT_RE:s,UNDERSCORE_TITLE_MODE:{scope:"title",begin:s,relevance:0}});function C(a,b){"."===a.input[a.index-1]&&b.ignoreMatch()}function D(a,b){void 0!==a.className&&(a.scope=a.className,delete a.className)}function E(a,b){!b||a.beginKeywords&&(a.begin="\\b("+a.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",a.__beforeBegin=C,a.keywords=a.keywords||a.beginKeywords,delete a.beginKeywords,void 0===a.relevance&&(a.relevance=0))}function F(a,b){Array.isArray(a.illegal)&&(a.illegal=n(...a.illegal))}function G(a,b){if(a.match){if(a.begin||a.end)throw Error("begin & end are not supported with match");a.begin=a.match,delete a.match}}function H(a,b){void 0===a.relevance&&(a.relevance=1)}let I=(a,b)=>{if(!a.beforeMatch)return;if(a.starts)throw Error("beforeMatch cannot be used with starts");let c=Object.assign({},a);Object.keys(a).forEach(b=>{delete a[b]}),a.keywords=c.keywords,a.begin=m(c.beforeMatch,j(c.begin)),a.starts={relevance:0,contains:[Object.assign(c,{endsParent:!0})]},a.relevance=0,delete c.beforeMatch},J=["of","and","for","in","not","or","if","then","parent","list","value"],K={},L=a=>{console.error(a)},M=(a,...b)=>{console.log(`WARN: ${a}`,...b)},N=(a,b)=>{K[`${a}/${b}`]||(console.log(`Deprecated as of ${a}. ${b}`),K[`${a}/${b}`]=!0)},O=Error();function P(a,b,{key:c}){let d=0,e=a[c],f={},g={};for(let a=1;a<=b.length;a++)g[a+d]=e[a],f[a+d]=!0,d+=o(b[a-1]);a[c]=g,a[c]._emit=f,a[c]._multi=!0}function Q(a){if(a.scope&&"object"==typeof a.scope&&null!==a.scope&&(a.beginScope=a.scope,delete a.scope),"string"==typeof a.beginScope&&(a.beginScope={_wrap:a.beginScope}),"string"==typeof a.endScope&&(a.endScope={_wrap:a.endScope}),Array.isArray(a.begin)){if(a.skip||a.excludeBegin||a.returnBegin)throw L("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),O;if("object"!=typeof a.beginScope||null===a.beginScope)throw L("beginScope must be object"),O;P(a,a.begin,{key:"beginScope"}),a.begin=q(a.begin,{joinWith:""})}if(Array.isArray(a.end)){if(a.skip||a.excludeEnd||a.returnEnd)throw L("skip, excludeEnd, returnEnd not compatible with endScope: {}"),O;if("object"!=typeof a.endScope||null===a.endScope)throw L("endScope must be object"),O;P(a,a.end,{key:"endScope"}),a.end=q(a.end,{joinWith:""})}}class R extends Error{constructor(a,b){super(a),this.name="HTMLInjectionError",this.html=b}}let S=Symbol("nomatch"),T=function(a){let e=Object.create(null),f=Object.create(null),g=[],p=!0,r="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},t={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function u(a){return t.noHighlightRe.test(a)}function v(a,b,c){let d="",e="";"object"==typeof b?(d=a,c=b.ignoreIllegals,e=b.language):(N("10.7.0","highlight(lang, code, ...args) has been deprecated."),N("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),e=a,d=b),void 0===c&&(c=!0);let f={code:d,language:e};P("before:highlight",f);let g=f.result?f.result:w(f.language,f.code,c);return g.code=f.code,P("after:highlight",g),g}function w(a,f,g,h){let j=Object.create(null);function k(){if(!B.keywords)return void M.addText(O);let a=0;B.keywordPatternRe.lastIndex=0;let b=B.keywordPatternRe.exec(O),c="";for(;b;){c+=O.substring(a,b.index);let d=y.case_insensitive?b[0].toLowerCase():b[0],e=B.keywords[d];if(e){let[a,f]=e;if(M.addText(c),c="",j[d]=(j[d]||0)+1,j[d]<=7&&(P+=f),a.startsWith("_"))c+=b[0];else{let c=y.classNameAliases[a]||a;m(b[0],c)}}else c+=b[0];a=B.keywordPatternRe.lastIndex,b=B.keywordPatternRe.exec(O)}c+=O.substring(a),M.addText(c)}function l(){null!=B.subLanguage?function(){if(""===O)return;let a=null;if("string"==typeof B.subLanguage){if(!e[B.subLanguage])return M.addText(O);a=w(B.subLanguage,O,!0,K[B.subLanguage]),K[B.subLanguage]=a._top}else a=x(O,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(P+=a.relevance),M.__addSublanguage(a._emitter,a.language)}():k(),O=""}function m(a,b){""!==a&&(M.startScope(b),M.addText(a),M.endScope())}function n(a,b){let c=1,d=b.length-1;for(;c<=d;){if(!a._emit[c]){c++;continue}let d=y.classNameAliases[a[c]]||a[c],e=b[c];d?m(e,d):(O=e,k(),O=""),c++}}function s(a,b){return a.scope&&"string"==typeof a.scope&&M.openNode(y.classNameAliases[a.scope]||a.scope),a.beginScope&&(a.beginScope._wrap?(m(O,y.classNameAliases[a.beginScope._wrap]||a.beginScope._wrap),O=""):a.beginScope._multi&&(n(a.beginScope,b),O="")),B=Object.create(a,{parent:{value:B}})}let u={};function v(c,d){let e=d&&d[0];if(O+=c,null==e)return l(),0;if("begin"===u.type&&"end"===d.type&&u.index===d.index&&""===e){if(O+=f.slice(d.index,d.index+1),!p){let b=Error(`0 width match regex (${a})`);throw b.languageName=a,b.badRule=u.rule,b}return 1}if(u=d,"begin"===d.type){let a=d[0],c=d.rule,e=new b(c);for(let b of[c.__beforeBegin,c["on:begin"]])if(b&&(b(d,e),e.isMatchIgnored))return 0===B.matcher.regexIndex?(O+=a[0],1):(U=!0,0);return c.skip?O+=a:(c.excludeBegin&&(O+=a),l(),c.returnBegin||c.excludeBegin||(O=a)),s(c,d),c.returnBegin?0:a.length}if("illegal"!==d.type||g){if("end"===d.type){let a=function(a){let c=a[0],d=f.substring(a.index),e=function a(c,d,e){var f;let g,h=(f=c.endRe,(g=f&&f.exec(e))&&0===g.index);if(h){if(c["on:end"]){let a=new b(c);c["on:end"](d,a),a.isMatchIgnored&&(h=!1)}if(h){for(;c.endsParent&&c.parent;)c=c.parent;return c}}if(c.endsWithParent)return a(c.parent,d,e)}(B,a,d);if(!e)return S;let g=B;B.endScope&&B.endScope._wrap?(l(),m(c,B.endScope._wrap)):B.endScope&&B.endScope._multi?(l(),n(B.endScope,a)):g.skip?O+=c:(g.returnEnd||g.excludeEnd||(O+=c),l(),g.excludeEnd&&(O=c));do B.scope&&M.closeNode(),B.skip||B.subLanguage||(P+=B.relevance),B=B.parent;while(B!==e.parent);return e.starts&&s(e.starts,a),g.returnEnd?0:c.length}(d);if(a!==S)return a}}else{let a=Error('Illegal lexeme "'+e+'" for mode "'+(B.scope||"<unnamed>")+'"');throw a.mode=B,a}if("illegal"===d.type&&""===e)return O+="\n",1;if(T>1e5&&T>3*d.index)throw Error("potential infinite loop, way more iterations than matches");return O+=e,e.length}let y=C(a);if(!y)throw L(r.replace("{}",a)),Error('Unknown language: "'+a+'"');let z=function(a){function b(b,c){return RegExp(i(b),"m"+(a.case_insensitive?"i":"")+(a.unicodeRegex?"u":"")+(c?"g":""))}class c{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,b){b.position=this.position++,this.matchIndexes[this.matchAt]=b,this.regexes.push([b,a]),this.matchAt+=o(a)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let a=this.regexes.map(a=>a[1]);this.matcherRe=b(q(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let b=this.matcherRe.exec(a);if(!b)return null;let c=b.findIndex((a,b)=>b>0&&void 0!==a),d=this.matchIndexes[c];return b.splice(0,c),Object.assign(b,d)}}class e{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let b=new c;return this.rules.slice(a).forEach(([a,c])=>b.addRule(a,c)),b.compile(),this.multiRegexes[a]=b,b}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(a,b){this.rules.push([a,b]),"begin"===b.type&&this.count++}exec(a){let b=this.getMatcher(this.regexIndex);b.lastIndex=this.lastIndex;let c=b.exec(a);if(this.resumingScanAtSamePosition())if(c&&c.index===this.lastIndex);else{let b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,c=b.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}if(a.compilerExtensions||(a.compilerExtensions=[]),a.contains&&a.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return a.classNameAliases=d(a.classNameAliases||{}),function c(f,g){let h;if(f.isCompiled)return f;[D,G,Q,I].forEach(a=>a(f,g)),a.compilerExtensions.forEach(a=>a(f,g)),f.__beforeBegin=null,[E,F,H].forEach(a=>a(f,g)),f.isCompiled=!0;let j=null;return"object"==typeof f.keywords&&f.keywords.$pattern&&(f.keywords=Object.assign({},f.keywords),j=f.keywords.$pattern,delete f.keywords.$pattern),j=j||/\w+/,f.keywords&&(f.keywords=function a(b,c,d="keyword"){let e=Object.create(null);return"string"==typeof b?f(d,b.split(" ")):Array.isArray(b)?f(d,b):Object.keys(b).forEach(function(d){Object.assign(e,a(b[d],c,d))}),e;function f(a,b){c&&(b=b.map(a=>a.toLowerCase())),b.forEach(function(b){var c,d,f;let g=b.split("|");e[g[0]]=[a,(c=g[0],(d=g[1])?Number(d):+(f=c,!J.includes(f.toLowerCase())))]})}}(f.keywords,a.case_insensitive)),f.keywordPatternRe=b(j,!0),g&&(f.begin||(f.begin=/\B|\b/),f.beginRe=b(f.begin),f.end||f.endsWithParent||(f.end=/\B|\b/),f.end&&(f.endRe=b(f.end)),f.terminatorEnd=i(f.end)||"",f.endsWithParent&&g.terminatorEnd&&(f.terminatorEnd+=(f.end?"|":"")+g.terminatorEnd)),f.illegal&&(f.illegalRe=b(f.illegal)),f.contains||(f.contains=[]),f.contains=[].concat(...f.contains.map(function(a){var b;return((b="self"===a?f:a).variants&&!b.cachedVariants&&(b.cachedVariants=b.variants.map(function(a){return d(b,{variants:null},a)})),b.cachedVariants)?b.cachedVariants:!function a(b){return!!b&&(b.endsWithParent||a(b.starts))}(b)?Object.isFrozen(b)?d(b):b:d(b,{starts:b.starts?d(b.starts):null})})),f.contains.forEach(function(a){c(a,f)}),f.starts&&c(f.starts,g),h=new e,f.contains.forEach(a=>h.addRule(a.begin,{rule:a,type:"begin"})),f.terminatorEnd&&h.addRule(f.terminatorEnd,{type:"end"}),f.illegal&&h.addRule(f.illegal,{type:"illegal"}),f.matcher=h,f}(a)}(y),A="",B=h||z,K={},M=new t.__emitter(t),N=[];for(let a=B;a!==y;a=a.parent)a.scope&&N.unshift(a.scope);N.forEach(a=>M.openNode(a));let O="",P=0,R=0,T=0,U=!1;try{if(y.__emitTokens)y.__emitTokens(f,M);else{for(B.matcher.considerAll();;){T++,U?U=!1:B.matcher.considerAll(),B.matcher.lastIndex=R;let a=B.matcher.exec(f);if(!a)break;let b=f.substring(R,a.index),c=v(b,a);R=a.index+c}v(f.substring(R))}return M.finalize(),A=M.toHTML(),{language:a,value:A,relevance:P,illegal:!1,_emitter:M,_top:B}}catch(b){if(b.message&&b.message.includes("Illegal"))return{language:a,value:c(f),illegal:!0,relevance:0,_illegalBy:{message:b.message,index:R,context:f.slice(R-100,R+100),mode:b.mode,resultSoFar:A},_emitter:M};if(p)return{language:a,value:c(f),illegal:!1,relevance:0,errorRaised:b,_emitter:M,_top:B};throw b}}function x(a,b){let d;b=b||t.languages||Object.keys(e);let f=((d={value:c(a),illegal:!1,relevance:0,_top:s,_emitter:new t.__emitter(t)})._emitter.addText(a),d),g=b.filter(C).filter(O).map(b=>w(b,a,!1));g.unshift(f);let[h,i]=g.sort((a,b)=>{if(a.relevance!==b.relevance)return b.relevance-a.relevance;if(a.language&&b.language){if(C(a.language).supersetOf===b.language)return 1;else if(C(b.language).supersetOf===a.language)return -1}return 0});return h.secondBest=i,h}function y(a){var b;let c,d=function(a){let b=a.className+" ";b+=a.parentNode?a.parentNode.className:"";let c=t.languageDetectRe.exec(b);if(c){let b=C(c[1]);return b||(M(r.replace("{}",c[1])),M("Falling back to no-highlight mode for this block.",a)),b?c[1]:"no-highlight"}return b.split(/\s+/).find(a=>u(a)||C(a))}(a);if(u(d))return;if(P("before:highlightElement",{el:a,language:d}),a.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",a);if(a.children.length>0&&(t.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(a)),t.throwUnescapedHTML))throw new R("One of your code blocks includes unescaped HTML.",a.innerHTML);let e=a.textContent,g=d?v(e,{language:d,ignoreIllegals:!0}):x(e);a.innerHTML=g.value,a.dataset.highlighted="yes",b=g.language,c=d&&f[d]||b,a.classList.add("hljs"),a.classList.add(`language-${c}`),a.result={language:g.language,re:g.relevance,relevance:g.relevance},g.secondBest&&(a.secondBest={language:g.secondBest.language,relevance:g.secondBest.relevance}),P("after:highlightElement",{el:a,result:g,text:e})}let z=!1;function A(){if("loading"===document.readyState){z||window.addEventListener("DOMContentLoaded",function(){A()},!1),z=!0;return}document.querySelectorAll(t.cssSelector).forEach(y)}function C(a){return e[a=(a||"").toLowerCase()]||e[f[a]]}function K(a,{languageName:b}){"string"==typeof a&&(a=[a]),a.forEach(a=>{f[a.toLowerCase()]=b})}function O(a){let b=C(a);return b&&!b.disableAutodetect}function P(a,b){g.forEach(function(c){c[a]&&c[a](b)})}for(let b in Object.assign(a,{highlight:v,highlightAuto:x,highlightAll:A,highlightElement:y,highlightBlock:function(a){return N("10.7.0","highlightBlock will be removed entirely in v12.0"),N("10.7.0","Please use highlightElement now."),y(a)},configure:function(a){t=d(t,a)},initHighlighting:()=>{A(),N("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){A(),N("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(b,c){let d=null;try{d=c(a)}catch(a){if(L("Language definition for '{}' could not be registered.".replace("{}",b)),p)L(a);else throw a;d=s}d.name||(d.name=b),e[b]=d,d.rawDefinition=c.bind(null,a),d.aliases&&K(d.aliases,{languageName:b})},unregisterLanguage:function(a){for(let b of(delete e[a],Object.keys(f)))f[b]===a&&delete f[b]},listLanguages:function(){return Object.keys(e)},getLanguage:C,registerAliases:K,autoDetection:O,inherit:d,addPlugin:function(a){var b;(b=a)["before:highlightBlock"]&&!b["before:highlightElement"]&&(b["before:highlightElement"]=a=>{b["before:highlightBlock"](Object.assign({block:a.el},a))}),b["after:highlightBlock"]&&!b["after:highlightElement"]&&(b["after:highlightElement"]=a=>{b["after:highlightBlock"](Object.assign({block:a.el},a))}),g.push(a)},removePlugin:function(a){let b=g.indexOf(a);-1!==b&&g.splice(b,1)}}),a.debugMode=function(){p=!1},a.safeMode=function(){p=!0},a.versionString="11.11.1",a.regex={concat:m,lookahead:j,either:n,optional:l,anyNumberOfTimes:k},B)"object"==typeof B[b]&&function a(b){return b instanceof Map?b.clear=b.delete=b.set=function(){throw Error("map is read-only")}:b instanceof Set&&(b.add=b.clear=b.delete=function(){throw Error("set is read-only")}),Object.freeze(b),Object.getOwnPropertyNames(b).forEach(c=>{let d=b[c],e=typeof d;"object"!==e&&"function"!==e||Object.isFrozen(d)||a(d)}),b}(B[b]);return Object.assign(a,B),a},U=T({});U.newInstance=()=>T({}),a.exports=U,U.HighlightJS=U,U.default=U},69:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(8249),e=c(6729);function f({children:a}){return(0,d.jsx)(e.Kq,{delayDuration:400,skipDelayDuration:300,children:a})}var g=c(707);function h({children:a}){return(0,d.jsxs)(f,{children:[a,(0,d.jsx)(g.l$,{position:"top-center",toastOptions:{style:{background:"var(--surface-2)",border:"1px solid var(--border-1)",color:"var(--text-1)",fontSize:"13px"}},theme:"dark"})]})}},261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},380:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23)),Promise.resolve().then(c.t.bind(c,440,23)),Promise.resolve().then(c.t.bind(c,4342,23)),Promise.resolve().then(c.t.bind(c,2265,23)),Promise.resolve().then(c.t.bind(c,5421,23)),Promise.resolve().then(c.t.bind(c,1335,23)),Promise.resolve().then(c.t.bind(c,664,23)),Promise.resolve().then(c.bind(c,4661))},722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},1213:(a,b,c)=>{Promise.resolve().then(c.bind(c,69)),Promise.resolve().then(c.bind(c,7728))},1230:()=>{},1245:(a,b,c)=>{Promise.resolve().then(c.bind(c,6187))},2056:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>n,dynamic:()=>k,metadata:()=>l,viewport:()=>m});var d=c(5735),e=c(7014),f=c.n(e),g=c(9345),h=c.n(g);c(2704);var i=c(5026),j=c(3593);let k="force-dynamic",l={title:"Antigravity Agent",description:"Chat with the Antigravity AI Agent from any browser",applicationName:"Antigravity Agent",manifest:"/manifest.json",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:"Antigravity Agent"},formatDetection:{telephone:!1}},m={width:"device-width",initialScale:1,maximumScale:1,viewportFit:"cover",themeColor:"#0a0a0f"};function n({children:a}){return(0,d.jsx)("html",{lang:"en",className:`${f().variable} ${h().variable}`,children:(0,d.jsxs)("body",{children:[(0,d.jsx)(j.default,{children:a}),(0,d.jsx)(i.default,{})]})})}},2237:(a,b,c)=>{"use strict";a.exports=c(6862)},2654:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23))},2704:()=>{},2918:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23))},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3221:(a,b,c)=>{"use strict";let d;c.d(b,{default:()=>a2});var e=c(8249),f=c(7484),g=Object.prototype.hasOwnProperty;let h=new WeakMap,i=()=>{},j=i(),k=Object,l=a=>a===j,m=(a,b)=>({...a,...b}),n={},o={},p="undefined",q=typeof document!=p,r=!1,s=(a,b)=>{let c=h.get(a);return[()=>!l(b)&&a.get(b)||n,d=>{if(!l(b)){let e=a.get(b);b in o||(o[b]=e),c[5](b,m(e,d),e||n)}},c[6],()=>!l(b)&&b in o?o[b]:!l(b)&&a.get(b)||n]},t=!0,[u,v]=[i,i],w={initFocus:a=>(q&&document.addEventListener("visibilitychange",a),u("focus",a),()=>{q&&document.removeEventListener("visibilitychange",a),v("focus",a)}),initReconnect:a=>{let b=()=>{t=!0,a()},c=()=>{t=!1};return u("online",b),u("offline",c),()=>{v("online",b),v("offline",c)}}},x=!f.useId,y=!0,z=y?f.useEffect:f.useLayoutEffect,A="u">typeof navigator&&navigator.connection,B=!y&&A&&(["slow-2g","2g"].includes(A.effectiveType)||A.saveData),C=new WeakMap,D=(a,b)=>a===`[object ${b}]`,E=0,F=a=>{let b,c,d=typeof a,e=k.prototype.toString.call(a),f=D(e,"Date"),g=D(e,"RegExp"),h=D(e,"Object");if(k(a)!==a||f||g)b=f?a.toJSON():"symbol"==d?a.toString():"string"==d?JSON.stringify(a):""+a;else{if(b=C.get(a))return b;if(b=++E+"~",C.set(a,b),Array.isArray(a)){for(c=0,b="@";c<a.length;c++)b+=F(a[c])+",";C.set(a,b)}if(h){b="#";let d=k.keys(a).sort();for(;!l(c=d.pop());)l(a[c])||(b+=c+":"+F(a[c])+",");C.set(a,b)}}return b},G=a=>{if("function"==typeof a)try{a=a()}catch(b){a=""}let b=a;return[a="string"==typeof a?a:(Array.isArray(a)?a.length:a)?F(a):"",b]},H=0,I=()=>++H;async function J(...a){let[b,c,d,e]=a,f=m({populateCache:!0,throwOnError:!0},"boolean"==typeof e?{revalidate:e}:e||{}),g=f.populateCache,i=f.rollbackOnError,k=f.optimisticData,n=f.throwOnError;if("function"==typeof c){let a=[];for(let d of b.keys())!/^\$(inf|sub)\$/.test(d)&&c(b.get(d)._k)&&a.push(d);return Promise.all(a.map(o))}return o(c);async function o(c){let e,[m]=G(c);if(!m)return;let[o,p]=s(b,m),[q,r,t,u]=h.get(b),v=()=>{let a=q[m];return("function"==typeof f.revalidate?f.revalidate(o().data,c):!1!==f.revalidate)&&(delete t[m],delete u[m],a&&a[0])?a[0](2).then(()=>o().data):o().data};if(a.length<3)return v();let w=d,x=!1,y=I();r[m]=[y,0];let z=!l(k),A=o(),B=A.data,C=A._c,D=l(C)?B:C;if(z&&p({data:k="function"==typeof k?k(D,B):k,_c:D}),"function"==typeof w)try{w=w(D)}catch(a){e=a,x=!0}if(w&&"function"==typeof w.then){let a;if(w=await w.catch(a=>{e=a,x=!0}),y!==r[m][0]){if(x)throw e;return w}x&&z&&(a=e,"function"==typeof i?i(a):!1!==i)&&(g=!0,p({data:D,_c:j}))}if(g&&!x&&("function"==typeof g?p({data:g(w,D),error:j,_c:j}):p({data:w,error:j,_c:j})),r[m][1]=I(),Promise.resolve(v()).then(()=>{p({_c:j})}),x){if(n)throw e;return}return w}}let K=(a,b)=>{for(let c in a)a[c][0]&&a[c][0](b)},L=(a,b)=>{if(!h.has(a)){let c=m(w,b),d=Object.create(null),e=J.bind(j,a),f=i,g=Object.create(null),k=(a,b)=>{let c=g[a]||[];return g[a]=c,c.push(b),()=>c.splice(c.indexOf(b),1)},l=(b,c,d)=>{a.set(b,c);let e=g[b];if(e)for(let a of e)a(c,d)},n=()=>{if(!h.has(a)&&(h.set(a,[d,Object.create(null),Object.create(null),Object.create(null),e,l,k]),!y)){let b=c.initFocus(setTimeout.bind(j,K.bind(j,d,0))),e=c.initReconnect(setTimeout.bind(j,K.bind(j,d,1)));f=()=>{b&&b(),e&&e(),h.delete(a)}}};return n(),[a,e,n,f]}return[a,h.get(a)[4]]},[M,N]=L(new Map),O=m({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:(a,b,c,d,e)=>{let f=c.errorRetryCount,g=e.retryCount,h=~~((Math.random()+.5)*(1<<(g<8?g:8)))*c.errorRetryInterval;(l(f)||!(g>f))&&setTimeout(d,h,e)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:B?5e3:3e3,compare:function a(b,c){var d,e;if(b===c)return!0;if(b&&c&&(d=b.constructor)===c.constructor){if(d===Date)return b.getTime()===c.getTime();if(d===RegExp)return b.toString()===c.toString();if(d===Array){if((e=b.length)===c.length)for(;e--&&a(b[e],c[e]););return -1===e}if(!d||"object"==typeof b){for(d in e=0,b)if(g.call(b,d)&&++e&&!g.call(c,d)||!(d in c)||!a(b[d],c[d]))return!1;return Object.keys(c).length===e}}return b!=b&&c!=c},isPaused:()=>!1,cache:M,mutate:N,fallback:{}},{isOnline:()=>t,isVisible:()=>{let a=q&&document.visibilityState;return l(a)||"hidden"!==a}}),P=(a,b)=>{let c=m(a,b);if(b){let{use:d,fallback:e}=a,{use:f,fallback:g}=b;d&&f&&(c.use=d.concat(f)),e&&g&&(c.fallback=m(e,g))}return c},Q=(0,f.createContext)({}),R=!1,S=R?window.__SWR_DEVTOOLS_USE__:[],T=()=>{let a=(0,f.useContext)(Q);return(0,f.useMemo)(()=>m(O,a),[a])},U=S.concat(a=>(b,c,d)=>{let e=c&&((...a)=>{let[d]=G(b),[,,,e]=h.get(M);if(d.startsWith("$inf$"))return c(...a);let f=e[d];return l(f)?c(...a):(delete e[d],f)});return a(b,e,d)});R&&(window.__SWR_DEVTOOLS_REACT__=f);var V=c(2237);let W=()=>{},X=W(),Y=(new WeakMap,f.use||(a=>{switch(a.status){case"pending":throw a;case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a.status="pending",a.then(b=>{a.status="fulfilled",a.value=b},b=>{a.status="rejected",a.reason=b}),a}})),Z={dedupe:!0},$=Promise.resolve(j),_=()=>i;k.defineProperty(a=>{let{value:b}=a,c=(0,f.useContext)(Q),d="function"==typeof b,e=(0,f.useMemo)(()=>d?b(c):b,[d,c,b]),g=(0,f.useMemo)(()=>d?e:P(c,e),[d,c,e]),h=e&&e.provider,i=(0,f.useRef)(j);h&&!i.current&&(i.current=L(h(g.cache||M),e));let k=i.current;return k&&(g.cache=k[0],g.mutate=k[1]),z(()=>{if(k)return k[2]&&k[2](),k[3]},[]),(0,f.createElement)(Q.Provider,m(a,{value:g}))},"defaultValue",{value:O});let aa=(d=(a,b,c)=>{let{cache:d,compare:e,suspense:g,fallbackData:i,revalidateOnMount:k,revalidateIfStale:n,refreshInterval:o,refreshWhenHidden:p,refreshWhenOffline:q,keepPreviousData:r,strictServerPrefetchWarning:t}=c,[u,v,w,A]=h.get(d),[B,C]=G(a),D=(0,f.useRef)(!1),E=(0,f.useRef)(!1),F=(0,f.useRef)(B),H=(0,f.useRef)(b),K=(0,f.useRef)(c),L=()=>K.current.isVisible()&&K.current.isOnline(),[M,N,O,P]=s(d,B),Q=(0,f.useRef)({}).current,R=l(i)?l(c.fallback)?j:c.fallback[B]:i,S=(a,b)=>{for(let c in Q)if("data"===c){if(!e(a[c],b[c])&&(!l(a[c])||!e(ae,b[c])))return!1}else if(b[c]!==a[c])return!1;return!0},T=!D.current,U=(0,f.useMemo)(()=>{let a=M(),c=P(),d=a=>{let c=m(a);return(delete c._k,(()=>{if(!B||!b||K.current.isPaused())return!1;if(T&&!l(k))return k;let a=l(R)?c.data:R;return l(a)||n})())?{isValidating:!0,isLoading:!0,...c}:c},e=d(a),f=a===c?e:d(c),g=e;return[()=>{let a=d(M());return S(a,g)?(g.data=a.data,g.isLoading=a.isLoading,g.isValidating=a.isValidating,g.error=a.error,g):(g=a,a)},()=>f]},[d,B]),W=(0,V.useSyncExternalStore)((0,f.useCallback)(a=>O(B,(b,c)=>{S(c,b)||a()}),[d,B]),U[0],U[1]),X=u[B]&&u[B].length>0,aa=W.data,ab=l(aa)?R&&"function"==typeof R.then?Y(R):R:aa,ac=W.error,ad=(0,f.useRef)(ab),ae=r?l(aa)?l(ad.current)?ab:ad.current:aa:ab,af=B&&l(ab),ag=(0,f.useRef)(null);y||(0,V.useSyncExternalStore)(_,()=>(ag.current=!1,ag),()=>(ag.current=!0,ag));let ah=ag.current;t&&ah&&!g&&af&&console.warn(`Missing pre-initiated data for serialized key "${B}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let ai=!(!B||!b||K.current.isPaused())&&(!X||!!l(ac))&&(T&&!l(k)?k:g?!l(ab)&&n:l(ab)||n),aj=T&&ai,ak=l(W.isValidating)?aj:W.isValidating,al=l(W.isLoading)?aj:W.isLoading,am=(0,f.useCallback)(async a=>{let b,d,f=H.current;if(!B||!f||E.current||K.current.isPaused())return!1;let g=!0,h=a||{},i=!w[B]||!h.dedupe,k=()=>x?!E.current&&B===F.current&&D.current:B===F.current,m={isValidating:!1,isLoading:!1},n=()=>{N(m)},o=()=>{let a=w[B];a&&a[1]===d&&delete w[B]},p={isValidating:!0};l(M().data)&&(p.isLoading=!0);try{if(i&&(N(p),c.loadingTimeout&&l(M().data)&&setTimeout(()=>{g&&k()&&K.current.onLoadingSlow(B,c)},c.loadingTimeout),w[B]=[f(C),I()]),[b,d]=w[B],b=await b,i&&setTimeout(o,c.dedupingInterval),!w[B]||w[B][1]!==d)return i&&k()&&K.current.onDiscarded(B),!1;m.error=j;let a=v[B];if(!l(a)&&(d<=a[0]||d<=a[1]||0===a[1]))return n(),i&&k()&&K.current.onDiscarded(B),!1;let h=M().data;m.data=e(h,b)?h:b,i&&k()&&K.current.onSuccess(b,B,c)}catch(c){o();let a=K.current,{shouldRetryOnError:b}=a;!a.isPaused()&&(m.error=c,i&&k())&&(a.onError(c,B,a),(!0===b||"function"==typeof b&&b(c))&&(!K.current.revalidateOnFocus||!K.current.revalidateOnReconnect||L())&&a.onErrorRetry(c,B,a,a=>{let b=u[B];b&&b[0]&&b[0](3,a)},{retryCount:(h.retryCount||0)+1,dedupe:!0}))}return g=!1,n(),!0},[B,d]),an=(0,f.useCallback)((...a)=>J(d,F.current,...a),[]);if(z(()=>{H.current=b,K.current=c,l(aa)||(ad.current=aa)}),z(()=>{var a;let b;if(!B)return;let c=am.bind(j,Z),d=0;K.current.revalidateOnFocus&&(d=Date.now()+K.current.focusThrottleInterval);let e=(a=(a,b={})=>{if(0==a){let a=Date.now();K.current.revalidateOnFocus&&a>d&&L()&&(d=a+K.current.focusThrottleInterval,c())}else if(1==a)K.current.revalidateOnReconnect&&L()&&c();else if(2==a)return am();else if(3==a)return am(b)},(b=u[B]||(u[B]=[])).push(a),()=>{let c=b.indexOf(a);c>=0&&(b[c]=b[b.length-1],b.pop())});if(E.current=!1,F.current=B,D.current=!0,N({_k:C}),ai&&!w[B])if(l(ab)||y)c();else setTimeout(c,1);return()=>{E.current=!0,e()}},[B]),z(()=>{let a;function b(){let b="function"==typeof o?o(M().data):o;b&&-1!==a&&(a=setTimeout(c,b))}function c(){!M().error&&(p||K.current.isVisible())&&(q||K.current.isOnline())?am(Z).then(b):b()}return b(),()=>{a&&(clearTimeout(a),a=-1)}},[o,p,q,B]),(0,f.useDebugValue)(ae),g){if(!x&&y&&af)throw Error("Fallback data is required when using Suspense in SSR.");af&&(H.current=b,K.current=c,E.current=!1);let a=A[B];if(Y(!l(a)&&af?an(a):$),!l(ac)&&af)throw ac;let d=af?am(Z):$;!l(ae)&&af&&(d.status="fulfilled",d.value=!0),Y(d)}return{mutate:an,get data(){return Q.data=!0,ae},get error(){return Q.error=!0,ac},get isValidating(){return Q.isValidating=!0,ak},get isLoading(){return Q.isLoading=!0,al}}},function(...a){let b=T(),[c,e,f]="function"==typeof a[1]?[a[0],a[1],a[2]||{}]:[a[0],null,(null===a[1]?a[2]:a[1])||{}],g=P(b,f),h=d,{use:i}=g,j=(i||[]).concat(U);for(let a=j.length;a--;)h=j[a](h);return h(c,e||g.fetcher||null,g)}),ab="/api/v1",ac=a=>fetch(a).then(a=>a.json()),ad={windows:`${ab}/windows`,cdpStatus:`${ab}/windows/cdp-status`,conversations:`${ab}/conversations`,recentProjects:`${ab}/windows/recent`,artifacts:`${ab}/artifacts/active`,changes:`${ab}/changes/active`,git:`${ab}/git/status`,workspace:`${ab}/workspace/files`,history:`${ab}/chat/history`,mode:`${ab}/chat/mode`,agent:`${ab}/chat/agent`,health:`${ab}/health`},ae="/api/v1",af="/api/v1";function ag(a){if(!a)return"";let b=new Date(a),c=Math.floor((Date.now()-b.getTime())/6e4);if(c<1)return"now";if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d} hr${1!==d?"s":""} ago`;let e=Math.floor(d/24);if(e<7)return`${e} day${1!==e?"s":""} ago`;let f=Math.floor(e/7);return`${f} wk${1!==f?"s":""} ago`}function ah({conversations:a,activeConversation:b,onSelect:c}){let[d,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(!1),j=(0,f.useRef)(null),k=(0,f.useCallback)(()=>{g(!1),i(!1)},[]),l=a.find(a=>a.active)||null,m=[...a.filter(a=>!a.active)].sort((a,b)=>a.mtime||b.mtime?a.mtime?b.mtime?new Date(b.mtime).getTime()-new Date(a.mtime).getTime():-1:1:0),n=h?m:m.slice(0,5),o=m.length-5;return(0,e.jsxs)("div",{ref:j,className:`conv-selector-wrapper ${d?"open":""}`,children:[(0,e.jsxs)("button",{className:"conv-selector-btn",onClick:()=>g(!d),title:"Switch conversation",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:b?.title?.substring(0,22)||"Select a conversation"}),(0,e.jsx)("svg",{className:"chevron",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`conv-dropdown ${d?"open":""}`,children:[(0,e.jsx)("div",{className:"conv-dropdown-header",children:"Select a conversation"}),(0,e.jsxs)("div",{className:"conv-dropdown-list",children:[l&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsx)("div",{className:"conv-section-label",children:"Current"}),(0,e.jsx)("button",{className:"conv-item active",onClick:()=>{-1!==l.index&&c(l.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[(0,e.jsx)("span",{className:"conv-item-title",children:l.title||"Untitled"}),l.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(l.mtime)}),(0,e.jsx)("span",{role:"button",tabIndex:0,className:"conv-item-action",title:"Current conversation",onClick:a=>a.stopPropagation(),onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&a.stopPropagation()},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,e.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,e.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,e.jsx)("path",{d:"M9 6V4h6v2"})]})})]})})]}),n.length>0&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsxs)("div",{className:"conv-section-label",children:["Recent",m.length>0&&(0,e.jsx)("span",{className:"conv-section-count",children:m.length})]}),n.map((a,b)=>{let d=a.title||a.id.substring(0,20)+"…";return(0,e.jsx)("button",{className:"conv-item",onClick:()=>{c(a.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[a.active&&(0,e.jsx)("span",{className:"conv-item-dot active"}),(0,e.jsx)("span",{className:"conv-item-title",children:d}),a.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(a.mtime)})]})},`conv-${b}`)}),!h&&o>0&&(0,e.jsxs)("button",{className:"conv-show-more",onClick:a=>{a.stopPropagation(),i(!0)},children:["Show ",o," more…"]})]}),0===a.length&&(0,e.jsx)("div",{className:"conv-dropdown-empty",children:"No conversations found"})]})]})]})}function ai({statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}){let[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(null),z=(0,f.useRef)(null),A=(0,f.useRef)(null),B=async()=>{let a=i.length>0?i[0].path:".";w(!0),y(null);try{let b=await m(a,!0);y({text:b.message||(b.success?"CDP started!":"Failed to start CDP"),type:b.success?"success":"error"})}catch{y({text:"Failed to start CDP server",type:"error"})}finally{w(!1)}},C=async a=>{a.preventDefault();let b=r.trim();if(b&&!t){u(!0),y(null);try{let a=await n(b);y({text:a.message||(a.success?"Window opened!":"Failed to open"),type:a.success?"success":"error"}),a.success&&s("")}catch{y({text:"Failed to open window",type:"error"})}finally{u(!1)}}},D=async(a,b,d)=>{if(d.stopPropagation(),!window.confirm(`Close window "${c[a]?.title||a}"?`))return;let e=await o(a,b);y({text:e.message||(e.success?"Closed!":"Failed to close"),type:e.success?"success":"error"})};return(0,e.jsxs)("header",{className:"header",children:[(0,e.jsxs)("div",{className:"header-left",children:[(0,e.jsx)("div",{className:"logo",children:(0,e.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"url(#hg)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"hg",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#6366f1"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#a855f7"})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}),(0,e.jsxs)("div",{className:"header-brand",children:[(0,e.jsx)("div",{className:"header-title",children:(0,e.jsx)("h1",{children:"Antigravity"})}),(0,e.jsx)("div",{className:`header-subtitle status-${a}`,children:b})]})]}),(0,e.jsxs)("div",{className:"header-right",children:[(0,e.jsx)(ah,{conversations:d,activeConversation:g,onSelect:k}),(0,e.jsxs)("div",{ref:z,className:`window-selector-wrapper ${p?"open":""}`,children:[(0,e.jsxs)("button",{className:"window-selector-btn",onClick:()=>q(!p),title:"Manage Antigravity windows",children:[(0,e.jsx)("span",{className:`cdp-indicator ${h.active?"active":"inactive"}`}),(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,e.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,e.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,e.jsx)("span",{className:"window-selector-label",children:c.find(a=>a.active)?.title||"Windows"}),(0,e.jsx)("svg",{className:"chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`window-dropdown ${p?"open":""}`,children:[(0,e.jsxs)("div",{className:"wm-cdp-status",children:[(0,e.jsxs)("div",{className:"wm-cdp-info",children:[(0,e.jsx)("span",{className:`wm-cdp-dot ${h.active?"active":"inactive"}`}),(0,e.jsx)("span",{children:h.active?`CDP Active \xb7 ${h.windowCount} window${1!==h.windowCount?"s":""}`:"CDP Inactive"})]}),!h.active&&(0,e.jsxs)("button",{className:"wm-cdp-start-btn",onClick:B,disabled:v,title:"Start Antigravity with CDP",children:[v?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})}),v?"Starting...":"Start CDP"]})]}),(0,e.jsx)("div",{className:"window-dropdown-header",children:"Open Windows"}),c.map(a=>(0,e.jsxs)("div",{className:`window-item ${a.active?"active":""}`,children:[(0,e.jsxs)("button",{className:"window-item-select",onClick:()=>{j(a.index),q(!1)},children:[(0,e.jsx)("span",{className:"window-dot"}),(0,e.jsx)("span",{className:"window-item-title",children:a.title})]}),(0,e.jsx)("button",{className:"window-item-close",onClick:b=>D(a.index,a.targetId,b),title:`Close "${a.title}"`,children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},a.index)),0===c.length&&(0,e.jsx)("div",{style:{padding:"12px",color:"var(--text-muted)",fontSize:"12px"},children:"No windows detected"}),i.length>0&&(0,e.jsxs)("div",{className:"wm-recent-section",children:[(0,e.jsx)("div",{className:"wm-recent-header",children:"Recent Projects"}),i.map(a=>(0,e.jsxs)("button",{className:"wm-recent-item",onClick:async()=>{u(!0),y(null);try{let b=await n(a.path);y({text:b.message||(b.success?"Opened!":"Failed"),type:b.success?"success":"error"})}catch{y({text:"Failed to open",type:"error"})}finally{u(!1)}},disabled:t,title:a.path,children:[(0,e.jsx)("svg",{className:"wm-recent-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsxs)("div",{className:"wm-recent-info",children:[(0,e.jsx)("span",{className:"wm-recent-name",children:a.name}),(0,e.jsx)("span",{className:"wm-recent-path",children:a.path})]})]},a.path))]}),(0,e.jsxs)("div",{className:"wm-open-section",children:[(0,e.jsx)("div",{className:"wm-open-label",children:"Open New Window"}),(0,e.jsxs)("form",{className:"wm-open-form",onSubmit:C,children:[(0,e.jsx)("input",{ref:A,type:"text",className:"wm-open-input",value:r,onChange:a=>s(a.target.value),placeholder:"/path/to/project",disabled:t}),(0,e.jsx)("button",{type:"submit",className:"wm-open-btn",disabled:t||!r.trim(),title:"Open directory in Antigravity",children:t?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]}),x&&(0,e.jsx)("div",{className:`wm-action-message ${x.type}`,children:x.text})]})]}),(0,e.jsx)("button",{className:"icon-btn",onClick:l,title:"New Chat","aria-label":"New Chat",children:(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]})}let aj=[{label:"List workspace files",prompt:"What files are in the current workspace?",icon:(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})},{label:"Explain architecture",prompt:"Explain the architecture of this project",icon:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"3",y:"3",width:"7",height:"7"}),(0,e.jsx)("rect",{x:"14",y:"3",width:"7",height:"7"}),(0,e.jsx)("rect",{x:"14",y:"14",width:"7",height:"7"}),(0,e.jsx)("rect",{x:"3",y:"14",width:"7",height:"7"})]})},{label:"Debug last error",prompt:"Help me debug the most recent error",icon:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})},{label:"Review recent changes",prompt:"Review and summarize the most recent code changes",icon:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 20h9"}),(0,e.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}];function ak({onQuickPrompt:a}){return(0,e.jsxs)("div",{className:"welcome-screen",children:[(0,e.jsxs)("div",{className:"welcome-logo-wrapper",children:[(0,e.jsx)("div",{className:"welcome-logo-glow"}),(0,e.jsx)("div",{className:"welcome-logo",children:(0,e.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"url(#wg)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"wg",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#6366f1"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#a855f7"})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})})]}),(0,e.jsx)("h2",{children:"Antigravity Agent"}),(0,e.jsx)("p",{children:"Ask anything — files, terminal, search, and more, all from your browser."}),(0,e.jsx)("div",{className:"quick-prompts",children:aj.map(b=>(0,e.jsxs)("button",{className:"quick-prompt",onClick:()=>a(b.prompt),children:[(0,e.jsx)("div",{className:"quick-prompt-icon",children:b.icon}),(0,e.jsx)("span",{className:"quick-prompt-label",children:b.label})]},b.prompt))})]})}function al({content:a}){return(0,e.jsxs)("div",{className:"user-message",children:[(0,e.jsx)("div",{className:"message-content",children:a}),(0,e.jsx)("div",{className:"user-avatar","aria-hidden":"true",children:"U"})]})}let am={command:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',file:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',search:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',read:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',browser:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',mcp:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6M12 22v-6M4.93 4.93l4.24 4.24M14.83 14.83l4.24 4.24M2 12h6M22 12h-6M4.93 19.07l4.24-4.24M14.83 9.17l4.24-4.24"/><circle cx="12" cy="12" r="4"/></svg>'},an='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>';function ao(a){let b=a.toLowerCase();return"deny"===b||"block"===b||"reject"===b?"permission-btn deny":"allow"===b||"allow once"===b||"allow this conversation"===b?"permission-btn allow":"tool-footer-btn"}function ap({data:a,onAction:b}){let c,d="permission required"===(c=(a.status||"").toLowerCase())?"permission":c.startsWith("running")||c.startsWith("editing")||c.startsWith("creating")||c.startsWith("search")?"running":c.startsWith("ran")||c.startsWith("edited")||c.startsWith("created")||c.startsWith("read")||c.startsWith("viewed")||c.startsWith("analyzed")||c.startsWith("wrote")||c.startsWith("replaced")||c.startsWith("deleted")?"done":c.includes("error")||c.includes("fail")?"error":c.startsWith("mcp")?"mcp":"running",f="permission"===d,g=f?an:am[a.type]||am.file,h=async c=>{if(b)return void b(a.id,c);try{await fetch("/api/v1/chat/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:a.id,buttonText:c})})}catch{}};return f?(0,e.jsxs)("div",{className:"permission-card","data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"permission-header",children:[(0,e.jsx)("span",{className:"permission-icon",dangerouslySetInnerHTML:{__html:an}}),(0,e.jsx)("span",{className:"permission-title",children:"Permission Required"})]}),a.path?(0,e.jsxs)("div",{className:"permission-description",children:["The agent needs access to: ",(0,e.jsx)("code",{className:"permission-path",children:a.path})]}):(0,e.jsx)("div",{className:"permission-description",children:"The agent is requesting your approval to proceed."}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"permission-actions",children:a.footerButtons.map((a,b)=>(0,e.jsx)("button",{className:ao(a),onClick:()=>h(a),children:a},b))})]}):(0,e.jsxs)("div",{className:`tool-call-card ${d}`,"data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"tool-header",children:[(0,e.jsx)("span",{className:"tool-icon",dangerouslySetInnerHTML:{__html:g}}),(0,e.jsx)("span",{className:"tool-status-text",children:a.status}),a.path&&(0,e.jsx)("span",{className:"tool-path",title:a.path,children:a.path})]}),a.command&&(0,e.jsx)("div",{className:"tool-command",children:(0,e.jsx)("code",{children:a.command})}),(a.additions||a.deletions)&&(0,e.jsxs)("div",{className:"tool-file-changes",children:[a.additions&&(0,e.jsx)("span",{className:"tool-additions",children:a.additions}),a.deletions&&(0,e.jsx)("span",{className:"tool-deletions",children:a.deletions})]}),a.exitCode&&(0,e.jsx)("div",{className:"tool-exit-code",children:a.exitCode}),a.terminalOutput&&(0,e.jsx)("div",{className:"tool-terminal",children:a.terminalOutput}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"tool-footer-actions",children:a.footerButtons.map((a,b)=>(0,e.jsx)("button",{className:ao(a),onClick:()=>h(a),children:a},b))})]})}function aq({time:a}){return(0,e.jsxs)("div",{className:"thinking-block",children:[(0,e.jsx)("span",{className:"thinking-icon",children:"\uD83D\uDCAD"}),(0,e.jsx)("span",{children:a})]})}function ar(){return(0,e.jsxs)("div",{className:"typing-indicator",children:[(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"})]})}function as(){return(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"url(#ag-av)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"ag-av",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",stopColor:"#6366f1"}),(0,e.jsx)("stop",{offset:"100%",stopColor:"#a855f7"})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}function at({content:a,steps:b,isStreaming:c,onRetry:d}){return(0,e.jsxs)("div",{className:`agent-message ${c?"streaming":""}`,children:[(0,e.jsx)("div",{className:"agent-avatar","aria-hidden":"true",children:(0,e.jsx)(as,{})}),(0,e.jsxs)("div",{className:"agent-message-body",children:[(0,e.jsxs)("div",{className:"agent-steps",children:[b.map((a,b)=>{switch(a.type){case"thinking":return(0,e.jsx)(aq,{time:a.data.time},`step-${b}`);case"tool_call":return(0,e.jsx)(ap,{data:a.data},`step-${b}`);case"hitl":case"notification":default:return null;case"file_change":return(0,e.jsxs)("div",{className:"file-change-indicator",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,e.jsx)("span",{className:"file-change-name",children:a.data.fileName})]},`step-${b}`);case"error":return(0,e.jsxs)("div",{className:"error-banner",children:[(0,e.jsxs)("div",{style:{marginBottom:!c&&d?"8px":"0"},children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{display:"inline",verticalAlign:"middle",marginRight:6},children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),String(a.data.message)]}),!c&&d&&(0,e.jsx)("button",{style:{padding:"6px 14px",background:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.35)",borderRadius:8,color:"#fca5a5",fontSize:12,fontWeight:600,cursor:"pointer"},onClick:d,children:"Try Again"})]},`step-${b}`)}}),c&&(0,e.jsx)(ar,{})]}),a&&(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:a}})]})]})}function au({messages:a,currentSteps:b,currentResponse:c,isStreaming:d,onRetry:f}){return(0,e.jsxs)(e.Fragment,{children:[a.map((a,b)=>"user"===a.role?(0,e.jsx)(al,{content:a.content},`msg-${b}`):(0,e.jsx)(at,{content:a.content,steps:a.steps||[],isStreaming:!1,onRetry:f},`msg-${b}`)),d&&(0,e.jsx)(at,{content:c,steps:b,isStreaming:!0,onRetry:f})]})}function av({onSend:a,onStop:b,isStreaming:c,currentMode:d,onToggleMode:g,currentAgent:h,agents:i,isLoadingAgents:j,onFetchAgents:k,onSwitchAgent:l,onToggleArtifacts:m,artifactCount:n,artifactPanelOpen:o,onToggleChanges:p,changesCount:q,changesPanelOpen:r,onToggleGit:s,gitChangedCount:t,gitPanelOpen:u,onToggleWorkspace:v,workspacePanelOpen:w}){let[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),B=(0,f.useRef)(null),C=(0,f.useRef)(null),D=h?h.replace(/^(Claude\s+|Google\s+|OpenAI\s+)/i,"").substring(0,20):"Agent";return(0,e.jsxs)("footer",{className:"input-area",children:[(0,e.jsxs)("div",{className:"input-toolbar",children:[(0,e.jsxs)("div",{ref:C,className:"agent-selector-wrapper",children:[(0,e.jsxs)("button",{className:"agent-selector-btn",onClick:()=>{z||k(),A(!z)},title:h?`Agent: ${h} — Click to switch`:"Select AI agent","aria-label":`Switch agent (currently ${h||"unknown"})`,type:"button",children:[(0,e.jsx)("span",{className:"agent-icon",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 2a4 4 0 0 1 4 4v2a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4z"}),(0,e.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-3-3.87"}),(0,e.jsx)("path",{d:"M4 21v-2a4 4 0 0 1 3-3.87"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"1"}),(0,e.jsx)("path",{d:"M9 17h6"})]})}),(0,e.jsx)("span",{className:"agent-label",children:D}),(0,e.jsx)("svg",{className:`agent-chevron ${z?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`agent-dropdown ${z?"open":""}`,children:[(0,e.jsx)("div",{className:"agent-dropdown-header",children:"Select Agent"}),j?(0,e.jsxs)("div",{className:"agent-dropdown-loading",children:[(0,e.jsx)("span",{className:"wm-spinner"}),(0,e.jsx)("span",{children:"Loading agents..."})]}):0===i.length?(0,e.jsx)("div",{className:"agent-dropdown-empty",children:"No agents detected. Make sure the IDE has a workbench open."}):(0,e.jsx)("div",{className:"agent-dropdown-list",children:i.map((a,b)=>(0,e.jsxs)("button",{className:`agent-option ${a.active?"active":""} ${h===a.name?"current":""}`,onClick:()=>{l(a.name),A(!1)},type:"button",children:[(0,e.jsx)("span",{className:"agent-option-name",children:a.name}),a.description&&(0,e.jsx)("span",{className:"agent-option-desc",children:a.description}),(a.active||h===a.name)&&(0,e.jsx)("svg",{className:"agent-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})})]},b))})]})]}),(0,e.jsxs)("button",{className:`mode-toggle ${d}`,onClick:g,title:`Mode: ${"planning"===d?"Planning":"Fast"} — Click to switch`,"aria-label":`Switch mode (currently ${d})`,type:"button",children:[(0,e.jsx)("span",{className:"mode-icon",children:"planning"===d?(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,e.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,e.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}):(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})}),(0,e.jsx)("span",{className:"mode-label",children:"planning"===d?"Plan":"Fast"})]}),(0,e.jsxs)("button",{className:`artifact-toggle-btn ${o?"active":""}`,onClick:m,title:`Artifacts${n>0?` (${n})`:""}`,"aria-label":"Toggle artifacts panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,e.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,e.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),n>0&&(0,e.jsx)("span",{className:"artifact-badge",children:n})]}),(0,e.jsxs)("button",{className:`changes-toggle-btn ${r?"active":""}`,onClick:p,title:`Changes${q>0?` (${q})`:""}`,"aria-label":"Toggle changes panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 20h9"}),(0,e.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),q>0&&(0,e.jsx)("span",{className:"changes-badge",children:q})]}),(0,e.jsxs)("button",{className:`git-toggle-btn ${u?"active":""}`,onClick:s,title:`Git${t>0?` (${t} changed)`:""}`,"aria-label":"Toggle git panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),t>0&&(0,e.jsx)("span",{className:"git-badge",children:t})]}),(0,e.jsx)("button",{className:`workspace-toggle-btn ${w?"active":""}`,onClick:v,title:"Working Directory","aria-label":"Toggle working directory panel",type:"button",children:(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})})]}),(0,e.jsxs)("div",{className:"input-wrapper",children:[(0,e.jsx)("textarea",{ref:B,value:x,onChange:a=>{y(a.target.value);let b=a.target;b.style.height="auto",b.style.height=Math.min(b.scrollHeight,150)+"px"},onKeyDown:d=>{if("Escape"===d.key&&c){d.preventDefault(),b();return}"Enter"===d.key&&(d.shiftKey||d.ctrlKey||d.metaKey)&&(d.preventDefault(),x.trim()?(a(x),y(""),B.current&&(B.current.style.height="auto")):c&&b())},placeholder:"Ask the Antigravity agent...",rows:1,"aria-label":"Chat message input",enterKeyHint:"enter",autoComplete:"off"}),(0,e.jsx)("button",{className:`send-btn${c&&x.trim()?" send-btn--interrupt":c?" send-btn--stop":""}`,onClick:()=>{x.trim()?(a(x),y(""),B.current&&(B.current.style.height="auto")):c&&b()},disabled:!c&&!x.trim(),"aria-label":c&&x.trim()?"Interrupt and send new message":c?"Stop generation":"Send message",title:c&&x.trim()?"Interrupt agent and send new message":c?"Stop generation (Esc)":"Send message",children:c&&!x.trim()?(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})}):(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,e.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(0,e.jsx)("div",{className:"input-hint",children:(0,e.jsx)("span",{children:"Shift+Enter to send \xb7 Enter for new line \xb7 Ctrl+N for new chat \xb7 Esc to stop"})})]})}function aw({open:a,onClose:b,activeConversation:c,files:d}){let[g,h]=(0,f.useState)(null),[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)(!1),[m,n]=(0,f.useState)("text/plain"),o=async a=>{l(!0),h(a);try{let b=await fetch(`/api/v1/artifacts/active/${encodeURIComponent(a)}`);if(!b.ok){let a=await b.json().catch(()=>({error:"Unknown error"}));j(`Error: ${a.error||b.statusText}`);return}let c=b.headers.get("Content-Type")||"text/plain";if(n(c),c.includes("image")){let a=await b.arrayBuffer(),c=new Uint8Array(a),d=c.byteLength;for(let a=0;a<d;a++)String.fromCharCode(c[a]);j("")}else{let a=await b.text();j(a)}}catch(a){j(`Error loading file: ${a.message}`)}finally{l(!1)}};return(0,e.jsxs)("div",{className:`artifact-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"artifact-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Artifacts"})]}),c?(0,e.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:[(0,e.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.title||"Untitled"}),(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})]}):d.length>0?(0,e.jsx)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})}):(0,e.jsx)("div",{style:{padding:"24px 16px",textAlign:"center",color:"var(--text-muted)",fontSize:"13px"},children:"No active conversation"}),g?(0,e.jsxs)("div",{className:"artifact-viewer",children:[(0,e.jsxs)("div",{className:"artifact-viewer-header",children:[(0,e.jsx)("button",{className:"artifact-back-btn",onClick:()=>{h(null),j("")},children:"← Back"}),(0,e.jsx)("span",{className:"artifact-viewer-title",children:g})]}),(0,e.jsx)("div",{className:"artifact-viewer-body",children:k?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"Loading..."}):m.includes("markdown")?(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:i.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.*$)/gim,"<li>$1</li>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br/>")}}):m.includes("image")?(0,e.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"20px"},children:(0,e.jsx)("img",{src:`data:${m};base64,${i}`,style:{maxWidth:"100%",borderRadius:"8px",border:"1px solid var(--border-subtle)"},alt:g})}):(0,e.jsx)("pre",{style:{margin:0,fontSize:"12px",lineHeight:1.6,color:"var(--text-secondary)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:i})})]}):(0,e.jsxs)("div",{className:"artifact-file-list",children:[d.map(a=>{var b;let c;return(0,e.jsxs)("button",{className:"artifact-file-item ",onClick:()=>{o(a.name)},disabled:!1,title:`Open ${a.name}`,children:[(0,e.jsx)("span",{className:"artifact-file-icon",children:(c=a.name).endsWith(".md")?"\uD83D\uDCC4":c.endsWith(".json")?"\uD83D\uDCCB":c.endsWith(".ts")||c.endsWith(".tsx")?"\uD83D\uDCD8":c.endsWith(".css")?"\uD83C\uDFA8":c.endsWith(".js")||c.endsWith(".jsx")?"\uD83D\uDCDC":"\uD83D\uDCC4"}),(0,e.jsxs)("div",{style:{flex:1,overflow:"hidden"},children:[(0,e.jsx)("div",{className:"artifact-file-name",children:a.name}),(0,e.jsx)("div",{style:{fontSize:"10px",color:"var(--text-muted)"},children:(a=>{if(a.includes("T")||a.includes("-")){let b=new Date(a);if(!isNaN(b.getTime()))return b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})+" \xb7 "+b.toLocaleDateString()}return a})(a.mtime)})]}),(0,e.jsx)("span",{className:"artifact-file-size",children:(b=a.size)<=0?"":b<1024?`${b}B`:b<1048576?`${(b/1024).toFixed(1)}KB`:`${(b/1048576).toFixed(1)}MB`})]},a.name)}),0===d.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No artifacts in this conversation"})]})]})}function ax({open:a,onClose:b,changes:c,onAcceptAll:d,onRejectAll:g,isAccepting:h,isRejecting:i}){let[j,k]=(0,f.useState)(null),[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(null),t=c.reduce((a,b)=>a+b.additions,0),u=c.reduce((a,b)=>a+b.deletions,0),v=async a=>{o(!0),k(a.filepath),q(a.filename),m([]);try{let b=await fetch(`/api/v1/changes/diff?filepath=${encodeURIComponent(a.filepath)}`),c=await b.json();c.diff?m(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(c.diff)):m([{type:"meta",content:c.message||"No diff available"}])}catch(a){m([{type:"meta",content:`Error: ${a.message}`}])}finally{o(!1)}},w=async()=>{s(null);let a=await d();a?.success?s({type:"success",text:"All changes accepted ✓"}):s({type:"error",text:a?.error||"Failed to accept changes"}),setTimeout(()=>s(null),3e3)},x=async()=>{s(null);let a=await g();a?.success?s({type:"success",text:"All changes rejected ✓"}):s({type:"error",text:a?.error||"Failed to reject changes"}),setTimeout(()=>s(null),3e3)},y=h||i;return(0,e.jsxs)("div",{className:`changes-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"changes-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Changes Overview"})]}),j?(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{k(null),m([]),q("")},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:p}),(0,e.jsx)("span",{className:"diff-viewer-path",children:j})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:n?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px",fontStyle:"italic"},children:"Loading diff..."}):0===l.length?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"No changes found"}):(0,e.jsx)("div",{className:"diff-lines",children:l.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"changes-summary",children:[(0,e.jsxs)("span",{className:"changes-count",children:[c.length," file",1!==c.length?"s":""," changed"]}),(0,e.jsxs)("div",{className:"changes-stats",children:[t>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",t]}),u>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",u]})]})]}),c.length>0&&(0,e.jsxs)("div",{className:"changes-action-bar",children:[(0,e.jsx)("button",{className:"changes-reject-all-btn",onClick:x,disabled:y,title:"Reject all file changes",children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Rejecting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),"Reject All"]})}),(0,e.jsx)("button",{className:"changes-accept-all-btn",onClick:w,disabled:y,title:"Accept all file changes",children:h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Accepting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Accept All"]})})]}),r&&(0,e.jsx)("div",{className:`changes-action-message changes-action-message--${r.type}`,children:r.text}),(0,e.jsxs)("div",{className:"changes-file-list",children:[c.map(a=>{var b;return(0,e.jsxs)("button",{className:"changes-file-item",onClick:()=>v(a),title:`View diff: ${a.filepath}`,children:[(0,e.jsx)("span",{className:"changes-file-icon",children:(b=a.filename).endsWith(".tsx")||b.endsWith(".jsx")?"⚛️":b.endsWith(".ts")||b.endsWith(".js")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":"\uD83D\uDCDD"}),(0,e.jsxs)("div",{className:"changes-file-info",children:[(0,e.jsx)("div",{className:"changes-file-name",children:a.filename}),(0,e.jsx)("div",{className:"changes-file-path",children:a.filepath})]}),(0,e.jsxs)("div",{className:"changes-file-diff",children:[a.additions>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",a.additions]}),a.deletions>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",a.deletions]})]})]},a.filepath)}),0===c.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No file changes in this conversation"})]})]})]})}let ay={modified:{label:"M",color:"#fbbf24"},added:{label:"A",color:"#34d399"},deleted:{label:"D",color:"#ef4444"},renamed:{label:"R",color:"#a78bfa"},copied:{label:"C",color:"#60a5fa"},untracked:{label:"U",color:"#94a3b8"},unmerged:{label:"!",color:"#f97316"}};function az({status:a}){let{label:b,color:c}=ay[a]||{label:"?",color:"#94a3b8"};return(0,e.jsx)("span",{className:"git-file-status-badge",style:{color:c,borderColor:`${c}44`,background:`${c}18`},children:b})}function aA({open:a,onClose:b,gitStatus:c,onRefresh:d}){let[g,h]=(0,f.useState)("changes"),[i,j]=(0,f.useState)(null),[k,l]=(0,f.useState)([]),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),[s,t]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(null),y=(a,b)=>{x({text:a,type:b}),setTimeout(()=>x(null),4e3)},z=async()=>{if(q.trim()&&!s){t(!0);try{let a=await fetch("/api/v1/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:q.trim(),stageAll:!0})}),b=await a.json();b.success?(r(""),y("Committed successfully","success"),d()):y(b.error||"Commit failed","error")}catch(a){y(`Error: ${a.message}`,"error")}finally{t(!1)}}},A=async()=>{if(!u){v(!0);try{let a=await fetch("/api/v1/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),b=await a.json();b.success?(y("Pushed to origin","success"),d()):y(b.error||"Push failed","error")}catch(a){y(`Error: ${a.message}`,"error")}finally{v(!1)}}},B=async(a,b)=>{n(!0),j({path:a.path,staged:b,untracked:"untracked"===a.status}),l([]);try{let c=new URLSearchParams({filepath:a.path,staged:String(b),untracked:String("untracked"===a.status)}),d=await fetch(`/api/v1/git/diff?${c}`),e=await d.json();e.diff?l(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(e.diff)):l([{type:"meta",content:e.error||"No diff available"}])}catch(a){l([{type:"meta",content:`Error: ${a.message}`}])}finally{n(!1)}},C=async()=>{p(!0),d(),await new Promise(a=>setTimeout(a,600)),p(!1)},D=a=>a.endsWith(".tsx")||a.endsWith(".jsx")?"⚛️":a.endsWith(".ts")||a.endsWith(".js")?"\uD83D\uDCD8":a.endsWith(".css")||a.endsWith(".scss")?"\uD83C\uDFA8":a.endsWith(".md")?"\uD83D\uDCC4":a.endsWith(".json")?"\uD83D\uDCCB":a.endsWith(".py")?"\uD83D\uDC0D":a.endsWith(".go")?"\uD83D\uDD39":a.endsWith(".sh")?"⚙️":"\uD83D\uDCDD",E=a=>{let b=a.split("/");return b.length<=2?a:`…/${b.slice(-2).join("/")}`},F=c?(c.staged?.length||0)+(c.unstaged?.length||0)+(c.untracked?.length||0):0;return(0,e.jsxs)("div",{className:`git-panel ${a?"open":""}`,role:"complementary","aria-label":"Git Panel",children:[(0,e.jsxs)("div",{className:"git-panel-header",children:[(0,e.jsxs)("div",{className:"git-panel-title-row",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close git panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsxs)("div",{className:"git-panel-title",children:[(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),(0,e.jsx)("span",{children:"Git"})]}),(0,e.jsx)("button",{className:`git-refresh-btn ${o?"spinning":""}`,onClick:C,title:"Refresh git status",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,e.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),c?.isGitRepo&&(0,e.jsxs)("div",{className:"git-branch-bar",children:[(0,e.jsxs)("div",{className:"git-branch-badge",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,e.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,e.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,e.jsx)("span",{children:c.branch})]}),c.remoteBranch&&(0,e.jsxs)("div",{className:"git-sync-badges",children:[c.ahead>0&&(0,e.jsxs)("span",{className:"git-sync-badge git-sync-badge--ahead",children:["↑",c.ahead]}),c.behind>0&&(0,e.jsxs)("span",{className:"git-sync-badge git-sync-badge--behind",children:["↓",c.behind]}),0===c.ahead&&0===c.behind&&(0,e.jsx)("span",{className:"git-sync-badge git-sync-badge--synced",children:"✓ synced"})]}),c.stashCount>0&&(0,e.jsxs)("span",{className:"git-stash-badge",title:`${c.stashCount} stash entries`,children:["\uD83D\uDCE6 ",c.stashCount]})]})]}),c?.isGitRepo&&!i&&(0,e.jsxs)("div",{className:"git-commit-bar",children:[(0,e.jsx)("div",{className:"git-commit-input-row",children:(0,e.jsx)("textarea",{className:"git-commit-textarea",placeholder:"Commit message…",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.ctrlKey||a.metaKey)&&(a.preventDefault(),z())},rows:2,disabled:s})}),(0,e.jsxs)("div",{className:"git-commit-actions",children:[(0,e.jsxs)("button",{className:"git-commit-btn",onClick:z,disabled:!q.trim()||s,title:"Stage all & commit (Ctrl+Enter)",children:[s?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,e.jsx)("path",{d:"M12 2v7M12 15v7M2 12h7M15 12h7"})]}),s?"Committing…":"Commit All"]}),(0,e.jsxs)("button",{className:"git-push-btn",onClick:A,disabled:u||!c?.branch,title:c?.ahead>0?`Push ${c.ahead} commit(s)`:"Push to remote",children:[u?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,e.jsx)("polyline",{points:"5 12 12 5 19 12"})]}),u?"Pushing…":c?.ahead>0?`Push (${c.ahead})`:"Push"]})]}),w&&(0,e.jsxs)("div",{className:`git-action-feedback git-action-feedback--${w.type}`,children:["success"===w.type?(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("span",{children:w.text})]})]}),c&&!c.isGitRepo&&(0,e.jsxs)("div",{className:"git-not-repo",children:[(0,e.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),(0,e.jsx)("p",{children:"No git repository detected"}),(0,e.jsx)("span",{children:"Open a git project in the IDE"})]}),!c&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading git status…"})]}),i&&c?.isGitRepo&&(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{j(null),l([])},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:i.path.split("/").pop()}),(0,e.jsx)("span",{className:"diff-viewer-path",title:i.path,children:E(i.path)}),(0,e.jsx)("span",{className:`diff-viewer-badge ${i.staged?"staged":"unstaged"}`,children:i.staged?"staged":i.untracked?"untracked":"unstaged"})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:m?(0,e.jsx)("div",{className:"diff-loading",children:"Loading diff…"}):0===k.length?(0,e.jsx)("div",{className:"diff-empty",children:"No diff available"}):(0,e.jsx)("div",{className:"diff-lines",children:k.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}),c?.isGitRepo&&!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"git-summary-bar",children:[(0,e.jsxs)("span",{className:"git-summary-stat",children:[(0,e.jsx)("span",{className:"git-summary-dot git-summary-dot--changed"}),F," changed"]}),c.staged.length>0&&(0,e.jsxs)("span",{className:"git-summary-stat",children:[(0,e.jsx)("span",{className:"git-summary-dot git-summary-dot--staged"}),c.staged.length," staged"]})]}),(0,e.jsxs)("div",{className:"git-tabs",children:[(0,e.jsxs)("button",{className:`git-tab ${"changes"===g?"active":""}`,onClick:()=>h("changes"),children:["Changes",F>0&&(0,e.jsx)("span",{className:"git-tab-badge",children:F})]}),(0,e.jsxs)("button",{className:`git-tab ${"commits"===g?"active":""}`,onClick:()=>h("commits"),children:["Commits",c.commits.length>0&&(0,e.jsx)("span",{className:"git-tab-badge git-tab-badge--neutral",children:c.commits.length})]})]}),"changes"===g&&(0,e.jsxs)("div",{className:"git-file-list",children:[c.staged.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--staged"}),(0,e.jsx)("span",{children:"Staged Changes"}),(0,e.jsx)("span",{className:"git-section-count",children:c.staged.length})]}),c.staged.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item git-file-item--staged",onClick:()=>B(a,!0),title:`View staged diff: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(az,{status:a.status})]},`staged-${b}`))]}),c.unstaged.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--unstaged"}),(0,e.jsx)("span",{children:"Changes"}),(0,e.jsx)("span",{className:"git-section-count",children:c.unstaged.length})]}),c.unstaged.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item",onClick:()=>B(a,!1),title:`View diff: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(az,{status:a.status})]},`unstaged-${b}`))]}),c.untracked.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--untracked"}),(0,e.jsx)("span",{children:"Untracked"}),(0,e.jsx)("span",{className:"git-section-count",children:c.untracked.length})]}),c.untracked.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item git-file-item--untracked",onClick:()=>B(a,!1),title:`View file: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(az,{status:"untracked"})]},`untracked-${b}`))]}),0===F&&(0,e.jsxs)("div",{className:"git-empty",children:[(0,e.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,e.jsx)("p",{children:"Working tree clean"}),(0,e.jsx)("span",{children:"No uncommitted changes"})]})]}),"commits"===g&&(0,e.jsx)("div",{className:"git-commit-list",children:0===c.commits.length?(0,e.jsx)("div",{className:"git-empty",children:(0,e.jsx)("p",{children:"No commits yet"})}):c.commits.map((a,b)=>(0,e.jsxs)("div",{className:"git-commit-item",children:[(0,e.jsx)("div",{className:"git-commit-hash",children:a.shortHash}),(0,e.jsxs)("div",{className:"git-commit-info",children:[(0,e.jsx)("div",{className:"git-commit-subject",children:a.subject}),(0,e.jsxs)("div",{className:"git-commit-meta",children:[(0,e.jsx)("span",{className:"git-commit-author",children:a.author}),(0,e.jsx)("span",{className:"git-commit-dot",children:"\xb7"}),(0,e.jsx)("span",{className:"git-commit-date",children:a.relativeDate})]})]})]},b))})]})]})}var aB=c(66);c(1230);let aC="[A-Za-z$_][0-9A-Za-z$_]*",aD=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],aE=["true","false","null","undefined","NaN","Infinity"],aF=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],aG=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aH=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],aJ=[].concat(aH,aF,aG),aK="[A-Za-z$_][0-9A-Za-z$_]*",aL=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],aM=["true","false","null","undefined","NaN","Infinity"],aN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],aO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aP=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aQ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],aR=[].concat(aP,aN,aO),aS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],aT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),aU=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),aV=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),aW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();aB.registerLanguage("javascript",function(a){var b;let c=a.regex,d=/<[A-Za-z0-9\\._:-]+/,e=/\/[A-Za-z0-9\\._:-]+>|\/>/,f={$pattern:aC,keyword:aD,literal:aE,built_in:aJ,"variable.language":aI},g="[0-9](_?[0-9])*",h=`\\.(${g})`,i="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",j={className:"number",variants:[{begin:`(\\b(${i})((${h})|\\.)?|(${h}))[eE][+-]?(${g})\\b`},{begin:`\\b(${i})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},l={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,k],subLanguage:"css"}},n={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},o={className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE,k]},p={className:"comment",variants:[a.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:aC+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),a.C_BLOCK_COMMENT_MODE,a.C_LINE_COMMENT_MODE]},q=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,l,m,n,o,{match:/\$\d+/},j];k.contains=q.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(q)});let r=[].concat(p,k.contains),s=r.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(r)}]),t={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:s},u={variants:[{match:[/class/,/\s+/,aC,/\s+/,/extends/,/\s+/,c.concat(aC,"(",c.concat(/\./,aC),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,aC],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:c.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...aF,...aG]}},w={match:c.concat(/\b/,(b=[...aH,"super","import"].map(a=>`${a}\\s*\\(`),c.concat("(?!",b.join("|"),")")),aC,c.lookahead(/\s*\(/)),className:"title.function",relevance:0},x={begin:c.concat(/\./,c.lookahead(c.concat(aC,/(?![0-9A-Za-z$_(])/))),end:aC,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+a.UNDERSCORE_IDENT_RE+")\\s*=>",z={match:[/const|var|let/,/\s+/,aC,/\s*/,/=\s*/,/(async\s*)?/,c.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[t]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:s,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[a.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,l,m,n,o,p,{match:/\$\d+/},j,v,{scope:"attr",match:aC+c.lookahead(":"),relevance:0},z,{begin:"("+a.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,a.REGEXP_MODE,{className:"function",begin:y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:a.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:s}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:d,"on:begin":(a,b)=>{let c,d=a[0].length+a.index,e=a.input[d];if("<"===e||","===e)return void b.ignoreMatch();">"!==e||((a,{after:b})=>{let c="</"+a[0].slice(1);return -1!==a.input.indexOf(c,b)})(a,{after:d})||b.ignoreMatch();let f=a.input.substring(d);if((c=f.match(/^\s*=/))||(c=f.match(/^\s+extends\s+/))&&0===c.index)return void b.ignoreMatch()},end:e}],subLanguage:"xml",contains:[{begin:d,end:e,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,aC,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[t],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+a.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[t,a.inherit(a.TITLE_MODE,{begin:aC,className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+aC,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[t]},w,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},u,{match:[/get|set/,/\s+/,aC,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},t]},{match:/\$[(.]/}]}}),aB.registerLanguage("typescript",function(a){var b;let c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a.regex,C=(c=a.regex,d=/<[A-Za-z0-9\\._:-]+/,e=/\/[A-Za-z0-9\\._:-]+>|\/>/,f=(a,b)=>{let c,d=a[0].length+a.index,e=a.input[d];if("<"===e||","===e)return void b.ignoreMatch();">"!==e||((a,{after:b})=>{let c="</"+a[0].slice(1);return -1!==a.input.indexOf(c,b)})(a,{after:d})||b.ignoreMatch();let f=a.input.substring(d);if((c=f.match(/^\s*=/))||(c=f.match(/^\s+extends\s+/))&&0===c.index)return void b.ignoreMatch()},g={$pattern:aK,keyword:aL,literal:aM,built_in:aR,"variable.language":aQ},h="[0-9](_?[0-9])*",i=`\\.(${h})`,j="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${j})((${i})|\\.)?|(${i}))[eE][+-]?(${h})\\b`},{begin:`\\b(${j})\\b((${i})\\b|\\.)?|(${i})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:g,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},n={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,l],subLanguage:"css"}},o={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,l],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE,l]},q={className:"comment",variants:[a.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:aK+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),a.C_BLOCK_COMMENT_MODE,a.C_LINE_COMMENT_MODE]},l.contains=(r=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,m,n,o,p,{match:/\$\d+/},k]).concat({begin:/\{/,end:/\}/,keywords:g,contains:["self"].concat(r)}),t=(s=[].concat(q,l.contains)).concat([{begin:/(\s*)\(/,end:/\)/,keywords:g,contains:["self"].concat(s)}]),u={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:g,contains:t},v={variants:[{match:[/class/,/\s+/,aK,/\s+/,/extends/,/\s+/,c.concat(aK,"(",c.concat(/\./,aK),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,aK],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:c.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...aN,...aO]}},x={match:c.concat(/\b/,(b=[...aP,"super","import"].map(a=>`${a}\\s*\\(`),c.concat("(?!",b.join("|"),")")),aK,c.lookahead(/\s*\(/)),className:"title.function",relevance:0},y={begin:c.concat(/\./,c.lookahead(c.concat(aK,/(?![0-9A-Za-z$_(])/))),end:aK,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+a.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,aK,/\s*/,/=\s*/,/(async\s*)?/,c.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[u]},{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{PARAMS_CONTAINS:t,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[a.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,m,n,o,p,q,{match:/\$\d+/},k,w,{scope:"attr",match:aK+c.lookahead(":"),relevance:0},A,{begin:"("+a.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[q,a.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:a.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:g,contains:t}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:d,"on:begin":f,end:e}],subLanguage:"xml",contains:[{begin:d,end:e,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,aK,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[u],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+a.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[u,a.inherit(a.TITLE_MODE,{begin:aK,className:"title.function"})]},{match:/\.\.\./,relevance:0},y,{match:"\\$"+aK,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[u]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,{match:[/get|set/,/\s+/,aK,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},u]},{match:/\$[(.]/}]}),D=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],E={begin:[/namespace/,/\s+/,a.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},F={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:D},contains:[C.exports.CLASS_REFERENCE]},G={$pattern:aK,keyword:aL.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:aM,built_in:aR.concat(D),"variable.language":aQ},H={className:"meta",begin:"@"+aK},I=(a,b,c)=>{let d=a.contains.findIndex(a=>a.label===b);if(-1===d)throw Error("can not find mode to replace");a.contains.splice(d,1,c)};Object.assign(C.keywords,G),C.exports.PARAMS_CONTAINS.push(H);let J=C.contains.find(a=>"attr"===a.scope),K=Object.assign({},J,{match:B.concat(aK,B.lookahead(/\s*\?:/))});return C.exports.PARAMS_CONTAINS.push([C.exports.CLASS_REFERENCE,J,K]),C.contains=C.contains.concat([H,E,F,K]),I(C,"shebang",a.SHEBANG()),I(C,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),C.contains.find(a=>"func.def"===a.label).relevance=0,Object.assign(C,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),C}),aB.registerLanguage("xml",function(a){let b=a.regex,c=b.concat(/[\p{L}_]/u,b.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),d={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},e={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},f=a.inherit(e,{begin:/\(/,end:/\)/}),g=a.inherit(a.APOS_STRING_MODE,{className:"string"}),h=a.inherit(a.QUOTE_STRING_MODE,{className:"string"}),i={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[d]},{begin:/'/,end:/'/,contains:[d]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[e,h,g,f,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[e,f,h,g]}]}]},a.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},d,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[i],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[i],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:b.concat(/</,b.lookahead(b.concat(c,b.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:c,relevance:0,starts:i}]},{className:"tag",begin:b.concat(/<\//,b.lookahead(b.concat(c,/>/))),contains:[{className:"name",begin:c,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}),aB.registerLanguage("css",function(a){let b=a.regex,c={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},d=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[c.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},c.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},c.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+aU.join("|")+")"},{begin:":(:)?("+aV.join("|")+")"}]},c.CSS_VARIABLE,{className:"attribute",begin:"\\b("+aW.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[c.BLOCK_COMMENT,c.HEXCOLOR,c.IMPORTANT,c.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},c.FUNCTION_DISPATCH]},{begin:b.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:aT.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,c.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+aS.join("|")+")\\b"}]}}),aB.registerLanguage("json",function(a){let b=["true","false","null"],c={scope:"literal",beginKeywords:b.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:b},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},a.QUOTE_STRING_MODE,c,a.C_NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}),aB.registerLanguage("markdown",function(a){let b=a.regex,c={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:b.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},e={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=a.inherit(e,{contains:[]}),h=a.inherit(f,{contains:[]});e.contains.push(h),f.contains.push(g);let i=[c,d];return[e,f,g,h].forEach(a=>{a.contains=a.contains.concat(i)}),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:i=i.concat(e,f)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:i}]}]},c,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},e,f,{className:"quote",begin:"^>\\s+",contains:i,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},d,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}),aB.registerLanguage("python",function(a){let b=a.regex,c=/[\p{XID_Start}_]\p{XID_Continue}*/u,d=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],e={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:d,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:e,illegal:/#/},h={begin:/\{\{/,relevance:0},i={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[a.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[a.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[a.BACKSLASH_ESCAPE,f,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[a.BACKSLASH_ESCAPE,f,h,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[a.BACKSLASH_ESCAPE,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,h,g]},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},j="[0-9](_?[0-9])*",k=`(\\b(${j}))?\\.(${j})|\\b(${j})\\.`,l=`\\b|${d.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${j})|(${k}))[eE][+-]?(${j})[jJ]?(?=${l})`},{begin:`(${k})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${l})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${l})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${l})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${l})`},{begin:`\\b(${j})[jJ](?=${l})`}]},n={className:"comment",begin:b.lookahead(/# type:/),end:/$/,keywords:e,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},o={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:e,contains:["self",f,m,i,a.HASH_COMMENT_MODE]}]};return g.contains=[i,m,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:e,illegal:/(<\/|\?)|=>/,contains:[f,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},i,n,a.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,c],scope:{1:"keyword",3:"title.function"},contains:[o]},{variants:[{match:[/\bclass/,/\s+/,c,/\s*/,/\(\s*/,c,/\s*\)/]},{match:[/\bclass/,/\s+/,c]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,o,i]}]}}),aB.registerLanguage("bash",function(a){let b=a.regex,c={};Object.assign(c,{className:"variable",variants:[{begin:b.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[c]}]}]});let d={className:"subst",begin:/\$\(/,end:/\)/,contains:[a.BACKSLASH_ESCAPE]},e=a.inherit(a.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),f={begin:/<<-?\s*(?=\w+)/,starts:{contains:[a.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},g={className:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,c,d]};d.contains.push(g);let h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},a.NUMBER_MODE,c]},i=a.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),j={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[a.inherit(a.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[i,a.SHEBANG(),j,h,e,f,{match:/(\/[a-z._-]+)+/},g,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},c]}}),aB.registerLanguage("yaml",function(a){let b="true false yes no null",c="[\\w#;/?:@&=+$,.~*'()[\\]]+",d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[a.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},e=a.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:b,relevance:0},g=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+c},{className:"type",begin:"!<"+c+">"},{className:"type",begin:"!"+c},{className:"type",begin:"!!"+c},{className:"meta",begin:"&"+a.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+a.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},a.HASH_COMMENT_MODE,{beginKeywords:b,keywords:{literal:b}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:a.C_NUMBER_RE+"\\b",relevance:0},{begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},{begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d],h=[...g];return h.pop(),h.push(e),f.contains=h,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}),aB.registerLanguage("sql",function(a){let b=a.regex,c=a.COMMENT("--","$"),d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],e=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(a=>!d.includes(a)),f={match:b.concat(/\b/,b.either(...d),/\s*\(/),relevance:0,keywords:{built_in:d}};function g(a){return b.concat(/\b/,b.either(...a.map(a=>a.replace(/\s+/,"\\s+"))),/\b/)}let h={scope:"keyword",match:g(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(a,{exceptions:b,when:c}={}){return b=b||[],a.map(a=>a.match(/\|\d+$/)||b.includes(a)?a:c(a)?`${a}|0`:a)}(e,{when:a=>a.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:g(["double precision","large object","with timezone","without timezone"])},h,f,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},a.C_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,c,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}),aB.registerLanguage("go",function(a){let b={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:b,illegal:"</",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"string",variants:[a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[a.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:b,illegal:/["']/}]}]}}),aB.registerLanguage("rust",function(a){let b=a.regex,c=/(r#)?/,d=b.concat(c,a.UNDERSCORE_IDENT_RE),e=b.concat(c,a.IDENT_RE),f={className:"title.function.invoke",relevance:0,begin:b.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e,b.lookahead(/\s*\(/))},g="([ui](8|16|32|64|128|size)|f(32|64))?",h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],i=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:a.IDENT_RE+"!?",type:i,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:h},illegal:"</",contains:[a.C_LINE_COMMENT_MODE,a.COMMENT("/\\*","\\*/",{contains:["self"]}),a.inherit(a.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+g},{begin:"\\b0o([0-7_]+)"+g},{begin:"\\b0x([A-Fa-f0-9_]+)"+g},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+g}],relevance:0},{begin:[/fn/,/\s+/,d],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,d],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,d,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,d],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,d],className:{1:"keyword",3:"title.class"}},{begin:a.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:i}},{className:"punctuation",begin:"->"},f]}}),aB.registerLanguage("diff",function(a){let b=a.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:b.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:b.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}});let aX={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rb:"ruby",rs:"rust",go:"go",css:"css",scss:"css",sass:"css",html:"xml",htm:"xml",svg:"xml",xml:"xml",json:"json",yaml:"yaml",yml:"yaml",toml:"yaml",md:"markdown",mdx:"markdown",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",diff:"diff",patch:"diff",typescript:"typescript",javascript:"javascript",python:"python"},aY={ts:"\uD83D\uDCD8",tsx:"⚛️",js:"\uD83D\uDCDC",jsx:"⚛️",json:"\uD83D\uDCCB",md:"\uD83D\uDCC4",mdx:"\uD83D\uDCC4",css:"\uD83C\uDFA8",scss:"\uD83C\uDFA8",sass:"\uD83C\uDFA8",py:"\uD83D\uDC0D",go:"\uD83D\uDD39",rs:"\uD83E\uDD80",sh:"⚙️",bash:"⚙️",zsh:"⚙️",sql:"\uD83D\uDDC4️",graphql:"\uD83D\uDD37",gql:"\uD83D\uDD37",yaml:"\uD83D\uDCD0",yml:"\uD83D\uDCD0",toml:"\uD83D\uDCD0",env:"\uD83D\uDD11",svg:"\uD83D\uDDBC️",png:"\uD83D\uDDBC️",jpg:"\uD83D\uDDBC️",jpeg:"\uD83D\uDDBC️",gif:"\uD83D\uDDBC️",webp:"\uD83D\uDDBC️",lock:"\uD83D\uDD12",gitignore:"\uD83D\uDC41️"};function aZ(a){return void 0===a?"":a<1024?`${a}B`:a<1048576?`${(a/1024).toFixed(1)}K`:`${(a/1048576).toFixed(1)}M`}function a$({node:a,depth:b,expandedPaths:c,onToggle:d,onFileOpen:g,selectedPath:h}){let i=c.has(a.path),j="dir"===a.type,k=h===a.path,l=12+14*b,m=(0,f.useCallback)(()=>{j?d(a.path):g(a)},[j,a,d,g]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{className:`workspace-tree-node ${j?"is-dir":"is-file"} ${k?"selected":""}`,style:{paddingLeft:l},onClick:m,title:j?i?"Collapse":"Expand":a.path,children:[j?(0,e.jsx)("svg",{className:`workspace-arrow ${i?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})}):(0,e.jsx)("span",{className:"workspace-arrow-spacer"}),(0,e.jsx)("span",{className:"workspace-node-icon",children:"dir"===a.type?"\uD83D\uDCC1":aY[a.ext||""]||"\uD83D\uDCDD"}),(0,e.jsx)("span",{className:"workspace-node-name",children:a.name}),!j&&void 0!==a.size&&(0,e.jsx)("span",{className:"workspace-node-size",children:aZ(a.size)}),j&&void 0!==a.children&&(0,e.jsx)("span",{className:"workspace-node-count",children:a.children.length})]}),j&&i&&a.children&&(0,e.jsx)("div",{className:"workspace-tree-children",children:0===a.children.length?(0,e.jsx)("div",{className:"workspace-empty-dir",style:{paddingLeft:l+14},children:"empty"}):a.children.map(a=>(0,e.jsx)(a$,{node:a,depth:b+1,expandedPaths:c,onToggle:d,onFileOpen:g,selectedPath:h},a.path))})]})}function a_({view:a,onClose:b,onCopyPath:c,workspacePath:d}){let[g,h]=(0,f.useState)(!1),i=(0,f.useMemo)(()=>a.content?function(a,b){let c,d,e,f=(e=aX[d=b.toLowerCase().replace(/^\./,"")])&&aB.getLanguage(e)?e:aB.getLanguage(d)?d:void 0;try{c=f?aB.highlight(a,{language:f}).value:aB.highlightAuto(a).value}catch{c=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return c.split("\n").map((a,b)=>({num:b+1,html:a}))}(a.content,a.lang||""):[],[a.content,a.lang]);return(0,e.jsxs)("div",{className:"workspace-file-viewer",children:[(0,e.jsxs)("div",{className:"workspace-viewer-header",children:[(0,e.jsxs)("button",{className:"workspace-viewer-back",onClick:b,title:"Back to file tree",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"15 18 9 12 15 6"})}),(0,e.jsx)("span",{children:"Back"})]}),(0,e.jsxs)("div",{className:"workspace-viewer-title",children:[(0,e.jsx)("span",{className:"workspace-viewer-name",children:a.name}),a.lang&&"plaintext"!==a.lang&&(0,e.jsx)("span",{className:"workspace-viewer-lang",children:a.lang})]}),(0,e.jsxs)("div",{className:"workspace-viewer-actions",children:[a.content&&(0,e.jsx)("button",{className:"workspace-viewer-action-btn",onClick:()=>{a.content&&(navigator.clipboard.writeText(a.content).catch(()=>{}),h(!0),setTimeout(()=>h(!1),2e3))},title:"Copy file content",children:g?(0,e.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,e.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),(0,e.jsx)("button",{className:"workspace-viewer-action-btn",onClick:()=>{c(a.path)},title:"Copy file path",children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,e.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]})]}),(0,e.jsxs)("div",{className:"workspace-viewer-meta",children:[(0,e.jsx)("span",{className:"workspace-viewer-path",title:`${d}/${a.path}`,children:a.path}),!a.loading&&!a.error&&a.content&&(0,e.jsxs)("span",{className:"workspace-viewer-stats",children:[a.lines," lines \xb7 ",aZ(a.size)]})]}),(0,e.jsxs)("div",{className:"workspace-viewer-body",children:[a.loading&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading…"})]}),!a.loading&&a.error&&(0,e.jsxs)("div",{className:"workspace-viewer-error",children:[(0,e.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("p",{children:a.error}),a.binary&&(0,e.jsx)("span",{children:"Binary files cannot be displayed as text."}),a.tooLarge&&(0,e.jsx)("span",{children:"Try opening the file directly in the IDE."})]}),!a.loading&&!a.error&&null!==a.content&&(0,e.jsx)("div",{className:"workspace-code-scroll",children:(0,e.jsx)("table",{className:"workspace-code-table",children:(0,e.jsx)("tbody",{children:i.map(({num:a,html:b})=>(0,e.jsxs)("tr",{className:"workspace-code-row",children:[(0,e.jsx)("td",{className:"workspace-line-num",children:a}),(0,e.jsx)("td",{className:"workspace-line-code",children:(0,e.jsx)("span",{dangerouslySetInnerHTML:{__html:b||"\xa0"}})})]},a))})})})]})]})}function a0({open:a,onClose:b,workspaceTree:c,workspaceLoading:d,onRefresh:g}){let[h,i]=(0,f.useState)(new Set),[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(null),r=(0,f.useCallback)(a=>{i(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,f.useCallback)(a=>{let b=c?`${c.workspacePath}/${a}`:a;navigator.clipboard.writeText(b).catch(()=>{}),o(a),setTimeout(()=>o(null),2e3)},[c]),t=(0,f.useCallback)(async a=>{q({path:a.path,name:a.name,content:null,lang:"",lines:0,size:a.size||0,error:null,loading:!0});try{let b=await fetch(`/api/v1/workspace/content?path=${encodeURIComponent(a.path)}`),c=await b.json();!b.ok||c.error?q(a=>a?{...a,loading:!1,error:c.error||"Failed to load file",binary:c.binary,tooLarge:c.tooLarge}:null):q({path:a.path,name:c.name,content:c.content,lang:c.lang,lines:c.lines,size:c.size,error:null,loading:!1})}catch(a){q(b=>b?{...b,loading:!1,error:`Network error: ${a.message}`}:null)}},[]),u=async()=>{k(!0),g(),await new Promise(a=>setTimeout(a,700)),k(!1)},v=(0,f.useMemo)(()=>{if(!c)return[];var a=c.tree;if(!l)return a;let b=l.toLowerCase(),d=a=>{if(a.name.toLowerCase().includes(b))return a;if("dir"===a.type&&a.children){let b=a.children.map(d).filter(Boolean);if(b.length>0)return{...a,children:b}}return null};return a.map(d).filter(Boolean)},[c,l]),w=c?.rootLabel||c?.workspacePath?.split("/").pop()||"Workspace",x=c?.workspacePath||"",y=p?p.path:null;return(0,e.jsxs)("div",{className:`workspace-panel ${a?"open":""}`,role:"complementary","aria-label":"Workspace Panel",children:[p&&(0,e.jsx)(a_,{view:p,onClose:()=>q(null),onCopyPath:s,workspacePath:x}),!p&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"workspace-panel-header",children:[(0,e.jsxs)("div",{className:"workspace-panel-title-row",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close workspace panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsxs)("div",{className:"workspace-panel-title",children:[(0,e.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:"Working Directory"})]}),(0,e.jsx)("button",{className:`git-refresh-btn ${j?"spinning":""}`,onClick:u,title:"Refresh file tree",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,e.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),x&&(0,e.jsxs)("div",{className:"workspace-path-bar",title:x,children:[(0,e.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,e.jsx)("path",{d:"M12 2v4M12 18v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M2 12h4M18 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83"})]}),(0,e.jsx)("span",{className:"workspace-path-text",children:x})]})]}),c&&(0,e.jsxs)("div",{className:"workspace-search-bar",children:[(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,e.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,e.jsx)("input",{className:"workspace-search-input",type:"text",placeholder:`Filter in ${w}…`,value:l,onChange:a=>m(a.target.value)}),l&&(0,e.jsx)("button",{className:"workspace-search-clear",onClick:()=>m(""),title:"Clear filter",children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),d&&!c&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading workspace…"})]}),!d&&!c&&(0,e.jsxs)("div",{className:"git-not-repo",children:[(0,e.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsx)("p",{children:"No workspace detected"}),(0,e.jsx)("span",{children:"Open a project in the IDE"})]}),n&&(0,e.jsxs)("div",{className:"workspace-copy-toast",children:[(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Path copied!"]}),c&&(0,e.jsxs)("div",{className:"workspace-tree",children:[(0,e.jsxs)("div",{className:"workspace-root-label",children:[(0,e.jsx)("span",{className:"workspace-root-icon",children:"\uD83D\uDDC2️"}),(0,e.jsx)("span",{className:"workspace-root-name",children:w}),(0,e.jsx)("span",{className:"workspace-node-count",children:c.tree.length})]}),0===v.length?(0,e.jsx)("div",{className:"git-empty",children:(0,e.jsx)("p",{children:l?"No matches":"Directory is empty"})}):(0,e.jsx)("div",{className:"workspace-tree-list",children:v.map(a=>{let b,c;return(0,e.jsx)(a$,{node:a,depth:0,expandedPaths:l?new Set((b=[],c=a=>{"dir"===a.type&&(b.push(a.path),a.children?.forEach(c))},v.forEach(c),b)):h,onToggle:r,onFileOpen:t,selectedPath:y},a.path)})})]})]})]})}function a1({networkOnline:a,isConnected:b}){let[c,d]=(0,f.useState)(!1),[g,h]=(0,f.useState)(!1);return c?(0,e.jsxs)("div",{className:`network-banner ${g?"recovered":"offline"}`,role:"status","aria-live":"polite",children:[(0,e.jsx)("span",{className:"network-banner-pulse"}),g?"✅ Connection restored":a?"\uD83D\uDD04 Reconnecting to server…":"\uD83D\uDCE1 No network — waiting for connection…"]}):null}function a2(){let{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,selectWindow:j,selectConversation:k,startNewChat:l,startCdpServer:m,openNewWindow:n,closeWindowByIndex:o,networkOnline:p,isConnected:q,isLoadingHistory:r,showWelcome:s,messages:t,currentSteps:u,currentResponse:v,isStreaming:w,sendMessage:x,stopStreaming:y,currentMode:z,toggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,fetchAgentList:E,switchAgent:F,toggleArtifactPanel:G,artifactFiles:H,artifactPanelOpen:I,toggleChangesPanel:J,changeFiles:K,changesPanelOpen:L,acceptAllChanges:M,rejectAllChanges:N,isAccepting:O,isRejecting:P,gitStatus:Q,gitPanelOpen:R,gitChangedCount:S,toggleGitPanel:U,refreshGit:V,workspaceTree:W,workspacePanelOpen:X,workspaceLoading:Y,toggleWorkspacePanel:Z,refreshWorkspace:$,messagesEndRef:_}=function(){let[a,b]=(0,f.useState)([]),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)("Agent"),[j,k]=(0,f.useState)("connected"),[l,m]=(0,f.useState)(!0),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)([]),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)("planning"),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)([]),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(!1),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(!0),H=(0,f.useRef)(null),I=(0,f.useRef)(null),J=(0,f.useRef)(null),K=(0,f.useRef)(""),L=(0,f.useRef)([]),{mutate:M}=T(),N=(0,f.useCallback)(()=>{requestAnimationFrame(()=>{J.current?.scrollIntoView({behavior:"smooth"})})},[]),O=(0,f.useCallback)((a,b)=>{k(a),i(b)},[]),{data:P,mutate:Q}=aa(ad.health,ac,{refreshInterval:F?3e4:5e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,onSuccess:a=>{g(a.connected),F||G(!0),O(a.connected?"connected":"disconnected",a.connected?"Agent":!1===a.network?"Offline":"Reconnecting…")},onError:()=>{g(!1),O("disconnected",F?"Reconnecting…":"Offline")}}),{mutate:R}=aa(ad.mode,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.mode&&u(a.mode)}}),{mutate:S}=aa(ad.agent,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.agent&&w(a.agent)}}),{mutate:U}=aa(ad.history,ac,{revalidateOnFocus:!1,revalidateOnMount:!0,onSuccess:a=>{o(!1),a.turns&&a.turns.length>0?(m(!1),b(a.turns.map(a=>({role:a.role,content:a.content})))):m(!0)},onError:()=>{o(!1)}}),V=(0,f.useCallback)(()=>{o(!0),b([]),U()},[U]),{artifactFiles:W,artifactPanelOpen:X,toggleArtifactPanel:Y,openArtifactPanel:Z,loadArtifacts:$}=function(a){let[b,c]=(0,f.useState)(!1),{data:d,mutate:e}=aa(ad.artifacts,ac,{refreshInterval:b?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),g=d?.files||[];return{artifactFiles:g,artifactPanelOpen:b,toggleArtifactPanel:(0,f.useCallback)(()=>{c(a=>!a)},[]),openArtifactPanel:(0,f.useCallback)(()=>{c(!0)},[]),loadArtifacts:e}}(),{changeFiles:_,changesPanelOpen:ab,toggleChangesPanel:ag,loadChanges:ah,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al}=function(){let[a,b]=(0,f.useState)(!1),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),{data:h,mutate:i}=aa(ad.changes,ac,{refreshInterval:a?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),j=h?.changes||[],k=(0,f.useCallback)(()=>{b(a=>!a)},[]),l=(0,f.useCallback)(async()=>{d(!0);try{let a=await fetch("/api/v1/changes/accept-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{d(!1)}},[i]),m=(0,f.useCallback)(async()=>{g(!0);try{let a=await fetch("/api/v1/changes/reject-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{g(!1)}},[i]);return{changeFiles:j,changesPanelOpen:a,toggleChangesPanel:k,loadChanges:i,acceptAllChanges:l,rejectAllChanges:m,isAccepting:c,isRejecting:e}}(),{gitStatus:am,gitPanelOpen:an,gitChangedCount:ao,toggleGitPanel:ap,refreshGit:aq}=function(){let[a,b]=(0,f.useState)(!1),{data:c,mutate:d}=aa(ad.git,ac,{refreshInterval:a?4e3:15e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),e=c?.isGitRepo!==void 0?c:null,g=e?(e.staged?.length||0)+(e.unstaged?.length||0)+(e.untracked?.length||0):0;return{gitStatus:e,gitPanelOpen:a,gitChangedCount:g,toggleGitPanel:(0,f.useCallback)(()=>{b(a=>!a)},[]),refreshGit:(0,f.useCallback)(()=>{d()},[d])}}(),{workspaceTree:ar,workspacePanelOpen:as,workspaceLoading:at,toggleWorkspacePanel:au,refreshWorkspace:av}=function(){let[a,b]=(0,f.useState)(!1),{data:c,mutate:d,isLoading:e}=aa(ad.workspace,ac,{refreshInterval:a?5e3:6e4,revalidateOnFocus:a,revalidateOnReconnect:!0,dedupingInterval:3e3}),g=c?.workspacePath?c:null;return{workspaceTree:g,workspacePanelOpen:a,workspaceLoading:e,toggleWorkspacePanel:(0,f.useCallback)(()=>{b(a=>!a)},[]),refreshWorkspace:(0,f.useCallback)(()=>{d()},[d])}}(),{windows:aw,conversations:ax,activeConversation:ay,cdpStatus:az,recentProjects:aA,loadWindows:aB,selectWindow:aC,loadConversations:aD,selectConversation:aE,checkCdpStatus:aF,startCdpServer:aG,openNewWindow:aH,closeWindowByIndex:aI,loadRecentProjects:aJ}=function(a,b,c){let{data:d,mutate:e}=aa(ad.windows,ac,{revalidateOnFocus:!0}),g=d?.windows||[],{data:h,mutate:i}=aa(ad.cdpStatus,ac,{refreshInterval:15e3,revalidateOnFocus:!0}),j={active:h?.active??!1,windowCount:h?.windowCount??0,error:h?.error??null},{data:k,mutate:l}=aa(ad.conversations,ac,{revalidateOnFocus:!0}),m=k?.conversations||[],n=m.find(a=>a.active)||null,{data:o,mutate:p}=aa(ad.recentProjects,ac,{revalidateOnFocus:!0}),q=o?.recentProjects||[],r=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/cdp-start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a||".",killExisting:b||!1})}),d=await c.json();return d.success&&(i(),e()),d}catch(a){return{success:!1,message:a.message||"Failed to start CDP server"}}},[i,e]),s=(0,f.useCallback)(async a=>{try{let b=await fetch(`${ae}/windows/open`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a})}),c=await b.json();return c.success&&(e(),i()),c}catch(a){return{success:!1,message:a.message||"Failed to open window"}}},[e,i]),t=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b?{targetId:b}:{index:a})}),d=await c.json();return d.success&&(e(),i()),d}catch(a){return{success:!1,message:a.message||"Failed to close window"}}},[e,i]),u=(0,f.useCallback)(async d=>{try{b(!0),await fetch(`${ae}/windows/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:d})}),e(),a(),setTimeout(()=>l(),300),setTimeout(()=>l(),1500),c?.()}catch{}},[e,a,b,l,c]),v=(0,f.useCallback)(async d=>{try{let e=await fetch(`${ae}/conversations/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:d})});if((await e.json()).success){b(!1);let e=0,f=async()=>{e++;try{let b=await fetch(`${ae}/conversations`),f=(await b.json()).conversations||[],g=f.find(a=>a.active);if(g&&g.title===d||e>10){l({conversations:f},{revalidate:!1}),a(),c?.();return}}catch{}setTimeout(f,500)};f()}}catch{}},[a,b,l,c]);return{windows:g,conversations:m,activeConversation:n,cdpStatus:j,recentProjects:q,loadWindows:e,selectWindow:u,loadConversations:l,selectConversation:v,checkCdpStatus:i,startCdpServer:r,openNewWindow:s,closeWindowByIndex:t,loadRecentProjects:p}}(V,m,(0,f.useCallback)(()=>{$(),ah()},[$,ah])),aK=(0,f.useCallback)(async()=>{let a="planning"===t?"fast":"planning";u(a);try{let b=await fetch(`${af}/chat/mode`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:a})}),c=await b.json();c.mode&&u(c.mode),R()}catch{u(t)}},[t,R]),aL=(0,f.useCallback)(async()=>{A(!0);try{let a=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"list"})}),b=await a.json();b.agents&&y(b.agents),b.currentAgent&&w(b.currentAgent)}catch{}A(!1)},[]),aM=(0,f.useCallback)(async a=>{w(a);try{let b=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",agent:a})}),c=await b.json();c.agent?w(c.agent):c.success||w(v),S()}catch{w(v)}},[v,S]),aN=(0,f.useCallback)(a=>{let{type:b,...c}=a;switch(b){case"tool_call":q(a=>{let d,e=a.findIndex(a=>"tool_call"===a.type&&a.data?.id===c.id);return e>=0?(d=[...a])[e]={type:b,data:c}:d=[...a,{type:b,data:c}],L.current=d,d});break;case"thinking":case"hitl":case"error":case"notification":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d});break;case"file_change":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d}),$(),ah();break;case"response":s(c.content||""),K.current=c.content||"";break;case"status":O(c.isRunning?"streaming":"connected",c.isRunning?"Agent working...":"Agent");break;case"done":c.finalResponse&&(s(c.finalResponse),K.current=c.finalResponse),O("connected","Agent"),d(!1),$(),ah()}N()},[O,N,$,ah]),aO=(0,f.useCallback)(async a=>{if(!a.trim())return;H.current&&(H.current.abort(),H.current=null,fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})),I.current&&(await I.current,I.current=null),m(!1);let c=a.trim();b(a=>[...a,{role:"user",content:c}]),d(!0),q([]),s(""),K.current="",L.current=[],O("streaming","Agent typing...");let e=new AbortController;H.current=e,I.current=(async()=>{try{let a="",b=0;for(;b<=5;){let d=!1;try{let f={"Content-Type":"application/json"};a&&(f["Last-Event-ID"]=a);let g=(await fetch(`${af}/chat/stream`,{method:"POST",headers:f,body:JSON.stringify({message:c}),signal:e.signal})).body.getReader(),h=new TextDecoder,i="",j=!1;for(;;){let{done:b,value:c}=await g.read();if(b){d=!0;break}let e=(i+=h.decode(c,{stream:!0})).split("\n");for(let b of(i=e.pop(),e)){if(!b.startsWith(":")){if(b.startsWith("id: ")){a=b.slice(4).trim();continue}if(!b.startsWith("retry:")&&b.startsWith("data: "))try{let a=JSON.parse(b.slice(6));aN(a),"done"===a.type&&(j=!0)}catch{}}}if(j)break}if(j||!d||++b>5)break;console.warn(`[SSE] Stream dropped (attempt ${b}/5), reconnecting in 2000ms...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if("AbortError"===a.name||++b>5)throw a;console.warn(`[SSE] Fetch error (attempt ${b}/5):`,a.message),await new Promise(a=>setTimeout(a,2e3))}}}catch(a){"AbortError"!==a.name&&(q(b=>[...b,{type:"error",data:{message:a.message}}]),O("error","Error"))}finally{let a=K.current,c=[...L.current];d(!1),H.current===e&&(H.current=null),(a||c.length>0)&&b(b=>[...b,{role:"agent",content:a,steps:c}]),O("connected","Agent")}})(),await I.current},[aN,O]),aP=(0,f.useCallback)(async()=>{H.current&&H.current.abort(),b([]),q([]),s(""),m(!0);try{let a=await fetch(`${af}/chat/new`,{method:"POST"});(await a.json()).success&&O("connected","New Chat")}catch{}},[O]),aQ=(0,f.useCallback)(()=>{H.current&&(H.current.abort(),H.current=null),fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})},[]),aR=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/approve`,{method:"POST"}),O("streaming","Agent")}catch{}},[O]),aS=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/reject`,{method:"POST"})}catch{}},[]),aT=(0,f.useRef)(c);aT.current=c;let{isMonitoring:aU}=function(a={}){let{onEvent:b,onActivityStart:c,onActivityEnd:d,onTurnChange:e,onModeChange:g,onSync:h,autoConnect:i=!0}=a,[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(null),n=(0,f.useRef)(null),o=(0,f.useRef)(null),p=(0,f.useRef)(!1),q=(0,f.useRef)(b),r=(0,f.useRef)(c),s=(0,f.useRef)(d),t=(0,f.useRef)(e),u=(0,f.useRef)(g),v=(0,f.useRef)(h);q.current=b,r.current=c,s.current=d,t.current=e,u.current=g,v.current=h;let w=(0,f.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),n.current&&(n.current.abort(),n.current=null),k(!1),p.current=!1},[]),x=(0,f.useCallback)(async()=>{if(p.current||n.current)return;p.current=!0;let a=new AbortController;n.current=a;try{let b=await fetch("/api/v1/chat/monitor",{signal:a.signal});if(!b.ok||!b.body)throw Error(`Monitor connection failed: ${b.status}`);k(!0),p.current=!1;let c=b.body.getReader(),d=new TextDecoder,e="";for(;;){let{done:a,value:b}=await c.read();if(a)break;let f=(e+=d.decode(b,{stream:!0})).split("\n");for(let a of(e=f.pop(),f))if(!(a.startsWith(":")||a.startsWith("retry:")||a.startsWith("id:"))&&a.startsWith("data: "))try{let{type:b,...c}=JSON.parse(a.slice(6));switch(q.current?.({type:b,...c}),b){case"activity_start":r.current?.();break;case"activity_end":s.current?.(c);break;case"turn_change":t.current?.(c);break;case"mode_change":u.current?.(c);break;case"sync":m(Date.now()),v.current?.(c)}}catch{}}}catch(a){if("AbortError"===a.name)return;console.warn("[Monitor] Connection lost:",a.message)}finally{n.current=null,p.current=!1,k(!1),a.signal.aborted||(o.current=setTimeout(()=>{o.current=null,x()},3e3))}},[]);return{isMonitoring:j,lastSyncTime:l,connect:x,disconnect:w}}({autoConnect:!0,onActivityStart:()=>{C(!0),aT.current||(k("streaming"),i("Agent working..."))},onActivityEnd:()=>{C(!1),aT.current||(k("connected"),i("Agent"),U(),$(),ah())},onTurnChange:()=>{aT.current||(m(!1),U())},onModeChange:({newMode:a})=>{u(a)},onSync:a=>{"boolean"==typeof a.isRunning&&C(a.isRunning)},onEvent:a=>{aT.current||"tool_call"!==a.type&&"response"!==a.type&&"thinking"!==a.type&&"hitl"!==a.type&&"notification"!==a.type||aN(a)}});return{messages:a,isStreaming:c,isConnected:e,statusText:h,statusState:j,showWelcome:l,isLoadingHistory:n,currentSteps:p,currentResponse:r,windows:aw,conversations:ax,activeConversation:ay,artifactFiles:W,artifactPanelOpen:X,changeFiles:_,changesPanelOpen:ab,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al,gitStatus:am,gitPanelOpen:an,gitChangedCount:ao,toggleGitPanel:ap,refreshGit:aq,workspaceTree:ar,workspacePanelOpen:as,workspaceLoading:at,toggleWorkspacePanel:au,refreshWorkspace:av,currentMode:t,currentAgent:v,agents:x,isLoadingAgents:z,cdpStatus:az,recentProjects:aA,isAgentBusy:B,isMonitorConnected:D,networkOnline:F,sendMessage:aO,stopStreaming:aQ,startNewChat:aP,approve:aR,reject:aS,selectWindow:aC,selectConversation:aE,toggleArtifactPanel:Y,openArtifactPanel:Z,toggleChangesPanel:ag,toggleMode:aK,fetchAgentList:aL,switchAgent:aM,startCdpServer:aG,openNewWindow:aH,closeWindowByIndex:aI,messagesEndRef:J,setShowWelcome:m}}(),ab=(0,f.useCallback)(async()=>{try{await fetch("/api/v1/health"),window.location.reload()}catch{}},[]);return(0,e.jsxs)("div",{className:"app-container",children:[(0,e.jsx)(ai,{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}),(0,e.jsx)(a1,{networkOnline:p,isConnected:q}),(0,e.jsxs)("main",{className:"messages-area",role:"log","aria-live":"polite",children:[r?(0,e.jsxs)("div",{className:"history-loading",children:[(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"45%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"80%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"65%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"72%"}})]}),(0,e.jsx)("div",{className:"history-loading-header right",children:(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"35%"}})}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"90%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"55%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"68%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"40%"}})]}),(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"50%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"75%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"60%"}})]}),(0,e.jsx)("p",{className:"history-loading-text",children:"Loading conversation history…"})]}):s?(0,e.jsx)(ak,{onQuickPrompt:x}):(0,e.jsx)(au,{messages:t,currentSteps:u,currentResponse:v,isStreaming:w,onRetry:ab}),(0,e.jsx)("div",{ref:_})]}),(0,e.jsx)(av,{onSend:x,onStop:y,isStreaming:w,currentMode:z,onToggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,onFetchAgents:E,onSwitchAgent:F,onToggleArtifacts:G,artifactCount:H.length,artifactPanelOpen:I,onToggleChanges:J,changesCount:K.length,changesPanelOpen:L,onToggleGit:U,gitChangedCount:S,gitPanelOpen:R,onToggleWorkspace:Z,workspacePanelOpen:X}),(0,e.jsx)(aw,{open:I,onClose:G,activeConversation:g,files:H}),(0,e.jsx)(ax,{open:L,onClose:J,changes:K,onAcceptAll:M,onRejectAll:N,isAccepting:O,isRejecting:P}),(0,e.jsx)(aA,{open:R,onClose:U,gitStatus:Q,onRefresh:V}),(0,e.jsx)(a0,{open:X,onClose:Z,workspaceTree:W,workspaceLoading:Y,onRefresh:$})]})}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3502:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>L,handler:()=>N,routeModule:()=>M});var d=c(7553),e=c(4006),f=c(7798),g=c(4775),h=c(9373),i=c(3461),j=c(1020),k=c(6349),l=c(4365),m=c(6023),n=c(3747),o=c(4235),p=c(3938),q=c(261),r=c(6758),s=c(7243),t=c(6713),u=c(7527),v=c(2820),w=c(8216),x=c(7929),y=c(9551),z=c(9125),A=c(6439),B=c(7068),C=c(5547),D=c.n(C),E=c(1287),F=c(1494),G=c(722),H=c(753),I=c(3954),J={};for(let a in E)0>["default","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(J[a]=()=>E[a]);c.d(b,J);let K={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,9647)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/page.tsx"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,2056)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,5547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.bind(c,7548)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/not-found.tsx"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,5270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,8193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,L={require:c,loadChunk:()=>Promise.resolve()},M=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:K},distDir:".next",relativeProjectDir:""});async function N(a,b,d){var C;M.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let J=!!(0,h.getRequestMeta)(a,"minimalMode"),O="/page";"/index"===O&&(O="/");let P=await M.prepare(a,b,{srcPage:O,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,parsedUrl:ae,interceptionRoutePatterns:af,deploymentId:ag}=P,ah=(0,q.normalizeAppPath)(O),{isOnDemandRevalidate:ai}=P,aj=ad.experimental.ppr&&!ad.cacheComponents&&(0,I.isInterceptionRouteAppPath)(aa)?null:M.match(aa,$),ak=!!$.routes[aa],al=a.headers["user-agent"]||"",am=(0,t.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],aq=(0,r.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr);if(!(0,h.getRequestMeta)(a,"postponed")&&ar&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let b=[];for await(let c of a)b.push(c);let c=Buffer.concat(b).toString("utf8");(0,h.addRequestMeta)(a,"postponed",c)}let as=ar&&(null==(C=$.routes[ah]??$.dynamicRoutes[ah])?void 0:C.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?(0,h.getRequestMeta)(a,"postponed"):void 0,aw=as&&ap&&!ao;J&&(aw=aw&&!!av);let ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=(!an||!as)&&(!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots)),az=!!((aj||ak||$.routes[ah])&&!(an&&as)),aA=as&&!0===ad.cacheComponents,aB=!0===M.isDev||!az||"string"==typeof av||(aA&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aw&&!J:aw),aC=an&&as,aD=null;_||!az||aB||aq||av||aw||(aD=aa);let aE=aD;!aE&&M.isDev&&(aE=aa),M.isDev||_||!az||!ap||aw||(0,k.d)(a.headers);let aF={...E,tree:K,GlobalError:D(),handler:N,routeModule:M,__next_app__:L};X&&Y&&(0,o.setManifestsSingleton)({page:O,clientReferenceManifest:Y,serverActionsManifest:X});let aG=a.method||"GET",aH=(0,g.getTracer)(),aI=aH.getActiveScopeSpan(),aJ=async()=>((null==ac?void 0:ac.render404)?await ac.render404(a,b,ae,!1):b.end("This page could not be found"),null);try{let f=M.getVaryHeader(aa,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return M.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aH.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aG} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aG} ${O}`)})},m=(0,h.getRequestMeta)(a,"incrementalCache"),o=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let l={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aF,Component:(0,j.T)(aF),params:S,routeModule:M,page:O,postponed:f,shouldWaitOnAllReady:aC,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||aB,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,setCacheStatus:null==ac?void 0:ac.setCacheStatus,setIsrStatus:null==ac?void 0:ac.setIsrStatus,setReactDebugChannel:null==ac?void 0:ac.setReactDebugChannel,sendErrorsToBrowser:null==ac?void 0:ac.sendErrorsToBrowser,dir:c(3873).join(process.cwd(),M.relativeProjectDir),isDraftMode:_,botType:am,isOnDemandRevalidate:ai,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,images:ad.images,previewProps:$.preview,deploymentId:ag,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:m,cacheLifeProfiles:ad.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...at||au?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:at}:{},cacheComponents:!!ad.cacheComponents,experimental:{isRoutePPREnabled:as,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[],clientParamParsingOrigins:ad.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,B.parseMaxPostponedStateSize)(ad.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>M.onRequestError(a,b,d,e,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:M.isDev}};at&&(l.renderOpts.nextExport=!0,l.renderOpts.supportsDynamicResponse=!1,l.renderOpts.isDebugDynamicAccesses=at),i&&(l.renderOpts.supportsDynamicResponse=!1);let n=await k(e,l),{metadata:o}=n,{cacheControl:p,headers:q={},fetchTags:r,fetchMetrics:s}=o;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,az&&(null==p?void 0:p.revalidate)===0&&!M.isDev&&!as){let a=o.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
2
+ see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:n,headers:q,rscData:o.flightData,postponed:o.postponed,status:o.statusCode,segmentData:o.segmentData},cacheControl:p}},p=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i,forceStaticRender:j=!1})=>{let k,l=!1===M.isDev,q=c||b.writableEnded;if(ai&&ab&&!f&&!J)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(k=(0,v.parseFallbackField)(aj.fallback)),k===v.FallbackMode.PRERENDER&&(0,t.isBot)(al)&&(!as||an)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(k!==v.FallbackMode.NOT_FOUND||f)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),!J&&k!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aE&&!q&&!_&&T&&(l||!ak)){if((l||aj)&&k===v.FallbackMode.NOT_FOUND){if(ad.experimental.adapterPath)return await aJ();throw new A.NoFallbackError}if(as&&(ad.cacheComponents?!aw:!ap)){let b=l&&"string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:ah,c=l&&(null==aj?void 0:aj.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null,f=await M.handleResponse({cacheKey:b,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:as,responseGenerator:async()=>o({span:i,postponed:void 0,fallbackRouteParams:c,forceStaticRender:!1}),waitUntil:d.waitUntil,isMinimalMode:J});if(null===f)return null;if(f)return delete f.cacheControl,f}}let r=ai||g||!av?void 0:av;if(aA&&!J&&m&&aw&&!j){let b=await m.get(aa,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(r=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=M.getResponseCache(a);try{await b.revalidate(aa,m,as,!1,a=>p({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if(at&&void 0!==r)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=l&&(null==aj?void 0:aj.fallbackRouteParams)&&(0,h.getRequestMeta)(a,"renderFallbackShell")?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null;return o({span:i,postponed:r,fallbackRouteParams:s,forceStaticRender:j})},q=async c=>{var f,g,i,j,k;let l,m=await M.handleResponse({cacheKey:aD,responseGenerator:a=>p({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil,isMinimalMode:J});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),M.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!m){if(aD)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;az&&!aw&&(!n||ao)&&(J||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=m;if(av)l={revalidate:0,expire:void 0};else if(aw)l={revalidate:0,expire:void 0};else if(!M.isDev)if(_)l={revalidate:0,expire:void 0};else if(az){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===u.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];J&&az&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let r=aA?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(q.headers){let a={...q.headers};for(let[c,d]of(J&&az||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=q.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(J&&az&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!q.status||ap&&as||(b.statusCode=q.status),!J&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),n&&!aw&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(ad.cacheComponents)return b.statusCode=404,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${q.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:m.cacheControl})}return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(q.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=q.html;if(!n||J||ap)return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:m.cacheControl});if(at)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let A=new TransformStream;return v.push(A.readable),o({span:c,postponed:q.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(A.writable)}).catch(a=>{A.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aI)return await aH.withPropagatedContext(a.headers,()=>aH.trace(i.BaseServerSpan.handleRequest,{spanName:`${aG} ${O}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aG,"http.target":a.url}},q));await q(aI)}catch(b){throw b instanceof A.NoFallbackError||await M.onRequestError(a,b,{routerKind:"App Router",routePath:O,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:az,isOnDemandRevalidate:ai})},!1,ac),b}}},3593:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/providers.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/providers.tsx","default")},3873:a=>{"use strict";a.exports=require("path")},3948:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23)),Promise.resolve().then(c.t.bind(c,5098,23)),Promise.resolve().then(c.t.bind(c,7644,23)),Promise.resolve().then(c.t.bind(c,3859,23)),Promise.resolve().then(c.t.bind(c,8099,23)),Promise.resolve().then(c.t.bind(c,6237,23)),Promise.resolve().then(c.t.bind(c,8562,23)),Promise.resolve().then(c.t.bind(c,6675,23))},3954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},5026:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx","default")},6055:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(8868);let e=async a=>[{type:"image/x-icon",sizes:"16x16",url:(0,d.fillMetadataSegment)(".",await a.params,"favicon.ico")+"?603d046c9a6fdfbb"}]},6187:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx","default")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6862:(a,b,c)=>{"use strict";var d=c(7484),e="function"==typeof Object.is?Object.is:function(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},f=d.useState,g=d.useEffect,h=d.useLayoutEffect,i=d.useDebugValue;function j(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!e(a,c)}catch(a){return!0}}var k="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(a,b){return b()}:function(a,b){var c=b(),d=f({inst:{value:c,getSnapshot:b}}),e=d[0].inst,k=d[1];return h(function(){e.value=c,e.getSnapshot=b,j(e)&&k({inst:e})},[a,c,b]),g(function(){return j(e)&&k({inst:e}),a(function(){j(e)&&k({inst:e})})},[a]),i(c),c};b.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:k},7068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},7548:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",backgroundColor:"#0a0a0f",color:"#888",fontFamily:"system-ui, sans-serif",margin:0},children:[(0,d.jsx)("h1",{style:{fontSize:"3rem",margin:0,color:"#fff"},children:"404"}),(0,d.jsx)("p",{style:{fontSize:"1.1rem",marginTop:"0.5rem"},children:"Page not found"})]})}},7597:(a,b,c)=>{Promise.resolve().then(c.bind(c,3593)),Promise.resolve().then(c.bind(c,5026))},7728:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(8249),e=c(7484),f=c(1220);function g(){let[a,b]=(0,e.useState)(null),[c,g]=(0,e.useState)(!1),[h]=(0,e.useState)(()=>!1),[i]=(0,e.useState)(()=>!1),j=(0,e.useCallback)(async()=>{if(a){try{await a.prompt();let b=await a.userChoice;"accepted"===b.outcome&&g(!1)}catch(a){console.error("PWA install error:",a)}b(null)}},[a]),k=(0,e.useCallback)(()=>{g(!1),localStorage.setItem("pwa-install-dismissed",Date.now().toString())},[]);return!c||i?null:(0,d.jsxs)("div",{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,padding:"12px 16px",background:"linear-gradient(135deg, rgba(20, 20, 35, 0.98), rgba(30, 25, 50, 0.98))",backdropFilter:"blur(20px)",borderTop:"1px solid rgba(139, 92, 246, 0.3)",display:"flex",alignItems:"center",gap:"12px",animation:"slideUp 0.3s ease-out",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.4)"},children:[(0,d.jsx)("style",{children:`
3
3
  @keyframes slideUp {
4
4
  from { transform: translateY(100%); opacity: 0; }
5
5
  to { transform: translateY(0); opacity: 1; }
6
6
  }
7
- `}),(0,d.jsx)("div",{style:{width:44,height:44,borderRadius:10,overflow:"hidden",flexShrink:0,border:"1px solid rgba(139, 92, 246, 0.2)"},children:(0,d.jsx)(f.default,{src:"/icons/icon-192.png",alt:"Antigravity",width:44,height:44,style:{display:"block"}})}),(0,d.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,d.jsx)("div",{style:{color:"#f0f0f5",fontSize:"14px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif"},children:"Install Antigravity"}),(0,d.jsx)("div",{style:{color:"#9ca3af",fontSize:"12px",fontFamily:"Inter, system-ui, sans-serif",marginTop:2},children:h?'Tap the Share button, then "Add to Home Screen"':"Add to home screen for quick access"})]}),!h&&(0,d.jsx)("button",{onClick:j,style:{padding:"8px 16px",borderRadius:8,border:"none",background:"linear-gradient(135deg, #8b5cf6, #6d28d9)",color:"#fff",fontSize:"13px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Install"}),(0,d.jsx)("button",{onClick:k,style:{background:"none",border:"none",color:"#6b7280",fontSize:"18px",cursor:"pointer",padding:"4px",lineHeight:1,flexShrink:0},"aria-label":"Dismiss install prompt",children:"✕"})]})}},8335:()=>{},8354:a=>{"use strict";a.exports=require("util")},8509:(a,b,c)=>{Promise.resolve().then(c.bind(c,293))},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9129:(a,b,c)=>{Promise.resolve().then(c.bind(c,5026))},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9647:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,dynamic:()=>g});var d=c(5735),e=c(6187),f=c(1986);let g="force-dynamic";function h(){return(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("div",{className:"p-8 text-center text-gray-500",children:"Loading Chat Interface..."}),children:(0,d.jsx)(e.default,{})})}}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7471,6368],()=>b(b.s=3502));module.exports=c})();
7
+ `}),(0,d.jsx)("div",{style:{width:44,height:44,borderRadius:10,overflow:"hidden",flexShrink:0,border:"1px solid rgba(139, 92, 246, 0.2)"},children:(0,d.jsx)(f.default,{src:"/icons/icon-192.png",alt:"Antigravity",width:44,height:44,style:{display:"block"}})}),(0,d.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,d.jsx)("div",{style:{color:"#f0f0f5",fontSize:"14px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif"},children:"Install Antigravity"}),(0,d.jsx)("div",{style:{color:"#9ca3af",fontSize:"12px",fontFamily:"Inter, system-ui, sans-serif",marginTop:2},children:h?'Tap the Share button, then "Add to Home Screen"':"Add to home screen for quick access"})]}),!h&&(0,d.jsx)("button",{onClick:j,style:{padding:"8px 16px",borderRadius:8,border:"none",background:"linear-gradient(135deg, #8b5cf6, #6d28d9)",color:"#fff",fontSize:"13px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Install"}),(0,d.jsx)("button",{onClick:k,style:{background:"none",border:"none",color:"#6b7280",fontSize:"18px",cursor:"pointer",padding:"4px",lineHeight:1,flexShrink:0},"aria-label":"Dismiss install prompt",children:"✕"})]})}},8335:()=>{},8354:a=>{"use strict";a.exports=require("util")},8509:(a,b,c)=>{Promise.resolve().then(c.bind(c,3221))},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9647:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,dynamic:()=>g});var d=c(5735),e=c(6187),f=c(1986);let g="force-dynamic";function h(){return(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("div",{className:"p-8 text-center text-gray-500",children:"Loading Chat Interface..."}),children:(0,d.jsx)(e.default,{})})}}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7471,9814],()=>b(b.s=3502));module.exports=c})();