commandmate 0.3.5 → 0.4.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 (161) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +19 -23
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  13. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  14. package/.next/cache/webpack/server-production/0.pack +0 -0
  15. package/.next/cache/webpack/server-production/index.pack +0 -0
  16. package/.next/next-server.js.nft.json +1 -1
  17. package/.next/prerender-manifest.json +1 -1
  18. package/.next/react-loadable-manifest.json +69 -55
  19. package/.next/required-server-files.json +1 -1
  20. package/.next/server/app/_not-found/page.js +1 -1
  21. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/app/update-check/route.js +1 -1
  24. package/.next/server/app/api/repositories/clone/route.js +1 -1
  25. package/.next/server/app/api/repositories/route.js +8 -8
  26. package/.next/server/app/api/repositories/scan/route.js +1 -1
  27. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -2
  28. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  29. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  30. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  31. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  32. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  33. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  34. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  35. package/.next/server/app/api/worktrees/[id]/schedules/route.js +2 -2
  36. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  37. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  38. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  39. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  40. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  41. package/.next/server/app/api/worktrees/route.js +1 -1
  42. package/.next/server/app/login/page.js +1 -1
  43. package/.next/server/app/login/page.js.nft.json +1 -1
  44. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  45. package/.next/server/app/page.js +3 -3
  46. package/.next/server/app/page.js.nft.json +1 -1
  47. package/.next/server/app/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/proxy/[...path]/route.js +4 -4
  49. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  50. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  51. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/worktrees/[id]/page.js +6 -6
  53. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  54. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/worktrees/[id]/terminal/page.js +2 -4
  56. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  57. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app-paths-manifest.json +8 -8
  59. package/.next/server/chunks/{3294.js → 1628.js} +3 -3
  60. package/.next/server/chunks/185.js +36 -0
  61. package/.next/server/chunks/3860.js +1 -1
  62. package/.next/server/chunks/4893.js +2 -2
  63. package/.next/server/chunks/4952.js +1 -1
  64. package/.next/server/chunks/5488.js +6 -6
  65. package/.next/server/chunks/7425.js +34 -31
  66. package/.next/server/chunks/7566.js +2 -2
  67. package/.next/server/chunks/8199.js +1 -0
  68. package/.next/server/chunks/8585.js +1 -1
  69. package/.next/server/chunks/8693.js +1 -1
  70. package/.next/server/middleware-build-manifest.js +1 -1
  71. package/.next/server/middleware-manifest.json +5 -5
  72. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  73. package/.next/server/pages/500.html +1 -1
  74. package/.next/server/server-reference-manifest.json +1 -1
  75. package/.next/static/chunks/12-00c528d46a0a0a1d.js +1 -0
  76. package/.next/static/chunks/{13.feeafc7cc620f8c4.js → 13.b9521543496f4468.js} +1 -1
  77. package/.next/static/chunks/1334.bfedf44ee9fe2761.js +1 -0
  78. package/.next/static/chunks/143.eb6b4671490cd223.js +1 -0
  79. package/.next/static/chunks/{3574.7a94c27e6a496a56.js → 1442.74b5f4de9a4b4e1b.js} +1 -1
  80. package/.next/static/chunks/2083-b5bed0c77cc53281.js +1 -0
  81. package/.next/static/chunks/2725.eb2d236c8030711c.js +1 -0
  82. package/.next/static/chunks/3398-3d40a17387bd554b.js +1 -0
  83. package/.next/static/chunks/3516.3c576047408cae6b.js +1 -0
  84. package/.next/static/chunks/3559.422c6ca760b85750.js +1 -0
  85. package/.next/static/chunks/3956.52c5b9a0071a641d.js +1 -0
  86. package/.next/static/chunks/4012.32b576a4fa621774.js +1 -0
  87. package/.next/static/chunks/4212.e7ba1009bc1da62d.js +131 -0
  88. package/.next/static/chunks/4303.caf91e86105d5e70.js +1 -0
  89. package/.next/static/chunks/4327.4dcda9b6fab6a385.js +82 -0
  90. package/.next/static/chunks/4671.d86d21d0dfdace41.js +1 -0
  91. package/.next/static/chunks/5518.ec88dcb5a27b17fe.js +1 -0
  92. package/.next/static/chunks/6434.08d262283371d333.js +1 -0
  93. package/.next/static/chunks/{656.5e2de0173f5a06bd.js → 656.dc26b973d07d9627.js} +5 -5
  94. package/.next/static/chunks/7119.01777af21b55740c.js +1 -0
  95. package/.next/static/chunks/7293.fb88bb102af4aa04.js +1 -0
  96. package/.next/static/chunks/8913-40625650292eb3d0.js +1 -0
  97. package/.next/static/chunks/8977.fc18b8260cd8bc1f.js +1 -0
  98. package/.next/static/chunks/9552.d959149efd41e84b.js +1 -0
  99. package/.next/static/chunks/app/layout-7198a7a49aa21a97.js +1 -0
  100. package/.next/static/chunks/app/page-7498cf75e69d9227.js +1 -0
  101. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-0599f64a8e80d255.js +1 -0
  102. package/.next/static/chunks/app/worktrees/[id]/page-94ad7a1ce1f0c440.js +1 -0
  103. package/.next/static/chunks/app/worktrees/[id]/terminal/page-175b618c047bc992.js +1 -0
  104. package/.next/static/chunks/d3ac728e.daf595a898e9b720.js +1 -0
  105. package/.next/static/chunks/webpack-f7111aab807d73b9.js +1 -0
  106. package/.next/static/css/f7dc01350168df01.css +3 -0
  107. package/.next/trace +5 -5
  108. package/README.md +66 -56
  109. package/dist/server/server.js +5 -0
  110. package/dist/server/src/lib/auto-yes-manager.js +58 -18
  111. package/dist/server/src/lib/claude-session.js +9 -3
  112. package/dist/server/src/lib/cli-session.js +60 -10
  113. package/dist/server/src/lib/cli-tools/codex.js +7 -7
  114. package/dist/server/src/lib/cli-tools/gemini.js +3 -0
  115. package/dist/server/src/lib/cli-tools/opencode-config.js +179 -33
  116. package/dist/server/src/lib/cli-tools/opencode.js +5 -0
  117. package/dist/server/src/lib/cli-tools/vibe-local.js +3 -0
  118. package/dist/server/src/lib/cmate-parser.js +7 -7
  119. package/dist/server/src/lib/db-migrations.js +18 -1
  120. package/dist/server/src/lib/errors.js +153 -0
  121. package/dist/server/src/lib/prompt-answer-sender.js +3 -0
  122. package/dist/server/src/lib/prompt-detector.js +49 -7
  123. package/dist/server/src/lib/resource-cleanup.js +257 -0
  124. package/dist/server/src/lib/schedule-manager.js +269 -83
  125. package/dist/server/src/lib/tmux-capture-cache.js +221 -0
  126. package/dist/server/src/lib/tmux.js +41 -20
  127. package/dist/server/src/types/markdown-editor.js +9 -1
  128. package/package.json +11 -8
  129. package/.next/server/chunks/539.js +0 -35
  130. package/.next/server/chunks/7458.js +0 -1
  131. package/.next/server/chunks/7808.js +0 -1
  132. package/.next/static/chunks/1038-3509435b68c0967e.js +0 -1
  133. package/.next/static/chunks/1098.49268c9fe1b028fa.js +0 -1
  134. package/.next/static/chunks/2335-98a211e00b94c7ac.js +0 -1
  135. package/.next/static/chunks/3559.f073f72c4466ce0e.js +0 -1
  136. package/.next/static/chunks/3843.3fdda732987f7bb8.js +0 -1
  137. package/.next/static/chunks/4212.52c1bb34fc97d0d0.js +0 -131
  138. package/.next/static/chunks/4327.157a4c226d919531.js +0 -60
  139. package/.next/static/chunks/4362.7bd6f0282e49d79b.js +0 -1
  140. package/.next/static/chunks/4721.40615a5f4f32b5fb.js +0 -1
  141. package/.next/static/chunks/5112.17318d1c6b28044b.js +0 -1
  142. package/.next/static/chunks/6406.9653f0d41ab85059.js +0 -1
  143. package/.next/static/chunks/6792.3c01ac4dda4b5c6d.js +0 -1
  144. package/.next/static/chunks/8091-d65d2ab6daed23c6.js +0 -1
  145. package/.next/static/chunks/8125.245a9df052d274fb.js +0 -1
  146. package/.next/static/chunks/8522.1607e96011c66877.js +0 -1
  147. package/.next/static/chunks/8841.dadeb1ece8e46004.js +0 -1
  148. package/.next/static/chunks/8885.f8d9912b40d74811.js +0 -1
  149. package/.next/static/chunks/9178-88850a7c48deea07.js +0 -1
  150. package/.next/static/chunks/9552.b7dfb7903ead934b.js +0 -1
  151. package/.next/static/chunks/app/layout-9110f9a5e41c6bf4.js +0 -1
  152. package/.next/static/chunks/app/page-9e523a8f415bc707.js +0 -1
  153. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-4a3c0861367e0391.js +0 -1
  154. package/.next/static/chunks/app/worktrees/[id]/page-8fb4dc30b58a5681.js +0 -1
  155. package/.next/static/chunks/app/worktrees/[id]/terminal/page-5d85a7e508ce36d3.js +0 -1
  156. package/.next/static/chunks/d3ac728e.6c9c508274d4d2d5.js +0 -1
  157. package/.next/static/chunks/webpack-81c97591dd5567ac.js +0 -1
  158. package/.next/static/css/45b3a41370668314.css +0 -3
  159. /package/.next/static/chunks/{30d07d85-393352a92199f695.js → 30d07d85.1dc99a921fc18e34.js} +0 -0
  160. /package/.next/static/{p3hosTZoJ22r35fWwUoLr → dwGMLEU53HOvFOWqiZOT0}/_buildManifest.js +0 -0
  161. /package/.next/static/{p3hosTZoJ22r35fWwUoLr → dwGMLEU53HOvFOWqiZOT0}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4362],{24362:function(e,c,n){n.d(c,{createPieServices:function(){return u.l}});var u=n(71498);n(78985)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4721],{24721:function(e,n,c){c.d(n,{createInfoServices:function(){return u.M}});var u=c(38644);c(78985)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5112],{25112:function(e,c,n){n.d(c,{createRadarServices:function(){return r.T}});var r=n(6581);n(78985)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6406],{26406:function(e,c,r){r.d(c,{createArchitectureServices:function(){return t.i}});var t=r(7955);r(78985)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6792],{25770:function(n,r,t){t.d(r,{Z:function(){return o}});var e=t(98721);function u(n){var r=-1,t=null==n?0:n.length;for(this.__data__=new e.Z;++r<t;)this.add(n[r])}u.prototype.add=u.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},u.prototype.has=function(n){return this.__data__.has(n)};var o=u},64364:function(n,r){r.Z=function(n,r){for(var t=-1,e=null==n?0:n.length;++t<e&&!1!==r(n[t],t,n););return n}},84168:function(n,r){r.Z=function(n,r){for(var t=-1,e=null==n?0:n.length,u=0,o=[];++t<e;){var f=n[t];r(f,t,n)&&(o[u++]=f)}return o}},80659:function(n,r){r.Z=function(n,r){for(var t=-1,e=null==n?0:n.length,u=Array(e);++t<e;)u[t]=r(n[t],t,n);return u}},36366:function(n,r){r.Z=function(n,r){for(var t=-1,e=r.length,u=n.length;++t<e;)n[u+t]=r[t];return n}},50388:function(n,r,t){t.d(r,{Z:function(){return i}});var e,u,o=t(2369),f=t(82025),i=(e=o.Z,function(n,r){if(null==n)return n;if(!(0,f.Z)(n))return e(n,r);for(var t=n.length,o=-1,i=Object(n);(u?o--:++o<t)&&!1!==r(i[o],o,i););return n})},41764:function(n,r){r.Z=function(n,r,t,e){for(var u=n.length,o=t+(e?1:-1);e?o--:++o<u;)if(r(n[o],o,n))return o;return -1}},28491:function(n,r,t){t.d(r,{Z:function(){return a}});var e=t(36366),u=t(40856),o=t(70351),f=t(28070),i=u.Z?u.Z.isConcatSpreadable:void 0,c=function(n){return(0,f.Z)(n)||(0,o.Z)(n)||!!(i&&n&&n[i])},a=function n(r,t,u,o,f){var i=-1,a=r.length;for(u||(u=c),f||(f=[]);++i<a;){var Z=r[i];t>0&&u(Z)?t>1?n(Z,t-1,u,o,f):(0,e.Z)(f,Z):o||(f[f.length]=Z)}return f}},2369:function(n,r,t){var e=t(19045),u=t(47799);r.Z=function(n,r){return n&&(0,e.Z)(n,r,u.Z)}},83613:function(n,r,t){var e=t(87439),u=t(47373);r.Z=function(n,r){r=(0,e.Z)(r,n);for(var t=0,o=r.length;null!=n&&t<o;)n=n[(0,u.Z)(r[t++])];return t&&t==o?n:void 0}},34635:function(n,r,t){var e=t(36366),u=t(28070);r.Z=function(n,r,t){var o=r(n);return(0,u.Z)(n)?o:(0,e.Z)(o,t(n))}},42890:function(n,r,t){t.d(r,{Z:function(){return G}});var e=t(8883),u=t(25770),o=function(n,r){for(var t=-1,e=null==n?0:n.length;++t<e;)if(r(n[t],t,n))return!0;return!1},f=t(92363),i=function(n,r,t,e,i,c){var a=1&t,Z=n.length,l=r.length;if(Z!=l&&!(a&&l>Z))return!1;var v=c.get(n),s=c.get(r);if(v&&s)return v==r&&s==n;var h=-1,b=!0,p=2&t?new u.Z:void 0;for(c.set(n,r),c.set(r,n);++h<Z;){var g=n[h],d=r[h];if(e)var y=a?e(d,g,h,r,n,c):e(g,d,h,n,r,c);if(void 0!==y){if(y)continue;b=!1;break}if(p){if(!o(r,function(n,r){if(!(0,f.Z)(p,r)&&(g===n||i(g,n,t,e,c)))return p.push(r)})){b=!1;break}}else if(!(g===d||i(g,d,t,e,c))){b=!1;break}}return c.delete(n),c.delete(r),b},c=t(40856),a=t(6408),Z=t(84338),l=function(n){var r=-1,t=Array(n.size);return n.forEach(function(n,e){t[++r]=[e,n]}),t},v=t(64088),s=c.Z?c.Z.prototype:void 0,h=s?s.valueOf:void 0,b=function(n,r,t,e,u,o,f){switch(t){case"[object DataView]":if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)break;n=n.buffer,r=r.buffer;case"[object ArrayBuffer]":if(n.byteLength!=r.byteLength||!o(new a.Z(n),new a.Z(r)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,Z.Z)(+n,+r);case"[object Error]":return n.name==r.name&&n.message==r.message;case"[object RegExp]":case"[object String]":return n==r+"";case"[object Map]":var c=l;case"[object Set]":var s=1&e;if(c||(c=v.Z),n.size!=r.size&&!s)break;var b=f.get(n);if(b)return b==r;e|=2,f.set(n,r);var p=i(c(n),c(r),e,u,o,f);return f.delete(n),p;case"[object Symbol]":if(h)return h.call(n)==h.call(r)}return!1},p=t(1782),g=Object.prototype.hasOwnProperty,d=function(n,r,t,e,u,o){var f=1&t,i=(0,p.Z)(n),c=i.length;if(c!=(0,p.Z)(r).length&&!f)return!1;for(var a=c;a--;){var Z=i[a];if(!(f?Z in r:g.call(r,Z)))return!1}var l=o.get(n),v=o.get(r);if(l&&v)return l==r&&v==n;var s=!0;o.set(n,r),o.set(r,n);for(var h=f;++a<c;){var b=n[Z=i[a]],d=r[Z];if(e)var y=f?e(d,b,Z,r,n,o):e(b,d,Z,n,r,o);if(!(void 0===y?b===d||u(b,d,t,e,o):y)){s=!1;break}h||(h="constructor"==Z)}if(s&&!h){var _=n.constructor,j=r.constructor;_!=j&&"constructor"in n&&"constructor"in r&&!("function"==typeof _&&_ instanceof _&&"function"==typeof j&&j instanceof j)&&(s=!1)}return o.delete(n),o.delete(r),s},y=t(68748),_=t(28070),j=t(23605),w=t(9798),O="[object Arguments]",m="[object Array]",k="[object Object]",A=Object.prototype.hasOwnProperty,E=function(n,r,t,u,o,f){var c=(0,_.Z)(n),a=(0,_.Z)(r),Z=c?m:(0,y.Z)(n),l=a?m:(0,y.Z)(r);Z=Z==O?k:Z,l=l==O?k:l;var v=Z==k,s=l==k,h=Z==l;if(h&&(0,j.Z)(n)){if(!(0,j.Z)(r))return!1;c=!0,v=!1}if(h&&!v)return f||(f=new e.Z),c||(0,w.Z)(n)?i(n,r,t,u,o,f):b(n,r,Z,t,u,o,f);if(!(1&t)){var p=v&&A.call(n,"__wrapped__"),g=s&&A.call(r,"__wrapped__");if(p||g){var E=p?n.value():n,S=g?r.value():r;return f||(f=new e.Z),o(E,S,t,u,f)}}return!!h&&(f||(f=new e.Z),d(n,r,t,u,o,f))},S=t(82370),z=function n(r,t,e,u,o){return r===t||(null!=r&&null!=t&&((0,S.Z)(r)||(0,S.Z)(t))?E(r,t,e,u,n,o):r!=r&&t!=t)},C=function(n,r,t,u){var o=t.length,f=o,i=!u;if(null==n)return!f;for(n=Object(n);o--;){var c=t[o];if(i&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++o<f;){var a=(c=t[o])[0],Z=n[a],l=c[1];if(i&&c[2]){if(void 0===Z&&!(a in n))return!1}else{var v=new e.Z;if(u)var s=u(Z,l,a,n,r,v);if(!(void 0===s?z(l,Z,3,u,v):s))return!1}}return!0},L=t(7632),N=function(n){return n==n&&!(0,L.Z)(n)},P=t(47799),$=function(n){for(var r=(0,P.Z)(n),t=r.length;t--;){var e=r[t],u=n[e];r[t]=[e,u,N(u)]}return r},B=function(n,r){return function(t){return null!=t&&t[n]===r&&(void 0!==r||n in Object(t))}},D=function(n){var r=$(n);return 1==r.length&&r[0][2]?B(r[0][0],r[0][1]):function(t){return t===n||C(t,n,r)}},x=t(83613),I=function(n,r,t){var e=null==n?void 0:(0,x.Z)(n,r);return void 0===e?t:e},M=t(95222),R=t(19823),V=t(47373),q=t(20937),F=t(62838),G=function(n){var r,t,e;if("function"==typeof n)return n;if(null==n)return q.Z;if("object"==typeof n){;return(0,_.Z)(n)?(r=n[0],t=n[1],(0,R.Z)(r)&&N(t)?B((0,V.Z)(r),t):function(n){var e=I(n,r);return void 0===e&&e===t?(0,M.Z)(n,r):z(t,e,3)}):D(n)}return e=n,(0,R.Z)(e)?(0,F.Z)((0,V.Z)(e)):function(n){return(0,x.Z)(n,e)}}},62838:function(n,r){r.Z=function(n){return function(r){return null==r?void 0:r[n]}}},80512:function(n,r,t){t.d(r,{Z:function(){return s}});var e=t(25770),u=t(41764),o=function(n){return n!=n},f=function(n,r,t){for(var e=t-1,u=n.length;++e<u;)if(n[e]===r)return e;return -1},i=function(n,r){return!!(null==n?0:n.length)&&(r==r?f(n,r,0):(0,u.Z)(n,o,0))>-1},c=function(n,r,t){for(var e=-1,u=null==n?0:n.length;++e<u;)if(t(r,n[e]))return!0;return!1},a=t(92363),Z=t(32974),l=t(64088),v=Z.Z&&1/(0,l.Z)(new Z.Z([,-0]))[1]==1/0?function(n){return new Z.Z(n)}:function(){},s=function(n,r,t){var u=-1,o=i,f=n.length,Z=!0,s=[],h=s;if(t)Z=!1,o=c;else if(f>=200){var b=r?null:v(n);if(b)return(0,l.Z)(b);Z=!1,o=a.Z,h=new e.Z}else h=r?[]:s;n:for(;++u<f;){var p=n[u],g=r?r(p):p;if(p=t||0!==p?p:0,Z&&g==g){for(var d=h.length;d--;)if(h[d]===g)continue n;r&&h.push(g),s.push(p)}else o(h,g,t)||(h!==s&&h.push(g),s.push(p))}return s}},92363:function(n,r){r.Z=function(n,r){return n.has(r)}},45900:function(n,r,t){var e=t(20937);r.Z=function(n){return"function"==typeof n?n:e.Z}},87439:function(n,r,t){t.d(r,{Z:function(){return s}});var e,u,o,f=t(28070),i=t(19823),c=t(98509),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z=/\\(\\)?/g,l=(e=function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(a,function(n,t,e,u){r.push(e?u.replace(Z,"$1"):t||n)}),r},o=(u=(0,c.Z)(e,function(n){return 500===o.size&&o.clear(),n})).cache,u),v=t(36720),s=function(n,r){return(0,f.Z)(n)?n:(0,i.Z)(n,r)?[n]:l((0,v.Z)(n))}},1782:function(n,r,t){var e=t(34635),u=t(35038),o=t(47799);r.Z=function(n){return(0,e.Z)(n,o.Z,u.Z)}},35038:function(n,r,t){var e=t(84168),u=t(88157),o=Object.prototype.propertyIsEnumerable,f=Object.getOwnPropertySymbols,i=f?function(n){return null==n?[]:(n=Object(n),(0,e.Z)(f(n),function(r){return o.call(n,r)}))}:u.Z;r.Z=i},93025:function(n,r,t){var e=t(87439),u=t(70351),o=t(28070),f=t(65482),i=t(53934),c=t(47373);r.Z=function(n,r,t){r=(0,e.Z)(r,n);for(var a=-1,Z=r.length,l=!1;++a<Z;){var v=(0,c.Z)(r[a]);if(!(l=null!=n&&t(n,v)))break;n=n[v]}return l||++a!=Z?l:!!(Z=null==n?0:n.length)&&(0,i.Z)(Z)&&(0,f.Z)(v,Z)&&((0,o.Z)(n)||(0,u.Z)(n))}},19823:function(n,r,t){var e=t(28070),u=t(82245),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f=/^\w*$/;r.Z=function(n,r){if((0,e.Z)(n))return!1;var t=typeof n;return!!("number"==t||"symbol"==t||"boolean"==t||null==n||(0,u.Z)(n))||f.test(n)||!o.test(n)||null!=r&&n in Object(r)}},64088:function(n,r){r.Z=function(n){var r=-1,t=Array(n.size);return n.forEach(function(n){t[++r]=n}),t}},47373:function(n,r,t){var e=t(82245),u=1/0;r.Z=function(n){if("string"==typeof n||(0,e.Z)(n))return n;var r=n+"";return"0"==r&&1/n==-u?"-0":r}},99812:function(n,r,t){t.d(r,{Z:function(){return c}});var e=t(84168),u=t(50388),o=function(n,r){var t=[];return(0,u.Z)(n,function(n,e,u){r(n,e,u)&&t.push(n)}),t},f=t(42890),i=t(28070),c=function(n,r){return((0,i.Z)(n)?e.Z:o)(n,(0,f.Z)(r,3))}},81585:function(n,r,t){var e=t(64364),u=t(50388),o=t(45900),f=t(28070);r.Z=function(n,r){return((0,f.Z)(n)?e.Z:u.Z)(n,(0,o.Z)(r))}},95222:function(n,r,t){t.d(r,{Z:function(){return o}});var e=function(n,r){return null!=n&&r in Object(n)},u=t(93025),o=function(n,r){return null!=n&&(0,u.Z)(n,r,e)}},82245:function(n,r,t){var e=t(59576),u=t(82370);r.Z=function(n){return"symbol"==typeof n||(0,u.Z)(n)&&"[object Symbol]"==(0,e.Z)(n)}},47799:function(n,r,t){var e=t(70836),u=t(35400),o=t(82025);r.Z=function(n){return(0,o.Z)(n)?(0,e.Z)(n):(0,u.Z)(n)}},49579:function(n,r,t){t.d(r,{Z:function(){return c}});var e=function(n,r,t,e){var u=-1,o=null==n?0:n.length;for(e&&o&&(t=n[++u]);++u<o;)t=r(t,n[u],u,n);return t},u=t(50388),o=t(42890),f=function(n,r,t,e,u){return u(n,function(n,u,o){t=e?(e=!1,n):r(t,n,u,o)}),t},i=t(28070),c=function(n,r,t){var c=(0,i.Z)(n)?e:f,a=arguments.length<3;return c(n,(0,o.Z)(r,4),t,a,u.Z)}},88157:function(n,r){r.Z=function(){return[]}},36720:function(n,r,t){t.d(r,{Z:function(){return l}});var e=t(40856),u=t(80659),o=t(28070),f=t(82245),i=1/0,c=e.Z?e.Z.prototype:void 0,a=c?c.toString:void 0,Z=function n(r){if("string"==typeof r)return r;if((0,o.Z)(r))return(0,u.Z)(r,n)+"";if((0,f.Z)(r))return a?a.call(r):"";var t=r+"";return"0"==t&&1/r==-i?"-0":t},l=function(n){return null==n?"":Z(n)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8091],{20318:function(e,t,n){n.d(t,{Ix:function(){return x},pm:function(){return m}});var r=n(57437),a=n(2265),s=n(41671),l=n(99388),o=n(33245),i=n(32489),c=n(3468);function d(e){let{type:t,iconColor:n}=e,a="h-5 w-5 ".concat(n);switch(t){case"success":return(0,r.jsx)(s.Z,{className:a,"data-testid":"toast-icon-success"});case"error":return(0,r.jsx)(l.Z,{className:a,"data-testid":"toast-icon-error"});default:return(0,r.jsx)(o.Z,{className:a,"data-testid":"toast-icon-info"})}}function u(e){let{id:t,message:n,type:s,onClose:l,duration:o=3e3}=e,c=(0,a.useRef)(null),u=function(e){switch(e){case"success":return{bgColor:"bg-green-50",borderColor:"border-green-200",textColor:"text-green-800",iconColor:"text-green-500"};case"error":return{bgColor:"bg-red-50",borderColor:"border-red-200",textColor:"text-red-800",iconColor:"text-red-500"};default:return{bgColor:"bg-blue-50",borderColor:"border-blue-200",textColor:"text-blue-800",iconColor:"text-blue-500"}}}(s);(0,a.useEffect)(()=>(o>0&&(c.current=setTimeout(()=>{l(t)},o)),()=>{c.current&&clearTimeout(c.current)}),[t,o,l]);let x=(0,a.useCallback)(()=>{c.current&&clearTimeout(c.current),l(t)},[t,l]);return(0,r.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(u.bgColor,"\n ").concat(u.borderColor,"\n ").concat(u.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n animate-slide-in\n "),children:[(0,r.jsx)(d,{type:s,iconColor:u.iconColor}),(0,r.jsx)("p",{className:"flex-1 text-sm font-medium",children:n}),(0,r.jsx)("button",{"data-testid":"toast-close-button",onClick:x,"aria-label":"Close notification",className:"\n ".concat(u.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})]})}function x(e){let{toasts:t,onClose:n}=e;return(0,r.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:c.k.TOAST},children:t.map(e=>(0,r.jsx)(u,{id:e.id,message:e.message,type:e.type,onClose:n,duration:e.duration},e.id))})}function m(){let[e,t]=(0,a.useState)([]),n=(0,a.useRef)(0);return{toasts:e,showToast:(0,a.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,s="toast-".concat(++n.current,"-").concat(Date.now()),l={id:s,message:e,type:r,duration:a};return t(e=>[...e,l]),s},[]),removeToast:(0,a.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),clearToasts:(0,a.useCallback)(()=>{t([])},[])}}},8820:function(e,t,n){n.d(t,{Vw:function(){return M}});var r=n(57437),a=n(2265);n(27648);var s=n(43241),l=n(58819),o=n(99376),i=n(34021),c=n(8672),d=n(74707);function u(e){let{status:t,label:n}=e,a=c.F4[t],s="".concat(n,": ").concat(a.label);return"spinner"===a.type?(0,r.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0 border-2 border-t-transparent animate-spin ".concat(a.className),title:s,"aria-label":s}):(0,r.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0 ".concat(a.className),title:s,"aria-label":s})}let x=(0,a.memo)(function(e){let{branch:t,isSelected:n,onClick:a}=e;return(0,r.jsxs)("button",{"data-testid":"branch-list-item",onClick:a,"aria-current":n?"true":void 0,className:"\n w-full px-4 py-3 flex flex-col gap-1\n hover:bg-gray-800 transition-colors\n focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500\n ".concat(n?"bg-gray-700 border-l-2 border-blue-500":"border-l-2 border-transparent","\n "),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[t.cliStatus&&Object.keys(t.cliStatus).length>0&&(0,r.jsx)("div",{className:"flex items-center gap-1 flex-shrink-0","aria-label":"CLI tool status",children:Object.entries(t.cliStatus).map(e=>{let[t,n]=e;return(0,r.jsx)(u,{status:null!=n?n:"idle",label:(0,d.Ds)(t)},t)})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white truncate",children:t.name}),(0,r.jsx)("p",{className:"text-xs text-gray-400 truncate",children:t.repositoryName})]}),t.hasUnread&&(0,r.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-blue-500 flex-shrink-0","aria-label":"Has unread messages"})]}),t.description&&(0,r.jsx)("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:(0,r.jsx)("p",{className:"text-xs text-gray-400 line-clamp-2",children:t.description})})]})}),m=[{key:"updatedAt",label:"Updated"},{key:"repositoryName",label:"Repository"},{key:"branchName",label:"Branch"},{key:"status",label:"Status"}],h=(0,a.memo)(function(){var e;let{sortKey:t,sortDirection:n,setSortKey:l,setSortDirection:o}=(0,s.Sz)(),[i,c]=(0,a.useState)(!1),d=(0,a.useRef)(null);(0,a.useEffect)(()=>{function e(e){d.current&&!d.current.contains(e.target)&&c(!1)}if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]),(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&c(!1)}if(i)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let u=(0,a.useCallback)(()=>{c(e=>!e)},[]),x=(0,a.useCallback)(e=>{e===t?o("asc"===n?"desc":"asc"):(l(e),o("updatedAt"===e?"desc":"asc")),c(!1)},[t,n,l,o]),h=(0,a.useCallback)(()=>{o("asc"===n?"desc":"asc")},[n,o]),b=(null===(e=m.find(e=>e.key===t))||void 0===e?void 0:e.label)||"Sort";return(0,r.jsxs)("div",{ref:d,className:"relative","data-testid":"sort-selector",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("button",{type:"button",onClick:u,"aria-expanded":i,"aria-haspopup":"listbox","aria-label":"Sort by ".concat(b),className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:[(0,r.jsx)(f,{className:"w-3 h-3"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:b})]}),(0,r.jsx)("button",{type:"button",onClick:h,"aria-label":"asc"===n?"Sort ascending":"Sort descending",className:" p-1 rounded text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:"asc"===n?(0,r.jsx)(g,{className:"w-3 h-3"}):(0,r.jsx)(p,{className:"w-3 h-3"})})]}),i&&(0,r.jsx)("div",{role:"listbox","aria-label":"Sort options",className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-gray-800 border border-gray-600 ",children:m.map(e=>(0,r.jsxs)("button",{type:"button",role:"option","aria-selected":t===e.key,onClick:()=>x(e.key),className:"\n w-full px-3 py-2 text-left text-sm\n flex items-center justify-between\n hover:bg-gray-700 transition-colors\n ".concat(t===e.key?"text-blue-400":"text-gray-300","\n "),children:[(0,r.jsx)("span",{children:e.label}),t===e.key&&(0,r.jsx)("span",{className:"text-xs",children:"asc"===n?"ASC":"DESC"})]},e.key))})]})});function f(e){let{className:t}=e;return(0,r.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function g(e){let{className:t}=e;return(0,r.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function p(e){let{className:t}=e;return(0,r.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}var b=n(69234);let y=["en","ja"],v={en:"English",ja:"日本語"};function w(){let{currentLocale:e,switchLocale:t}={currentLocale:(0,b.bU)(),switchLocale:e=>{y.includes(e)&&(!function(e){let t="https:"===window.location.protocol;document.cookie="".concat("locale","=").concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax").concat(t?";Secure":"")}(e),localStorage.setItem("locale",e),window.location.reload())}};return(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),"aria-label":"Language",className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm ",children:y.map(e=>(0,r.jsx)("option",{value:e,children:v[e]},e))})}var j=n(38706),N=n(14362);function k(){let e=(0,j.T)("auth"),t=(0,N.m)(),[n,s]=(0,a.useState)(!1);if(!t)return null;async function l(){s(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}return(0,r.jsx)("button",{type:"button",onClick:l,disabled:n,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 transition-colors ",children:n?"...":e("logout.button")})}var C=n(47712);let S={waiting:0,ready:1,running:2,generating:3,idle:4},L=(0,a.memo)(function(){let e=(0,o.useRouter)(),{worktrees:t,selectedWorktreeId:n,selectWorktree:l}=(0,i.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:u}=(0,s.Sz)(),[m,f]=(0,a.useState)(""),g=(0,a.useMemo)(()=>{let e=t.map(C.I_),n=e;if(m.trim()){let t=m.toLowerCase();n=e.filter(e=>e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t))}return function(e,t,n){let r=[...e];return r.sort((e,r)=>{let a=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,n=t(e.lastActivity);a=t(r.lastActivity)-n;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),n=r.repositoryName.toLowerCase();a=t.localeCompare(n);break}case"branchName":{let t=e.name.toLowerCase(),n=r.name.toLowerCase();a=t.localeCompare(n);break}case"status":a=S[e.status]-S[r.status]}return("updatedAt"===t?"desc"===n:"asc"===n)?a:-a}),r}(n,d,u)},[t,m,d,u]),p=t=>{l(t),e.push("/worktrees/".concat(t)),c()};return(0,r.jsxs)("nav",{"data-testid":"sidebar","aria-label":"Branch navigation",className:"h-full flex flex-col bg-gray-900 text-white",role:"navigation",children:[(0,r.jsx)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Branches"}),(0,r.jsx)(h,{})]})}),(0,r.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-700",children:(0,r.jsx)("input",{type:"text",placeholder:"Search branches...",value:m,onChange:e=>f(e.target.value),className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white placeholder-gray-400 border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent "})}),(0,r.jsx)("div",{"data-testid":"branch-list",className:"flex-1 overflow-y-auto",children:0===g.length?(0,r.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:m?"No branches found":"No branches available"}):g.map(e=>(0,r.jsx)(x,{branch:e,isSelected:e.id===n,onClick:()=>p(e.id)},e.id))}),(0,r.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-gray-700 space-y-2",children:[(0,r.jsx)(w,{}),(0,r.jsx)(k,{})]})]})});var E=n(3468);let z="transform transition-transform duration-300 ease-out",M=(0,a.memo)(function(e){let{children:t}=e,{isOpen:n,isMobileDrawerOpen:a,closeMobileDrawer:o}=(0,s.Sz)();return(0,l.d)()?(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[a&&(0,r.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:o,"aria-hidden":"true"}),(0,r.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 z-50\n ".concat(z,"\n ").concat(a?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,r.jsx)(L,{})}),(0,r.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden",role:"main",children:t})]}):(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex",children:[(0,r.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72\n ".concat(z,"\n ").concat(n?"translate-x-0":"-translate-x-full","\n "),style:{zIndex:E.k.SIDEBAR},role:"complementary","aria-hidden":!n,children:(0,r.jsx)(L,{})}),(0,r.jsx)("main",{className:"\n flex-1 min-w-0 h-full overflow-hidden\n transition-[padding] duration-300 ease-out\n ".concat(n?"md:pl-72":"md:pl-0","\n "),role:"main",children:t})]})})},98702:function(e,t,n){n.d(t,{u:function(){return o}});var r=n(57437),a=n(2265),s=n(54887),l=n(3468);function o(e){let{isOpen:t,onClose:n,title:o,children:i,size:c="lg",showCloseButton:d=!0,disableClose:u=!1}=e,x=(0,a.useRef)(null);return((0,a.useEffect)(()=>{if(u)return;let e=e=>{"Escape"===e.key&&t&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,n,u]),(0,a.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]),t)?(0,s.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:l.k.MODAL},children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:u?void 0:n}),(0,r.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,r.jsxs)("div",{ref:x,className:"relative w-full ".concat({sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[c]," max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-white rounded-lg shadow-xl transform transition-all"),children:[(o||d)&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 flex-shrink-0",children:[(0,r.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:o}),d&&(0,r.jsx)("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:(0,r.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:i})]})})]}),document.body):null}},10789:function(e,t,n){n.d(t,{Ct:function(){return c},zx:function(){return a},Zb:function(){return s},aY:function(){return i},Ol:function(){return l},ll:function(){return o},u_:function(){return d.u}});var r=n(57437);function a(e){let{variant:t="primary",size:n="md",fullWidth:a=!1,loading:s=!1,disabled:l,className:o="",children:i,...c}=e,d=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[t],{sm:"btn-sm",md:"",lg:"btn-lg"}[n],a?"w-full":"",l||s?"opacity-50 cursor-not-allowed":"",o].filter(Boolean).join(" ");return(0,r.jsxs)("button",{className:d,disabled:l||s,...c,children:[s&&(0,r.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i]})}function s(e){let{hover:t=!1,padding:n="md",className:a="",children:s,...l}=e,o=["card",t?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[n],a].filter(Boolean).join(" ");return(0,r.jsx)("div",{className:o,...l,children:s})}function l(e){let{className:t="",children:n,...a}=e;return(0,r.jsx)("div",{className:"mb-3 ".concat(t),...a,children:n})}function o(e){let{className:t="",children:n,...a}=e;return(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900 ".concat(t),...a,children:n})}function i(e){let{className:t="",children:n,...a}=e;return(0,r.jsx)("div",{className:t,...a,children:n})}function c(e){let{variant:t="gray",dot:n=!1,className:a="",children:s,...l}=e,o=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[t],a].filter(Boolean).join(" ");return(0,r.jsxs)("span",{className:o,...l,children:[n&&(0,r.jsx)("span",{className:"mr-1.5 inline-block h-2 w-2 rounded-full ".concat({success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[t]),"aria-hidden":"true"}),s]})}n(2265);var d=n(98702)},43616:function(e,t,n){n.d(t,{n:function(){return d}});var r=n(57437),a=n(2265),s=n(10789),l=n(20318),o=n(3227),i=n(32636),c=n(93448);function d(e){let{worktreeId:t}=e,[n,d]=(0,a.useState)([]),[u,x]=(0,a.useState)(null),[m,h]=(0,a.useState)(null),[f,g]=(0,a.useState)(!0),[p,b]=(0,a.useState)(null),[y,v]=(0,a.useState)(""),[w,j]=(0,a.useState)(0),[N,k]=(0,a.useState)("all"),[C,S]=(0,a.useState)(!1),{toasts:L,showToast:E,removeToast:z}=(0,l.pm)();(0,a.useEffect)(()=>{(async()=>{try{g(!0),b(null);let e=await o.Iv.getLogs(t);d(e)}catch(e){b((0,o.zG)(e))}finally{g(!1)}})()},[t]);let M=(0,a.useMemo)(()=>"all"===N?n:n.filter(e=>e.toLowerCase().includes(N)),[n,N]),T=async e=>{try{g(!0),b(null);let n=await o.Iv.getLogFile(t,e);h(n.content),x(e),v(""),j(0)}catch(e){b((0,o.zG)(e))}finally{g(!1)}},A=(0,a.useCallback)(async()=>{if(u)try{S(!0);let e=await o.Iv.getLogFile(t,u,{sanitize:!0});await (0,i.v)(e.content),E("Log copied to clipboard (sanitized)","success")}catch(e){E("Failed to export log: ".concat((0,o.zG)(e)),"error")}finally{S(!1)}},[t,u,E]),I=(0,a.useMemo)(()=>{let e;if(!y||!m)return[];let t=RegExp((0,c.hr)(y),"gi"),n=[];for(;null!==(e=t.exec(m));)n.push({index:e.index,length:e[0].length});return n},[y,m]);(0,a.useEffect)(()=>{j(0)},[y]);let D=()=>{I.length>0&&j(e=>(e+1)%I.length)},R=()=>{I.length>0&&j(e=>(e-1+I.length)%I.length)},B=(0,a.useMemo)(()=>{if(!m||!y||0===I.length)return m;let e="",t=0;return I.forEach((n,r)=>{e+=(0,c.Xv)(m.substring(t,n.index));let a=m.substring(n.index,n.index+n.length),s=r===w;e+='<mark class="'.concat(s?"bg-yellow-400 text-black":"bg-yellow-200 text-black",'" data-match-index="').concat(r,'">').concat((0,c.Xv)(a),"</mark>"),t=n.index+n.length}),e+=(0,c.Xv)(m.substring(t))},[m,y,I,w]);return(0,a.useEffect)(()=>{I.length>0&&w>=0&&setTimeout(()=>{let e=document.querySelector('mark[data-match-index="'.concat(w,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)},[w,I.length]),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)(s.Zb,{padding:"md",children:[(0,r.jsx)(s.Ol,{children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(s.ll,{children:"Log Files"}),(0,r.jsx)(s.Ct,{variant:"gray",children:M.length})]}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsxs)(s.zx,{variant:"all"===N?"primary":"ghost",size:"sm",onClick:()=>k("all"),children:["All (",n.length,")"]}),(0,r.jsxs)(s.zx,{variant:"claude"===N?"primary":"ghost",size:"sm",onClick:()=>k("claude"),children:["Claude (",n.filter(e=>e.toLowerCase().includes("claude")).length,")"]}),(0,r.jsxs)(s.zx,{variant:"codex"===N?"primary":"ghost",size:"sm",onClick:()=>k("codex"),children:["Codex (",n.filter(e=>e.toLowerCase().includes("codex")).length,")"]}),(0,r.jsxs)(s.zx,{variant:"gemini"===N?"primary":"ghost",size:"sm",onClick:()=>k("gemini"),children:["Gemini (",n.filter(e=>e.toLowerCase().includes("gemini")).length,")"]})]})]})}),(0,r.jsxs)(s.aY,{children:[f&&0===n.length&&(0,r.jsx)("div",{className:"text-center py-4",children:(0,r.jsx)("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-gray-300 border-t-blue-600"})}),p&&(0,r.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:p}),!f&&0===M.length&&!p&&(0,r.jsx)("p",{className:"text-sm text-gray-600 text-center py-4",children:"all"===N?"No log files found":"No ".concat(N," log files found")}),M.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:M.map(e=>(0,r.jsx)("button",{onClick:()=>T(e),className:"w-full text-left px-3 py-2 rounded text-sm font-mono transition-colors ".concat(u===e?"bg-blue-50 text-blue-700 border border-blue-200":"hover:bg-gray-50 border border-transparent"),children:e},e))})]})]}),u&&(0,r.jsxs)(s.Zb,{padding:"md",children:[(0,r.jsx)(s.Ol,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(s.ll,{className:"font-mono text-base",children:u}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(s.zx,{variant:"ghost",size:"sm",onClick:A,disabled:!u||C,title:"Copy sanitized log to clipboard",children:C?"Exporting...":"Export"}),(0,r.jsx)(s.zx,{variant:"ghost",size:"sm",onClick:()=>{x(null),h(null),v(""),j(0)},children:"Close"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",value:y,onChange:e=>v(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.shiftKey?R():D())},placeholder:"Search in log file...",className:"input w-full pr-20"}),I.length>0&&(0,r.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-500",children:[w+1," / ",I.length]})]}),I.length>0&&(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(s.zx,{variant:"ghost",size:"sm",onClick:R,disabled:0===I.length,title:"Previous match (Shift+Enter)",children:"↑"}),(0,r.jsx)(s.zx,{variant:"ghost",size:"sm",onClick:D,disabled:0===I.length,title:"Next match (Enter)",children:"↓"})]})]})]})}),(0,r.jsxs)(s.aY,{children:[f&&(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"})}),!f&&m&&(0,r.jsx)("div",{className:"bg-gray-900 text-gray-100 rounded p-4 overflow-x-auto max-h-[500px] scrollbar-thin",children:y&&I.length>0?(0,r.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:B||""}}):(0,r.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap",children:m})}),!f&&y&&0===I.length&&m&&(0,r.jsxs)("div",{className:"text-center py-4 text-sm text-gray-500",children:['No matches found for "',y,'"']})]})]}),(0,r.jsx)(l.Ix,{toasts:L,onClose:z})]})}},6940:function(e,t,n){n.d(t,{R:function(){return x}});var r=n(57437),a=n(2265),s=n(3227);function l(e,t){if(!t.trim())return e;let n=t.toLowerCase();return e.map(e=>({...e,commands:e.commands.filter(e=>{let t=e.name.toLowerCase().includes(n),r=e.description.toLowerCase().includes(n);return t||r})})).filter(e=>e.commands.length>0)}function o(e){let{groups:t,onSelect:n,highlightedIndex:a=-1,className:s=""}=e,l=0;return 0===t.length?(0,r.jsx)("div",{className:"text-sm text-gray-500 p-4 text-center ".concat(s),children:"No commands available"}):(0,r.jsx)("div",{className:"overflow-y-auto ".concat(s),children:t.map(e=>(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("div",{className:"px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider bg-gray-50",children:e.label}),(0,r.jsx)("div",{children:e.commands.map(e=>{let t=l;l++;let s=t===a;return(0,r.jsxs)("button",{type:"button","data-command-item":!0,"data-highlighted":s,onClick:()=>n(e),className:"w-full px-3 py-2 text-left flex items-start gap-2 hover:bg-blue-50 transition-colors ".concat(s?"bg-blue-100":""),children:[(0,r.jsxs)("span",{className:"text-blue-600 font-mono text-sm flex-shrink-0",children:["/",e.name]}),(0,r.jsx)("span",{className:"text-gray-600 text-sm truncate",children:e.description})]},e.name)})})]},e.category))})}function i(e){let{isOpen:t,groups:n,onSelect:s,onClose:i,isMobile:c=!1,position:d,onFreeInput:u}=e,[x,m]=(0,a.useState)(""),[h,f]=(0,a.useState)(0),g=(0,a.useRef)(null),p=(0,a.useMemo)(()=>l(n,x),[n,x]),b=(0,a.useMemo)(()=>p.flatMap(e=>e.commands),[p]);(0,a.useEffect)(()=>{t&&(m(""),f(0),setTimeout(()=>{var e;null===(e=g.current)||void 0===e||e.focus()},50))},[t]);let y=(0,a.useCallback)(e=>{s(e),i()},[s,i]),v=(0,a.useCallback)(e=>{if(t)switch(e.key){case"Escape":e.preventDefault(),i();break;case"ArrowDown":e.preventDefault(),f(e=>Math.min(e+1,b.length-1));break;case"ArrowUp":e.preventDefault(),f(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),b[h]&&y(b[h])}},[t,b,h,i,y]);return((0,a.useEffect)(()=>{if(t)return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[t,v]),t)?c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:i,"aria-hidden":"true"}),(0,r.jsxs)("div",{"data-testid":"slash-command-bottom-sheet",className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-xl z-50 max-h-[70vh] flex flex-col shadow-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Commands"}),(0,r.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",className:"p-2 rounded-full hover:bg-gray-100",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 py-2 border-b border-gray-100",children:(0,r.jsx)("input",{ref:g,type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),u&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>u(x),className:"w-full px-4 py-3 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors",children:[(0,r.jsx)("span",{className:"text-blue-600",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,r.jsx)("span",{className:"text-gray-600",children:"Enter custom command..."})]}),(0,r.jsx)(o,{groups:p,onSelect:y,highlightedIndex:h,className:"flex-1 overflow-y-auto pb-20"})]})]}):(0,r.jsxs)("div",{role:"listbox",className:"absolute bg-white border border-gray-200 rounded-lg shadow-lg z-50 w-80 max-h-96 flex flex-col",style:d?{top:d.top,left:d.left}:{bottom:"100%",left:0,marginBottom:"4px"},children:[(0,r.jsx)("div",{className:"px-3 py-2 border-b border-gray-100",children:(0,r.jsx)("input",{ref:g,type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"})}),u&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>u(x),className:"w-full px-3 py-2 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors text-sm",children:[(0,r.jsx)("span",{className:"text-blue-600",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,r.jsx)("span",{className:"text-gray-600",children:"Enter custom command..."})]}),(0,r.jsx)(o,{groups:p,onSelect:y,highlightedIndex:h,className:"flex-1 overflow-y-auto"}),(0,r.jsxs)("div",{className:"px-3 py-1.5 border-t border-gray-100 text-xs text-gray-400 flex gap-3",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Enter"})," select"]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Esc"})," close"]})]})]}):null}function c(e){let{worktreeId:t,cliToolId:n,disabled:s=!1,onInterrupt:l}=e,[o,i]=(0,a.useState)(!1),c=(0,a.useRef)(0),u=(0,a.useCallback)(async()=>{let e=Date.now();if(!(e-c.current<1e3)){c.current=e,i(!0);try{let e=await fetch("/api/worktrees/".concat(t,"/interrupt"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:n})});if(e.ok)null==l||l();else{let t=await e.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",t.error||e.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{i(!1)}}},[t,n,l]);return(0,r.jsx)("button",{type:"button",onClick:u,disabled:s||o,className:"flex-shrink-0 p-2 text-orange-600 hover:bg-orange-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Stop processing","data-testid":"interrupt-button",children:o?(0,r.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,r.jsx)(d,{})})}function d(){return(0,r.jsx)("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var u=n(58819);function x(e){let{worktreeId:t,onMessageSent:n,cliToolId:o,isSessionRunning:d=!1}=e,[x,m]=(0,a.useState)(""),[h,f]=(0,a.useState)(!1),[g,p]=(0,a.useState)(null),[b,y]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),k=(0,a.useRef)(null),C=(0,a.useRef)(null),S=(0,a.useRef)(!1),L=(0,a.useRef)(null),E=(0,u.d)(),{groups:z}=function(e,t){let[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!0),[c,d]=(0,a.useState)(null),[u,x]=(0,a.useState)(""),[m,h]=(0,a.useState)(t||"claude"),f=(0,a.useCallback)(async()=>{try{i(!0),d(null);let n=e?"/api/worktrees/".concat(e,"/slash-commands"):"/api/slash-commands";t&&(n+="?cliTool=".concat(t));let a=await fetch(n);if(!a.ok)throw Error("HTTP error ".concat(a.status));let s=await a.json();r(s.groups),h(s.cliTool||t||"claude")}catch(e){d((0,s.zG)(e)),r([])}finally{i(!1)}},[e,t]);(0,a.useEffect)(()=>{f()},[f]);let g=(0,a.useMemo)(()=>n.flatMap(e=>e.commands),[n]),p=(0,a.useMemo)(()=>l(n,u),[n,u]);return{groups:n,filteredGroups:p,allCommands:g,loading:o,error:c,filter:u,setFilter:x,refresh:(0,a.useCallback)(()=>{f()},[f]),cliTool:m}}(t,o);(0,a.useEffect)(()=>{let e=k.current;e&&(x?(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,160),"px")):e.style.height="24px")},[x]);let M=async()=>{if(!b&&x.trim()&&!h)try{f(!0),p(null);let e=o||"claude";await s.Iv.sendMessage(t,x.trim(),e),m(""),N(!1),null==n||n(e)}catch(e){p((0,s.zG)(e))}finally{f(!1)}},T=async e=>{e.preventDefault(),await M()},A=()=>{var e;w(!1),N(!1),null===(e=k.current)||void 0===e||e.focus()};return(0,r.jsxs)("div",{ref:L,className:"space-y-2 relative",children:[g&&(0,r.jsx)("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:g}),(0,r.jsxs)("form",{onSubmit:T,className:"flex items-end gap-2 bg-white border border-gray-300 rounded-lg px-4 py-2 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500",children:[E&&(0,r.jsx)("button",{type:"button",onClick:()=>{j&&N(!1),w(!0)},className:"flex-shrink-0 p-2 text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors","aria-label":"Show slash commands","data-testid":"mobile-command-button",children:(0,r.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),(0,r.jsx)("textarea",{ref:k,value:x,onChange:e=>{let t=e.target.value;if(m(t),""===t){N(!1),w(!1);return}j||("/"===t||t.startsWith("/")&&!t.includes(" ")?w(!0):w(!1))},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&v){e.preventDefault(),A();return}if(S.current&&"Enter"===e.key){S.current=!1;return}if("Enter"===e.key&&!b&&(!v||j)){if(E)return;e.shiftKey||(e.preventDefault(),M())}}},onCompositionStart:()=>{y(!0),S.current=!1,C.current&&clearTimeout(C.current)},onCompositionEnd:()=>{y(!1),S.current=!0,C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{S.current=!1},300)},placeholder:E?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:h,rows:1,className:"flex-1 outline-none bg-transparent resize-none py-1 overflow-y-auto scrollbar-thin",style:{minHeight:"24px",maxHeight:"160px"}}),(0,r.jsx)(c,{worktreeId:t,cliToolId:o||"claude",disabled:!d}),(0,r.jsx)("button",{type:"submit",disabled:!x.trim()||h,className:"flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Send message",children:h?(0,r.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,r.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),(0,r.jsx)(i,{isOpen:v,groups:z,onSelect:e=>{var t;m("/".concat(e.name," ")),w(!1),null===(t=k.current)||void 0===t||t.focus()},onClose:A,isMobile:E,onFreeInput:e=>{w(!1),N(!0),m(e?"/".concat(e):"/"),setTimeout(()=>{var e;null===(e=k.current)||void 0===e||e.focus()},50)}})]})}},8672:function(e,t,n){n.d(t,{F4:function(){return i},Ie:function(){return d},xh:function(){return c}});let r="bg-gray-500",a="bg-green-500",s="border-blue-500",l="bg-yellow-500",o="bg-red-500",i={idle:{className:r,label:"Idle",type:"dot"},ready:{className:a,label:"Ready",type:"dot"},running:{className:s,label:"Running",type:"spinner"},waiting:{className:l,label:"Waiting for response",type:"dot"},generating:{className:s,label:"Generating",type:"spinner"}},c={idle:{className:r,label:"Idle",type:"dot"},ready:{className:a,label:"Ready",type:"dot"},running:{className:s,label:"Running",type:"spinner"},waiting:{className:l,label:"Waiting for response",type:"dot"},error:{className:o,label:"Error",type:"dot"}},d={idle:{className:r,label:"Idle - No active session",type:"dot"},ready:{className:a,label:"Ready - Waiting for input",type:"dot"},running:{className:s,label:"Running - Processing",type:"spinner"},waiting:{className:l,label:"Waiting - User input required",type:"dot"},error:{className:o,label:"Error",type:"dot"}}},3468:function(e,t,n){n.d(t,{k:function(){return r}});let r={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},58819:function(e,t,n){n.d(t,{G:function(){return a},d:function(){return s}});var r=n(2265);let a=768;function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=a}=e,[n,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>window.innerWidth<t;s(e());let n=()=>{s(e())};return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[t]),n}},74707:function(e,t,n){n.d(t,{Ds:function(){return s},Ho:function(){return o},Ns:function(){return i},tK:function(){return r},ts:function(){return l}});let r=["claude","codex","gemini","vibe-local","opencode"],a={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode"};function s(e){var t;return null!==(t=a[e])&&void 0!==t?t:e}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&r.includes(e)?s(e):t}let o=128,i=2097152},32636:function(e,t,n){n.d(t,{v:function(){return a}});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function a(e){if(!e||0===e.trim().length)return;let t=e.replace(r,"");await navigator.clipboard.writeText(t)}},98408:function(e,t,n){n.d(t,{G:function(){return l}});var r=n(69073),a=n(8854);let s={en:a._,ja:r.ja};function l(e){var t;return null!==(t=s[e])&&void 0!==t?t:a._}},87348:function(e,t,n){n.d(t,{Fq:function(){return r}}),n(74707);let r=["claude","codex"]},93448:function(e,t,n){function r(e,t){let n=null;return function(){for(var r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];n&&clearTimeout(n),n=setTimeout(()=>{e(...a),n=null},t)}}function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function s(e){let t=new Set;for(let n of e){t.add(n);let e=n.split("/"),r="";for(let n=0;n<e.length-1;n++)r=r?"".concat(r,"/").concat(e[n]):e[n],t.add(r)}return t}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;return e.length<=t?e:"".concat(e.substring(0,t-3),"...")}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}n.d(t,{Ds:function(){return r},Ps:function(){return s},Xv:function(){return o},aS:function(){return l},hr:function(){return a}})},47712:function(e,t,n){n.d(t,{He:function(){return a},I_:function(){return s}});var r=n(87348);function a(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function s(e){var t,n;let s=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt)),l=null!==(t=e.selectedAgents)&&void 0!==t?t:r.Fq,o={};for(let t of l)o[t]=a(null===(n=e.sessionStatusByCli)||void 0===n?void 0:n[t]);return{id:e.id,name:e.name,repositoryName:e.repositoryName,status:"idle",hasUnread:s,lastActivity:e.updatedAt,description:e.description,cliStatus:o}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8125],{18125:function(e,c,n){n.d(c,{createTreemapServices:function(){return r.K}});var r=n(28151);n(78985)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8522],{35539:function(e,t,r){r.d(t,{k:function(){return Z}});var s=r(86620),n=r(98402),i=r(47799),o=r(99812),a=r(45130),h=r(81585),u=r(87826),c=r(28491),d=r(30801),l=r(80512),_=r(38259),f=(0,d.Z)(function(e){return(0,l.Z)((0,c.Z)(e,1,_.Z,!0))}),b=r(33625),p=r(49579);class Z{constructor(e={}){this._isDirected=!Object.prototype.hasOwnProperty.call(e,"directed")||e.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=s.Z(void 0),this._defaultEdgeLabelFn=s.Z(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return n.Z(e)||(e=s.Z(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return i.Z(this._nodes)}sources(){var e=this;return o.Z(this.nodes(),function(t){return a.Z(e._in[t])})}sinks(){var e=this;return o.Z(this.nodes(),function(t){return a.Z(e._out[t])})}setNodes(e,t){var r=arguments,s=this;return h.Z(e,function(e){r.length>1?s.setNode(e,t):s.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],h.Z(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),h.Z(i.Z(this._in[e]),t),delete this._in[e],delete this._preds[e],h.Z(i.Z(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(u.Z(t))t="\0";else{t+="";for(var r=t;!u.Z(r);r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e){if(u.Z(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return i.Z(t)}else if("\0"===e)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var t=this._preds[e];if(t)return i.Z(t)}successors(e){var t=this._sucs[e];if(t)return i.Z(t)}neighbors(e){var t=this.predecessors(e);if(t)return f(t,this.successors(e))}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;h.Z(this._nodes,function(r,s){e(s)&&t.setNode(s,r)}),h.Z(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var s={};return this._isCompound&&h.Z(t.nodes(),function(e){t.setParent(e,function e(n){var i=r.parent(n);return void 0===i||t.hasNode(i)?(s[n]=i,i):i in s?s[i]:e(i)}(e))}),t}setDefaultEdgeLabel(e){return n.Z(e)||(e=s.Z(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return b.Z(this._edgeObjs)}setPath(e,t){var r=this,s=arguments;return p.Z(e,function(e,n){return s.length>1?r.setEdge(e,n,t):r.setEdge(e,n),n}),this}setEdge(){var e,t,r,s,n=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,r=i.name,2==arguments.length&&(s=arguments[1],n=!0)):(e=i,t=arguments[1],r=arguments[3],arguments.length>2&&(s=arguments[2],n=!0)),e=""+e,t=""+t,u.Z(r)||(r=""+r);var o=j(this._isDirected,e,t,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return n&&(this._edgeLabels[o]=s),this;if(!u.Z(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[o]=n?s:this._defaultEdgeLabelFn(e,t,r);var a=function(e,t,r,s){var n=""+t,i=""+r;if(!e&&n>i){var o=n;n=i,i=o}var a={v:n,w:i};return s&&(a.name=s),a}(this._isDirected,e,t,r);return e=a.v,t=a.w,Object.freeze(a),this._edgeObjs[o]=a,g(this._preds[t],e),g(this._sucs[e],t),this._in[t][o]=a,this._out[e][o]=a,this._edgeCount++,this}edge(e,t,r){var s=1==arguments.length?y(this._isDirected,arguments[0]):j(this._isDirected,e,t,r);return this._edgeLabels[s]}hasEdge(e,t,r){var s=1==arguments.length?y(this._isDirected,arguments[0]):j(this._isDirected,e,t,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,s)}removeEdge(e,t,r){var s=1==arguments.length?y(this._isDirected,arguments[0]):j(this._isDirected,e,t,r),n=this._edgeObjs[s];return n&&(e=n.v,t=n.w,delete this._edgeLabels[s],delete this._edgeObjs[s],v(this._preds[t],e),v(this._sucs[e],t),delete this._in[t][s],delete this._out[e][s],this._edgeCount--),this}inEdges(e,t){var r=this._in[e];if(r){var s=b.Z(r);return t?o.Z(s,function(e){return e.v===t}):s}}outEdges(e,t){var r=this._out[e];if(r){var s=b.Z(r);return t?o.Z(s,function(e){return e.w===t}):s}}nodeEdges(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))}}function g(e,t){e[t]?e[t]++:e[t]=1}function v(e,t){--e[t]||delete e[t]}function j(e,t,r,s){var n=""+t,i=""+r;if(!e&&n>i){var o=n;n=i,i=o}return n+"\x01"+i+"\x01"+(u.Z(s)?"\0":s)}function y(e,t){return j(e,t.v,t.w,t.name)}Z.prototype._nodeCount=0,Z.prototype._edgeCount=0},68406:function(e,t,r){r.d(t,{k:function(){return s.k}});var s=r(35539)},7082:function(e,t,r){r.d(t,{Z:function(){return q}});var s=r(8883),n=r(64364),i=r(54646),o=r(66554),a=r(47799),h=r(49625),u=r(36686),c=r(63783),d=r(35038),l=r(36366),_=r(91408),f=r(88157),b=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,l.Z)(t,(0,d.Z)(e)),e=(0,_.Z)(e);return t}:f.Z,p=r(1782),Z=r(34635),g=function(e){return(0,Z.Z)(e,h.Z,b)},v=r(68748),j=Object.prototype.hasOwnProperty,y=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&j.call(e,"index")&&(r.index=e.index,r.input=e.input),r},m=r(15403),w=function(e,t){var r=t?(0,m.Z)(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},O=/\w*$/,C=function(e){var t=new e.constructor(e.source,O.exec(e));return t.lastIndex=e.lastIndex,t},E=r(40856),N=E.Z?E.Z.prototype:void 0,A=N?N.valueOf:void 0,L=r(76399),D=function(e,t,r){var s=e.constructor;switch(t){case"[object ArrayBuffer]":return(0,m.Z)(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return w(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return(0,L.Z)(e,r);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return C(e);case"[object Symbol]":return A?Object(A.call(e)):{}}},P=r(51700),F=r(28070),M=r(23605),x=r(82370),S=r(65832),k=r(94914),I=k.Z&&k.Z.isMap,U=I?(0,S.Z)(I):function(e){return(0,x.Z)(e)&&"[object Map]"==(0,v.Z)(e)},B=r(7632),G=k.Z&&k.Z.isSet,R=G?(0,S.Z)(G):function(e){return(0,x.Z)(e)&&"[object Set]"==(0,v.Z)(e)},V="[object Arguments]",z="[object Function]",W="[object Object]",$={};$[V]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object DataView]"]=$["[object Boolean]"]=$["[object Date]"]=$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Map]"]=$["[object Number]"]=$[W]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object Symbol]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Error]"]=$[z]=$["[object WeakMap]"]=!1;var q=function e(t,r,l,_,f,Z){var j,m=1&r,w=2&r,O=4&r;if(l&&(j=f?l(t,_,f,Z):l(t)),void 0!==j)return j;if(!(0,B.Z)(t))return t;var C=(0,F.Z)(t);if(C){if(j=y(t),!m)return(0,c.Z)(t,j)}else{var E,N,A,L,x=(0,v.Z)(t),S=x==z||"[object GeneratorFunction]"==x;if((0,M.Z)(t))return(0,u.Z)(t,m);if(x==W||x==V||S&&!f){if(j=w||S?{}:(0,P.Z)(t),!m)return w?(N=(E=j)&&(0,o.Z)(t,(0,h.Z)(t),E),(0,o.Z)(t,b(t),N)):(L=(A=j)&&(0,o.Z)(t,(0,a.Z)(t),A),(0,o.Z)(t,(0,d.Z)(t),L))}else{if(!$[x])return f?t:{};j=D(t,x,m)}}Z||(Z=new s.Z);var k=Z.get(t);if(k)return k;Z.set(t,j),R(t)?t.forEach(function(s){j.add(e(s,r,l,s,t,Z))}):U(t)&&t.forEach(function(s,n){j.set(n,e(s,r,l,n,t,Z))});var I=O?w?g:p.Z:w?h.Z:a.Z,G=C?void 0:I(t);return(0,n.Z)(G||t,function(s,n){G&&(s=t[n=s]),(0,i.Z)(j,n,e(s,r,l,n,t,Z))}),j}},87826:function(e,t){t.Z=function(e){return void 0===e}},33625:function(e,t,r){r.d(t,{Z:function(){return i}});var s=r(80659),n=r(47799),i=function(e){var t;return null==e?[]:(t=(0,n.Z)(e),(0,s.Z)(t,function(t){return e[t]}))}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8841],{78841:function(e,r,t){t.d(r,{diagram:function(){return p}});var n=t(8441),a=t(34960),s=t(55166),i=t(31954),d=t(54327),o={parse:(0,i.eW)(async e=>{let r=await (0,d.Qc)("info",e);i.cM.debug(r)},"parse")},c={version:n.X.version+""},p={parser:o,db:{getVersion:(0,i.eW)(()=>c.version,"getVersion")},renderer:{draw:(0,i.eW)((e,r,t)=>{i.cM.debug("rendering info diagram\n"+e);let n=(0,a.P)(r);(0,s.v2)(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${t}`)},"draw")}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8885],{88885:function(e,c,n){n.d(c,{createPacketServices:function(){return t.g}});var t=n(89135);n(78985)}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9178],{47866:function(e){"use strict";let{entries:t,setPrototypeOf:n,isFrozen:r,getPrototypeOf:a,getOwnPropertyDescriptor:o}=Object,{freeze:i,seal:l,create:s}=Object,{apply:c,construct:u}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),l||(l=function(e){return e}),c||(c=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return e.apply(t,r)}),u||(u=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let p=O(Array.prototype.forEach),f=O(Array.prototype.lastIndexOf),d=O(Array.prototype.pop),m=O(Array.prototype.push),h=O(Array.prototype.splice),y=O(String.prototype.toLowerCase),g=O(String.prototype.toString),b=O(String.prototype.match),v=O(String.prototype.replace),T=O(String.prototype.indexOf),E=O(String.prototype.trim),k=O(Object.prototype.hasOwnProperty),A=O(RegExp.prototype.test),_=(V=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(V,t)});function O(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return c(e,t,r)}}function S(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y;n&&n(e,null);let o=t.length;for(;o--;){let n=t[o];if("string"==typeof n){let e=a(n);e!==n&&(r(t)||(t[o]=e),n=e)}e[n]=!0}return e}function N(e){let n=s(null);for(let[r,a]of t(e))k(e,r)&&(Array.isArray(a)?n[r]=function(e){for(let t=0;t<e.length;t++)k(e,t)||(e[t]=null);return e}(a):a&&"object"==typeof a&&a.constructor===Object?n[r]=N(a):n[r]=a);return n}function R(e,t){for(;null!==e;){let n=o(e,t);if(n){if(n.get)return O(n.get);if("function"==typeof n.value)return O(n.value)}e=a(e)}return function(){return null}}let C=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),x=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),w=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),D=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=i(["#text"]),L=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),H=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),z=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),U=l(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$=l(/<%[\w\W]*|[\w\W]*%>/gm),F=l(/\$\{[\w\W]*/gm),Z=l(/^data-[\-\w.\u00B7-\uFFFF]+$/),B=l(/^aria-[\-\w]+$/),W=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=l(/^(?:\w+script|data):/i),Y=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q=l(/^html$/i);var V,K=Object.freeze({__proto__:null,ARIA_ATTR:B,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:l(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:Z,DOCTYPE_NAME:q,ERB_EXPR:$,IS_ALLOWED_URI:W,IS_SCRIPT_OR_DATA:G,MUSTACHE_EXPR:U,TMPLIT_EXPR:F});let X={element:1,text:3,progressingInstruction:7,comment:8,document:9},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Q=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var ee=function e(){let n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,a=t=>e(t);if(a.version="3.3.1",a.removed=[],!r||!r.document||r.document.nodeType!==X.document||!r.Element)return a.isSupported=!1,a;let{document:o}=r,l=o,c=l.currentScript,{DocumentFragment:u,HTMLTemplateElement:O,Node:U,Element:$,NodeFilter:F,NamedNodeMap:Z=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:B,DOMParser:G,trustedTypes:Y}=r,V=$.prototype,ee=R(V,"cloneNode"),et=R(V,"remove"),en=R(V,"nextSibling"),er=R(V,"childNodes"),ea=R(V,"parentNode");if("function"==typeof O){let e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let eo="",{implementation:ei,createNodeIterator:el,createDocumentFragment:es,getElementsByTagName:ec}=o,{importNode:eu}=l,ep=Q();a.isSupported="function"==typeof t&&"function"==typeof ea&&ei&&void 0!==ei.createHTMLDocument;let{MUSTACHE_EXPR:ef,ERB_EXPR:ed,TMPLIT_EXPR:em,DATA_ATTR:eh,ARIA_ATTR:ey,IS_SCRIPT_OR_DATA:eg,ATTR_WHITESPACE:eb,CUSTOM_ELEMENT:ev}=K,{IS_ALLOWED_URI:eT}=K,eE=null,ek=S({},[...C,...x,...w,...M,...P]),eA=null,e_=S({},[...L,...H,...j,...z]),eO=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eS=null,eN=null,eR=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),eC=!0,ex=!0,ew=!1,eI=!0,eM=!1,eD=!0,eP=!1,eL=!1,eH=!1,ej=!1,ez=!1,eU=!1,e$=!0,eF=!1,eZ=!0,eB=!1,eW={},eG=null,eY=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),eq=null,eV=S({},["audio","video","img","source","image","track"]),eK=null,eX=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eJ="http://www.w3.org/1998/Math/MathML",eQ="http://www.w3.org/2000/svg",e0="http://www.w3.org/1999/xhtml",e1=e0,e2=!1,e9=null,e7=S({},[eJ,eQ,e0],g),e4=S({},["mi","mo","mn","ms","mtext"]),e3=S({},["annotation-xml"]),e5=S({},["title","style","font","a","script"]),e8=null,e6=["application/xhtml+xml","text/html"],te=null,tt=null,tn=o.createElement("form"),tr=function(e){return e instanceof RegExp||e instanceof Function},ta=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!tt||tt!==e){if(e&&"object"==typeof e||(e={}),e=N(e),te="application/xhtml+xml"===(e8=-1===e6.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?g:y,eE=k(e,"ALLOWED_TAGS")?S({},e.ALLOWED_TAGS,te):ek,eA=k(e,"ALLOWED_ATTR")?S({},e.ALLOWED_ATTR,te):e_,e9=k(e,"ALLOWED_NAMESPACES")?S({},e.ALLOWED_NAMESPACES,g):e7,eK=k(e,"ADD_URI_SAFE_ATTR")?S(N(eX),e.ADD_URI_SAFE_ATTR,te):eX,eq=k(e,"ADD_DATA_URI_TAGS")?S(N(eV),e.ADD_DATA_URI_TAGS,te):eV,eG=k(e,"FORBID_CONTENTS")?S({},e.FORBID_CONTENTS,te):eY,eS=k(e,"FORBID_TAGS")?S({},e.FORBID_TAGS,te):N({}),eN=k(e,"FORBID_ATTR")?S({},e.FORBID_ATTR,te):N({}),eW=!!k(e,"USE_PROFILES")&&e.USE_PROFILES,eC=!1!==e.ALLOW_ARIA_ATTR,ex=!1!==e.ALLOW_DATA_ATTR,ew=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eI=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eM=e.SAFE_FOR_TEMPLATES||!1,eD=!1!==e.SAFE_FOR_XML,eP=e.WHOLE_DOCUMENT||!1,ej=e.RETURN_DOM||!1,ez=e.RETURN_DOM_FRAGMENT||!1,eU=e.RETURN_TRUSTED_TYPE||!1,eH=e.FORCE_BODY||!1,e$=!1!==e.SANITIZE_DOM,eF=e.SANITIZE_NAMED_PROPS||!1,eZ=!1!==e.KEEP_CONTENT,eB=e.IN_PLACE||!1,eT=e.ALLOWED_URI_REGEXP||W,e1=e.NAMESPACE||e0,e4=e.MATHML_TEXT_INTEGRATION_POINTS||e4,e3=e.HTML_INTEGRATION_POINTS||e3,eO=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tr(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(eO.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tr(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(eO.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(eO.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),eM&&(ex=!1),ez&&(ej=!0),eW&&(eE=S({},P),eA=[],!0===eW.html&&(S(eE,C),S(eA,L)),!0===eW.svg&&(S(eE,x),S(eA,H),S(eA,z)),!0===eW.svgFilters&&(S(eE,w),S(eA,H),S(eA,z)),!0===eW.mathMl&&(S(eE,M),S(eA,j),S(eA,z))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?eR.tagCheck=e.ADD_TAGS:(eE===ek&&(eE=N(eE)),S(eE,e.ADD_TAGS,te))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?eR.attributeCheck=e.ADD_ATTR:(eA===e_&&(eA=N(eA)),S(eA,e.ADD_ATTR,te))),e.ADD_URI_SAFE_ATTR&&S(eK,e.ADD_URI_SAFE_ATTR,te),e.FORBID_CONTENTS&&(eG===eY&&(eG=N(eG)),S(eG,e.FORBID_CONTENTS,te)),e.ADD_FORBID_CONTENTS&&(eG===eY&&(eG=N(eG)),S(eG,e.ADD_FORBID_CONTENTS,te)),eZ&&(eE["#text"]=!0),eP&&S(eE,["html","head","body"]),eE.table&&(S(eE,["tbody"]),delete eS.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');eo=(n=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===n&&(n=J(Y,c)),null!==n&&"string"==typeof eo&&(eo=n.createHTML(""));i&&i(e),tt=e}},to=S({},[...x,...w,...I]),ti=S({},[...M,...D]),tl=function(e){let t=ea(e);t&&t.tagName||(t={namespaceURI:e1,tagName:"template"});let n=y(e.tagName),r=y(t.tagName);return!!e9[e.namespaceURI]&&(e.namespaceURI===eQ?t.namespaceURI===e0?"svg"===n:t.namespaceURI===eJ?"svg"===n&&("annotation-xml"===r||e4[r]):!!to[n]:e.namespaceURI===eJ?t.namespaceURI===e0?"math"===n:t.namespaceURI===eQ?"math"===n&&e3[r]:!!ti[n]:e.namespaceURI===e0?(t.namespaceURI!==eQ||!!e3[r])&&(t.namespaceURI!==eJ||!!e4[r])&&!ti[n]&&(e5[n]||!to[n]):"application/xhtml+xml"===e8&&!!e9[e.namespaceURI])},ts=function(e){m(a.removed,{element:e});try{ea(e).removeChild(e)}catch(t){et(e)}},tc=function(e,t){try{m(a.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){m(a.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e){if(ej||ez)try{ts(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}}},tu=function(e){let t=null,r=null;if(eH)e="<remove></remove>"+e;else{let t=b(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===e8&&e1===e0&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let a=n?n.createHTML(e):e;if(e1===e0)try{t=new G().parseFromString(a,e8)}catch(e){}if(!t||!t.documentElement){t=ei.createDocument(e1,"template",null);try{t.documentElement.innerHTML=e2?eo:a}catch(e){}}let i=t.body||t.documentElement;return(e&&r&&i.insertBefore(o.createTextNode(r),i.childNodes[0]||null),e1===e0)?ec.call(t,eP?"html":"body")[0]:eP?t.documentElement:i},tp=function(e){return el.call(e.ownerDocument||e,e,F.SHOW_ELEMENT|F.SHOW_COMMENT|F.SHOW_TEXT|F.SHOW_PROCESSING_INSTRUCTION|F.SHOW_CDATA_SECTION,null)},tf=function(e){return e instanceof B&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof Z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},td=function(e){return"function"==typeof U&&e instanceof U};function tm(e,t,n){p(e,e=>{e.call(a,t,n,tt)})}let th=function(e){let t=null;if(tm(ep.beforeSanitizeElements,e,null),tf(e))return ts(e),!0;let n=te(e.nodeName);if(tm(ep.uponSanitizeElement,e,{tagName:n,allowedTags:eE}),eD&&e.hasChildNodes()&&!td(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent)||e.nodeType===X.progressingInstruction||eD&&e.nodeType===X.comment&&A(/<[/\w]/g,e.data))return ts(e),!0;if(!(eR.tagCheck instanceof Function&&eR.tagCheck(n))&&(!eE[n]||eS[n])){if(!eS[n]&&tg(n)&&(eO.tagNameCheck instanceof RegExp&&A(eO.tagNameCheck,n)||eO.tagNameCheck instanceof Function&&eO.tagNameCheck(n)))return!1;if(eZ&&!eG[n]){let t=ea(e)||e.parentNode,n=er(e)||e.childNodes;if(n&&t){let r=n.length;for(let a=r-1;a>=0;--a){let r=ee(n[a],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,en(e))}}}return ts(e),!0}return e instanceof $&&!tl(e)||("noscript"===n||"noembed"===n||"noframes"===n)&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(ts(e),!0):(eM&&e.nodeType===X.text&&(t=e.textContent,p([ef,ed,em],e=>{t=v(t,e," ")}),e.textContent!==t&&(m(a.removed,{element:e.cloneNode()}),e.textContent=t)),tm(ep.afterSanitizeElements,e,null),!1)},ty=function(e,t,n){if(e$&&("id"===t||"name"===t)&&(n in o||n in tn))return!1;if(ex&&!eN[t]&&A(eh,t));else if(eC&&A(ey,t));else if(eR.attributeCheck instanceof Function&&eR.attributeCheck(t,e));else if(!eA[t]||eN[t]){if(!(tg(e)&&(eO.tagNameCheck instanceof RegExp&&A(eO.tagNameCheck,e)||eO.tagNameCheck instanceof Function&&eO.tagNameCheck(e))&&(eO.attributeNameCheck instanceof RegExp&&A(eO.attributeNameCheck,t)||eO.attributeNameCheck instanceof Function&&eO.attributeNameCheck(t,e))||"is"===t&&eO.allowCustomizedBuiltInElements&&(eO.tagNameCheck instanceof RegExp&&A(eO.tagNameCheck,n)||eO.tagNameCheck instanceof Function&&eO.tagNameCheck(n))))return!1}else if(eK[t]);else if(A(eT,v(n,eb,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===T(n,"data:")&&eq[e]);else if(ew&&!A(eg,v(n,eb,"")));else if(n)return!1;return!0},tg=function(e){return"annotation-xml"!==e&&b(e,ev)},tb=function(e){tm(ep.beforeSanitizeAttributes,e,null);let{attributes:t}=e;if(!t||tf(e))return;let r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:eA,forceKeepAttr:void 0},o=t.length;for(;o--;){let{name:i,namespaceURI:l,value:s}=t[o],c=te(i),u="value"===i?s:E(s);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,tm(ep.uponSanitizeAttribute,e,r),u=r.attrValue,eF&&("id"===c||"name"===c)&&(tc(i,e),u="user-content-"+u),eD&&A(/((--!?|])>)|<\/(style|title|textarea)/i,u)||"attributename"===c&&b(u,"href")){tc(i,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr||!eI&&A(/\/>/i,u)){tc(i,e);continue}eM&&p([ef,ed,em],e=>{u=v(u,e," ")});let f=te(e.nodeName);if(!ty(f,c,u)){tc(i,e);continue}if(n&&"object"==typeof Y&&"function"==typeof Y.getAttributeType){if(l);else switch(Y.getAttributeType(f,c)){case"TrustedHTML":u=n.createHTML(u);break;case"TrustedScriptURL":u=n.createScriptURL(u)}}if(u!==s)try{l?e.setAttributeNS(l,i,u):e.setAttribute(i,u),tf(e)?ts(e):d(a.removed)}catch(t){tc(i,e)}}tm(ep.afterSanitizeAttributes,e,null)},tv=function e(t){let n=null,r=tp(t);for(tm(ep.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)tm(ep.uponSanitizeShadowNode,n,null),th(n),tb(n),n.content instanceof u&&e(n.content);tm(ep.afterSanitizeShadowDOM,t,null)};return a.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,i=null,s=null;if((e2=!e)&&(e="<!-->"),"string"!=typeof e&&!td(e)){if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw _("dirty is not a string, aborting")}else throw _("toString is not a function")}if(!a.isSupported)return e;if(eL||ta(t),a.removed=[],"string"==typeof e&&(eB=!1),eB){if(e.nodeName){let t=te(e.nodeName);if(!eE[t]||eS[t])throw _("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof U)(o=(r=tu("<!---->")).ownerDocument.importNode(e,!0)).nodeType===X.element&&"BODY"===o.nodeName?r=o:"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!ej&&!eM&&!eP&&-1===e.indexOf("<"))return n&&eU?n.createHTML(e):e;if(!(r=tu(e)))return ej?null:eU?eo:""}r&&eH&&ts(r.firstChild);let c=tp(eB?e:r);for(;i=c.nextNode();)th(i),tb(i),i.content instanceof u&&tv(i.content);if(eB)return e;if(ej){if(ez)for(s=es.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(eA.shadowroot||eA.shadowrootmode)&&(s=eu.call(l,s,!0)),s}let f=eP?r.outerHTML:r.innerHTML;return eP&&eE["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&A(q,r.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+f),eM&&p([ef,ed,em],e=>{f=v(f,e," ")}),n&&eU?n.createHTML(f):f},a.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ta(e),eL=!0},a.clearConfig=function(){tt=null,eL=!1},a.isValidAttribute=function(e,t,n){return tt||ta({}),ty(te(e),te(t),n)},a.addHook=function(e,t){"function"==typeof t&&m(ep[e],t)},a.removeHook=function(e,t){if(void 0!==t){let n=f(ep[e],t);return -1===n?void 0:h(ep[e],n,1)[0]}return d(ep[e])},a.removeHooks=function(e){ep[e]=[]},a.removeAllHooks=function(){ep=Q()},a}();e.exports=ee},47835:function(e,t,n){e.exports=self.DOMPurify||(self.DOMPurify=n(47866).default||n(47866))},30401:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},10407:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},93807:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]])},78867:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},42208:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},88964:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]])},48736:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},79548:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]])},56475:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},49465:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},14924:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},47416:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]])},74440:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]])},45675:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},83229:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},18930:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},76865:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},17689:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return a.a}});var r=n(55775),a=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(47043);n(57437),n(2265);let a=r._(n(15602));function o(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,a.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let r=n(18993);function a(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let r=n(57437),a=n(2265),o=n(81523),i=n(70049);function l(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},c=function(e){let t={...s,...e},n=(0,a.lazy)(()=>t.loader().then(l)),c=t.loading;function u(e){let l=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,s=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(i.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(a.Suspense,{fallback:l,children:s})}return u.displayName="LoadableComponent",u}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return o}});let r=n(57437),a=n(20544);function o(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,a.getExpectedRequestStore)("next/dynamic css"),o=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));o.push(...t)}}return 0===o.length?null:(0,r.jsx)(r.Fragment,{children:o.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},10751:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.types=void 0;let o=n(50949);Object.defineProperty(t,"types",{enumerable:!0,get:function(){return o.types}}),a(n(92442),t),a(n(63002),t);let i=n(92442),l=n(63002);a(n(50949),t),t.default=i.tokenizer,e.exports=i.tokenizer,e.exports.types=o.types,e.exports.reconstruct=l.reconstruct},63002:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstruct=void 0;let r=n(50949),a=n(31327),o=e=>e.map(t.reconstruct).join(""),i=e=>{if("options"in e)return e.options.map(o).join("|");if("stack"in e)return o(e.stack);throw Error("options or stack must be Root or Group token")};t.reconstruct=e=>{switch(e.type){case r.types.ROOT:return i(e);case r.types.CHAR:{let t=String.fromCharCode(e.value);return(/[[\\{}$^.|?*+()]/.test(t)?"\\":"")+t}case r.types.POSITION:if("^"===e.value||"$"===e.value)return e.value;return`\\${e.value}`;case r.types.REFERENCE:return`\\${e.value}`;case r.types.SET:return a.writeSetTokens(e);case r.types.GROUP:{let t=e.name?`?<${e.name}>`:e.remember?"":e.followedBy?"?=":e.notFollowedBy?"?!":"?:";return`(${t}${i(e)})`}case r.types.REPETITION:{let n;let{min:r,max:a}=e;return n=0===r&&1===a?"?":1===r&&a===1/0?"+":0===r&&a===1/0?"*":a===1/0?`{${r},}`:r===a?`{${r}}`:`{${r},${a}}`,`${t.reconstruct(e.value)}${n}`}case r.types.RANGE:return`${a.setChar(e.from)}-${a.setChar(e.to)}`;default:throw Error(`Invalid token type ${e}`)}}},42829:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NOTANYCHAR=t.WHITESPACE=t.WORDS=t.INTS=void 0;let i=o(n(84220)),l=n(50949);function s(e){let t={},n=0;for(let r of e)r.type===l.types.CHAR&&(t[r.value]=!0),r.type===l.types.RANGE&&(t[`${r.from}-${r.to}`]=!0),n+=1;return{lookup:()=>Object.assign({},t),len:n}}t.INTS=s(i.ints().set),t.WORDS=s(i.words().set),t.WHITESPACE=s(i.whitespace().set),t.NOTANYCHAR=s(i.anyChar().set)},84220:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.anyChar=t.notWhitespace=t.whitespace=t.notInts=t.ints=t.notWords=t.words=void 0;let r=n(50949),a=()=>[{type:r.types.RANGE,from:48,to:57}],o=()=>[{type:r.types.CHAR,value:95},{type:r.types.RANGE,from:97,to:122},{type:r.types.RANGE,from:65,to:90},{type:r.types.RANGE,from:48,to:57}],i=()=>[{type:r.types.CHAR,value:9},{type:r.types.CHAR,value:10},{type:r.types.CHAR,value:11},{type:r.types.CHAR,value:12},{type:r.types.CHAR,value:13},{type:r.types.CHAR,value:32},{type:r.types.CHAR,value:160},{type:r.types.CHAR,value:5760},{type:r.types.RANGE,from:8192,to:8202},{type:r.types.CHAR,value:8232},{type:r.types.CHAR,value:8233},{type:r.types.CHAR,value:8239},{type:r.types.CHAR,value:8287},{type:r.types.CHAR,value:12288},{type:r.types.CHAR,value:65279}],l=()=>[{type:r.types.CHAR,value:10},{type:r.types.CHAR,value:13},{type:r.types.CHAR,value:8232},{type:r.types.CHAR,value:8233}];t.words=()=>({type:r.types.SET,set:o(),not:!1}),t.notWords=()=>({type:r.types.SET,set:o(),not:!0}),t.ints=()=>({type:r.types.SET,set:a(),not:!1}),t.notInts=()=>({type:r.types.SET,set:a(),not:!0}),t.whitespace=()=>({type:r.types.SET,set:i(),not:!1}),t.notWhitespace=()=>({type:r.types.SET,set:i(),not:!0}),t.anyChar=()=>({type:r.types.SET,set:l(),not:!0})},92442:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.tokenizer=void 0;let i=o(n(82204)),l=n(50949),s=o(n(84220)),c=/^[a-zA-Z_$]$/i,u=/^[a-zA-Z0-9_$]$/i,p=/\d/;t.tokenizer=e=>{let t=0,n,r={type:l.types.ROOT,stack:[]},a=r,o=r.stack,f=[],d=[],m=0,h=t=>{throw SyntaxError(`Invalid regular expression: /${e}/: Nothing to repeat at column ${t-1}`)},y=i.strToChars(e);for(;t<y.length;)switch(n=y[t++]){case"\\":if(t===y.length)throw SyntaxError(`Invalid regular expression: /${e}/: \\ at end of pattern`);switch(n=y[t++]){case"b":o.push({type:l.types.POSITION,value:"b"});break;case"B":o.push({type:l.types.POSITION,value:"B"});break;case"w":o.push(s.words());break;case"W":o.push(s.notWords());break;case"d":o.push(s.ints());break;case"D":o.push(s.notInts());break;case"s":o.push(s.whitespace());break;case"S":o.push(s.notWhitespace());break;default:if(p.test(n)){let e=n;for(;t<y.length&&p.test(y[t]);)e+=y[t++];let r=parseInt(e,10),a={type:l.types.REFERENCE,value:r};o.push(a),d.push({reference:a,stack:o,index:o.length-1})}else o.push({type:l.types.CHAR,value:n.charCodeAt(0)})}break;case"^":o.push({type:l.types.POSITION,value:"^"});break;case"$":o.push({type:l.types.POSITION,value:"$"});break;case"[":{let n;"^"===y[t]?(n=!0,t++):n=!1;let r=i.tokenizeClass(y.slice(t),e);t+=r[1],o.push({type:l.types.SET,set:r[0],not:n});break}case".":o.push(s.anyChar());break;case"(":{let r={type:l.types.GROUP,stack:[],remember:!0};if("?"===y[t]){if(n=y[t+1],t+=2,"="===n)r.followedBy=!0,r.remember=!1;else if("!"===n)r.notFollowedBy=!0,r.remember=!1;else if("<"===n){let n="";if(c.test(y[t]))n+=y[t],t++;else throw SyntaxError(`Invalid regular expression: /${e}/: Invalid capture group name, character '${y[t]}' after '<' at column ${t+1}`);for(;t<y.length&&u.test(y[t]);)n+=y[t],t++;if(!n)throw SyntaxError(`Invalid regular expression: /${e}/: Invalid capture group name, character '${y[t]}' after '<' at column ${t+1}`);if(">"!==y[t])throw SyntaxError(`Invalid regular expression: /${e}/: Unclosed capture group name, expected '>', found '${y[t]}' at column ${t+1}`);r.name=n,t++}else if(":"===n)r.remember=!1;else throw SyntaxError(`Invalid regular expression: /${e}/: Invalid group, character '${n}' after '?' at column ${t-1}`)}else m+=1;o.push(r),f.push(a),a=r,o=r.stack;break}case")":if(0===f.length)throw SyntaxError(`Invalid regular expression: /${e}/: Unmatched ) at column ${t-1}`);o=(a=f.pop()).options?a.options[a.options.length-1]:a.stack;break;case"|":{a.options||(a.options=[a.stack],delete a.stack);let e=[];a.options.push(e),o=e;break}case"{":{let e=/^(\d+)(,(\d+)?)?\}/.exec(y.slice(t)),n,r;null!==e?(0===o.length&&h(t),n=parseInt(e[1],10),r=e[2]?e[3]?parseInt(e[3],10):1/0:n,t+=e[0].length,o.push({type:l.types.REPETITION,min:n,max:r,value:o.pop()})):o.push({type:l.types.CHAR,value:123});break}case"?":0===o.length&&h(t),o.push({type:l.types.REPETITION,min:0,max:1,value:o.pop()});break;case"+":0===o.length&&h(t),o.push({type:l.types.REPETITION,min:1,max:1/0,value:o.pop()});break;case"*":0===o.length&&h(t),o.push({type:l.types.REPETITION,min:0,max:1/0,value:o.pop()});break;default:o.push({type:l.types.CHAR,value:n.charCodeAt(0)})}if(0!==f.length)throw SyntaxError(`Invalid regular expression: /${e}/: Unterminated group`);return function(e,t){for(let n of e.reverse())if(t<n.reference.value){n.reference.type=l.types.CHAR;let e=n.reference.value.toString();if(n.reference.value=parseInt(e,8),!/^[0-7]+$/.test(e)){let t=0;for(;"8"!==e[t]&&"9"!==e[t];)t+=1;if(0===t?(n.reference.value=e.charCodeAt(0),t+=1):n.reference.value=parseInt(e.slice(0,t),8),e.length>t){let r=n.stack.splice(n.index+1);for(let r of e.slice(t))n.stack.push({type:l.types.CHAR,value:r.charCodeAt(0)});n.stack.push(...r)}}}}(d,m),r}},50949:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(33132),t),a(n(78034),t),a(n(63630),t)},63630:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},33132:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78034:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.types=void 0,(n=t.types||(t.types={}))[n.ROOT=0]="ROOT",n[n.GROUP=1]="GROUP",n[n.POSITION=2]="POSITION",n[n.SET=3]="SET",n[n.RANGE=4]="RANGE",n[n.REPETITION=5]="REPETITION",n[n.REFERENCE=6]="REFERENCE",n[n.CHAR=7]="CHAR"},82204:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.tokenizeClass=t.strToChars=void 0;let i=n(50949),l=o(n(84220));t.strToChars=e=>e.replace(/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g,(e,t,n,r,a,o,i)=>{if(n)return e;let l=String.fromCharCode(t?8:r?parseInt(r,16):a?parseInt(a,16):o?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(o):({0:0,t:9,n:10,v:11,f:12,r:13})[i]);return/[[\]{}^$.|?*+()]/.test(l)?`\\${l}`:l}),t.tokenizeClass=(e,t)=>{var n,r,a,o,s,c,u;let p=[],f,d,m=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;for(;null!==(f=m.exec(e));){let e=null!==(u=null!==(c=null!==(s=null!==(o=null!==(a=null!==(r=null!==(n=f[1]&&l.words())&&void 0!==n?n:f[2]&&l.ints())&&void 0!==r?r:f[3]&&l.whitespace())&&void 0!==a?a:f[4]&&l.notWords())&&void 0!==o?o:f[5]&&l.notInts())&&void 0!==s?s:f[6]&&l.notWhitespace())&&void 0!==c?c:f[7]&&{type:i.types.RANGE,from:(f[8]||f[9]).charCodeAt(0),to:(d=f[10]).charCodeAt(d.length-1)})&&void 0!==u?u:(d=f[16])&&{type:i.types.CHAR,value:d.charCodeAt(0)};if(!e)return[p,m.lastIndex];p.push(e)}throw SyntaxError(`Invalid regular expression: /${t}/: Unterminated character class`)}},31327:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.writeSetTokens=t.setChar=void 0;let i=n(50949),l=o(n(42829));function s(e){return 94===e?"\\^":92===e?"\\\\":93===e?"\\]":45===e?"\\-":String.fromCharCode(e)}function c(e,{lookup:t,len:n}){if(n!==e.length)return!1;let r=t();for(let t of e){if(t.type===i.types.SET)return!1;let e=t.type===i.types.CHAR?t.value:`${t.from}-${t.to}`;if(!r[e])return!1;r[e]=!1}return!0}t.setChar=s,t.writeSetTokens=function e(t,n=!1){if(c(t.set,l.INTS))return t.not?"\\D":"\\d";if(c(t.set,l.WORDS))return t.not?"\\W":"\\w";if(t.not&&c(t.set,l.NOTANYCHAR))return".";if(c(t.set,l.WHITESPACE))return t.not?"\\S":"\\s";let r="";for(let n=0;n<t.set.length;n++){var a;r+=(a=t.set[n]).type===i.types.CHAR?s(a.value):a.type===i.types.RANGE?`${s(a.from)}-${s(a.to)}`:e(a,!0)}let o=`${t.not?"^":""}${r}`;return n?o:`[${o}]`}},57792:function(){},55125:function(e,t,n){"use strict";let r=n(10751),a=r.types;function o(e,t){var n;t||(t={});let o=void 0===t.limit?25:t.limit;(n=e,"[object RegExp]"===({}).toString.call(n))?e=e.source:"string"!=typeof e&&(e=String(e));try{e=r(e)}catch{return!1}let i=0;return function e(t,n){let r,l;if(t.type===a.REPETITION&&(n++,i++,n>1||i>o))return!1;if(t.options){for(r=0,l=t.options.length;r<l;r++)if(!e({stack:t.options[r]},n))return!1}let s=t.stack||t.value?.stack;if(!s)return!0;for(r=0;r<s.length;r++)if(!e(s[r],n))return!1;return!0}(e,0)}e.exports=o,e.exports.default=o,e.exports.safeRegex=o},57934:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(7085),a=n(41738);let o=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],i={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...o,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...o],h2:[["className","sr-only"]],img:[...o,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...o,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...o],table:[...o],ul:[...o,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},l={}.hasOwnProperty;function s(e,t){if(t&&"object"==typeof t)switch("string"==typeof t.type?t.type:""){case"comment":return function(e,t){if(e.schema.allowComments){let e="string"==typeof t.value?t.value:"",n=e.indexOf("-->"),r={type:"comment",value:n<0?e:e.slice(0,n)};return f(r,t),r}}(e,t);case"doctype":return function(e,t){if(e.schema.allowDoctypes){let e={type:"doctype"};return f(e,t),e}}(e,t);case"element":return function(e,t){let n="string"==typeof t.tagName?t.tagName:"";e.stack.push(n);let r=c(e,t.children),a=function(e,t){let n;let r=e.stack[e.stack.length-1],a=e.schema.attributes,o=e.schema.required,i=a&&l.call(a,r)?a[r]:void 0,s=a&&l.call(a,"*")?a["*"]:void 0,c=t&&"object"==typeof t?t:{},p={};for(n in c)if(l.call(c,n)){let t=c[n],r=u(e,d(i,n),n,t);null==r&&(r=u(e,d(s,n),n,t)),null!=r&&(p[n]=r)}if(o&&l.call(o,r)){let e=o[r];for(n in e)l.call(e,n)&&!l.call(p,n)&&(p[n]=e[n])}return p}(e,t.properties);e.stack.pop();let o=!1;if(n&&"*"!==n&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&l.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(o=!1;++r<t.length;)e.stack.includes(t[r])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let i={type:"element",tagName:n,properties:a,children:r};return f(i,t),i}(e,t);case"root":return function(e,t){let n={type:"root",children:c(e,t.children)};return f(n,t),n}(e,t);case"text":return function(e,t){let n={type:"text",value:"string"==typeof t.value?t.value:""};return f(n,t),n}(0,t)}}function c(e,t){let n=[];if(Array.isArray(t)){let r=-1;for(;++r<t.length;){let a=s(e,t[r]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function u(e,t,n,r){return t?Array.isArray(r)?function(e,t,n,r){let a=-1,o=[];for(;++a<r.length;){let i=p(e,t,n,r[a]);("number"==typeof i||"string"==typeof i)&&o.push(i)}return o}(e,t,n,r):p(e,t,n,r):void 0}function p(e,t,n,r){if(("boolean"==typeof r||"number"==typeof r||"string"==typeof r)&&function(e,t,n){let r=e.schema.protocols&&l.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||0===r.length)return!0;let a=String(n),o=a.indexOf(":"),i=a.indexOf("?"),s=a.indexOf("#"),c=a.indexOf("/");if(o<0||c>-1&&o>c||i>-1&&o>i||s>-1&&o>s)return!0;let u=-1;for(;++u<r.length;){let e=r[u];if(o===e.length&&a.slice(0,e.length)===e)return!0}return!1}(e,n,r)){if("object"==typeof t&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let a=t[n];if(a&&"object"==typeof a&&"flags"in a){if(a.test(String(r))){e=!0;break}}else if(a===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function f(e,t){let n=(0,a.FK)(t);t.data&&(e.data=(0,r.ZP)(t.data)),n&&(e.position=n)}function d(e,t){let n;let r=-1;if(e)for(;++r<e.length;){let a=e[r],o="string"==typeof a?a:a[0];if(o===t)return a;"data*"===o&&(n=a)}if(t.length>4&&"data"===t.slice(0,4).toLowerCase())return n}function m(e){return function(t){return function(e,t){let n={type:"root",children:[]},r=s({schema:t?{...i,...t}:i,stack:[]},e);return r&&(Array.isArray(r)?1===r.length?n=r[0]:n.children=r:n=r),n}(t,e)}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9552],{49552:function(t,e,a){a.d(e,{diagram:function(){return v}});var n,i=a(67665);a(34577),a(23919),a(63025),a(19328),a(54973),a(11866),a(10507),a(33281),a(66691);var r=a(94705),d=a(55166),s=a(31954),o=a(84370),g=a(3843),l=a(68406),p=(0,s.eW)(t=>t.append("circle").attr("class","start-state").attr("r",(0,d.nV)().state.sizeUnit).attr("cx",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit).attr("cy",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit),"drawStartState"),h=(0,s.eW)(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,d.nV)().state.textHeight).attr("class","divider").attr("x2",2*(0,d.nV)().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),c=(0,s.eW)((t,e)=>{let a=t.append("text").attr("x",2*(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.textHeight+2*(0,d.nV)().state.padding).attr("font-size",(0,d.nV)().state.fontSize).attr("class","state-title").text(e.id),n=a.node().getBBox();return t.insert("rect",":first-child").attr("x",(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.padding).attr("width",n.width+2*(0,d.nV)().state.padding).attr("height",n.height+2*(0,d.nV)().state.padding).attr("rx",(0,d.nV)().state.radius),a},"drawSimpleState"),x=(0,s.eW)((t,e)=>{let a=(0,s.eW)(function(t,e,a){let n=t.append("tspan").attr("x",2*(0,d.nV)().state.padding).text(e);a||n.attr("dy",(0,d.nV)().state.textHeight)},"addTspan"),n=t.append("text").attr("x",2*(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.textHeight+1.3*(0,d.nV)().state.padding).attr("font-size",(0,d.nV)().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=n.height,r=t.append("text").attr("x",(0,d.nV)().state.padding).attr("y",i+.4*(0,d.nV)().state.padding+(0,d.nV)().state.dividerMargin+(0,d.nV)().state.textHeight).attr("class","state-description"),o=!0,g=!0;e.descriptions.forEach(function(t){o||(a(r,t,g),g=!1),o=!1});let l=t.append("line").attr("x1",(0,d.nV)().state.padding).attr("y1",(0,d.nV)().state.padding+i+(0,d.nV)().state.dividerMargin/2).attr("y2",(0,d.nV)().state.padding+i+(0,d.nV)().state.dividerMargin/2).attr("class","descr-divider"),p=r.node().getBBox(),h=Math.max(p.width,n.width);return l.attr("x2",h+3*(0,d.nV)().state.padding),t.insert("rect",":first-child").attr("x",(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.padding).attr("width",h+2*(0,d.nV)().state.padding).attr("height",p.height+i+2*(0,d.nV)().state.padding).attr("rx",(0,d.nV)().state.radius),t},"drawDescrState"),V=(0,s.eW)((t,e,a)=>{let n;let i=(0,d.nV)().state.padding,r=2*(0,d.nV)().state.padding,s=t.node().getBBox(),o=s.width,g=s.x,l=t.append("text").attr("x",0).attr("y",(0,d.nV)().state.titleShift).attr("font-size",(0,d.nV)().state.fontSize).attr("class","state-title").text(e.id),p=l.node().getBBox().width+r,h=Math.max(p,o);h===o&&(h+=r);let c=t.node().getBBox();e.doc,n=g-i,p>o&&(n=(o-h)/2+i),Math.abs(g-c.x)<i&&p>o&&(n=g-(p-o)/2);let x=1-(0,d.nV)().state.textHeight;return t.insert("rect",":first-child").attr("x",n).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",c.height+(0,d.nV)().state.textHeight+(0,d.nV)().state.titleShift+1).attr("rx","0"),l.attr("x",n+i),p<=o&&l.attr("x",g+(h-r)/2-p/2+i),t.insert("rect",":first-child").attr("x",n).attr("y",(0,d.nV)().state.titleShift-(0,d.nV)().state.textHeight-(0,d.nV)().state.padding).attr("width",h).attr("height",3*(0,d.nV)().state.textHeight).attr("rx",(0,d.nV)().state.radius),t.insert("rect",":first-child").attr("x",n).attr("y",(0,d.nV)().state.titleShift-(0,d.nV)().state.textHeight-(0,d.nV)().state.padding).attr("width",h).attr("height",c.height+3+2*(0,d.nV)().state.textHeight).attr("rx",(0,d.nV)().state.radius),t},"addTitleAndBox"),u=(0,s.eW)(t=>(t.append("circle").attr("class","end-state-outer").attr("r",(0,d.nV)().state.sizeUnit+(0,d.nV)().state.miniPadding).attr("cx",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+(0,d.nV)().state.miniPadding).attr("cy",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+(0,d.nV)().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",(0,d.nV)().state.sizeUnit).attr("cx",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+2).attr("cy",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+2)),"drawEndState"),f=(0,s.eW)((t,e)=>{let a=(0,d.nV)().state.forkWidth,n=(0,d.nV)().state.forkHeight;if(e.parentId){let t=a;a=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",n).attr("x",(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.padding)},"drawForkJoinState"),y=(0,s.eW)((t,e,a,n)=>{let i=0,r=n.append("text");r.style("text-anchor","start"),r.attr("class","noteText");let s=t.replace(/\r\n/g,"<br/>"),o=(s=s.replace(/\n/g,"<br/>")).split(d.SY.lineBreakRegex),g=1.25*(0,d.nV)().state.noteMargin;for(let t of o){let n=t.trim();if(n.length>0){let t=r.append("tspan");t.text(n),0===g&&(g+=t.node().getBBox().height),i+=g,t.attr("x",e+(0,d.nV)().state.noteMargin),t.attr("y",a+i+1.25*(0,d.nV)().state.noteMargin)}}return{textWidth:r.node().getBBox().width,textHeight:i}},"_drawLongText"),w=(0,s.eW)((t,e)=>{e.attr("class","state-note");let a=e.append("rect").attr("x",0).attr("y",(0,d.nV)().state.padding),{textWidth:n,textHeight:i}=y(t,0,0,e.append("g"));return a.attr("height",i+2*(0,d.nV)().state.noteMargin),a.attr("width",n+2*(0,d.nV)().state.noteMargin),a},"drawNote"),b=(0,s.eW)(function(t,e){let a=e.id,n={id:a,label:e.id,width:0,height:0},i=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&p(i),"end"===e.type&&u(i),("fork"===e.type||"join"===e.type)&&f(i,e),"note"===e.type&&w(e.note.text,i),"divider"===e.type&&h(i),"default"===e.type&&0===e.descriptions.length&&c(i,e),"default"===e.type&&e.descriptions.length>0&&x(i,e);let r=i.node().getBBox();return n.width=r.width+2*(0,d.nV)().state.padding,n.height=r.height+2*(0,d.nV)().state.padding,n},"drawState"),B=0,m=(0,s.eW)(function(t,e,a){let n=(0,s.eW)(function(t){switch(t){case i.oI.relationType.AGGREGATION:return"aggregation";case i.oI.relationType.EXTENSION:return"extension";case i.oI.relationType.COMPOSITION:return"composition";case i.oI.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));let g=e.points,l=(0,o.jvg)().x(function(t){return t.x}).y(function(t){return t.y}).curve(o.$0Z),p=t.append("path").attr("d",l(g)).attr("id","edge"+B).attr("class","transition"),h="";if((0,d.nV)().state.arrowMarkerAbsolute&&(h=(0,d.Gr)(!0)),p.attr("marker-end","url("+h+"#"+n(i.oI.relationType.DEPENDENCY)+"End)"),void 0!==a.title){let n=t.append("g").attr("class","stateLabel"),{x:i,y:o}=r.w8.calcLabelPosition(e.points),g=d.SY.getRows(a.title),l=0,p=[],h=0,c=0;for(let t=0;t<=g.length;t++){let e=n.append("text").attr("text-anchor","middle").text(g[t]).attr("x",i).attr("y",o+l),a=e.node().getBBox();h=Math.max(h,a.width),c=Math.min(c,a.x),s.cM.info(a.x,i,o+l),0===l&&(l=e.node().getBBox().height,s.cM.info("Title height",l,o)),p.push(e)}let x=l*g.length;if(g.length>1){let t=(g.length-1)*l*.5;p.forEach((e,a)=>e.attr("y",o+a*l-t)),x=l*g.length}let V=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",i-h/2-(0,d.nV)().state.padding/2).attr("y",o-x/2-(0,d.nV)().state.padding/2-3.5).attr("width",h+(0,d.nV)().state.padding).attr("height",x+(0,d.nV)().state.padding),s.cM.info(V)}B++},"drawEdge"),M={},k=(0,s.eW)(function(){},"setConf"),S=(0,s.eW)(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),E=(0,s.eW)(function(t,e,a,i){let r;n=(0,d.nV)().state;let g=(0,d.nV)().securityLevel;"sandbox"===g&&(r=(0,o.Ys)("#i"+e));let l="sandbox"===g?(0,o.Ys)(r.nodes()[0].contentDocument.body):(0,o.Ys)("body"),p="sandbox"===g?r.nodes()[0].contentDocument:document;s.cM.debug("Rendering diagram "+t);let h=l.select(`[id='${e}']`);S(h),W(i.db.getRootDoc(),h,void 0,!1,l,p,i);let c=n.padding,x=h.node().getBBox(),V=x.width+2*c,u=x.height+2*c;(0,d.v2)(h,u,1.75*V,n.useMaxWidth),h.attr("viewBox",`${x.x-n.padding} ${x.y-n.padding} `+V+" "+u)},"draw"),N=(0,s.eW)(t=>t?t.length*n.fontSizeFactor:1,"getLabelWidth"),W=(0,s.eW)((t,e,a,i,r,o,p)=>{let h;let c=new l.k({compound:!0,multigraph:!0}),x=!0;for(h=0;h<t.length;h++)if("relation"===t[h].stmt){x=!1;break}a?c.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:n.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):c.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:n.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),c.setDefaultEdgeLabel(function(){return{}});let u=p.db.getStates(),f=p.db.getRelations();for(let t of Object.keys(u)){let d;let s=u[t];if(a&&(s.parentId=a),s.doc){let t=e.append("g").attr("id",s.id).attr("class","stateGroup");d=W(s.doc,t,s.id,!i,r,o,p);{let e=(t=V(t,s,i)).node().getBBox();d.width=e.width,d.height=e.height+n.padding/2,M[s.id]={y:n.compositTitleSize}}}else d=b(e,s,c);if(s.note){let t=b(e,{descriptions:[],id:s.id+"-note",note:s.note,type:"note"},c);"left of"===s.note.position?(c.setNode(d.id+"-note",t),c.setNode(d.id,d)):(c.setNode(d.id,d),c.setNode(d.id+"-note",t)),c.setParent(d.id,d.id+"-group"),c.setParent(d.id+"-note",d.id+"-group")}else c.setNode(d.id,d)}s.cM.debug("Count=",c.nodeCount(),c);let y=0;f.forEach(function(t){y++,s.cM.debug("Setting edge",t),c.setEdge(t.id1,t.id2,{relation:t,width:N(t.title),height:n.labelHeight*d.SY.getRows(t.title).length,labelpos:"c"},"id"+y)}),(0,g.bK)(c),s.cM.debug("Graph after layout",c.nodes());let w=e.node();c.nodes().forEach(function(t){void 0!==t&&void 0!==c.node(t)?(s.cM.warn("Node "+t+": "+JSON.stringify(c.node(t))),r.select("#"+w.id+" #"+t).attr("transform","translate("+(c.node(t).x-c.node(t).width/2)+","+(c.node(t).y+(M[t]?M[t].y:0)-c.node(t).height/2)+" )"),r.select("#"+w.id+" #"+t).attr("data-x-shift",c.node(t).x-c.node(t).width/2),o.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach(t=>{let e=t.parentElement,a=0,n=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),Number.isNaN(n=parseInt(e.getAttribute("data-x-shift"),10))&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",a-n-8)})):s.cM.debug("No Node "+t+": "+JSON.stringify(c.node(t)))});let B=w.getBBox();c.edges().forEach(function(t){void 0!==t&&void 0!==c.edge(t)&&(s.cM.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(c.edge(t))),m(e,c.edge(t),c.edge(t).relation))}),B=w.getBBox();let k={id:a||"root",label:a||"root",width:0,height:0};return k.width=B.width+2*n.padding,k.height=B.height+2*n.padding,s.cM.debug("Doc rendered",k,c),k},"renderDoc"),v={parser:i.J8,get db(){return new i.oI(1)},renderer:{setConf:k,draw:E},styles:i.Ee,init:(0,s.eW)(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{22241:function(n,e,r){Promise.resolve().then(r.t.bind(r,2778,23)),Promise.resolve().then(r.bind(r,18828))},18828:function(n,e,r){"use strict";r.d(e,{AppProviders:function(){return u}});var t=r(57437),i=r(69234);function o(n){let{locale:e,...r}=n;if(!e)throw Error(void 0);return(0,t.jsx)(i.Pj,{locale:e,...r})}var s=r(43241),c=r(34021),l=r(14362);function u(n){let{children:e,locale:r,messages:i,timeZone:u,authEnabled:f=!1}=n;return(0,t.jsx)(o,{locale:r,messages:i,timeZone:u,children:(0,t.jsx)(l.H,{authEnabled:f,children:(0,t.jsx)(s.Hn,{children:(0,t.jsx)(c._I,{children:e})})})})}},2778:function(){}},function(n){n.O(0,[2461,9234,8528,2971,2117,1744],function(){return n(n.s=22241)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{14564:function(e,t,a){Promise.resolve().then(a.bind(a,66677))},99376:function(e,t,a){"use strict";var s=a(35475);a.o(s,"useParams")&&a.d(t,{useParams:function(){return s.useParams}}),a.o(s,"useRouter")&&a.d(t,{useRouter:function(){return s.useRouter}})},66677:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return C}});var s=a(57437),r=a(2265),l=a(8820),n=a(27648),i=a(10789),c=a(38706),o=a(69234),d=a(45306),x=a(98408),m=a(3227);function p(e){let{worktree:t,onSessionKilled:a,onStatusChanged:l}=e,{id:p,name:u,description:h,updatedAt:g,isSessionRunning:y,isWaitingForResponse:b,favorite:f,status:v,link:j}=t,[N,w]=(0,r.useState)(!1),[k,C]=(0,r.useState)(f||!1),[S,z]=(0,r.useState)(!1),[P,E]=(0,r.useState)(v||null),[A,L]=(0,r.useState)(!1),T=(0,c.T)(),R=(0,o.bU)(),D=(0,x.G)(R),I=g?(0,d.Q)(new Date(g),{addSuffix:!0,locale:D}):null,O="main"===u||"master"===u,M=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm(T("worktree.session.confirmKill",{name:u})))try{w(!0),await m.Iv.killSession(p),a&&a()}catch(t){let e=(0,m.zG)(t);alert("".concat(T("worktree.session.failedToKill"),": ").concat(e))}finally{w(!1)}},F=async e=>{e.preventDefault(),e.stopPropagation();try{z(!0);let e=!k;await m.Iv.toggleFavorite(p,e),C(e)}catch(t){let e=(0,m.zG)(t);alert("".concat(T("worktree.errors.failedToUpdateFavorite"),": ").concat(e))}finally{z(!1)}},U=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{L(!0),await m.Iv.updateStatus(p,e),E(e),l&&l()}catch(t){let e=(0,m.zG)(t);alert("".concat(T("worktree.errors.failedToUpdateStatus"),": ").concat(e))}finally{L(!1)}};return(0,s.jsx)(n.default,{href:"/worktrees/".concat(p),className:"block",children:(0,s.jsxs)(i.Zb,{hover:!0,padding:"lg",className:"h-full",children:[(0,s.jsx)(i.Ol,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)(i.ll,{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("button",{onClick:F,disabled:S,className:"flex-shrink-0 transition-colors hover:scale-110",title:k?T("common.favorites.remove"):T("common.favorites.add"),children:(0,s.jsx)("svg",{className:"w-5 h-5 ".concat(k?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"),stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),(0,s.jsx)("span",{className:"truncate",children:u}),O&&(0,s.jsx)(i.Ct,{variant:"info",children:"Main"}),y&&b&&(0,s.jsx)(i.Ct,{variant:"warning",dot:!0,children:T("worktree.status.waitingForResponse")}),y&&!b&&(0,s.jsx)(i.Ct,{variant:"success",dot:!0,children:T("worktree.status.responseCompleted")})]}),y&&(0,s.jsx)(i.zx,{variant:"danger",size:"sm",onClick:M,disabled:N,className:"flex-shrink-0",children:N?T("common.ending"):T("common.end")})]})}),(0,s.jsx)(i.aY,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[h&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:h})]}),j&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,s.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),j&&window.open(j,"_blank","noopener,noreferrer")},className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 hover:underline transition-colors",title:"Open link in new tab",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),(0,s.jsx)("span",{className:"truncate",children:j})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,s.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,s.jsx)("button",{onClick:e=>U(null,e),disabled:A,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat(null===P?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"),children:"Not set"}),(0,s.jsx)("button",{onClick:e=>U("todo",e),disabled:A,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat("todo"===P?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"),children:"ToDo"}),(0,s.jsx)("button",{onClick:e=>U("doing",e),disabled:A,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat("doing"===P?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"),children:"Doing"}),(0,s.jsx)("button",{onClick:e=>U("done",e),disabled:A,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat("done"===P?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"),children:"Done"})]})]}),I&&(0,s.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,s.jsxs)("span",{children:["Updated ",I]})]})]})})]})})}function u(e){let{initialWorktrees:t=[]}=e,[a,l]=(0,r.useState)(t),[n,c]=(0,r.useState)([]),[o,d]=(0,r.useState)(!t.length),[x,u]=(0,r.useState)(null),[h,g]=(0,r.useState)(""),[y,b]=(0,r.useState)("updated"),[f,v]=(0,r.useState)("desc"),[j,N]=(0,r.useState)(null),[w,k]=(0,r.useState)(null),[C,S]=(0,r.useState)(null),[z,P]=(0,r.useState)([]),[E,A]=(0,r.useState)(!1),[L,T]=(0,r.useState)(null),R=(0,r.useCallback)(async()=>{try{let e=await m.J1.getExcluded();e.success&&P(e.repositories)}catch(e){}},[]),D=(0,r.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e||d(!0),u(null);let t=await m.Iv.getAll();l(t.worktrees),c(t.repositories)}catch(e){u((0,m.zG)(e))}finally{e||d(!1)}},[]),I=e=>!!(e&&"session_status_changed"===e.type),{status:O}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{worktreeIds:t=[],onMessage:a,onStatusChange:s,autoReconnect:l=!0,reconnectDelay:n=3e3}=e,[i,c]=(0,r.useState)("disconnected"),o=(0,r.useRef)(null),d=(0,r.useRef)(),x=(0,r.useRef)(new Set),m=(0,r.useCallback)(e=>{c(e),null==s||s(e)},[s]),p=(0,r.useCallback)(()=>{var e;if((null===(e=o.current)||void 0===e?void 0:e.readyState)===WebSocket.OPEN)return;m("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",s=new WebSocket("".concat(t,"//").concat(window.location.host));s.onopen=()=>{m("connected"),x.current.forEach(e=>{s.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},s.onmessage=e=>{try{let t=JSON.parse(e.data);null==a||a(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},s.onerror=()=>{m("error")},s.onclose=()=>{m("disconnected"),o.current=null,l&&(d.current=setTimeout(()=>{p()},n))},o.current=s},[m,a,l,n]),u=(0,r.useCallback)(()=>{d.current&&clearTimeout(d.current),o.current&&(o.current.close(1e3,"Client disconnect"),o.current=null),m("disconnected")},[m]),h=(0,r.useCallback)(e=>{var t;(null===(t=o.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),x.current.add(e))},[]),g=(0,r.useCallback)(e=>{var t;(null===(t=o.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),x.current.delete(e))},[]),y=(0,r.useCallback)(e=>{var t;(null===(t=o.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(e))},[]);return(0,r.useEffect)(()=>(p(),()=>{u()}),[]),(0,r.useEffect)(()=>{"connected"===i&&t.length>0&&t.forEach(e=>{h(e)})},[i,t]),{status:i,subscribe:h,unsubscribe:g,sendMessage:y,connect:p,disconnect:u}}({onMessage:(0,r.useCallback)(e=>{if(I(e.data)){let t=e.data;l(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&D(!0)},[D])});(0,r.useEffect)(()=>{t.length||D(),R()},[t.length,D,R]),(0,r.useEffect)(()=>{let e=setInterval(()=>{D(!0)},5e3);return()=>clearInterval(e)},[D]),(0,r.useEffect)(()=>{let e=()=>{"visible"===document.visibilityState&&D(!0)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[D]);let M=(0,r.useMemo)(()=>{let e=[...a];if(j&&(e=e.filter(e=>e.repositoryPath===j)),null!==w&&(e="unset"===w?e.filter(e=>!e.status):e.filter(e=>e.status===w)),h){let t=h.toLowerCase();e=e.filter(e=>{var a,s;return e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||(null===(a=e.lastMessageSummary)||void 0===a?void 0:a.toLowerCase().includes(t))||(null===(s=e.description)||void 0===s?void 0:s.toLowerCase().includes(t))})}return e.sort((e,t)=>{let a=0;switch(y){case"name":a=e.name.localeCompare(t.name);break;case"updated":a=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":a=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===f?a:-a}),e},[a,j,w,h,y,f]),F=(0,r.useMemo)(()=>{let e=new Map;for(let t of M){let a=t.repositoryPath||"unknown";e.has(a)||e.set(a,[]),e.get(a).push(t)}return e},[M]),U=e=>{y===e?v(e=>"asc"===e?"desc":"asc"):(b(e),v("asc"))},_=async e=>{T(e);try{let t=await m.J1.restore(e);t.warning&&u(t.warning),await D(),await R()}catch(e){u((0,m.zG)(e))}finally{T(null)}},W=async(e,t)=>{var a;let s=(null===(a=n.find(t=>t.path===e))||void 0===a?void 0:a.worktreeCount)||0;if("delete"===prompt('Delete repository "'.concat(t,'"?\n\nThis will delete:\n- ').concat(s,' worktree(s)\n- Related chat history\n- Related memos\n\n* Log files will be preserved\n\nThis repository will be added to the exclusion list.\nIt will NOT be re-registered when you run "Sync All".\nYou can restore it from the excluded repositories list.\n\nType "delete" to confirm:'))){S(e);try{await m.J1.delete(e),j===e&&N(null),await D(),await R()}catch(e){u((0,m.zG)(e))}finally{S(null)}}};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)(i.Ct,{variant:"gray",children:[a.length," branches"]}),n.length>0&&(0,s.jsxs)(i.Ct,{variant:"info",children:[n.length," ",1===n.length?"repository":"repositories"]}),"connected"===O&&(0,s.jsx)(i.Ct,{variant:"success",dot:!0,children:"Live"})]}),(0,s.jsx)("div",{className:"flex gap-2 w-full sm:w-auto",children:(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:()=>D(),disabled:o,children:o?"Loading...":"Refresh"})})]}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row gap-3",children:(0,s.jsx)("input",{type:"text",placeholder:"Search worktrees...",value:h,onChange:e=>g(e.target.value),className:"input flex-1"})}),n.length>0&&(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,s.jsxs)(i.zx,{variant:null===j?"primary":"ghost",size:"sm",onClick:()=>N(null),children:["All (",a.length,")"]}),n.map(e=>(0,s.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,s.jsxs)(i.zx,{variant:j===e.path?"primary":"ghost",size:"sm",onClick:()=>N(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")"]}),(0,s.jsx)("button",{className:"absolute right-1 opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity px-1",onClick:t=>{t.stopPropagation(),W(e.path,e.name)},disabled:C===e.path,title:"Delete repository",children:C===e.path?"...":"x"})]},e.path))]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,s.jsx)(i.zx,{variant:null===w?"primary":"ghost",size:"sm",onClick:()=>k(null),children:"All"}),(0,s.jsx)(i.zx,{variant:"todo"===w?"primary":"ghost",size:"sm",onClick:()=>k("todo"),children:"\uD83D\uDCDD ToDo"}),(0,s.jsx)(i.zx,{variant:"doing"===w?"primary":"ghost",size:"sm",onClick:()=>k("doing"),children:"\uD83D\uDEA7 Doing"}),(0,s.jsx)(i.zx,{variant:"done"===w?"primary":"ghost",size:"sm",onClick:()=>k("done"),children:"✅ Done"}),(0,s.jsx)(i.zx,{variant:"unset"===w?"primary":"ghost",size:"sm",onClick:()=>k("unset"),children:"Not set"})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,s.jsxs)(i.zx,{variant:"favorite"===y?"primary":"ghost",size:"sm",onClick:()=>U("favorite"),children:["⭐ Favorite ","favorite"===y&&("asc"===f?"↑":"↓")]}),(0,s.jsxs)(i.zx,{variant:"name"===y?"primary":"ghost",size:"sm",onClick:()=>U("name"),children:["Name ","name"===y&&("asc"===f?"↑":"↓")]}),(0,s.jsxs)(i.zx,{variant:"updated"===y?"primary":"ghost",size:"sm",onClick:()=>U("updated"),children:["Updated ","updated"===y&&("asc"===f?"↑":"↓")]})]}),x&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-800",children:x})}),o&&!a.length&&(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),(0,s.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!x&&0===M.length&&(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,s.jsx)("p",{className:"mt-4 text-gray-600",children:h?"No worktrees found matching your search":"No worktrees found"})]}),!o&&M.length>0&&(0,s.jsx)("div",{className:"space-y-8",children:Array.from(F.entries()).map(e=>{let[t,a]=e,r=n.find(e=>e.path===t),l=(null==r?void 0:r.name)||"Unknown Repository";return(0,s.jsxs)("div",{className:"space-y-4",children:[(n.length>1||!j)&&(0,s.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[(0,s.jsx)("h3",{className:"text-xl font-semibold text-gray-900",children:l}),(0,s.jsx)(i.Ct,{variant:"gray",children:a.length})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:a.map(e=>(0,s.jsx)(p,{worktree:e,onSessionKilled:D,onStatusChanged:D},e.id))})]},t)})}),z.length>0&&(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,s.jsxs)("button",{className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>A(!E),children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Excluded Repositories (",z.length,")"]}),(0,s.jsx)("span",{className:"text-gray-400 text-sm",children:E?"Hide":"Show"})]}),E&&(0,s.jsx)("div",{className:"border-t border-gray-200 divide-y divide-gray-100",children:z.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e.name}),(0,s.jsx)("span",{className:"text-xs text-gray-500 ml-2",children:e.path})]}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:()=>_(e.path),disabled:L===e.path,children:L===e.path?"Restoring...":"Restore"})]},e.id))})]})]})}a(99376),a(74707),a(34343),a(6940),a(43616);class h{static getInstance(){return h.instance||(h.instance=new h),h.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return"https://".concat(t[1],"/").concat(t[3]).toLowerCase().replace(/\/$/,"");let a=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return a?"https://".concat(a[1],"/").concat(a[2]).toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let a=e.match(/:(.+?)(\.git)?$/);if(a&&e.startsWith("git@")){let e=a[1].split("/");return e[e.length-1]}let s=e.match(/\/([^\/]+?)(\.git)?$/);return s?s[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}constructor(){}}function g(e){let{onRepositoryAdded:t}=e,[a,l]=(0,r.useState)(!1),[n,c]=(0,r.useState)("local"),[o,d]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[u,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(!1),[f,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(null),[w,k]=(0,r.useState)(null),[C,S]=(0,r.useState)(null),z=h.getInstance(),P=(0,r.useCallback)(async e=>{try{let s=await m.J1.getCloneStatus(e);if("completed"===s.status)S("Repository cloned successfully"),v(!1),N(null),p(""),l(!1),t&&t();else if("failed"===s.status){var a;k((null===(a=s.error)||void 0===a?void 0:a.message)||"Clone failed"),v(!1),N(null)}else("running"===s.status||"pending"===s.status)&&setTimeout(()=>P(e),2e3)}catch(e){k((0,m.zG)(e)),v(!1),N(null)}},[t]);(0,r.useEffect)(()=>{j&&f&&P(j)},[j,f,P]);let E=async e=>{if(e.preventDefault(),!o.trim()){k("Repository path is required");return}k(null),S(null),g(!0);try{let e=await m.J1.scan(o);S(e.message),d(""),l(!1),t&&t()}catch(e){k((0,m.zG)(e))}finally{g(!1)}},A=async e=>{if(e.preventDefault(),!x.trim()){k("Clone URL is required");return}let t=z.validate(x.trim());if(!t.valid){"EMPTY_URL"===t.error?k("Clone URL is required"):k("Invalid URL format");return}k(null),S(null),v(!0);try{let e=await m.J1.clone(x.trim());N(e.jobId)}catch(e){k((0,m.zG)(e)),v(!1)}},L=async()=>{k(null),S(null),b(!0);try{let e=await m.J1.sync();S(e.message),t&&t()}catch(e){k((0,m.zG)(e))}finally{b(!1)}},T=()=>{l(!1),d(""),p(""),k(null),c("local")};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!a&&(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:()=>l(!0),children:"+ Add Repository"}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:L,disabled:y,children:y?"Syncing...":"Sync All"})]}),a&&(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,s.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[(0,s.jsx)("button",{role:"tab","aria-selected":"local"===n,onClick:()=>c("local"),className:"px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ".concat("local"===n?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"),children:"Local Path"}),(0,s.jsx)("button",{role:"tab","aria-selected":"url"===n,onClick:()=>c("url"),className:"px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ".concat("url"===n?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"),children:"Clone URL"})]}),"local"===n&&(0,s.jsxs)("form",{onSubmit:E,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),(0,s.jsx)("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),(0,s.jsx)("input",{id:"repositoryPath",type:"text",value:o,onChange:e=>d(e.target.value),placeholder:"/absolute/path/to/repository",className:"input w-full font-mono text-sm",disabled:u}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.zx,{type:"submit",variant:"primary",disabled:u||!o.trim(),children:u?"Scanning...":"Scan & Add"}),(0,s.jsx)(i.zx,{type:"button",variant:"ghost",onClick:T,disabled:u,children:"Cancel"})]})]}),"url"===n&&(0,s.jsxs)("form",{onSubmit:A,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),(0,s.jsx)("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),(0,s.jsx)("input",{id:"cloneUrl",type:"text",value:x,onChange:e=>p(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:f}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.zx,{type:"submit",variant:"primary",disabled:f||!x.trim(),children:f?"Cloning...":"Clone"}),(0,s.jsx)(i.zx,{type:"button",variant:"ghost",onClick:T,disabled:f,children:"Cancel"})]})]})]})}),C&&(0,s.jsx)("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-green-800",children:C})}),w&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-800",children:w})})]})}function y(e){var t;let{appId:a,pollInterval:l=3e4,showResponseTime:n=!1,compact:i=!1}=e,[c,o]=(0,r.useState)(null),[d,x]=(0,r.useState)(!0),m=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/external-apps/".concat(a,"/health"));if(e.ok){let t=await e.json();o(t)}else o({id:a,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch(e){o({id:a,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{x(!1)}},[a]);if((0,r.useEffect)(()=>{m();let e=setInterval(m,l);return()=>clearInterval(e)},[m,l]),d)return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!i&&(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let p=null!==(t=null==c?void 0:c.healthy)&&void 0!==t&&t,u=p?"bg-green-500":"bg-gray-400",h=p?"Running":"Stopped";return i?(0,s.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(u),title:h}):(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(u)}),(0,s.jsx)("span",{className:"text-xs ".concat(p?"text-green-600":"text-gray-500"),children:h}),n&&(null==c?void 0:c.responseTime)!==void 0&&(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["(",c.responseTime,"ms)"]})]})}function b(e){var t;let{app:a,onEdit:l,onDelete:n}=e,[c,o]=(0,r.useState)(!1),[d,x]=(0,r.useState)(!1),m=async()=>{x(!0);try{await n(a.id)}finally{x(!1),o(!1)}},p="/proxy/".concat(a.pathPrefix,"/");return(0,s.jsxs)(i.Zb,{padding:"md",className:"relative",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h4",{className:"text-base font-semibold text-gray-900 truncate",children:a.displayName}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:a.name})]}),(0,s.jsx)(i.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[a.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[t=a.appType]||t})]}),(0,s.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"Status"}),(0,s.jsx)(y,{appId:a.id,pollInterval:3e4})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"Port"}),(0,s.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",a.targetPort]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"Path"}),(0,s.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",a.pathPrefix,"/"]})]}),a.websocketEnabled&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"WebSocket"}),(0,s.jsx)(i.Ct,{variant:"info",children:"Enabled"})]}),!a.enabled&&(0,s.jsx)("div",{className:"mt-2 py-1 px-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-700",children:"This app is disabled"})]}),c?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',a.displayName,'"?']}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.zx,{variant:"danger",size:"sm",onClick:m,disabled:d,loading:d,children:"Delete"}),(0,s.jsx)(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:()=>window.open(p,"_blank"),disabled:!a.enabled,children:"Open"}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:()=>l(a),children:"Settings"}),(0,s.jsx)(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let f={MIN:1024,MAX:65535},v=/^[a-zA-Z0-9-]+$/,j={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},N=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:j[e]}));function w(e){let{isOpen:t,onClose:a,editApp:l,onSave:n}=e,c=!!l,[o,d]=(0,r.useState)(""),[x,m]=(0,r.useState)(""),[p,u]=(0,r.useState)(""),[h,g]=(0,r.useState)(""),[y,b]=(0,r.useState)(""),[j,w]=(0,r.useState)(!1),[k,C]=(0,r.useState)(""),[S,z]=(0,r.useState)(!0),[P,E]=(0,r.useState)({}),[A,L]=(0,r.useState)(!1),[T,R]=(0,r.useState)(null);(0,r.useEffect)(()=>{t&&(l?(d(l.displayName),m(l.name),u(l.pathPrefix),g(l.targetPort),b(l.appType),w(l.websocketEnabled),C(l.description||""),z(l.enabled)):(d(""),m(""),u(""),g(""),b(""),w(!1),C(""),z(!0)),E({}),R(null))},[t,l]);let D=async e=>{e.preventDefault(),R(null);let t=function(e,t){var a,s,r,l;let n={};return((null===(a=e.displayName)||void 0===a?void 0:a.trim())||(n.displayName="Display name is required"),t||((null===(s=e.name)||void 0===s?void 0:s.trim())?v.test(e.name)||(n.name="Only alphanumeric characters and hyphens are allowed"):n.name="Identifier name is required",(null===(r=e.pathPrefix)||void 0===r?void 0:r.trim())?v.test(e.pathPrefix)||(n.pathPrefix="Only alphanumeric characters and hyphens are allowed"):n.pathPrefix="Path prefix is required"),e.targetPort)?"number"!=typeof e.targetPort||Number.isInteger(l=e.targetPort)&&l>=f.MIN&&l<=f.MAX||(n.targetPort="Port must be between ".concat(f.MIN," and ").concat(f.MAX)):n.targetPort="Port number is required",t||e.appType||(n.appType="App type is required"),n}({displayName:o,name:x,pathPrefix:p,targetPort:h,appType:y},c);if(Object.keys(t).length>0){E(t);return}E({}),L(!0);try{if(c&&l){let e=await fetch("/api/external-apps/".concat(l.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:k||void 0,targetPort:h||void 0,websocketEnabled:j,enabled:S})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to update app")}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,name:x,pathPrefix:p,targetPort:h,appType:y,websocketEnabled:j,description:k||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}n(),a()}catch(e){R(e instanceof Error?e.message:"An error occurred")}finally{L(!1)}};return(0,s.jsx)(i.u_,{isOpen:t,onClose:a,title:c?"Edit External App":"Add External App",size:"md",children:(0,s.jsxs)("form",{onSubmit:D,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:"input w-full ".concat(P.displayName?"border-red-500":""),placeholder:"My App",disabled:A}),P.displayName&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.displayName})]}),!c&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"name",type:"text",value:x,onChange:e=>m(e.target.value),className:"input w-full font-mono ".concat(P.name?"border-red-500":""),placeholder:"my-app",disabled:A}),(0,s.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),P.name&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.name})]}),!c&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),(0,s.jsx)("input",{id:"pathPrefix",type:"text",value:p,onChange:e=>u(e.target.value),className:"input flex-1 font-mono ".concat(P.pathPrefix?"border-red-500":""),placeholder:"app-name",disabled:A}),(0,s.jsx)("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),P.pathPrefix&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.pathPrefix})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"targetPort",type:"number",value:h,onChange:e=>g(e.target.value?parseInt(e.target.value,10):""),className:"input w-full font-mono ".concat(P.targetPort?"border-red-500":""),placeholder:"5173",min:f.MIN,max:f.MAX,disabled:A}),(0,s.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",f.MIN,"-",f.MAX,")"]}),P.targetPort&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.targetPort})]}),!c&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("select",{id:"appType",value:y,onChange:e=>b(e.target.value),className:"input w-full ".concat(P.appType?"border-red-500":""),disabled:A,children:[(0,s.jsx)("option",{value:"",children:"Select app type..."}),N.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}),P.appType&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.appType})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),(0,s.jsx)("textarea",{id:"description",value:k,onChange:e=>C(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:A})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{id:"websocketEnabled",type:"checkbox",checked:j,onChange:e=>w(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:A}),(0,s.jsx)("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),c&&(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{id:"enabled",type:"checkbox",checked:S,onChange:e=>z(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:A}),(0,s.jsx)("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),T&&(0,s.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:T}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[(0,s.jsx)(i.zx,{type:"button",variant:"ghost",onClick:a,disabled:A,children:"Cancel"}),(0,s.jsx)(i.zx,{type:"submit",variant:"primary",loading:A,children:c?"Save Changes":"Add App"})]})]})})}function k(){let[e,t]=(0,r.useState)([]),[a,l]=(0,r.useState)(!0),[n,c]=(0,r.useState)(null),[o,d]=(0,r.useState)(!1),[x,m]=(0,r.useState)(null),p=(0,r.useCallback)(async()=>{try{c(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let a=await e.json();t(a.apps||[])}catch(e){c(e instanceof Error?e.message:"An error occurred")}finally{l(!1)}},[]);(0,r.useEffect)(()=>{p();let e=setInterval(p,6e4);return()=>clearInterval(e)},[p]);let u=(0,r.useCallback)(e=>{m(e),d(!0)},[]),h=(0,r.useCallback)(()=>{m(null),d(!0)},[]),g=(0,r.useCallback)(async e=>{try{let t=await fetch("/api/external-apps/".concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}p()}catch(e){console.error("Failed to delete app:",e)}},[p]),y=(0,r.useCallback)(()=>{p()},[p]),f=(0,r.useCallback)(()=>{d(!1),m(null)},[]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:h,children:"+ Add App"})]}),a?(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),(0,s.jsx)("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):n?(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:p,children:"Retry"})]})}):0===e.length?(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:h,children:"Add Your First App"})]})}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>(0,s.jsx)(b,{app:e,onEdit:u,onDelete:g},e.id))}),(0,s.jsx)(w,{isOpen:o,onClose:f,editApp:x,onSave:y})]})}function C(){let[e,t]=(0,r.useState)(0),a=(0,r.useCallback)(()=>{t(e=>e+1)},[]);return(0,s.jsx)(l.Vw,{children:(0,s.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsx)("h1",{className:"mb-2",children:"CommandMate"}),(0,s.jsx)("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)(g,{onRepositoryAdded:a})}),(0,s.jsx)(u,{},e),(0,s.jsx)("div",{className:"mt-8",children:(0,s.jsx)(k,{})})]})})}},38706:function(e,t,a){"use strict";a.d(t,{T:function(){return l}});var s=a(69234);function r(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=r(0,s.T_);r(0,s.Gb)}},function(e){e.O(0,[9234,216,2335,8528,8091,2971,2117,1744],function(){return e(e.s=14564)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5441],{20084:function(e,r,s){Promise.resolve().then(s.bind(s,50653))},50653:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return u}});var t=s(57437),n=s(2265),a=s(99376),o=s(38706),l=s(10789),i=s(53012),c=s(23260),d=s(12158),m=s(39625),x=s(1243);function u(){let e=(0,a.useRouter)(),r=(0,a.useParams)(),s=(0,o.T)("common"),u=r.id,h=r.path.join("/"),[p,g]=(0,n.useState)(null),[f,b]=(0,n.useState)(!0),[y,j]=(0,n.useState)(null),v=(null==p?void 0:p.extension)==="md"||(null==p?void 0:p.extension)==="markdown";return(0,n.useEffect)(()=>{(async()=>{b(!0),j(null);try{let e=await fetch("/api/worktrees/".concat(u,"/files/").concat(h));if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to load file")}let r=await e.json();g(r)}catch(e){j(e instanceof Error?e.message:"Failed to load file")}finally{b(!1)}})()},[u,h]),(0,t.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,t.jsx)("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:()=>e.back(),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors","aria-label":s("back"),children:[(0,t.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),(0,t.jsx)("span",{className:"hidden sm:inline",children:s("back")})]}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:h})})]})}),(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:[f&&(0,t.jsx)(l.Zb,{padding:"lg",children:(0,t.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,t.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),(0,t.jsx)("p",{className:"ml-3 text-gray-600",children:"Loading file..."})]})}),y&&(0,t.jsx)(l.Zb,{padding:"lg",children:(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-5 h-5 text-red-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsx)("p",{className:"text-sm text-red-800",children:y})]})})}),p&&!f&&!y&&(0,t.jsxs)(l.Zb,{padding:"none",children:[(0,t.jsx)("div",{className:"bg-gray-100 px-4 py-3 border-b border-gray-200",children:(0,t.jsxs)("p",{className:"text-xs text-gray-600 font-mono break-all",children:[p.worktreePath,"/",p.path]})}),(0,t.jsx)("div",{className:"p-6 sm:p-8 bg-white",children:p.isVideo?(0,t.jsx)(x.R,{src:p.content,mimeType:p.mimeType}):p.isImage?(0,t.jsx)(m.O,{src:p.content,alt:p.path,mimeType:p.mimeType}):v?(0,t.jsx)("div",{className:"prose prose-slate max-w-none prose-headings:font-semibold prose-h1:text-3xl prose-h1:border-b prose-h1:pb-2 prose-h2:text-2xl prose-h2:border-b prose-h2:pb-2 prose-h3:text-xl prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-pre:bg-gray-100 prose-pre:border prose-pre:border-gray-200 prose-code:text-sm prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none prose-img:rounded-lg prose-img:shadow-md",children:(0,t.jsx)(i.UG,{remarkPlugins:[c.Z],rehypePlugins:[d.Z],components:{code:e=>{let{inline:r,className:s,children:n,...a}=e;return r?(0,t.jsx)("code",{className:"bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm font-mono",...a,children:n}):(0,t.jsx)("code",{className:s,...a,children:n})},pre:e=>{let{children:r}=e;return(0,t.jsx)("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto",children:r})},table:e=>{let{children:r}=e;return(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("table",{className:"border-collapse border border-gray-300",children:r})})},th:e=>{let{children:r}=e;return(0,t.jsx)("th",{className:"border border-gray-300 bg-gray-100 px-4 py-2 text-left font-semibold",children:r})},td:e=>{let{children:r}=e;return(0,t.jsx)("td",{className:"border border-gray-300 px-4 py-2",children:r})},blockquote:e=>{let{children:r}=e;return(0,t.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 italic text-gray-700",children:r})}},children:p.content})}):(0,t.jsx)("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto text-sm",children:(0,t.jsx)("code",{className:"language-".concat(p.extension),children:p.content})})})]})]})]})}},98702:function(e,r,s){"use strict";s.d(r,{u:function(){return l}});var t=s(57437),n=s(2265),a=s(54887),o=s(3468);function l(e){let{isOpen:r,onClose:s,title:l,children:i,size:c="lg",showCloseButton:d=!0,disableClose:m=!1}=e,x=(0,n.useRef)(null);return((0,n.useEffect)(()=>{if(m)return;let e=e=>{"Escape"===e.key&&r&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,s,m]),(0,n.useEffect)(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[r]),r)?(0,a.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:o.k.MODAL},children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:m?void 0:s}),(0,t.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,t.jsxs)("div",{ref:x,className:"relative w-full ".concat({sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[c]," max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-white rounded-lg shadow-xl transform transition-all"),children:[(l||d)&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 flex-shrink-0",children:[(0,t.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:l}),d&&(0,t.jsx)("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:(0,t.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:i})]})})]}),document.body):null}},10789:function(e,r,s){"use strict";s.d(r,{Ct:function(){return c},zx:function(){return n},Zb:function(){return a},aY:function(){return i},Ol:function(){return o},ll:function(){return l},u_:function(){return d.u}});var t=s(57437);function n(e){let{variant:r="primary",size:s="md",fullWidth:n=!1,loading:a=!1,disabled:o,className:l="",children:i,...c}=e,d=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[r],{sm:"btn-sm",md:"",lg:"btn-lg"}[s],n?"w-full":"",o||a?"opacity-50 cursor-not-allowed":"",l].filter(Boolean).join(" ");return(0,t.jsxs)("button",{className:d,disabled:o||a,...c,children:[a&&(0,t.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i]})}function a(e){let{hover:r=!1,padding:s="md",className:n="",children:a,...o}=e,l=["card",r?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[s],n].filter(Boolean).join(" ");return(0,t.jsx)("div",{className:l,...o,children:a})}function o(e){let{className:r="",children:s,...n}=e;return(0,t.jsx)("div",{className:"mb-3 ".concat(r),...n,children:s})}function l(e){let{className:r="",children:s,...n}=e;return(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900 ".concat(r),...n,children:s})}function i(e){let{className:r="",children:s,...n}=e;return(0,t.jsx)("div",{className:r,...n,children:s})}function c(e){let{variant:r="gray",dot:s=!1,className:n="",children:a,...o}=e,l=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[r],n].filter(Boolean).join(" ");return(0,t.jsxs)("span",{className:l,...o,children:[s&&(0,t.jsx)("span",{className:"mr-1.5 inline-block h-2 w-2 rounded-full ".concat({success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[r]),"aria-hidden":"true"}),a]})}s(2265);var d=s(98702)},39625:function(e,r,s){"use strict";s.d(r,{O:function(){return a}});var t=s(57437),n=s(2265);function a(e){let{src:r,alt:s,onError:a}=e,[o,l]=(0,n.useState)(!1);return o?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-gray-500",children:[(0,t.jsx)("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,t.jsx)("p",{className:"text-sm",children:"Failed to load image"}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:s})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,t.jsx)("img",{src:r,alt:s,onError:()=>{l(!0),null==a||a()},style:{maxWidth:"100%",maxHeight:"500px",objectFit:"contain"},className:"rounded-lg shadow-sm"})})}},1243:function(e,r,s){"use strict";s.d(r,{R:function(){return a}});var t=s(57437),n=s(2265);function a(e){let{src:r,onError:s}=e,[a,o]=(0,n.useState)(!0),[l,i]=(0,n.useState)(!1);return l?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-gray-500",children:[(0,t.jsx)("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),(0,t.jsx)("p",{className:"text-sm",children:"Failed to load video"})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center p-4",children:[a&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,t.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),(0,t.jsx)("p",{className:"ml-3 text-gray-600",children:"Loading video..."})]}),(0,t.jsx)("video",{controls:!0,src:r,onLoadedData:()=>{o(!1)},onError:()=>{o(!1),i(!0),null==s||s()},style:{maxWidth:"100%",maxHeight:"500px",display:a?"none":"block"},className:"rounded-lg shadow-sm",children:"Your browser does not support the video tag."})]})}},3468:function(e,r,s){"use strict";s.d(r,{k:function(){return t}});let t={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}}},function(e){e.O(0,[9234,1038,2971,2117,1744],function(){return e(e.s=20084)}),_N_E=e.O()}]);