@shepai/cli 1.94.0 → 1.95.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 (136) hide show
  1. package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts +2 -0
  2. package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map +1 -1
  3. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  4. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +2 -1
  5. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts +1 -0
  6. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts.map +1 -1
  7. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.js +10 -0
  8. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  9. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +12 -1
  10. package/dist/tsconfig.build.tsbuildinfo +1 -1
  11. package/package.json +1 -1
  12. package/web/.next/BUILD_ID +1 -1
  13. package/web/.next/build-manifest.json +2 -2
  14. package/web/.next/fallback-build-manifest.json +2 -2
  15. package/web/.next/prerender-manifest.json +3 -3
  16. package/web/.next/required-server-files.js +2 -2
  17. package/web/.next/required-server-files.json +2 -2
  18. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +18 -18
  19. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  20. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  21. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +21 -21
  22. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +21 -21
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  27. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +14 -14
  28. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  29. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  30. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +18 -18
  31. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  32. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  33. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +21 -21
  34. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  35. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  36. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +21 -21
  37. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  38. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  39. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +14 -14
  40. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  41. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  42. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +14 -14
  43. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  44. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  45. package/web/.next/server/app/_global-error.html +2 -2
  46. package/web/.next/server/app/_global-error.rsc +1 -1
  47. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  48. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  49. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  50. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  51. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  52. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  53. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
  55. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  57. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  59. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  61. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  62. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  63. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  64. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js +1 -1
  65. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js.map +1 -1
  66. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js +1 -1
  67. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js.map +1 -1
  68. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
  69. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
  70. package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js +1 -1
  71. package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js.map +1 -1
  72. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  73. package/web/.next/server/chunks/ssr/[root-of-the-server]__45aad79d._.js +1 -1
  74. package/web/.next/server/chunks/ssr/[root-of-the-server]__45aad79d._.js.map +1 -1
  75. package/web/.next/server/chunks/ssr/[root-of-the-server]__4be9a9bb._.js +1 -1
  76. package/web/.next/server/chunks/ssr/[root-of-the-server]__5cc4752a._.js +1 -1
  77. package/web/.next/server/chunks/ssr/[root-of-the-server]__5cc4752a._.js.map +1 -1
  78. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
  79. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
  80. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
  81. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
  82. package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js +1 -1
  83. package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js.map +1 -1
  84. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +1 -1
  85. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  86. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
  87. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
  88. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  89. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  90. package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
  91. package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
  92. package/web/.next/server/chunks/ssr/{_9f6b01ba._.js → _c2399eb5._.js} +2 -2
  93. package/web/.next/server/chunks/ssr/{_9f6b01ba._.js.map → _c2399eb5._.js.map} +1 -1
  94. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  95. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  96. package/web/.next/server/chunks/ssr/_df15bd24._.js +1 -1
  97. package/web/.next/server/chunks/ssr/_df15bd24._.js.map +1 -1
  98. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  99. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  100. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js +1 -1
  101. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js.map +1 -1
  102. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  103. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  104. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  105. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  106. package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js +2 -2
  107. package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js.map +1 -1
  108. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  109. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
  110. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  111. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
  112. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  113. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  114. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  115. package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js +2 -2
  116. package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js.map +1 -1
  117. package/web/.next/server/pages/500.html +2 -2
  118. package/web/.next/server/server-reference-manifest.js +1 -1
  119. package/web/.next/server/server-reference-manifest.json +28 -28
  120. package/web/.next/static/chunks/{fca533d905e50d78.js → 35b142afe3405da9.js} +1 -1
  121. package/web/.next/static/chunks/{47d6a912ef998ba6.js → 3c68b85c9dd7f200.js} +1 -1
  122. package/web/.next/static/chunks/{2f0da3c393fc4f04.js → 42040482bd2ec9aa.js} +1 -1
  123. package/web/.next/static/chunks/{34a9700c5d94478b.js → 465f63a101981da8.js} +1 -1
  124. package/web/.next/static/chunks/{5014c892e1ecc7d6.js → 490407527f8234cb.js} +1 -1
  125. package/web/.next/static/chunks/{aef300837193b9fe.js → 59b988d41943386c.js} +1 -1
  126. package/web/.next/static/chunks/61c4d617e4b83d4b.css +1 -0
  127. package/web/.next/static/chunks/{949f140ebb0ba001.js → 6d61b6eaca9f925a.js} +1 -1
  128. package/web/.next/static/chunks/8ec10587d1c608a2.css +1 -0
  129. package/web/.next/static/chunks/{b2c294b25be01866.js → 98767389c1aad0b2.js} +1 -1
  130. package/web/.next/static/chunks/{8656ca74dcb26191.js → c4bbbfcfc008cba4.js} +1 -1
  131. package/web/.next/static/chunks/{a2d089b6a5c4fe0b.js → eb981f9e02a74f15.js} +1 -1
  132. package/web/.next/static/chunks/{0e4078228269008c.js → f0bbc2f086d7d996.js} +2 -2
  133. package/web/.next/static/chunks/39560c01879ac76a.css +0 -2
  134. /package/web/.next/static/{FBd4oUGtZ_PQpjMeHHiks → AT8BmALAnMpq68TlqG9FY}/_buildManifest.js +0 -0
  135. /package/web/.next/static/{FBd4oUGtZ_PQpjMeHHiks → AT8BmALAnMpq68TlqG9FY}/_clientMiddlewareManifest.json +0 -0
  136. /package/web/.next/static/{FBd4oUGtZ_PQpjMeHHiks → AT8BmALAnMpq68TlqG9FY}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,u=1;function p(e){var t=e.match(l);t&&(n+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function f(){var e={line:n,column:u};return function(t){return t.position=new h(e),x(i),t}}function h(e){this.start=e,this.end={line:n,column:u},this.source=t.source}function m(r){var l=Error(t.source+":"+n+":"+u+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=u,l.source=e,t.silent);else throw l}function x(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function g(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return u+=2,p(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}h.prototype.content=e,x(i);var v,b=[];for(g(b);v=function(){var e=f(),t=x(a);if(t){if(y(),!x(o))return m("property missing ':'");var n=x(s),l=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return x(c),l}}();)!1!==v&&(b.push(v),g(b));return b}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,l.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:l}=e;i?t(r,l,e):l&&((n=n||{})[r]=l)}),n};let l=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||i.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,c):e.replace(a,c)).replace(l,s))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),l=e.r(51521);function i(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,l.camelCase)(e,t)]=r)}),n}i.default=i,t.exports=i},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,l=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===l.call(e)},s=function(e){if(!e||"[object Object]"!==l.call(e))return!1;var t,n=r.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,l,i,a,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(t=arguments[p],null!=t)for(n in t)r=u(d,n),d!==(l=u(t,n))&&(h&&l&&(s(l)||(i=o(l)))?(i?(i=!1,a=r&&o(r)?r:[]):a=r&&s(r)?r:{},c(d,{name:n,newValue:e(h,a,l)})):void 0!==l&&c(d,{name:n,newValue:l}));return d}},36986,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(31406),l=e.i(60112),i=e.i(83428),a=e.i(67669),o=e.i(24042),s=e.i(64970),c=e.i(33548),u=e.i(23925),d=e.i(8986),p=e.i(30702),f=e.i(21023);let h=(0,f.createServerReference)("6072d81bcee5826415cf3a7f0493083ec7829a5043",f.callServer,void 0,f.findSourceMapURL,"approveFeature"),m=(0,f.createServerReference)("70c15b3601313938a0069849263a6bd7874256840f",f.callServer,void 0,f.findSourceMapURL,"rejectFeature"),x=(0,f.createServerReference)("4031e18fb0153f184c770cf48e1e41049a2092e35f",f.callServer,void 0,f.findSourceMapURL,"getFeatureArtifact"),g=(0,f.createServerReference)("401a299fb545a46d9d38a3725166e12ae6e8423e00",f.callServer,void 0,f.findSourceMapURL,"getResearchArtifact"),y=(0,f.createServerReference)("404e2f91f07dcd81d2ee355f897e47a23d8739f4cd",f.callServer,void 0,f.findSourceMapURL,"getMergeReviewData");var v=e.i(77859),b=e.i(75921),k=e.i(8361),w=e.i(30153),j=e.i(8537),N=e.i(39443);e.i(1650);var C=e.i(11495);e.i(99348);var S=e.i(17466),M=e.i(45811),E=e.i(35364),P=e.i(2828);e.i(31566);var I=e.i(65104);e.i(81803);var T=e.i(72714),R=e.i(38573),D=e.i(19933),A=e.i(99105),L=e.i(51251),z=e.i(91967),O=e.i(5978),F=e.i(22528),_=e.i(36589),B=e.i(87620),H=e.i(87342),U=e.i(66033),q=e.i(53532),$=e.i(41687),V=e.i(56720),K=e.i(13123),W=e.i(52740),G=e.i(39979),Q=e.i(85995),X=e.i(51080),J=e.i(86874),Y=e.i(29297),Z=e.i(73772),ee=e.i(13044),et=["Enter"," "],en=["ArrowUp","PageDown","End"],er=["ArrowDown","PageUp","Home",...en],el={ltr:[...et,"ArrowRight"],rtl:[...et,"ArrowLeft"]},ei={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ea="Menu",[eo,es,ec]=(0,H.createCollection)(ea),[eu,ed]=(0,F.createContextScope)(ea,[ec,W.createPopperScope,X.createRovingFocusGroupScope]),ep=(0,W.createPopperScope)(),ef=(0,X.createRovingFocusGroupScope)(),[eh,em]=eu(ea),[ex,eg]=eu(ea),ey=e=>{let{__scopeMenu:r,open:l=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=e,c=ep(r),[u,d]=n.useState(null),p=n.useRef(!1),f=(0,Y.useCallbackRef)(o),h=(0,U.useDirection)(a);return n.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,t.jsx)(W.Root,{...c,children:(0,t.jsx)(eh,{scope:r,open:l,onOpenChange:f,content:u,onContentChange:d,children:(0,t.jsx)(ex,{scope:r,onClose:n.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:h,modal:s,children:i})})})};ey.displayName=ea;var ev=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e,i=ep(r);return(0,t.jsx)(W.Anchor,{...i,...l,ref:n})});ev.displayName="MenuAnchor";var eb="MenuPortal",[ek,ew]=eu(eb,{forceMount:void 0}),ej=e=>{let{__scopeMenu:n,forceMount:r,children:l,container:i}=e,a=em(eb,n);return(0,t.jsx)(ek,{scope:n,forceMount:r,children:(0,t.jsx)(Q.Presence,{present:r||a.open,children:(0,t.jsx)(G.Portal,{asChild:!0,container:i,children:l})})})};ej.displayName=eb;var eN="MenuContent",[eC,eS]=eu(eN),eM=n.forwardRef((e,n)=>{let r=ew(eN,e.__scopeMenu),{forceMount:l=r.forceMount,...i}=e,a=em(eN,e.__scopeMenu),o=eg(eN,e.__scopeMenu);return(0,t.jsx)(eo.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(Q.Presence,{present:l||a.open,children:(0,t.jsx)(eo.Slot,{scope:e.__scopeMenu,children:o.modal?(0,t.jsx)(eE,{...i,ref:n}):(0,t.jsx)(eP,{...i,ref:n})})})})}),eE=n.forwardRef((e,r)=>{let l=em(eN,e.__scopeMenu),i=n.useRef(null),a=(0,O.useComposedRefs)(r,i);return n.useEffect(()=>{let e=i.current;if(e)return(0,Z.hideOthers)(e)},[]),(0,t.jsx)(eT,{...e,ref:a,trapFocus:l.open,disableOutsidePointerEvents:l.open,disableOutsideScroll:!0,onFocusOutside:(0,z.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>l.onOpenChange(!1)})}),eP=n.forwardRef((e,n)=>{let r=em(eN,e.__scopeMenu);return(0,t.jsx)(eT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),eI=(0,J.createSlot)("MenuContent.ScrollLock"),eT=n.forwardRef((e,r)=>{let{__scopeMenu:l,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:x,...g}=e,y=em(eN,l),v=eg(eN,l),b=ep(l),k=ef(l),w=es(l),[j,N]=n.useState(null),C=n.useRef(null),S=(0,O.useComposedRefs)(r,C,y.onContentChange),M=n.useRef(0),E=n.useRef(""),P=n.useRef(0),I=n.useRef(null),T=n.useRef("right"),R=n.useRef(0),D=x?ee.RemoveScroll:n.Fragment;n.useEffect(()=>()=>window.clearTimeout(M.current),[]),(0,$.useFocusGuards)();let A=n.useCallback(e=>{var t,n;return T.current===I.current?.side&&(t=e,!!(n=I.current?.area)&&function(e,t){let{x:n,y:r}=e,l=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let a=t[e],o=t[i],s=a.x,c=a.y,u=o.x,d=o.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(l=!l)}return l}({x:t.clientX,y:t.clientY},n))},[]);return(0,t.jsx)(eC,{scope:l,searchRef:E,onItemEnter:n.useCallback(e=>{A(e)&&e.preventDefault()},[A]),onItemLeave:n.useCallback(e=>{A(e)||(C.current?.focus(),N(null))},[A]),onTriggerLeave:n.useCallback(e=>{A(e)&&e.preventDefault()},[A]),pointerGraceTimerRef:P,onPointerGraceIntentChange:n.useCallback(e=>{I.current=e},[]),children:(0,t.jsx)(D,{...x?{as:eI,allowPinchZoom:!0}:void 0,children:(0,t.jsx)(V.FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:(0,z.composeEventHandlers)(o,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,t.jsx)(q.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:(0,t.jsx)(X.Root,{asChild:!0,...k,dir:v.dir,orientation:"vertical",loop:i,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:(0,z.composeEventHandlers)(u,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(W.Content,{role:"menu","aria-orientation":"vertical","data-state":e4(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...g,ref:S,style:{outline:"none",...g.style},onKeyDown:(0,z.composeEventHandlers)(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;if(t){var l;let t,i,a,o,s,c;"Tab"===e.key&&e.preventDefault(),!n&&r&&(l=e.key,t=E.current+l,i=w().filter(e=>!e.disabled),a=document.activeElement,o=i.find(e=>e.ref.current===a)?.textValue,s=function(e,t,n){var r;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=(r=Math.max(i,0),e.map((t,n)=>e[(r+n)%e.length]));1===l.length&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(l.toLowerCase()));return o!==n?o:void 0}(i.map(e=>e.textValue),t,o),c=i.find(e=>e.textValue===s)?.ref.current,function e(t){E.current=t,window.clearTimeout(M.current),""!==t&&(M.current=window.setTimeout(()=>e(""),1e3))}(t),c&&setTimeout(()=>c.focus()))}let i=C.current;if(e.target!==i||!er.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);en.includes(e.key)&&a.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(a)}),onBlur:(0,z.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),E.current="")}),onPointerMove:(0,z.composeEventHandlers)(e.onPointerMove,e8(e=>{let t=e.target,n=R.current!==e.clientX;e.currentTarget.contains(t)&&n&&(T.current=e.clientX>R.current?"right":"left",R.current=e.clientX)}))})})})})})})});eM.displayName=eN;var eR=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e;return(0,t.jsx)(B.Primitive.div,{role:"group",...l,ref:n})});eR.displayName="MenuGroup";var eD=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e;return(0,t.jsx)(B.Primitive.div,{...l,ref:n})});eD.displayName="MenuLabel";var eA="MenuItem",eL="menu.itemSelect",ez=n.forwardRef((e,r)=>{let{disabled:l=!1,onSelect:i,...a}=e,o=n.useRef(null),s=eg(eA,e.__scopeMenu),c=eS(eA,e.__scopeMenu),u=(0,O.useComposedRefs)(r,o),d=n.useRef(!1);return(0,t.jsx)(eO,{...a,ref:u,disabled:l,onClick:(0,z.composeEventHandlers)(e.onClick,()=>{let e=o.current;if(!l&&e){let t=new CustomEvent(eL,{bubbles:!0,cancelable:!0});e.addEventListener(eL,e=>i?.(e),{once:!0}),(0,B.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?d.current=!1:s.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,z.composeEventHandlers)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;l||t&&" "===e.key||et.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ez.displayName=eA;var eO=n.forwardRef((e,r)=>{let{__scopeMenu:l,disabled:i=!1,textValue:a,...o}=e,s=eS(eA,l),c=ef(l),u=n.useRef(null),d=(0,O.useComposedRefs)(r,u),[p,f]=n.useState(!1),[h,m]=n.useState("");return n.useEffect(()=>{let e=u.current;e&&m((e.textContent??"").trim())},[o.children]),(0,t.jsx)(eo.ItemSlot,{scope:l,disabled:i,textValue:a??h,children:(0,t.jsx)(X.Item,{asChild:!0,...c,focusable:!i,children:(0,t.jsx)(B.Primitive.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...o,ref:d,onPointerMove:(0,z.composeEventHandlers)(e.onPointerMove,e8(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,z.composeEventHandlers)(e.onPointerLeave,e8(e=>s.onItemLeave(e))),onFocus:(0,z.composeEventHandlers)(e.onFocus,()=>f(!0)),onBlur:(0,z.composeEventHandlers)(e.onBlur,()=>f(!1))})})})}),eF=n.forwardRef((e,n)=>{let{checked:r=!1,onCheckedChange:l,...i}=e;return(0,t.jsx)(eK,{scope:e.__scopeMenu,checked:r,children:(0,t.jsx)(ez,{role:"menuitemcheckbox","aria-checked":e6(r)?"mixed":r,...i,ref:n,"data-state":e9(r),onSelect:(0,z.composeEventHandlers)(i.onSelect,()=>l?.(!!e6(r)||!r),{checkForDefaultPrevented:!1})})})});eF.displayName="MenuCheckboxItem";var e_="MenuRadioGroup",[eB,eH]=eu(e_,{value:void 0,onValueChange:()=>{}}),eU=n.forwardRef((e,n)=>{let{value:r,onValueChange:l,...i}=e,a=(0,Y.useCallbackRef)(l);return(0,t.jsx)(eB,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,t.jsx)(eR,{...i,ref:n})})});eU.displayName=e_;var eq="MenuRadioItem",e$=n.forwardRef((e,n)=>{let{value:r,...l}=e,i=eH(eq,e.__scopeMenu),a=r===i.value;return(0,t.jsx)(eK,{scope:e.__scopeMenu,checked:a,children:(0,t.jsx)(ez,{role:"menuitemradio","aria-checked":a,...l,ref:n,"data-state":e9(a),onSelect:(0,z.composeEventHandlers)(l.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});e$.displayName=eq;var eV="MenuItemIndicator",[eK,eW]=eu(eV,{checked:!1}),eG=n.forwardRef((e,n)=>{let{__scopeMenu:r,forceMount:l,...i}=e,a=eW(eV,r);return(0,t.jsx)(Q.Presence,{present:l||e6(a.checked)||!0===a.checked,children:(0,t.jsx)(B.Primitive.span,{...i,ref:n,"data-state":e9(a.checked)})})});eG.displayName=eV;var eQ=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e;return(0,t.jsx)(B.Primitive.div,{role:"separator","aria-orientation":"horizontal",...l,ref:n})});eQ.displayName="MenuSeparator";var eX=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e,i=ep(r);return(0,t.jsx)(W.Arrow,{...i,...l,ref:n})});eX.displayName="MenuArrow";var eJ="MenuSub",[eY,eZ]=eu(eJ),e0=e=>{let{__scopeMenu:r,children:l,open:i=!1,onOpenChange:a}=e,o=em(eJ,r),s=ep(r),[c,u]=n.useState(null),[d,p]=n.useState(null),f=(0,Y.useCallbackRef)(a);return n.useEffect(()=>(!1===o.open&&f(!1),()=>f(!1)),[o.open,f]),(0,t.jsx)(W.Root,{...s,children:(0,t.jsx)(eh,{scope:r,open:i,onOpenChange:f,content:d,onContentChange:p,children:(0,t.jsx)(eY,{scope:r,contentId:(0,K.useId)(),triggerId:(0,K.useId)(),trigger:c,onTriggerChange:u,children:l})})})};e0.displayName=eJ;var e1="MenuSubTrigger",e2=n.forwardRef((e,r)=>{let l=em(e1,e.__scopeMenu),i=eg(e1,e.__scopeMenu),a=eZ(e1,e.__scopeMenu),o=eS(e1,e.__scopeMenu),s=n.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},p=n.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return n.useEffect(()=>p,[p]),n.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),(0,t.jsx)(ev,{asChild:!0,...d,children:(0,t.jsx)(eO,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":a.contentId,"data-state":e4(l.open),...e,ref:(0,O.composeRefs)(r,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),l.open||l.onOpenChange(!0))},onPointerMove:(0,z.composeEventHandlers)(e.onPointerMove,e8(t=>{o.onItemEnter(t),!t.defaultPrevented&&(e.disabled||l.open||s.current||(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{l.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,z.composeEventHandlers)(e.onPointerLeave,e8(e=>{p();let t=l.content?.getBoundingClientRect();if(t){let n=l.content?.dataset.side,r="right"===n,i=t[r?"left":"right"],a=t[r?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:i,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,t=>{let n=""!==o.searchRef.current;e.disabled||n&&" "===t.key||el[i.dir].includes(t.key)&&(l.onOpenChange(!0),l.content?.focus(),t.preventDefault())})})})});e2.displayName=e1;var e5="MenuSubContent",e3=n.forwardRef((e,r)=>{let l=ew(eN,e.__scopeMenu),{forceMount:i=l.forceMount,...a}=e,o=em(eN,e.__scopeMenu),s=eg(eN,e.__scopeMenu),c=eZ(e5,e.__scopeMenu),u=n.useRef(null),d=(0,O.useComposedRefs)(r,u);return(0,t.jsx)(eo.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(Q.Presence,{present:i||o.open,children:(0,t.jsx)(eo.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(eT,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,z.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:(0,z.composeEventHandlers)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ei[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function e4(e){return e?"open":"closed"}function e6(e){return"indeterminate"===e}function e9(e){return e6(e)?"indeterminate":e?"checked":"unchecked"}function e8(e){return t=>"mouse"===t.pointerType?e(t):void 0}e3.displayName=e5;var e7="DropdownMenu",[te,tt]=(0,F.createContextScope)(e7,[ed]),tn=ed(),[tr,tl]=te(e7),ti=e=>{let{__scopeDropdownMenu:r,children:l,dir:i,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,u=tn(r),d=n.useRef(null),[p,f]=(0,_.useControllableState)({prop:a,defaultProp:o??!1,onChange:s,caller:e7});return(0,t.jsx)(tr,{scope:r,triggerId:(0,K.useId)(),triggerRef:d,contentId:(0,K.useId)(),open:p,onOpenChange:f,onOpenToggle:n.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,t.jsx)(ey,{...u,open:p,onOpenChange:f,dir:i,modal:c,children:l})})};ti.displayName=e7;var ta="DropdownMenuTrigger",to=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,disabled:l=!1,...i}=e,a=tl(ta,r),o=tn(r);return(0,t.jsx)(ev,{asChild:!0,...o,children:(0,t.jsx)(B.Primitive.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...i,ref:(0,O.composeRefs)(n,a.triggerRef),onPointerDown:(0,z.composeEventHandlers)(e.onPointerDown,e=>{!l&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,e=>{!l&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});to.displayName=ta;var ts=e=>{let{__scopeDropdownMenu:n,...r}=e,l=tn(n);return(0,t.jsx)(ej,{...l,...r})};ts.displayName="DropdownMenuPortal";var tc="DropdownMenuContent",tu=n.forwardRef((e,r)=>{let{__scopeDropdownMenu:l,...i}=e,a=tl(tc,l),o=tn(l),s=n.useRef(!1);return(0,t.jsx)(eM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...i,ref:r,onCloseAutoFocus:(0,z.composeEventHandlers)(e.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,z.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!a.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tu.displayName=tc;var td=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eR,{...i,...l,ref:n})});td.displayName="DropdownMenuGroup";var tp=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eD,{...i,...l,ref:n})});tp.displayName="DropdownMenuLabel";var tf=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(ez,{...i,...l,ref:n})});tf.displayName="DropdownMenuItem";var th=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eF,{...i,...l,ref:n})});th.displayName="DropdownMenuCheckboxItem";var tm=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eU,{...i,...l,ref:n})});tm.displayName="DropdownMenuRadioGroup";var tx=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(e$,{...i,...l,ref:n})});tx.displayName="DropdownMenuRadioItem";var tg=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eG,{...i,...l,ref:n})});tg.displayName="DropdownMenuItemIndicator";var ty=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eQ,{...i,...l,ref:n})});ty.displayName="DropdownMenuSeparator";var tv=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eX,{...i,...l,ref:n})});tv.displayName="DropdownMenuArrow";var tb=e=>{let{__scopeDropdownMenu:n,children:r,open:l,onOpenChange:i,defaultOpen:a}=e,o=tn(n),[s,c]=(0,_.useControllableState)({prop:l,defaultProp:a??!1,onChange:i,caller:"DropdownMenuSub"});return(0,t.jsx)(e0,{...o,open:s,onOpenChange:c,children:r})},tk=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(e2,{...i,...l,ref:n})});tk.displayName="DropdownMenuSubTrigger";var tw=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(e3,{...i,...l,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tw.displayName="DropdownMenuSubContent",e.s(["Arrow",()=>tv,"CheckboxItem",()=>th,"Content",()=>tu,"DropdownMenu",()=>ti,"DropdownMenuArrow",()=>tv,"DropdownMenuCheckboxItem",()=>th,"DropdownMenuContent",()=>tu,"DropdownMenuGroup",()=>td,"DropdownMenuItem",()=>tf,"DropdownMenuItemIndicator",()=>tg,"DropdownMenuLabel",()=>tp,"DropdownMenuPortal",()=>ts,"DropdownMenuRadioGroup",()=>tm,"DropdownMenuRadioItem",()=>tx,"DropdownMenuSeparator",()=>ty,"DropdownMenuSub",()=>tb,"DropdownMenuSubContent",()=>tw,"DropdownMenuSubTrigger",()=>tk,"DropdownMenuTrigger",()=>to,"Group",()=>td,"Item",()=>tf,"ItemIndicator",()=>tg,"Label",()=>tp,"Portal",()=>ts,"RadioGroup",()=>tm,"RadioItem",()=>tx,"Root",()=>ti,"Separator",()=>ty,"Sub",()=>tb,"SubContent",()=>tw,"SubTrigger",()=>tk,"Trigger",()=>to,"createDropdownMenuScope",()=>tt],61920);var tj=e.i(61920),tj=tj,tN=e.i(76016),tC=e.i(95812),tS=e.i(31777);let tM=tj.Root,tE=tj.Trigger;tj.Group,tj.Portal,tj.Sub,tj.RadioGroup,n.forwardRef(({className:e,inset:n,children:r,...l},i)=>(0,t.jsxs)(tj.SubTrigger,{ref:i,className:(0,tS.cn)("focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...l,children:[r,(0,t.jsx)(tN.ChevronRight,{className:"ml-auto"})]})).displayName=tj.SubTrigger.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(tj.SubContent,{ref:r,className:(0,tS.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg",e),...n})).displayName=tj.SubContent.displayName;let tP=n.forwardRef(({className:e,sideOffset:n=4,...r},l)=>(0,t.jsx)(tj.Portal,{children:(0,t.jsx)(tj.Content,{ref:l,sideOffset:n,className:(0,tS.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),...r})}));tP.displayName=tj.Content.displayName;let tI=n.forwardRef(({className:e,inset:n,...r},l)=>(0,t.jsx)(tj.Item,{ref:l,className:(0,tS.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r}));tI.displayName=tj.Item.displayName,n.forwardRef(({className:e,children:n,checked:r,...l},i)=>(0,t.jsxs)(tj.CheckboxItem,{ref:i,className:(0,tS.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...l,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(tj.ItemIndicator,{children:(0,t.jsx)(u.Check,{className:"h-4 w-4"})})}),n]})).displayName=tj.CheckboxItem.displayName,n.forwardRef(({className:e,children:n,...r},l)=>(0,t.jsxs)(tj.RadioItem,{ref:l,className:(0,tS.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(tj.ItemIndicator,{children:(0,t.jsx)(tC.Circle,{className:"h-2 w-2 fill-current"})})}),n]})).displayName=tj.RadioItem.displayName;let tT=n.forwardRef(({className:e,inset:n,...r},l)=>(0,t.jsx)(tj.Label,{ref:l,className:(0,tS.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}));tT.displayName=tj.Label.displayName;let tR=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(tj.Separator,{ref:r,className:(0,tS.cn)("bg-muted -mx-1 my-1 h-px",e),...n}));function tD({actions:e,repositoryPath:r,showSpecs:l}){let[a,o]=(0,n.useState)(!1),s=e.ideLoading||e.shellLoading||e.specsLoading,p=e.ideError??e.shellError??e.specsError;return(0,t.jsxs)(tM,{modal:!1,children:[(0,t.jsx)(tE,{asChild:!0,children:(0,t.jsxs)(E.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:s,children:[s?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):p?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(A.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(tP,{align:"start",className:"w-48",children:[(0,t.jsx)(tT,{children:"Open in"}),(0,t.jsxs)(tI,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(d.Code2,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(tI,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(R.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(tI,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!l,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(tR,{}),(0,t.jsxs)(tI,{onClick:()=>{navigator.clipboard.writeText(r),o(!0),setTimeout(()=>o(!1),2e3)},className:"gap-2",children:[a?(0,t.jsx)(u.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-4"}),a?"Copied!":"Copy path"]})]})]})}tR.displayName=tj.Separator.displayName;var tA=e.i(68304);let tL=(0,f.createServerReference)("40c3b24e5aa2fb87bbde5aec5a27df95e79b91ef65",f.callServer,void 0,f.findSourceMapURL,"getFeaturePhaseTimings"),tz=(0,f.createServerReference)("40d6f5a6b123367488a6be3cd90d1788a4cf97c490",f.callServer,void 0,f.findSourceMapURL,"getFeaturePlan");var tO=e.i(11345),tF=e.i(81846),t_=e.i(16868),tB=e.i(3645);let tH=(0,tB.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var tU=e.i(48306);e.i(50032);var tq=e.i(86254),t$=e.i(42076);let tV=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function tK({onReject:e,onApprove:r,approveLabel:l,revisionPlaceholder:i,isProcessing:a=!1,isRejecting:o=!1,children:s,chatInput:c,onChatInputChange:d}){let[p,f]=(0,n.useState)(""),h=c??p,m=d??f,x=(0,k.useSoundAction)("approve"),g=a||o,[y,v]=(0,n.useState)([]),[b,w]=(0,n.useState)(!1),[j,N]=(0,n.useState)(null),[C,S]=(0,n.useState)(!1),[M,I]=(0,n.useState)(!1),[T,R]=(0,n.useState)(!1),D=C||M&&T,A=M&&!T,L=(0,n.useRef)(0),z=(0,n.useRef)(crypto.randomUUID()),O=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&I(!0),"Shift"===e.key&&R(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&I(!1),"Shift"===e.key&&R(!1)}function n(){I(!1),R(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",n)}},[]);let F=(0,n.useCallback)(async e=>{for(let t of(N(null),e)){if(t.size>0xa00000)return void N(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!tV.has(e))return void N(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();v(n=>[...n,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let n=new FormData;n.append("file",t),n.append("sessionId",z.current);let r=await fetch("/api/attachments/upload",{method:"POST",body:n});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));v(t=>t.filter(t=>t.id!==e)),N(t.error??"Upload failed");return}let l=await r.json();v(t=>t.some(t=>t.id!==e&&t.path===l.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...l,id:e,loading:!1}:t))}catch{v(t=>t.filter(t=>t.id!==e)),N("Upload failed")}}},[]),_=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L.current+=1,1===L.current&&w(!0)},[]),B=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L.current-=1,0===L.current&&w(!1)},[]),H=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),U=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L.current=0,w(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&F(t)},[F]),q=(0,n.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),F(n))},[F]),$=(0,n.useCallback)(async()=>{try{let e=await (0,t$.pickFiles)();e&&v(t=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return r.length>0?[...t,...r]:t})}catch{}},[]),V=(0,n.useCallback)(e=>{v(t=>t.filter(t=>t.id!==e))},[]),K=(0,n.useCallback)(()=>{m(""),v([]),N(null)},[m]),W=(0,n.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),O.current?.requestSubmit())},[]),G="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[s,e?(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:O,onSubmit:function(t){t.preventDefault();let n=h.trim();if(C||M&&T)x.play(),r(),K();else{if(!n||!e)return;e(n,y.filter(e=>!e.loading)),K()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":"File drop zone","data-drag-over":b?"true":"false",onDragEnter:_,onDragLeave:B,onDragOver:H,onDrop:U,className:(0,tS.cn)("rounded-md border-2 border-transparent transition-colors",b&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(tU.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:g,value:h,onChange:e=>m(e.target.value),onKeyDown:W,onPaste:q,rows:3,className:"max-h-[35dvh] min-h-0 flex-1 resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),y.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:y.map(e=>(0,t.jsx)(tq.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>V(e.id),disabled:g,loading:e.loading},e.id))}),j?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:j}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[G,"+Enter"]})," ","reject",(0,t.jsx)("span",{className:"mx-1 opacity-40",children:"|"}),(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[G,"+Shift+Enter"]})," ","approve"]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:$,disabled:g,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(t_.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:"Attach files"})]}),(0,t.jsx)("div",{onMouseLeave:()=>S(!1),children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:g,"data-testid":"drawer-action-submit",className:(0,tS.cn)("relative flex h-8 min-w-[10rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",D?"border-blue-400/60 text-white":A?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-blue-500/85 transition-transform duration-300 ease-in-out",style:{transform:D?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,tS.cn)("absolute inset-0 z-10 flex items-center justify-center gap-1.5 pr-8 transition-opacity duration-300",D?"opacity-0":"opacity-100"),children:[(0,t.jsx)(tH,{className:"h-3.5 w-3.5 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,tS.cn)("absolute inset-0 z-10 flex items-center justify-center gap-1.5 text-white transition-opacity duration-300",D?"opacity-100":"opacity-0"),children:[(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5 shrink-0"}),l]}),(0,t.jsx)("span",{className:(0,tS.cn)("border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l bg-blue-500/85 transition-opacity duration-300",D&&"pointer-events-none opacity-0"),onMouseEnter:()=>S(!0),children:(0,t.jsx)(tO.ChevronLeft,{className:"h-3.5 w-3.5 text-white"})})]})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:D?"Approve":"Send revision feedback"})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(E.Button,{type:"button",className:"flex-1",disabled:g,onClick:()=>{x.play(),r()},children:l})})]})}function tW({data:e,selections:r,onSelect:l,onApprove:i,onReject:a,isProcessing:o=!1,isRejecting:s=!1,showHeader:c=!1,chatInput:u,onChatInputChange:d}){let{question:p,context:f,questions:h,finalAction:m}=e,[x,g]=(0,n.useState)(0),y=(0,k.useSoundAction)("select"),v=(0,k.useSoundAction)("navigate"),b=h.length,w=x===b-1,j=h[x],N=(0,n.useMemo)(()=>Object.keys(r).length,[r]),C=(0,n.useCallback)((e,t)=>{y.play(),l(e,t),w||setTimeout(()=>g(e=>e+1),250)},[l,w,y]);return 0===b?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:p}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:f})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:j.question}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,n)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${n+1}`,className:(0,tS.cn)("h-1.5 rounded-full transition-all duration-200",n===x?"bg-primary w-4":"w-1.5",n!==x&&r[e.id]?"bg-primary/50":"",n===x||r[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),g(n)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:j.options.map((e,n)=>{let l=r[j.id]===e.id,i=String.fromCharCode(65+n);return(0,t.jsx)("button",{type:"button",className:(0,tS.cn)("border-border w-full rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",l&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:o,onClick:()=>C(j.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[i,"."]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-0.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:e.label}),e.recommended?(0,t.jsx)(tF.Badge,{className:"px-1.5 py-0 text-[10px]",children:"AI Recommended"}):null,e.isNew?(0,t.jsx)(tF.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] text-white hover:bg-emerald-600/80",children:"New"}):null]}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]})]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(E.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===x||o,onClick:()=>{v.play(),g(e=>e-1)},children:[(0,t.jsx)(tO.ChevronLeft,{className:"mr-1 h-4 w-4"}),"Previous"]}),w?null:(0,t.jsxs)(E.Button,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>{v.play(),g(e=>e+1)},children:[r[j.id]?"Next":"Skip",(0,t.jsx)(tN.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]}),(0,t.jsx)(tK,{onReject:a,onApprove:()=>i(m.id),approveLabel:m.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:o,isRejecting:s,chatInput:u,onChatInputChange:d,children:(0,t.jsx)("div",{className:(0,tS.cn)("bg-muted h-1.5 overflow-hidden",N>0&&N<b||o?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:o?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${b>0?N/b*100:0}%`},"data-testid":"progress-bar"})})})]})}function tG(){}function tQ(){}let tX=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tY={};function tZ(e,t){return((t||tY).jsx?tJ:tX).test(e)}let t0=/[ \t\n\f\r]/g;function t1(e){return""===e.replace(t0,"")}class t2{constructor(e,t){this.attribute=t,this.property=e}}t2.prototype.attribute="",t2.prototype.booleanish=!1,t2.prototype.boolean=!1,t2.prototype.commaOrSpaceSeparated=!1,t2.prototype.commaSeparated=!1,t2.prototype.defined=!1,t2.prototype.mustUseProperty=!1,t2.prototype.number=!1,t2.prototype.overloadedBoolean=!1,t2.prototype.property="",t2.prototype.spaceSeparated=!1,t2.prototype.space=void 0;let t5=0,t3=nt(),t4=nt(),t6=nt(),t9=nt(),t8=nt(),t7=nt(),ne=nt();function nt(){return 2**++t5}e.s(["boolean",0,t3,"booleanish",0,t4,"commaOrSpaceSeparated",0,ne,"commaSeparated",0,t7,"number",0,t9,"overloadedBoolean",0,t6,"spaceSeparated",0,t8],83954);var nn=e.i(83954);let nr=Object.keys(nn);class nl extends t2{constructor(e,t,n,r){let l=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++l<nr.length;){const e=nr[l];!function(e,t,n){n&&(e[t]=n)}(this,nr[l],(n&nn[e])===nn[e])}}}function ni(e){return e.toLowerCase()}nl.prototype.defined=!0;let na=/[A-Z]/g,no=/-[a-z]/g,ns=/^data[-\w.:]+$/i;function nc(e){return"-"+e.toLowerCase()}function nu(e){return e.charAt(1).toUpperCase()}let nd={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class np{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function nf(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new np(n,r,t)}function nh(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let i=new nl(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ni(r)]=r,n[ni(i.attribute)]=r}return new np(t,n,e.space)}np.prototype.normal={},np.prototype.property={},np.prototype.space=void 0;let nm=nh({properties:{ariaActiveDescendant:null,ariaAtomic:t4,ariaAutoComplete:null,ariaBusy:t4,ariaChecked:t4,ariaColCount:t9,ariaColIndex:t9,ariaColSpan:t9,ariaControls:t8,ariaCurrent:null,ariaDescribedBy:t8,ariaDetails:null,ariaDisabled:t4,ariaDropEffect:t8,ariaErrorMessage:null,ariaExpanded:t4,ariaFlowTo:t8,ariaGrabbed:t4,ariaHasPopup:null,ariaHidden:t4,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:t8,ariaLevel:t9,ariaLive:null,ariaModal:t4,ariaMultiLine:t4,ariaMultiSelectable:t4,ariaOrientation:null,ariaOwns:t8,ariaPlaceholder:null,ariaPosInSet:t9,ariaPressed:t4,ariaReadOnly:t4,ariaRelevant:null,ariaRequired:t4,ariaRoleDescription:t8,ariaRowCount:t9,ariaRowIndex:t9,ariaRowSpan:t9,ariaSelected:t4,ariaSetSize:t9,ariaSort:null,ariaValueMax:t9,ariaValueMin:t9,ariaValueNow:t9,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function nx(e,t){return t in e?e[t]:t}function ng(e,t){return nx(e,t.toLowerCase())}let ny=nh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:t7,acceptCharset:t8,accessKey:t8,action:null,allow:null,allowFullScreen:t3,allowPaymentRequest:t3,allowUserMedia:t3,alt:null,as:null,async:t3,autoCapitalize:null,autoComplete:t8,autoFocus:t3,autoPlay:t3,blocking:t8,capture:null,charSet:null,checked:t3,cite:null,className:t8,cols:t9,colSpan:null,content:null,contentEditable:t4,controls:t3,controlsList:t8,coords:t9|t7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:t3,defer:t3,dir:null,dirName:null,disabled:t3,download:t6,draggable:t4,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:t3,formTarget:null,headers:t8,height:t9,hidden:t6,high:t9,href:null,hrefLang:null,htmlFor:t8,httpEquiv:t8,id:null,imageSizes:null,imageSrcSet:null,inert:t3,inputMode:null,integrity:null,is:null,isMap:t3,itemId:null,itemProp:t8,itemRef:t8,itemScope:t3,itemType:t8,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:t3,low:t9,manifest:null,max:null,maxLength:t9,media:null,method:null,min:null,minLength:t9,multiple:t3,muted:t3,name:null,nonce:null,noModule:t3,noValidate:t3,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:t3,optimum:t9,pattern:null,ping:t8,placeholder:null,playsInline:t3,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:t3,referrerPolicy:null,rel:t8,required:t3,reversed:t3,rows:t9,rowSpan:t9,sandbox:t8,scope:null,scoped:t3,seamless:t3,selected:t3,shadowRootClonable:t3,shadowRootDelegatesFocus:t3,shadowRootMode:null,shape:null,size:t9,sizes:null,slot:null,span:t9,spellCheck:t4,src:null,srcDoc:null,srcLang:null,srcSet:null,start:t9,step:null,style:null,tabIndex:t9,target:null,title:null,translate:null,type:null,typeMustMatch:t3,useMap:null,value:t4,width:t9,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:t8,axis:null,background:null,bgColor:null,border:t9,borderColor:null,bottomMargin:t9,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:t3,declare:t3,event:null,face:null,frame:null,frameBorder:null,hSpace:t9,leftMargin:t9,link:null,longDesc:null,lowSrc:null,marginHeight:t9,marginWidth:t9,noResize:t3,noHref:t3,noShade:t3,noWrap:t3,object:null,profile:null,prompt:null,rev:null,rightMargin:t9,rules:null,scheme:null,scrolling:t4,standby:null,summary:null,text:null,topMargin:t9,valueType:null,version:null,vAlign:null,vLink:null,vSpace:t9,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:t3,disableRemotePlayback:t3,prefix:null,property:null,results:t9,security:null,unselectable:null},space:"html",transform:ng}),nv=nh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ne,accentHeight:t9,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:t9,amplitude:t9,arabicForm:null,ascent:t9,attributeName:null,attributeType:null,azimuth:t9,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:t9,by:null,calcMode:null,capHeight:t9,className:t8,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:t9,diffuseConstant:t9,direction:null,display:null,dur:null,divisor:t9,dominantBaseline:null,download:t3,dx:null,dy:null,edgeMode:null,editable:null,elevation:t9,enableBackground:null,end:null,event:null,exponent:t9,externalResourcesRequired:null,fill:null,fillOpacity:t9,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:t7,g2:t7,glyphName:t7,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:t9,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:t9,horizOriginX:t9,horizOriginY:t9,id:null,ideographic:t9,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:t9,k:t9,k1:t9,k2:t9,k3:t9,k4:t9,kernelMatrix:ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:t9,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:t9,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:t9,overlineThickness:t9,paintOrder:null,panose1:null,path:null,pathLength:t9,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:t8,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:t9,pointsAtY:t9,pointsAtZ:t9,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ne,rev:ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ne,requiredFeatures:ne,requiredFonts:ne,requiredFormats:ne,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:t9,specularExponent:t9,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:t9,strikethroughThickness:t9,string:null,stroke:null,strokeDashArray:ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:t9,strokeOpacity:t9,strokeWidth:null,style:null,surfaceScale:t9,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ne,tabIndex:t9,tableValues:null,target:null,targetX:t9,targetY:t9,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:t9,underlineThickness:t9,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:t9,values:null,vAlphabetic:t9,vMathematical:t9,vectorEffect:null,vHanging:t9,vIdeographic:t9,version:null,vertAdvY:t9,vertOriginX:t9,vertOriginY:t9,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:t9,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nx}),nb=nh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),nk=nh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ng}),nw=nh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),nj=nf([nm,ny,nb,nk,nw],"html"),nN=nf([nm,nv,nb,nk,nw],"svg");var nC=e.i(63185);let nS=nE("end"),nM=nE("start");function nE(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function nP(e){return e&&"object"==typeof e?"position"in e||"type"in e?nT(e.position):"start"in e||"end"in e?nT(e):"line"in e||"column"in e?nI(e):"":""}function nI(e){return nR(e&&e.line)+":"+nR(e&&e.column)}function nT(e){return nI(e&&e.start)+"-"+nI(e&&e.end)}function nR(e){return e&&"number"==typeof e?e:1}class nD extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},i=!1;if(t&&(l="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(i=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){const e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=nP(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=i&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nD.prototype.file="",nD.prototype.name="",nD.prototype.reason="",nD.prototype.message="",nD.prototype.stack="",nD.prototype.column=void 0,nD.prototype.line=void 0,nD.prototype.ancestors=void 0,nD.prototype.cause=void 0,nD.prototype.fatal=void 0,nD.prototype.place=void 0,nD.prototype.ruleId=void 0,nD.prototype.source=void 0;let nA={}.hasOwnProperty,nL=new Map,nz=/[A-Z]/g,nO=new Set(["table","tbody","thead","tfoot","tr"]),nF=new Set(["td","th"]),n_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nB(e,t,n){var r,l,i,a,o,s,c,u,d;let p,f,h,m,x,g,y,v,b,k,w;return"element"===t.type?(r=e,l=t,i=n,f=p=r.schema,"svg"===l.tagName.toLowerCase()&&"html"===p.space&&(r.schema=nN),r.ancestors.push(l),h=n$(r,l.tagName,!1),m=function(e,t){let n,r,l={};for(r in t.properties)if("children"!==r&&nA.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=ni(t),r=t,l=t2;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ns.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(no,nu);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!no.test(e)){let n=e.replace(na,nc);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=nl}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var l;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(l=n)[l.length-1]?[...l,""]:l).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,nC.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new nD("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=n_+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)nA.call(e,t)&&(n[function(e){let t=e.replace(nz,nK);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?nd[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,a]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&nF.has(t.tagName)?n=a:l[r]=a}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(r,l),x=nq(r,l),nO.has(l.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&t1(e.value):t1(e))})),nH(r,m,h,l),nU(m,x),r.ancestors.pop(),r.schema=p,r.create(l,h,m,i)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return tG("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}nV(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,o=t,s=n,y=g=a.schema,"svg"===o.name&&"html"===g.space&&(a.schema=nN),a.ancestors.push(o),v=null===o.name?a.Fragment:n$(a,o.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];tG("ExpressionStatement"===t.type);let l=t.expression;tG("ObjectExpression"===l.type);let i=l.properties[0];tG("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else nV(e,t.position);else{let l,i=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];tG("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else nV(e,t.position);else l=null===r.value||r.value;n[i]=l}return n}(a,o),k=nq(a,o),nH(a,b,v,o),nU(b,k),a.ancestors.pop(),a.schema=g,a.create(o,v,b,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nV(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,nU(w={},nq(c,u)),c.create(u,c.Fragment,w,d)):"text"===t.type?t.value:void 0}function nH(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nU(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function nq(e,t){let n=[],r=-1,l=e.passKeys?new Map:nL;for(;++r<t.children.length;){let i,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=l.get(e)||0;i=e+"-"+t,l.set(e,t+1)}}let o=nB(e,a,i);void 0!==o&&n.push(o)}return n}function n$(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),l=-1;for(;++l<n.length;){let t=tZ(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}tG(e,"always a result"),r=e}else r=tZ(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return nA.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);nV(e)}function nV(e,t){let n=new nD("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=n_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function nK(e){return"-"+e.toLowerCase()}let nW={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},nG={};function nQ(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return nX(e.children,t,n)}return Array.isArray(e)?nX(e,t,n):""}function nX(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=nQ(e[l],t,n);return r.join("")}function nJ(e,t,n,r){let l,i=e.length,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)(l=r.slice(a,a+1e4)).unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function nY(e,t){return e.length>0?(nJ(e,e.length,0,t),e):t}let nZ={}.hasOwnProperty,n0=rn(/[A-Za-z]/),n1=rn(/[\dA-Za-z]/),n2=rn(/[#-'*+\--9=?A-Z^-~]/);function n5(e){return null!==e&&(e<32||127===e)}let n3=rn(/\d/),n4=rn(/[\dA-Fa-f]/),n6=rn(/[!-/:-@[-`{-~]/);function n9(e){return null!==e&&e<-2}function n8(e){return null!==e&&(e<0||32===e)}function n7(e){return -2===e||-1===e||32===e}let re=rn(/\p{P}|\p{S}/u),rt=rn(/\s/);function rn(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function rr(e,t,n,r){let l=r?r-1:1/0,i=0;return function(r){return n7(r)?(e.enter(n),function r(a){return n7(a)&&i++<l?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let rl={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rr(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return n9(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},ri={tokenize:function(e){let t,n,r,l=this,i=[],a=0;return o;function o(t){if(a<i.length){let n=i[a];return l.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&g();let r=l.events.length,i=r;for(;i--;)if("exit"===l.events[i][0]&&"chunkFlow"===l.events[i][1].type){n=l.events[i][1].end;break}x(a);let o=r;for(;o<l.events.length;)l.events[o][1].end={...n},o++;return nJ(l.events,i+1,0,l.events.slice(r)),l.events.length=o,c(e)}return o(e)}function c(n){if(a===i.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(ra,u,d)(n)}function u(e){return t&&g(),x(a),p(e)}function d(e){return l.parser.lazy[l.now().line]=a!==i.length,r=l.now().offset,h(e)}function p(t){return l.containerState={},e.attempt(ra,f,h)(t)}function f(e){return a++,i.push([l.currentConstruct,l.containerState]),p(e)}function h(r){if(null===r){t&&g(),x(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return n9(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,l.interrupt=void 0,o):(e.consume(n),t)}(r)}function m(e,i){let o=l.sliceStream(e);if(i&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),l.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let o=l.events.length,s=o;for(;s--;)if("exit"===l.events[s][0]&&"chunkFlow"===l.events[s][1].type){if(e){n=l.events[s][1].end;break}e=!0}for(x(a),i=o;i<l.events.length;)l.events[i][1].end={...n},i++;nJ(l.events,s+1,0,l.events.slice(o)),l.events.length=i}}function x(t){let n=i.length;for(;n-- >t;){let t=i[n];l.containerState=t[1],t[0].exit.call(l,e)}i.length=t}function g(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},ra={tokenize:function(e,t,n){return rr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ro={partial:!0,tokenize:function(e,t,n){return function(t){return n7(t)?rr(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||n9(e)?t(e):n(e)}}};class rs{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&rc(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),rc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),rc(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);rc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);rc(this.left,t.reverse())}}}function rc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ru(e){let t,n,r,l,i,a,o,s={},c=-1,u=new rs(e);for(;++c<u.length;){for(;c in s;)c=s[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,l=e.get(t)[1],i=e.get(t)[2],a=t-1,o=[],s=l._tokenizer;!s&&(s=i.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,u=[],d={},p=-1,f=l,h=0,m=0,x=[0];for(;f;){for(;e.get(++a)[1]!==f;);o.push(a),!f._tokenizer&&(n=i.sliceStream(f),f.next||n.push(null),r&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=f,f=f.next}for(f=l;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(m=p+1,x.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):x.pop(),p=x.length;p--;){let t=c.slice(x[p],x[p+1]),n=o.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[h+u[p][0]]=h+u[p][1],h+=u[p][1]-u[p][0]-1;return d}(u,c)),c=s[c],o=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(l=u.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(i=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,i))}}return nJ(e,0,1/0,u.slice(0)),!o}let rd={resolve:function(e){return ru(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):n9(t)?e.check(rp,i,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},rp={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rr(e,l,"linePrefix")};function l(l){if(null===l||n9(l))return n(l);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},rf={tokenize:function(e){let t=this,n=e.attempt(ro,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,rr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(rd,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},rh={resolveAll:ry()},rm=rg("string"),rx=rg("text");function rg(e){return{resolveAll:ry("text"===e?rv:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,i,a);return i;function i(e){return s(e)?l(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return s(e)?(t.exit("data"),l(e)):(t.consume(e),o)}function s(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function ry(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function rv(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,l=e[n-1][1],i=t.sliceStream(l),a=i.length,o=-1,s=0;for(;a--;){let e=i[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)s++,o--;if(o)break;o=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:l.start._bufferIndex+o,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...i.start},l.start.offset===l.end.offset?Object.assign(l,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function rb(e){return null===e||n8(e)||rt(e)?1:re(e)?2:void 0}function rk(e,t,n){let r=[],l=-1;for(;++l<e.length;){let i=e[l].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let rw={name:"attention",resolveAll:function(e,t){let n,r,l,i,a,o,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};rj(d,-o),rj(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},l={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=nY(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=nY(s,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",l,t]]),s=nY(s,rk(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=nY(s,[["exit",l,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=nY(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,nJ(e,n-1,u-n+3,s),u=n+s.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,l=this.previous,i=rb(l);return function(a){return n=a,e.enter("attentionSequence"),function a(o){if(o===n)return e.consume(o),a;let s=e.exit("attentionSequence"),c=rb(o),u=!c||2===c&&i||r.includes(o),d=!i||2===i&&c||r.includes(l);return s._open=!!(42===n?u:u&&(i||!d)),s._close=!!(42===n?d:d&&(c||!u)),t(o)}(a)}}};function rj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let rN={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return n7(t)?rr(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(rN,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return n7(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},rC={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return n6(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},rS=document.createElement("i");function rM(e){let t="&"+e+";";rS.innerHTML=t;let n=rS.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let rE={name:"characterReference",tokenize:function(e,t,n){let r,l,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,l=n1,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=n4,c):(e.enter("characterReferenceValue"),r=7,l=n3,c(t))}function c(o){if(59===o&&a){let r=e.exit("characterReferenceValue");return l!==n1||rM(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return l(o)&&a++<r?(e.consume(o),c):n(o)}}},rP={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},rI={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,l=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),n7(t)?rr(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(i++,e.consume(l),t):i>=o?(e.exit("codeFencedFenceSequence"),n7(l)?rr(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||n9(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,o=0;return function(t){var i;let c;return i=t,a=(c=l.events[l.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(o++,e.consume(l),t):o<3?n(l):(e.exit("codeFencedFenceSequence"),n7(l)?rr(e,s,"whitespace")(l):s(l))}(i)};function s(i){return null===i||n9(i)?(e.exit("codeFencedFence"),l.interrupt?t(i):e.check(rP,u,h)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||n9(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(l)):n7(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rr(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(i))}function c(t){return null===t||n9(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||n9(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function u(t){return e.attempt(i,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return a>0&&n7(t)?rr(e,f,"linePrefix",a+1)(t):f(t)}function f(t){return null===t||n9(t)?e.check(rP,u,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||n9(n)?(e.exit("codeFlowValue"),f(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},rT={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),rr(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?i(n):n9(n)?e.attempt(rR,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||n9(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},rR={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):n9(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):rr(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):n9(e)?l(e):n(e)}}};function rD(e,t,n,r,l,i,a,o,s){let c=s||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||n5(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(l),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||n9(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(l){return!u&&(null===l||41===l||n8(l))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(l)):u<c&&40===l?(e.consume(l),u++,h):41===l?(e.consume(l),u--,h):null===l||32===l||40===l||n5(l)?n(l):(e.consume(l),92===l?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function rA(e,t,n,r,l,i){let a,o=this,s=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(i),c};function c(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):93===d?(e.exit(i),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):n9(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||n9(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!n7(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function rL(e,t,n,r,l,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(i),s(n))}function s(t){return t===a?(e.exit(i),o(a)):null===t?n(t):n9(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rr(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||n9(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function rz(e,t){let n;return function r(l){return n9(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):n7(l)?rr(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}function rO(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let rF={partial:!0,tokenize:function(e,t,n){return function(t){return n8(t)?rz(e,r)(t):n(t)};function r(t){return rL(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return n7(t)?rr(e,i,"whitespace")(t):i(t)}function i(e){return null===e||n9(e)?t(e):n(e)}}},r_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rB=["pre","script","style","textarea"],rH={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ro,t,n)}}},rU={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return n9(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},rq={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&nJ(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,i,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(l=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},u={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[l-2][1].start}};return i=nY(i=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+o+3)),i=nY(i,[["enter",u,t]]),i=nY(i,rk(t.parser.constructs.insideSpan.null,e.slice(r+o+4,l-3),t)),i=nY(i,[["exit",u,t],e[l-2],e[l-1],["exit",c,t]]),i=nY(i,e.slice(l+1)),i=nY(i,[["exit",s,t]]),nJ(e,r,e.length,i),e},tokenize:function(e,t,n){let r,l,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){return r?r._inactive?u(t):(l=i.parser.defined.includes(rO(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(r$,c,l?c:u)(t):91===t?e.attempt(rV,c,l?s:u)(t):l?c(t):u(t)}function s(t){return e.attempt(rK,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},r$={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return n8(t)?rz(e,l)(t):l(t)}function l(t){return 41===t?c(t):rD(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return n8(t)?rz(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?rL(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return n8(t)?rz(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},rV={tokenize:function(e,t,n){let r=this;return function(t){return rA.call(r,e,l,i,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes(rO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},rK={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},rW={name:"labelStartImage",resolveAll:rq.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},rG={name:"labelStartLink",resolveAll:rq.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},rQ={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),rr(e,t,"linePrefix")}}},rX={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(i){var a;return e.enter("thematicBreak"),r=a=i,function i(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),n7(n)?rr(e,i,"whitespace")(n):i(n))}(a)):l>=3&&(null===a||n9(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},rJ={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ro,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rr(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!n7(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rZ,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,rr(e,e.attempt(rJ,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],i=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,a=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:n3(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(rX,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return n3(l)&&++a<10?(e.consume(l),t):(!r.interrupt||a<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),o(l)):n(l)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(ro,r.interrupt?n:s,e.attempt(rY,u,c))}function s(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return n7(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},rY={partial:!0,tokenize:function(e,t,n){let r=this;return rr(e,function(e){let l=r.events[r.events.length-1];return!n7(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},rZ={partial:!0,tokenize:function(e,t,n){let r=this;return rr(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},r0={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",a,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,l=this;return function(t){var a;let o,s=l.events.length;for(;s--;)if("lineEnding"!==l.events[s][1].type&&"linePrefix"!==l.events[s][1].type&&"content"!==l.events[s][1].type){o="paragraph"===l.events[s][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||o)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),n7(n)?rr(e,i,"lineSuffix")(n):i(n))}(a)):n(t)};function i(r){return null===r||n9(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,l=this;return function(t){var r;return e.enter("definition"),r=t,rA.call(l,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function i(t){return(r=rO(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return n8(t)?rz(e,o)(t):o(t)}function o(t){return rD(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(rF,c,c)(t)}function c(t){return n7(t)?rr(e,u,"whitespace")(t):u(t)}function u(i){return null===i||n9(i)?(e.exit("definition"),l.parser.defined.push(r),t(i)):n(i)}}}},"disable",0,{null:[]},"document",0,{42:rJ,43:rJ,45:rJ,48:rJ,49:rJ,50:rJ,51:rJ,52:rJ,53:rJ,54:rJ,55:rJ,56:rJ,57:rJ,62:rN},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),l-2>i&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},nJ(e,i,l-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){var i;return e.enter("atxHeading"),i=l,e.enter("atxHeadingSequence"),function l(i){return 35===i&&r++<6?(e.consume(i),l):null===i||n8(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||n9(r)?(e.exit("atxHeading"),t(r)):n7(r)?rr(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||n8(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(i)}}},42:rX,45:[r0,rX],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,l,i,a,o,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),l=!0,f):63===a?(e.consume(a),r=3,s.interrupt?t:R):n0(a)?(e.consume(a),i=String.fromCharCode(a),h):n(a)}function u(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,a=0,p):n0(l)?(e.consume(l),r=4,s.interrupt?t:R):n(l)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:R):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(a++)?(e.consume(r),a===l.length)?s.interrupt?t:N:p:n(r)}function f(t){return n0(t)?(e.consume(t),i=String.fromCharCode(t),h):n(t)}function h(a){if(null===a||47===a||62===a||n8(a)){let o=47===a,c=i.toLowerCase();return!o&&!l&&rB.includes(c)?(r=1,s.interrupt?t(a):N(a)):r_.includes(i.toLowerCase())?(r=6,o)?(e.consume(a),m):s.interrupt?t(a):N(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):l?function t(n){return n7(n)?(e.consume(n),t):w(n)}(a):x(a))}return 45===a||n1(a)?(e.consume(a),i+=String.fromCharCode(a),h):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:N):n(r)}function x(t){return 47===t?(e.consume(t),w):58===t||95===t||n0(t)?(e.consume(t),g):n7(t)?(e.consume(t),x):w(t)}function g(t){return 45===t||46===t||58===t||95===t||n1(t)?(e.consume(t),g):y(t)}function y(t){return 61===t?(e.consume(t),v):n7(t)?(e.consume(t),y):x(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,b):n7(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||n8(n)?y(n):(e.consume(n),t)}(t)}function b(t){return t===o?(e.consume(t),o=null,k):null===t||n9(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||n7(e)?x(e):n(e)}function w(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||n9(t)?N(t):n7(t)?(e.consume(t),j):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),P):62===t&&4===r?(e.consume(t),D):63===t&&3===r?(e.consume(t),R):93===t&&5===r?(e.consume(t),T):n9(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(rH,A,C)(t)):null===t||n9(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),N)}function C(t){return e.check(rU,S,A)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||n9(t)?C(t):(e.enter("htmlFlowData"),N(t))}function E(t){return 45===t?(e.consume(t),R):N(t)}function P(t){return 47===t?(e.consume(t),i="",I):N(t)}function I(t){if(62===t){let n=i.toLowerCase();return rB.includes(n)?(e.consume(t),D):N(t)}return n0(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),I):N(t)}function T(t){return 93===t?(e.consume(t),R):N(t)}function R(t){return 62===t?(e.consume(t),D):45===t&&2===r?(e.consume(t),R):N(t)}function D(t){return null===t||n9(t)?(e.exit("htmlFlowData"),A(t)):(e.consume(t),D)}function A(n){return e.exit("htmlFlow"),t(n)}}},61:r0,95:rX,96:rI,126:rI},"flowInitial",0,{[-2]:rT,[-1]:rT,32:rT},"insideSpan",0,{null:[rw,rh]},"string",0,{38:rE,92:rC},"text",0,{[-5]:rQ,[-4]:rQ,[-3]:rQ,33:rW,38:rE,42:rw,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return n0(t)?(e.consume(t),i):64===t?n(t):o(t)}function i(t){return 43===t||45===t||46===t||n1(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||n1(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||n5(r)?n(r):(e.consume(r),a)}function o(t){return 64===t?(e.consume(t),s):n2(t)?(e.consume(t),o):n(t)}function s(l){return n1(l)?function l(i){return 46===i?(e.consume(i),r=0,s):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||n1(i))&&r++<63){let n=45===i?t:l;return e.consume(i),n}return n(i)}(i)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,i,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),b):63===t?(e.consume(t),y):n0(t)?(e.consume(t),w):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,f):n0(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):n9(t)?(i=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?P(e):45===e?d(e):u(e)}function f(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):n9(t)?(i=h,I(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),x):h(t)}function x(t){return 62===t?P(t):93===t?(e.consume(t),x):h(t)}function g(t){return null===t||62===t?P(t):n9(t)?(i=g,I(t)):(e.consume(t),g)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):n9(t)?(i=y,I(t)):(e.consume(t),y)}function v(e){return 62===e?P(e):y(e)}function b(t){return n0(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||n1(t)?(e.consume(t),k):function t(n){return n9(n)?(i=t,I(n)):n7(n)?(e.consume(n),t):P(n)}(t)}function w(t){return 45===t||n1(t)?(e.consume(t),w):47===t||62===t||n8(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),P):58===t||95===t||n0(t)?(e.consume(t),N):n9(t)?(i=j,I(t)):n7(t)?(e.consume(t),j):P(t)}function N(t){return 45===t||46===t||58===t||95===t||n1(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),C):n9(n)?(i=t,I(n)):n7(n)?(e.consume(n),t):j(n)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):n9(t)?(i=C,I(t)):n7(t)?(e.consume(t),C):(e.consume(t),M)}function S(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):n9(t)?(i=S,I(t)):(e.consume(t),S)}function M(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||n8(t)?j(t):(e.consume(t),M)}function E(e){return 47===e||62===e||n8(e)?j(e):n(e)}function P(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return n7(t)?rr(e,R,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),i(t)}}}],91:rG,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return n9(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},rC],93:rq,95:rw,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(l=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(l.type="codeTextData",o(a))}(s)):n9(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),o(s))}function o(t){return null===t||32===t||96===t||n9(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),o)}}}}],19210);var r1=e.i(19210);let r2=/[\0\t\n\r]/g;function r5(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let r3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function r4(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return r5(n.slice(t?2:1),t?16:10)}return rM(n)||e}let r6={}.hasOwnProperty;function r9(e){return{line:e.line,column:e.column,offset:e.offset}}function r8(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+nP({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nP({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+nP({start:t.start,end:t.end})+") is still open")}function r7(e){let t=this;t.parser=function(n){var r,l;let i,a,o,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(l=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(f),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(f,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(x,l),htmlFlowData:c,htmlText:r(x,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=r5(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=rM(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=r9(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rO(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(r3,r4),n.identifier=rO(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=r9(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rO(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(r6.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:i,exit:o,buffer:l,resume:s,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,l,i,a,o=t-1,s=-1,c=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||i||(i=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(l=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",l=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!l||i<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(o,0,["enter",l,t[2]]),o++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];r6.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||r8).call(a,void 0,e[0])}for(r.position={start:r9(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:r9(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:r9(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||r8).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+nP({start:e.start,end:e.end})+"): it’s not open");n.position.end=r9(e.end)}function s(){var e;return e=this.stack.pop(),nQ(e,"boolean"!=typeof nG.includeImageAlt||nG.includeImageAlt,"boolean"!=typeof nG.includeHtml||nG.includeHtml)}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:r9(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=r9(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function x(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(l)(function(e){for(;!ru(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,l=(nZ.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){nZ.call(l,r)||(l[r]=[]);let e=i[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);nJ(e,0,0,r)}(l[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([r1,...(e||{}).extensions||[]]),content:n(rl),defined:[],document:n(ri),flow:n(rf),lazy:{},string:n(rm),text:n(rx)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},l={},i=[],a=[],o=[],s={attempt:h(function(e,t){m(e,t.from)}),check:h(f),consume:function(e){n9(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:h(f,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let i,a=e[r];if("string"==typeof a)i=a;else switch(a){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(a)}n=-2===a,l.push(i)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=nY(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==a[a.length-1])?[]:(m(t,0),c.events=rk(i,c.events,c),c.events)}},u=t.tokenize.call(c,s);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,l=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;if(r===i)n=[e[r].slice(l,a)];else{if(n=e.slice(r,i),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}a>0&&n.push(e[i].slice(0,a))}return n}(a,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:i}}function f(e,t){t.restore()}function h(e,t){return function(n,l,i){var a;let u,d,f,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?i:g(e[d])}function g(e){return function(n){let l,i,a,u,d;return(l=p(),i=c.previous,a=c.currentConstruct,u=c.events.length,d=Array.from(o),h={from:u,restore:function(){r=l,c.previous=i,c.currentConstruct=a,c.events.length=u,o=d,x()}},f=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,y,v)(n)}}function y(t){return e(f,h),l}function v(e){return(h.restore(),++d<u.length)?g(u[d]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&nJ(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function x(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(l).document().write((a=1,o="",s=!0,function(e,t,n){let r,l,c,u,d,p=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,o="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(r2.lastIndex=c,u=(r=r2.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){o=e.slice(c);break}if(10===d&&c===u&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),c<u&&(p.push(e.slice(c,u)),a+=u-c),d){case 0:p.push(65533),a++;break;case 9:for(l=4*Math.ceil(a/4),p.push(-2);a++<l;)p.push(-1);break;case 10:p.push(-4),a=1;break;default:i=!0,a=1}c=u+1}return n&&(i&&p.push(-5),o&&p.push(o),p.push(null)),p})(n,r,!0))))}}let le="object"==typeof self?self:globalThis,lt=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=l=>{if(t.has(l))return t.get(l);let[i,a]=e[l];switch(i){case 0:case -1:return n(a,l);case 1:{let e=n([],l);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),l);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new le[e](t),l)}case 8:return n(BigInt(a),l);case"BigInt":return n(Object(BigInt(a)),l);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new le[i](a),l)})(0)},{toString:ln}={},{keys:lr}=Object,ll=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=ln.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},li=([e,t])=>0===e&&("function"===t||"symbol"===t),la=(e,{json:t,lossy:n}={})=>{var r,l,i;let a,o,s=[];return(r=!(t||n),l=!!t,i=new Map,a=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},o=e=>{if(i.has(e))return i.get(e);let[t,n]=ll(e);switch(t){case 0:{let l=e;switch(n){case"bigint":t=8,l=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);l=null;break;case"undefined":return a([-1],e)}return a([t,l],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],l=a([t,r],e);for(let t of e)r.push(o(t));return l}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(l&&"toJSON"in e)return o(e.toJSON());let i=[],s=a([t,i],e);for(let t of lr(e))(r||!li(ll(e[t])))&&i.push([o(t),o(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],l=a([t,n],e);for(let[t,l]of e)(r||!(li(ll(t))||li(ll(l))))&&n.push([o(t),o(l)]);return l}case 6:{let n=[],l=a([t,n],e);for(let t of e)(r||!li(ll(t)))&&n.push(o(t));return l}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},lo="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?lt(la(e,t)):structuredClone(e):(e,t)=>lt(la(e,t));function ls(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let i=e.charCodeAt(n),a="";if(37===i&&n1(e.charCodeAt(n+1))&&n1(e.charCodeAt(n+2)))l=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),l=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+l+1,a=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function lc(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function lu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let ld=function(e){var t,n;if(null==e)return lf;if("function"==typeof e)return lp(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ld(e[n]);return lp(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,lp(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,lp(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function lp(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function lf(){return!0}let lh=[];function lm(e,t,n,r){var l,i,a;let o,s,c,u,d,p;"function"==typeof t&&"function"!=typeof n?(s=void 0,c=t,o=n):(s=t,c=n,o=r),l=s,i=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return c(e,r,n)},a=o,"function"==typeof l&&"function"!=typeof i?(a=i,i=l):u=l,d=ld(u),p=a?-1:1,(function e(t,n,r){let o=t&&"object"==typeof t?t:{};if("string"==typeof o.type){let e="string"==typeof o.tagName?o.tagName:"string"==typeof o.name?o.name:void 0;Object.defineProperty(s,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return s;function s(){var o;let s,c,u,f=lh;if((!l||d(t,n,r[r.length-1]||void 0))&&!1===(f=Array.isArray(o=i(t,r))?o:"number"==typeof o?[!0,o]:null==o?lh:[o])[0])return f;if("children"in t&&t.children&&t.children&&"skip"!==f[0])for(c=(a?t.children.length:-1)+p,u=r.concat(t);c>-1&&c<t.children.length;){if(!1===(s=e(t.children[c],c,u)())[0])return s;c="number"==typeof s[1]?s[1]:c+p}return f}})(e,void 0,[])()}function lx(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),i=l[0];i&&"text"===i.type?i.value="["+i.value:l.unshift({type:"text",value:"["});let a=l[l.length-1];return a&&"text"===a.type?a.value+=r:l.push({type:"text",value:r}),l}function lg(e){let t=e.spread;return null==t?e.children.length>1:t}function ly(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let lv={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),i=ls(l.toLowerCase()),a=e.footnoteOrder.indexOf(l),o=e.footnoteCounts.get(l);void 0===o?(o=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=a+1,o+=1,e.footnoteCounts.set(l,o);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lx(e,t);let l={src:ls(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:ls(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lx(e,t);let l={href:ls(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:ls(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=lg(n[r])}return t}(n):lg(t),i={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(l||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(l||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=nM(t.children[1]),a=nS(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),l.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length,o=-1,s=[];for(;++o<a;){let n=t.children[o],r={},a=i?i[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:l,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,i=[];for(;r;)i.push(ly(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return i.push(ly(t.slice(l),l>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:lb,yaml:lb,definition:lb,footnoteDefinition:lb};function lb(){}let lk={}.hasOwnProperty,lw={};function lj(e,t){e.position&&(t.position=function(e){let t=nM(e),n=nS(e);if(t&&n)return{start:t,end:n}}(e))}function lN(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,lo(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function lC(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function lS(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function lM(e,t){let n,r,l,i,a=(n=t||lw,r=new Map,l=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=i.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=lS(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=lS(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:lN,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...lv,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(lk.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=lo(n);return r.children=i.all(e),r}return lo(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(lk.call(n,"hProperties")||lk.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:lj,wrap:lC},lm(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i),o=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lc,r=e.options.footnoteBackLabel||lu,l=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],s=-1;for(;++s<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[s]);if(!l)continue;let i=e.all(l),a=String(l.identifier).toUpperCase(),c=ls(a.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){let e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else i.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(l,h),o.push(h)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...lo(a),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&(tG("children"in c),c.children.push({type:"text",value:"\n"},s)),c}function lE(e,t){return e&&"run"in e?async function(n,r){let l=lM(n,{file:r,...t});await e.run(l,r)}:function(n,r){return lM(n,{file:r,...e||t})}}function lP(e){if(e)throw e}var lI=e.i(75609);function lT(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let lR=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');lz(e);let r=0,l=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(l=i):(o=-1,l=a));return r===l?l=a:l<0&&(l=e.length),e.slice(r,l)},lD=function(e){let t;if(lz(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},lA=function(e){let t;lz(e);let n=e.length,r=-1,l=0,i=-1,a=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1)}return i<0||r<0||0===a||1===a&&i===r-1&&i===l+1?"":e.slice(i,r)},lL=function(...e){var t;let n,r,l,i=-1;for(;++i<e.length;)lz(e[i]),e[i]&&(l=void 0===l?e[i]:l+"/"+e[i]);return void 0===l?".":(lz(t=l),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,l="",i=0,a=-1,o=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(l.length<2||2!==i||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),a=s,o=0;continue}}else if(l.length>0){l="",i=0,a=s,o=0;continue}}t&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(a+1,s):l=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&o>-1?o++:o=-1}return l}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function lz(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function lO(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let lF=["history","path","basename","stem","extname","dirname"];class l_{constructor(e){let t,n;t=e?lO(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<lF.length;){const e=lF[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)lF.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?lR(this.path):void 0}set basename(e){lH(e,"basename"),lB(e,"basename"),this.path=lL(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?lD(this.path):void 0}set dirname(e){lU(this.basename,"dirname"),this.path=lL(e||"",this.basename)}get extname(){return"string"==typeof this.path?lA(this.path):void 0}set extname(e){if(lB(e,"extname"),lU(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=lL(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){lO(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!lO(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),lH(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?lR(this.path,this.extname):void 0}set stem(e){lH(e,"stem"),lB(e,"stem"),this.path=lL(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new nD(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function lB(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function lH(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function lU(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let lq=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},l$={}.hasOwnProperty;class lV extends lq{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function l(i,...a){let o=e[++n],s=-1;if(i)return void r(i);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,o?(function(e,t){let n;return function(...t){let i,a=e.length>t.length;a&&t.push(r);try{i=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(i&&i.then&&"function"==typeof i.then?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(o,l)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new lV,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,lI.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(lQ("data",this.frozen),this.namespace[e]=t,this):l$.call(this.namespace,e)&&this.namespace[e]||void 0:e?(lQ("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=lY(e),n=this.parser||this.Parser;return lW("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),lW("process",this.parser||this.Parser),lG("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let i=lY(e),a=n.parse(i);function o(e,n){e||!n?l(e):r?r(n):(tG(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){var l,i;if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof(l=a)||(i=l)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),lW("processSync",this.parser||this.Parser),lG("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,lP(e),t=r}),lJ("processSync","process",n),tG(t,"we either bailed on an error or have a tree"),t}run(e,t,n){lX(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,i){tG("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=lY(t);r.run(e,a,function(t,r,a){let o=r||e;t?i(t):l?l(o):(tG(n,"`done` is defined if `resolve` is not"),n(void 0,o,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){lP(e),n=t,r=!0}),lJ("runSync","run",r),tG(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=lY(t),r=this.compiler||this.Compiler;return lG("stringify",r),lX(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(lQ("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=(0,lI.default)(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else l(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,a=n[l][1];lT(a)&&lT(r)&&(r=(0,lI.default)(!0,a,r)),n[l]=[e,r,...i]}}}}let lK=new lV().freeze();function lW(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function lG(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function lQ(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lX(e){if(!lT(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function lJ(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function lY(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new l_(e)}let lZ=[],l0={allowDangerousHtml:!0},l1=/^(https?|ircs?|mailto|xmpp)$/i,l2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function l5(e){var n;let r,l,i,a,o,s=(r=(n=e).rehypePlugins||lZ,l=n.remarkPlugins||lZ,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...l0}:l0,lK().use(r7).use(l).use(lE,i).use(r)),c=(a=e.children||"",o=new l_,"string"==typeof a?o.value=a:tQ("Unexpected value `"+a+"` for `children` prop, expected `string`"),o);return function(e,n){let r=n.allowedElements,l=n.allowElement,i=n.components,a=n.disallowedElements,o=n.skipHtml,s=n.unwrapDisallowed,c=n.urlTransform||l3;for(let e of l2)Object.hasOwn(n,e.from)&&tQ("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&tQ("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),lm(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return o?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in nW)if(Object.hasOwn(nW,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=nW[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&l&&"number"==typeof t&&(i=!l(e,t,n)),i&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,l,i;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,a=function(e,t,l,i){let a=Array.isArray(l.children),o=nM(e);return r(t,l,i,a,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");l=t.jsx,i=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?i:l;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?nN:nj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=nB(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(c),c),e)}function l3(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||l1.test(e.slice(0,t))?e:""}let l4=(0,tB.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),l6=(0,tB.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),l9={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:n})=>n?(0,t.jsx)("code",{className:`${n} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:n})=>(0,t.jsx)("a",{href:n,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function l8({decision:e,index:r}){let[l,i]=(0,n.useState)(!1),a=(0,k.useSoundAction)("expand"),o=(0,k.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:r+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(tF.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(l5,{components:l9,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{l?o.play():a.play(),i(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(tN.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${l?"rotate-90":""}`}),(0,t.jsx)(l6,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),l?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function l7({data:e}){let{summary:n,decisions:r}=e;return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),n?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:n}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(l4,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),r.map((e,n)=>(0,t.jsx)(l8,{decision:e,index:n},e.title))]})}let ie=(0,tB.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);function it({item:e,index:n}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(tF.Badge,{className:"px-1.5 py-0 text-[10px]",children:"AI Recommended"}):null]})]})]})})})}function ir({data:e}){let{questions:n}=e;return 0===n.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ie,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),n.map((e,n)=>(0,t.jsx)(it,{item:e,index:n},e.question))]})}let il=(0,tB.default)("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"}]]),ii=(0,tB.default)("file-diff",[["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:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),ia=(0,tB.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var io=e.i(49228);let is=(0,tB.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var ic=e.i(35e3),iu=e.i(30090),iu=iu,id=e.i(17406);function ip({status:e}){switch(e){case id.CiStatus.Success:return(0,t.jsxs)(tF.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(ic.CheckCircle2,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case id.CiStatus.Pending:return(0,t.jsxs)(tF.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(i.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case id.CiStatus.Failure:return(0,t.jsxs)(tF.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(iu.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}var ih=e.i(70471);let im=(0,tB.default)("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"}]]),ix=(0,tB.default)("file-minus",[["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"}]]),ig=(0,tB.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),iy={added:{icon:im,label:"A",className:"text-green-600"},modified:{icon:ig,label:"M",className:"text-amber-600"},deleted:{icon:ix,label:"D",className:"text-red-600"},renamed:{icon:ig,label:"R",className:"text-blue-600"}};function iv({status:e}){let n=iy[e],r=n.icon;return(0,t.jsx)(r,{className:(0,tS.cn)("h-3.5 w-3.5 shrink-0",n.className)})}function ib({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,tS.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,tS.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pr-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function ik({file:e}){let[r,l]=(0,n.useState)(!1),i=e.path.split("/").pop()??e.path,a=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!r),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-left",children:[(0,t.jsx)(tN.ChevronRight,{className:(0,tS.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",r&&"rotate-90")}),(0,t.jsx)(iv,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[a,"/"]}),i]}):i}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),r&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(ib,{hunk:e},e.header))}):null]})}function iw({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(ih.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(ik,{file:e},e.path))})]})}function ij({data:e,onApprove:n,onReject:r,isProcessing:l=!1,isRejecting:i=!1,chatInput:a,onChatInputChange:o}){let{pr:s,diffSummary:c,fileDiffs:u,branch:d,warning:f}=e;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),d?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(io.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(tF.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:d.source}),(0,t.jsx)(is,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(tF.Badge,{variant:"outline",className:"font-mono text-[11px]",children:d.target})]})}):null,s?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",s.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(tF.Badge,{variant:"outline",className:"text-xs",children:s.status})]}),s.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(ip,{status:s.ciStatus})]}):null,s.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ia,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:s.commitHash.slice(0,7)})]})]}):null]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(ii,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",c.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",c.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):f?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(il,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:f})]})}):null,u&&u.length>0?(0,t.jsx)(iw,{fileDiffs:u}):null]}),(0,t.jsx)(tK,{onReject:r,onApprove:n,approveLabel:"Approve Merge",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:l,isRejecting:i,chatInput:a,onChatInputChange:o})]})}var iN=e.i(53360),iC=e.i(2287),iS=e.i(28267),iM=e.i(80436);let iE=(0,tB.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),iP=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function iI(e){let t=e.lastIndexOf(".");return t>=0&&iP.has(e.slice(t).toLowerCase())}function iT(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",n=iI(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",r=new URLSearchParams({path:e,...n&&{mimeType:n}});return`/api/attachments/preview?${r.toString()}`}let iR=/(?:^|\s)@(\/[^\s]+)/g;function iD({text:e,attachmentPaths:n}){let r=function(e){let t=[],n=0;for(let r of e.matchAll(iR)){let l=r.index,i=l+(r[0].length-r[0].trimStart().length);i>n&&t.push({type:"text",value:e.slice(n,i)}),t.push({type:"attachment",path:r[1]}),n=l+r[0].length}return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}(e),l=r.some(e=>"attachment"===e.type),i=n?.filter(Boolean)??[];return l||0!==i.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[r.map(e=>{if("text"===e.type){let n=e.value.trim();return n?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:n},`text-${n.slice(0,40)}`):null}return(0,t.jsx)(iA,{path:e.path},`att-${e.path}`)}),i.map(e=>(0,t.jsx)(iA,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function iA({path:e}){let r=e.split("/").pop()??e,[l,i]=(0,n.useState)(!1);return iI(e)?l?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(iE,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:r})]}):(0,t.jsxs)(iC.Dialog,{children:[(0,t.jsx)(iC.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:iT(e),alt:r,"data-testid":"inline-attachment-image",onError:()=>i(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(iC.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(iS.VisuallyHidden.Root,{children:(0,t.jsxs)(iC.DialogTitle,{children:["Preview: ",r]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:iT(e),alt:r,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:r})}),(0,t.jsx)("a",{href:iT(e),download:r,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${r}`,children:(0,t.jsx)(iM.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:iT(e),download:r,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:r})}var iL=e.i(25235);let iz=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),iO=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function iF({className:e,size:n="md",duration:r=5,...l}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,tS.cn)(iz({size:n}),e),...l,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),iO.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}e.i(47506);var i_=e.i(2929),iB=e.i(86782);function iH({data:e}){let n="maintain"===e.lifecycle;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:i_.lifecycleDisplayLabels[e.lifecycle]}),(0,t.jsx)(iU,{data:e}),!n&&e.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[e.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,tS.cn)("h-full rounded-full transition-all",i_.featureNodeStateConfig[e.state].progressClass),style:{width:`${e.progress}%`}})})]}):null,n&&e.pr?(0,t.jsx)(iV,{pr:e.pr}):null]}),(0,t.jsx)(iq,{data:e}),!n&&e.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iL.Separator,{}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(iV,{pr:e.pr})})]}):null,(0,t.jsx)(iK,{data:e})]})}function iU({data:e}){let n=i_.featureNodeStateConfig[e.state],r=n.icon;return(0,t.jsxs)("div",{className:(0,tS.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",n.badgeBgClass,n.badgeClass),children:["running"===e.state?(0,t.jsx)(iF,{size:"sm",className:"shrink-0"}):(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n.label})]})}function iq({data:e}){var n;let r,l,i,a,o;return e.branch||e.oneLiner||e.summary||e.userQuery||e.createdAt?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iL.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[e.branch?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(io.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:e.branch}),e.baseBranch?(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",e.baseBranch]}):null]})]}):null,e.oneLiner?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.oneLiner})]}):null,e.userQuery?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,t.jsx)(iD,{text:e.userQuery})]}):null,e.summary?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.summary})]}):null,e.createdAt?(0,t.jsx)(iG,{label:"Created",value:(n=e.createdAt,r=Date.now(),(o=Math.floor((a=Math.floor((i=Math.floor(Math.floor((r-(l="string"==typeof n?new Date(n).getTime():n))/1e3)/60))/60))/24))>30?new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):o>0?`${o} day${1===o?"":"s"} ago`:a>0?`${a} hour${1===a?"":"s"} ago`:i>0?`${i} minute${1===i?"":"s"} ago`:"just now")}):null]})]}):null}let i$={[id.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[id.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[id.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function iV({pr:e}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(tF.Badge,{className:i$[e.status],children:e.status})]}),e.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(ip,{status:e.ciStatus})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ia,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function iK({data:e}){return e.fastMode??e.agentType??e.runtime??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iL.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.fastMode?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(iN.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,e.agentType?(0,t.jsx)(iW,{agentType:e.agentType}):null,e.runtime?(0,t.jsx)(iG,{label:"Runtime",value:e.runtime}):null,e.blockedBy?(0,t.jsx)(iG,{label:"Blocked by",value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(iG,{label:"Error",value:e.errorMessage}):null]})]}):null}function iW({agentType:e}){let n=(0,iB.getAgentTypeIcon)(e),r=iB.agentTypeLabels[e]??e;return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),r]})]})}function iG({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:n})]})}var iQ=e.i(14748),iQ=iQ;let iX=(0,tB.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function iJ(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let n=Math.floor(t/3600),r=Math.floor(t%3600/60),l=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${l}s`:`${l}s`}let iY={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",merge:"Merging"},iZ={"run:started":{label:"started",colorClass:"text-blue-600"},"run:resumed":{label:"resumed",colorClass:"text-blue-600"},"run:completed":{label:"completed",colorClass:"text-emerald-600"},"run:failed":{label:"failed",colorClass:"text-red-600"},"run:stopped":{label:"stopped",colorClass:"text-amber-600"},"run:crashed":{label:"crashed",colorClass:"text-red-600"},"run:rejected":{label:"rejected",colorClass:"text-orange-600"}};function i0(e){return e.startsWith("run:")}function i1({timings:e,loading:n,error:r,rejectionFeedback:l}){if(n)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(r)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(iQ.default,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:r})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(iX,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No activity recorded yet"})]});let a=e.filter(e=>!i0(e.phase)),o=Math.max(...a.map(e=>e.durationMs??0),...a.map(e=>e.approvalWaitMs??0),0),s=function(e,t){if(!e.length)return[];let n=e.filter(e=>"run:rejected"===e.phase).length,r=t?.length??0,l=e;if(r>n){l=[...e];let i=e[e.length-1].agentRunId;for(let e=n;e<r;e++){let r=t[e];e>n&&l.push({agentRunId:i,phase:"run:resumed",startedAt:r.timestamp??`synthetic-resumed-${e}`}),l.push({agentRunId:i,phase:"run:rejected",startedAt:r.timestamp??`synthetic-${e}`})}}let i=[],a=[],o=0;for(let e of l)if(a.push(e),"run:rejected"===e.phase){let e=t?.[o];i.push({number:i.length+1,timings:a,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),a=[],o++}return a.length>0&&i.push({number:i.length+1,timings:a}),i}(e,l),c=s.length>1,u=a.reduce((e,t)=>e+(t.durationMs??0),0),d=a.reduce((e,t)=>e+(t.approvalWaitMs??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:s.map(e=>(0,t.jsx)(i2,{iteration:e,showHeader:c,maxDurationMs:o},e.number))}),u>0?(0,t.jsx)(i6,{totalExecMs:u,totalWaitMs:d}):null]})}function i2({iteration:e,showHeader:n,maxDurationMs:r}){return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"flex flex-col gap-1.5",children:[n?(0,t.jsxs)("div",{className:"text-muted-foreground text-xs font-medium",children:["Iteration ",e.number]}):null,e.timings.map(n=>{if(i0(n.phase)){let r="run:rejected"===n.phase;return(0,t.jsx)(i5,{timing:n,message:r?e.rejectionMessage:void 0,attachments:r?e.rejectionAttachments:void 0},`${n.agentRunId}-${n.phase}-${n.startedAt}`)}return(0,t.jsx)(i3,{timing:n,maxDurationMs:r},`${n.agentRunId}-${n.phase}-${n.startedAt}`)})]})}function i5({timing:e,message:n,attachments:r}){let l=iZ[e.phase];if(!l)return null;let i=r&&r.length>0;return(0,t.jsxs)("div",{className:`text-xs ${l.colorClass}`,children:[(0,t.jsx)("span",{children:l.label}),n?(0,t.jsxs)("span",{"data-testid":"rejection-feedback-text",className:"text-muted-foreground ml-2 font-normal italic",children:["— ",n]}):null,i?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"mt-1.5 ml-2",children:(0,t.jsx)(iD,{text:"",attachmentPaths:r})}):null]})}function i3({timing:e,maxDurationMs:n}){let r=e.phase.includes(":")?`rev ${e.phase.split(":")[1]}`:iY[e.phase]??e.phase,l=e.durationMs??0,i=n>0?Math.max(2,l/n*100):2,a=e.completedAt?"bg-emerald-500":"bg-blue-500";return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-24 shrink-0 text-xs",children:r}),(0,t.jsx)("div",{className:"bg-muted h-3 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:`h-full rounded-full ${a}`,style:{width:`${Math.min(i,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs",children:iJ(l)})]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(i4,{timing:e,maxDurationMs:n}):null]})}function i4({timing:e,maxDurationMs:n}){let r=e.approvalWaitMs??0,l=n>0?Math.max(2,r/n*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"flex items-center gap-3 pl-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-20 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-2.5 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(l,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs",children:iJ(r)})]})}function i6({totalExecMs:e,totalWaitMs:n}){return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border flex flex-col gap-1.5 border-t pt-3",children:[(0,t.jsx)(i9,{label:"Total execution",value:iJ(e)}),n>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i9,{label:"Total wait",value:iJ(n)}),(0,t.jsx)(i9,{label:"Total wall-clock",value:iJ(e+n)})]}):null]})}function i9({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-xs font-medium",children:n})]})}var iQ=iQ;let i8=(0,tB.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function i7({content:e,isConnected:r,error:l}){let i=(0,n.useRef)(null),[a,o]=(0,n.useState)(!0),s=(0,n.useCallback)(()=>{let e=i.current;e&&o(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),c=(0,n.useCallback)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight,o(!0))},[]);return((0,n.useEffect)(()=>{a&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,a]),l)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(iQ.default,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:l})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r?"Live":"Disconnected"}),a?null:(0,t.jsxs)("button",{type:"button",onClick:c,className:"text-muted-foreground hover:text-foreground ml-auto flex items-center gap-1 text-xs",children:[(0,t.jsx)(i8,{className:"h-3 w-3"}),"Jump to bottom"]})]}),(0,t.jsx)("div",{ref:i,onScroll:s,className:"flex-1 overflow-y-auto bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300",children:e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(R.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No log output yet"}),r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}var iQ=iQ;let ae=(0,tB.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var at=e.i(87889);let an=(0,tB.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),ar={Todo:{icon:tC.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:i.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:u.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:at.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},al={icon:tC.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function ai({tasks:e}){return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tasks defined yet"})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(aa,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,n)=>(0,t.jsx)(as,{task:e,index:n},e.title||`task-${n}`))})]})}function aa({tasks:e}){let r=(0,n.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,n=e.filter(e=>"Work in Progress"===e.state).length,r=e.filter(e=>"Review"===e.state).length,l=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,i=e.length,a=i>0?Math.round(t/i*100):0;return{done:t,wip:n,review:r,todo:l,total:i,percent:a}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[r.done," of ",r.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${r.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r.done>0?(0,t.jsx)(ao,{icon:u.Check,label:"Done",count:r.done,className:"text-emerald-600"}):null,r.wip>0?(0,t.jsx)(ao,{icon:i.Loader2,label:"In Progress",count:r.wip,className:"text-blue-600"}):null,r.review>0?(0,t.jsx)(ao,{icon:at.Eye,label:"Review",count:r.review,className:"text-amber-600"}):null,r.todo>0?(0,t.jsx)(ao,{icon:tC.Circle,label:"Todo",count:r.todo,className:"text-muted-foreground"}):null]})]})}function ao({icon:e,label:n,count:r,className:l}){return(0,t.jsxs)("span",{className:(0,tS.cn)("flex items-center gap-1 text-xs",l),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),r," ",n]})}function as({task:e,index:r}){let[l,i]=(0,n.useState)(!1),a=ar[e.state]??al,o=a.icon,s=e.actionItems.length>0,c=(0,n.useCallback)(()=>{s&&i(e=>!e)},[s]);return(0,t.jsxs)("div",{"data-testid":`task-card-${r}`,className:(0,tS.cn)("rounded-lg border",a.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:c,disabled:!s,className:(0,tS.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-left",s&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(o,{className:(0,tS.cn)("mt-0.5 h-4 w-4 shrink-0",a.colorClass,a.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,tS.cn)("text-sm font-medium",a.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),s?(0,t.jsx)(tN.ChevronRight,{className:(0,tS.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",l&&"rotate-90")}):null]}),l&&s?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,n)=>(0,t.jsx)(ac,{item:e},e.name||`ai-${n}`))})}):null]})}function ac({item:e}){let n=e.acceptanceCriteria.length,r=e.acceptanceCriteria.filter(e=>e.verified).length,l=n>0&&r===n;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[l?(0,t.jsx)(ic.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(an,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),n>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[r,"/",n]}):null]}),n>0?(0,t.jsx)("div",{className:"ml-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,n)=>(0,t.jsx)(au,{criterion:e},e.description||`ac-${n}`))}):null]})}function au({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(u.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(tC.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,tS.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let ad={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function ap({plan:e,loading:n,error:r}){return n?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):r?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(iQ.default,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:r})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(tF.Badge,{className:ad[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(ai,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(ae,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}function af(){return{data:null,loading:!1,error:null}}let ah=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"}],am=new Set(["implementation","review","deploy","maintain"]),ax={activity:async function(e){let t=await tL(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await tz(e);if("error"in t)throw Error(t.error);return t.plan}};function ag({featureNode:e,featureId:l,initialTab:a,urlTab:o,prdData:s,prdSelections:c,onPrdSelect:u,onPrdApprove:d,onPrdReject:p,isPrdLoading:f,techData:h,onTechApprove:m,onTechReject:x,isTechLoading:g,productData:y,mergeData:v,onMergeApprove:b,onMergeReject:k,isMergeLoading:w,isRejecting:j,chatInput:N,onChatInputChange:C}){let S=(0,r.usePathname)(),M=function(e){let[t,r]=(0,n.useState)(""),[l,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(null),s=(0,n.useRef)(null),c=(0,n.useCallback)(()=>{s.current&&(s.current.close(),s.current=null),i(!1)},[]);return(0,n.useEffect)(()=>{if(!e){r(""),i(!1),o(null);return}r(""),o(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return s.current=t,t.onopen=()=>{i(!0)},t.addEventListener("initial",e=>{r(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);r(e=>e+t.content)}),t.addEventListener("error",e=>{o(JSON.parse(e.data).error)}),t.onerror=()=>{i(!1)},()=>{t.close(),s.current=null}},[e,c]),{content:t,isConnected:l,error:a}}(l),E=(0,n.useMemo)(()=>{let t;return t=["overview","activity","log"],am.has(e.lifecycle)&&("implementation"!==e.lifecycle||"action-required"!==e.state)&&t.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&t.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&t.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&t.push("merge-review"),t},[e]),P=(0,n.useMemo)(()=>ah.filter(e=>E.includes(e.key)),[E]),I=(0,n.useMemo)(()=>{let e=S.match(/^(\/feature\/[^/]+)/);return e?e[1]:S},[S]),T=(0,n.useMemo)(()=>o&&E.includes(o)?o:a&&E.includes(a)?a:"overview",[]),[R,D]=(0,n.useState)(T),{tabs:A,fetchTab:L,refreshTab:z}=function(e,t){let r=Object.keys(t),[l,i]=(0,n.useState)(()=>{let e={};for(let t of r)e[t]=af();return e}),a=(0,n.useRef)(t);a.current=t;let o=(0,n.useRef)(e);o.current=e;let s=(0,n.useRef)(!0);(0,n.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let c=(0,n.useRef)(e);(0,n.useEffect)(()=>{c.current!==e&&(c.current=e,i(e=>{let t={};for(let n of Object.keys(e))t[n]=af();return t}))},[e]);let u=(0,n.useCallback)(async e=>{let t=a.current[e],n=o.current;if(t){s.current&&i(t=>({...t,[e]:{...t[e],loading:!0,error:null}}));try{let r=await t(n);s.current&&i(t=>({...t,[e]:{data:r,loading:!1,error:null}}))}catch(t){if(s.current){let n=t instanceof Error?t.message:"Failed to fetch tab data";i(t=>({...t,[e]:{data:null,loading:!1,error:n}}))}}}},[]),d=(0,n.useCallback)(async e=>{let t=l[e];t&&null!==t.data||t&&t.loading||await u(e)},[l,u]);return{tabs:l,fetchTab:d,refreshTab:(0,n.useCallback)(async e=>{await u(e)},[u])}}(l,ax),O=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!O.current)return;O.current=!1;let e="overview"===R?I:`${I}/${R}`;e!==S&&window.history.pushState(null,"",e)},[R,I,S]);let F=(0,n.useRef)(S);(0,n.useEffect)(()=>{if(F.current===S||(F.current=S,O.current))return;let e=S.split("/"),t=e.length>=4?e[3]:void 0,n=t&&E.includes(t)?t:"overview";n!==R&&(D(n),("activity"===n||"plan"===n)&&L(n))},[S]);let _=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!_.current&&(_.current=!0,!o&&"overview"!==T)){let e=`${I}/${T}`;e!==S&&window.history.replaceState(null,"",e)}},[]);let B=(0,n.useRef)(!1);(0,n.useEffect)(()=>{B.current||(B.current=!0,("activity"===R||"plan"===R)&&L(R))},[R,L]);let H=(0,n.useRef)(l);(0,n.useEffect)(()=>{H.current!==l&&(H.current=l,D("overview"))},[l]);let U=(0,n.useRef)(a);(0,n.useEffect)(()=>{if(U.current!==a&&a&&E.includes(a)){U.current=a,D(a);let e="overview"===a?I:`${I}/${a}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[a,E,I]),(0,n.useEffect)(()=>{E.includes(R)||(D("overview"),window.location.pathname!==I&&window.history.replaceState(null,"",I))},[E,R,I]);let q=(0,n.useRef)(e),$=(0,n.useRef)(R);$.current=R,(0,n.useEffect)(()=>{if(q.current!==e){q.current=e;let t=$.current;("activity"===t||"plan"===t)&&z(t)}},[e,z]);let V=(0,n.useCallback)(e=>{O.current=!0,D(e),("activity"===e||"plan"===e)&&L(e)},[L]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)(tA.Tabs,{value:R,onValueChange:V,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"shrink-0 overflow-x-auto px-4 pt-4",children:(0,t.jsx)(tA.TabsList,{className:"flex w-full",children:P.map(e=>(0,t.jsx)(tA.TabsTrigger,{value:e.key,className:"flex-1",children:e.label},e.key))})}),(0,t.jsx)(tA.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(iH,{data:e})}),(0,t.jsx)(tA.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(i1,{timings:A.activity.data?.timings??null,loading:A.activity.loading,error:A.activity.error,rejectionFeedback:A.activity.data?.rejectionFeedback})}),(0,t.jsx)(tA.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(i7,{content:M.content,isConnected:M.isConnected,error:M.error})}),(0,t.jsx)(tA.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ap,{plan:A.plan.data,loading:A.plan.loading,error:A.plan.error})}),E.includes("prd-review")?(0,t.jsx)(tA.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:s?(0,t.jsx)(tW,{data:s,selections:c??{},onSelect:u??(()=>void 0),onApprove:d??(()=>void 0),onReject:p,isProcessing:f,isRejecting:j,chatInput:N,onChatInputChange:C}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,E.includes("tech-decisions")?(0,t.jsx)(tA.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:h?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(l7,{data:h})}),(0,t.jsx)(ay,{onApprove:m??(()=>void 0),onReject:x,isProcessing:g,isRejecting:j,chatInput:N,onChatInputChange:C})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,E.includes("product-decisions")?(0,t.jsx)(tA.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===y?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):y?(0,t.jsx)(ir,{data:y}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,E.includes("merge-review")?(0,t.jsx)(tA.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:v?(0,t.jsx)(ij,{data:v,onApprove:b??(()=>void 0),onReject:k,isProcessing:w,isRejecting:j,chatInput:N,onChatInputChange:C}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null]})})}function ay({onApprove:e,onReject:n,isProcessing:r,isRejecting:l,chatInput:i,onChatInputChange:a}){return(0,t.jsx)(tK,{onReject:n,onApprove:e,approveLabel:"Approve Plan",revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:r,isRejecting:l,chatInput:i,onChatInputChange:a})}var av=e.i(57436),ab=e.i(69467),ak=e.i(54569),aw=e.i(99045);function aj(e,t,r,i,a){let[o,s]=(0,n.useState)(!1),c=(0,n.useRef)(r),u=(0,n.useRef)(i);return c.current=r,u.current=i,(0,n.useEffect)(()=>{if(u.current(),!e)return;let n=!1;return s(!0),t(e).then(e=>{n||c.current(e)}).catch(()=>{!n&&a&&l.toast.error(a)}).finally(()=>{n||s(!1)}),()=>{n=!0}},[e,t,a]),o}function aN({view:e,urlTab:f}){let R,D=(0,b.useFeatureFlags)(),A=(0,r.useRouter)(),L=(0,k.useSoundAction)("delete"),z=(0,k.useSoundAction)("reject"),[O,F]=(0,n.useState)(e);(0,n.useEffect)(()=>{F(e)},[e]);let _="feature"===O.type?O.node:null,{events:B}=(0,N.useAgentEventsContext)(),H=(0,n.useRef)(0);(0,n.useEffect)(()=>{if(H.current>B.length&&(H.current=0),!_||B.length<=H.current)return;let e=B.slice(H.current);for(let t of(H.current=B.length,(0,aw.resolveSseEventUpdates)(e)))t.featureId===_.featureId&&(!q.current||ew.current||ep.current||A.refresh(),(void 0!==t.state||void 0!==t.lifecycle)&&F(e=>{if("feature"!==e.type)return e;let n={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:n,initialTab:"requirements"===n.lifecycle&&"action-required"===n.state?"prd-review":"implementation"===n.lifecycle&&"action-required"===n.state?"tech-decisions":"review"===n.lifecycle&&("action-required"===n.state||"error"===n.state)?"merge-review":"overview"}}))},[B,_,A]);let U=(0,r.usePathname)().startsWith("/feature/"),q=(0,n.useRef)(U),$=(0,n.useRef)(U);(0,n.useEffect)(()=>{U&&!$.current&&A.refresh(),$.current=U},[U,A]),q.current=U;let V=(0,n.useCallback)(()=>{A.push("/")},[A]),[K,W]=(0,n.useState)(""),[G,Q]=(0,n.useState)(null),[X,J]=(0,n.useState)({}),[Y,Z]=(0,n.useState)({}),[ee,et]=(0,n.useState)(null),[en,er]=(0,n.useState)(void 0),[el,ei]=(0,n.useState)(null),[ea,eo]=(0,n.useState)(!1),[es,ec]=(0,n.useState)(!1),[eu,ed]=(0,n.useState)(!1),ep=(0,n.useRef)(!1),ef="feature"===O.type?O.initialTab:void 0;(0,n.useEffect)(()=>{W("")},[ef]);let eh=aj(_?.lifecycle==="requirements"&&_?.state==="action-required"?_.featureId:null,x,e=>{if(e.error)return void l.toast.error(e.error);if(e.questionnaire){Q(e.questionnaire);let t={};for(let n of e.questionnaire.questions){let e=n.options.find(e=>e.recommended);e&&(t[n.id]=e.id)}J(t),Z(t)}},()=>{J({}),Z({}),Q(null)},"Failed to load questionnaire"),em=_?.lifecycle==="implementation"&&_?.state==="action-required"?_.featureId:null,ex=aj(em,g,e=>{e.error?l.toast.error(e.error):e.techDecisions&&et(e.techDecisions)},()=>et(null),"Failed to load tech decisions"),eg=aj(em,x,e=>{e.productDecisions&&er(e.productDecisions)},()=>er(void 0)),ey=aj(_?.lifecycle==="review"&&(_?.state==="action-required"||_?.state==="error")?_.featureId:null,y,e=>{"error"in e?l.toast.error(e.error):ei(e)},()=>ei(null),"Failed to load merge review data"),ev=K.trim().length>0,eb=_?.lifecycle==="requirements"&&_?.state==="action-required"&&Object.keys(Y).some(e=>Y[e]!==X[e]),ek=ev||eb,ew=(0,n.useRef)(ek);ew.current=ek;let ej=(0,n.useCallback)(()=>{W(""),J({...Y})},[Y]),{attemptClose:eN}=(0,w.useGuardedDrawerClose)({open:U,isDirty:ek,onClose:V,onReset:ej}),eC=(0,n.useCallback)(async(e,t,n=[],r)=>{if(_?.featureId){ep.current=!0,ed(!0);try{let i=n.map(e=>e.path).filter(Boolean),a=await m(_.featureId,e,i);if(!a.rejected)return void l.toast.error(a.error??`Failed to reject ${t.toLowerCase()}`);z.play(),W(""),l.toast.success(`${t} rejected — agent re-iterating (iteration ${a.iteration})`),a.iterationWarning&&l.toast.warning(`Iteration ${a.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),V(),r?.()}finally{ep.current=!1,ed(!1)}}},[_,V,z]),eS=(0,n.useCallback)((e,t)=>eC(e,"Requirements",t,()=>J({})),[eC]),eM=(0,n.useCallback)((e,t)=>eC(e,"Plan",t),[eC]),eE=(0,n.useCallback)((e,t)=>eC(e,"Merge",t),[eC]),eP=(0,n.useCallback)(async e=>{if(!_?.featureId)return;let t=await h(_.featureId);t.approved?(W(""),l.toast.success(`${e} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:_.featureId}})),V()):l.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[_,V]),eI=(0,n.useCallback)(async e=>{let t;if("feature"!==O.type||!_)return;if(G){let e=[];for(let[t,n]of Object.entries(X)){let r=G.questions.find(e=>e.id===t),l=r?.options.find(e=>e.id===n);r&&l&&e.push({questionId:r.question,selectedOption:l.label})}t={approved:!0,changedSelections:e}}let n=await h(_.featureId,t);n.approved?(W(""),l.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:_.featureId}})),J({}),V()):l.toast.error(n.error??"Failed to approve requirements")},[O,_,G,X,V]),eT=(0,n.useCallback)(()=>eP("Plan"),[eP]),eR=(0,n.useCallback)(()=>eP("Merge"),[eP]),eD=(0,n.useCallback)(async(e,t)=>{eo(!0);try{let n=await (0,v.deleteFeature)(e,t);if(n.error)return void l.toast.error(n.error);L.play(),l.toast.success("Feature deleted successfully"),A.push("/"),A.refresh()}catch{l.toast.error("Failed to delete feature")}finally{eo(!1)}},[A,L]),eA=_?.repositoryPath&&_?.branch?{repositoryPath:_.repositoryPath,branch:_.branch,specPath:_.specPath}:null,eL=function(e){let[t,r]=(0,n.useState)(!1),[l,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(null),[p,f]=(0,n.useState)(null),h=(0,n.useRef)(null),m=(0,n.useRef)(null),x=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=[h,m,x];return()=>{for(let t of e)t.current&&clearTimeout(t.current)}},[]);let g=(0,n.useCallback)(async(t,n,r,l,i)=>{if(e&&!i){l.current&&clearTimeout(l.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,n.useCallback)(()=>g(av.openIde,r,c,h,t),[g,t]),openInShell:(0,n.useCallback)(()=>g(ab.openShell,i,d,m,l),[g,l]),openSpecsFolder:(0,n.useCallback)(async()=>{if(e?.specPath&&!a){x.current&&clearTimeout(x.current),o(!0),f(null);try{let t=await (0,ak.openFolder)(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";f(e),x.current=setTimeout(()=>f(null),5e3)}}catch(e){f(e instanceof Error?e.message:"An unexpected error occurred"),x.current=setTimeout(()=>f(null),5e3)}finally{o(!1)}}},[e,a]),ideLoading:t,shellLoading:l,specsLoading:a,ideError:s,shellError:u,specsError:p}}(eA),ez=_?.repositoryPath&&_.branch?{targetId:_.featureId,targetType:"feature",repositoryPath:_.repositoryPath,branch:_.branch}:null,eO=(0,j.useDeployAction)(ez),eF="Booting"===eO.status||"Ready"===eO.status,[e_,eB]=(0,n.useState)(!1),eH=(0,n.useCallback)(()=>{_?.featureId&&(navigator.clipboard.writeText(_.featureId),eB(!0),setTimeout(()=>eB(!1),2e3))},[_?.featureId]);if(_){let e=_.featureId.slice(0,8),n=_.repositoryName??_.repositoryPath.split("/").filter(Boolean).at(-1)??"";R=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-header",children:[(0,t.jsx)(M.DrawerTitle,{children:_.name}),n?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[(0,t.jsx)(d.Code2,{className:"text-muted-foreground size-3.5 shrink-0"}),_.remoteUrl?(0,t.jsxs)("a",{href:_.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors","data-testid":"feature-drawer-repo-link",children:[n,(0,t.jsx)(p.ExternalLink,{className:"size-3"})]}):(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]}):null,(0,t.jsx)(M.DrawerDescription,{className:"sr-only",children:_.name})]}),eA?(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-2","data-testid":"feature-drawer-actions",children:[(0,t.jsx)(tD,{actions:eL,repositoryPath:eA.repositoryPath,showSpecs:!!eA.specPath}),D.envDeploy&&ez?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.TooltipProvider,{children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(T.ActionButton,{label:eF?"Stop Dev Server":"Start Dev Server",onClick:eF?eO.stop:eO.deploy,loading:eO.deployLoading||eO.stopLoading,error:!!eO.deployError,icon:eF?s.Square:o.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(P.TooltipContent,{children:eF?"Stop Dev Server":"Start Dev Server"})]})}),eF?(0,t.jsx)(S.DeploymentStatusBadge,{status:eO.status,url:eO.url,targetId:ez?.targetId}):null]}):null,(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:e}),(0,t.jsx)("button",{type:"button",onClick:eH,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors","aria-label":"Copy feature ID","data-testid":"feature-drawer-copy-id",children:e_?(0,t.jsx)(u.Check,{className:"size-3.5 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-3.5"})})]}),_.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.Button,{variant:"ghost",size:"icon-sm","aria-label":"Delete feature",disabled:ea,className:"text-muted-foreground hover:text-destructive","data-testid":"feature-drawer-delete",onClick:()=>ec(!0),children:ea?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(a.Trash2,{className:"size-4"})}),(0,t.jsx)(I.DeleteFeatureDialog,{open:es,onOpenChange:ec,onConfirm:e=>eD(_.featureId,e),isDeleting:ea,featureName:_.name,featureId:_.featureId})]}):null]}):null]})}let eU=null;return"feature"===O.type&&_&&(eU=(0,t.jsx)(ag,{featureNode:_,featureId:_.featureId,initialTab:O.initialTab,urlTab:f,prdData:G,prdSelections:X,onPrdSelect:(e,t)=>J(n=>({...n,[e]:t})),onPrdApprove:eI,onPrdReject:eS,isPrdLoading:eh,techData:ee,onTechApprove:eT,onTechReject:eM,isTechLoading:ex,productData:eg?null:en,mergeData:el,onMergeApprove:eR,onMergeReject:eE,isMergeLoading:ey,isRejecting:eu,chatInput:K,onChatInputChange:W})),(0,t.jsx)(C.BaseDrawer,{open:U,onClose:eN,size:"md",modal:!1,header:R,"data-testid":"feature"===O.type?"feature-drawer":"repository-drawer",children:eU})}e.s(["FeatureDrawerClient",()=>aN],36986)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,u=1;function p(e){var t=e.match(l);t&&(n+=t.length);var r=e.lastIndexOf("\n");u=~r?e.length-r:u+e.length}function f(){var e={line:n,column:u};return function(t){return t.position=new h(e),x(i),t}}function h(e){this.start=e,this.end={line:n,column:u},this.source=t.source}function m(r){var l=Error(t.source+":"+n+":"+u+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=u,l.source=e,t.silent);else throw l}function x(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function g(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return u+=2,p(r),e=e.slice(n),u+=2,t({type:"comment",comment:r})}}h.prototype.content=e,x(i);var v,b=[];for(g(b);v=function(){var e=f(),t=x(a);if(t){if(y(),!x(o))return m("property missing ':'");var n=x(s),l=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return x(c),l}}();)!1!==v&&(b.push(v),g(b));return b}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,l.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:l}=e;i?t(r,l,e):l&&((n=n||{})[r]=l)}),n};let l=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,l=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||i.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,c):e.replace(a,c)).replace(l,s))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),l=e.r(51521);function i(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,l.camelCase)(e,t)]=r)}),n}i.default=i,t.exports=i},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,l=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===l.call(e)},s=function(e){if(!e||"[object Object]"!==l.call(e))return!1;var t,n=r.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,l,i,a,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(t=arguments[p],null!=t)for(n in t)r=u(d,n),d!==(l=u(t,n))&&(h&&l&&(s(l)||(i=o(l)))?(i?(i=!1,a=r&&o(r)?r:[]):a=r&&s(r)?r:{},c(d,{name:n,newValue:e(h,a,l)})):void 0!==l&&c(d,{name:n,newValue:l}));return d}},36986,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(31406),l=e.i(60112),i=e.i(83428),a=e.i(67669),o=e.i(24042),s=e.i(64970),c=e.i(33548),u=e.i(23925),d=e.i(8986),p=e.i(30702),f=e.i(21023);let h=(0,f.createServerReference)("60829ada67d090b9cc2adcc47cd369f2c55ccb75f8",f.callServer,void 0,f.findSourceMapURL,"approveFeature"),m=(0,f.createServerReference)("701e6e604bb5519bf335550b2479ebc20f6d45be7b",f.callServer,void 0,f.findSourceMapURL,"rejectFeature"),x=(0,f.createServerReference)("405b4d39ef8d02839055a098bd5f953ae9a60fb555",f.callServer,void 0,f.findSourceMapURL,"getFeatureArtifact"),g=(0,f.createServerReference)("4025c8030ead2012afa430299f4fb41773a1a4ea5a",f.callServer,void 0,f.findSourceMapURL,"getResearchArtifact"),y=(0,f.createServerReference)("408d90f966392197f62288c340e93c5e64419d0b8e",f.callServer,void 0,f.findSourceMapURL,"getMergeReviewData");var v=e.i(41987),b=e.i(75921),k=e.i(8361),w=e.i(30153),j=e.i(8537),N=e.i(39443);e.i(1650);var C=e.i(11495);e.i(99348);var S=e.i(17466),M=e.i(45811),E=e.i(35364),P=e.i(2828);e.i(31566);var I=e.i(65104);e.i(81803);var T=e.i(72714),R=e.i(38573),D=e.i(19933),A=e.i(99105),L=e.i(51251),z=e.i(91967),O=e.i(5978),F=e.i(22528),_=e.i(36589),B=e.i(87620),H=e.i(87342),U=e.i(66033),q=e.i(53532),$=e.i(41687),V=e.i(56720),K=e.i(13123),W=e.i(52740),G=e.i(39979),Q=e.i(85995),X=e.i(51080),J=e.i(86874),Y=e.i(29297),Z=e.i(73772),ee=e.i(13044),et=["Enter"," "],en=["ArrowUp","PageDown","End"],er=["ArrowDown","PageUp","Home",...en],el={ltr:[...et,"ArrowRight"],rtl:[...et,"ArrowLeft"]},ei={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ea="Menu",[eo,es,ec]=(0,H.createCollection)(ea),[eu,ed]=(0,F.createContextScope)(ea,[ec,W.createPopperScope,X.createRovingFocusGroupScope]),ep=(0,W.createPopperScope)(),ef=(0,X.createRovingFocusGroupScope)(),[eh,em]=eu(ea),[ex,eg]=eu(ea),ey=e=>{let{__scopeMenu:r,open:l=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=e,c=ep(r),[u,d]=n.useState(null),p=n.useRef(!1),f=(0,Y.useCallbackRef)(o),h=(0,U.useDirection)(a);return n.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,t.jsx)(W.Root,{...c,children:(0,t.jsx)(eh,{scope:r,open:l,onOpenChange:f,content:u,onContentChange:d,children:(0,t.jsx)(ex,{scope:r,onClose:n.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:h,modal:s,children:i})})})};ey.displayName=ea;var ev=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e,i=ep(r);return(0,t.jsx)(W.Anchor,{...i,...l,ref:n})});ev.displayName="MenuAnchor";var eb="MenuPortal",[ek,ew]=eu(eb,{forceMount:void 0}),ej=e=>{let{__scopeMenu:n,forceMount:r,children:l,container:i}=e,a=em(eb,n);return(0,t.jsx)(ek,{scope:n,forceMount:r,children:(0,t.jsx)(Q.Presence,{present:r||a.open,children:(0,t.jsx)(G.Portal,{asChild:!0,container:i,children:l})})})};ej.displayName=eb;var eN="MenuContent",[eC,eS]=eu(eN),eM=n.forwardRef((e,n)=>{let r=ew(eN,e.__scopeMenu),{forceMount:l=r.forceMount,...i}=e,a=em(eN,e.__scopeMenu),o=eg(eN,e.__scopeMenu);return(0,t.jsx)(eo.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(Q.Presence,{present:l||a.open,children:(0,t.jsx)(eo.Slot,{scope:e.__scopeMenu,children:o.modal?(0,t.jsx)(eE,{...i,ref:n}):(0,t.jsx)(eP,{...i,ref:n})})})})}),eE=n.forwardRef((e,r)=>{let l=em(eN,e.__scopeMenu),i=n.useRef(null),a=(0,O.useComposedRefs)(r,i);return n.useEffect(()=>{let e=i.current;if(e)return(0,Z.hideOthers)(e)},[]),(0,t.jsx)(eT,{...e,ref:a,trapFocus:l.open,disableOutsidePointerEvents:l.open,disableOutsideScroll:!0,onFocusOutside:(0,z.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>l.onOpenChange(!1)})}),eP=n.forwardRef((e,n)=>{let r=em(eN,e.__scopeMenu);return(0,t.jsx)(eT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),eI=(0,J.createSlot)("MenuContent.ScrollLock"),eT=n.forwardRef((e,r)=>{let{__scopeMenu:l,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:x,...g}=e,y=em(eN,l),v=eg(eN,l),b=ep(l),k=ef(l),w=es(l),[j,N]=n.useState(null),C=n.useRef(null),S=(0,O.useComposedRefs)(r,C,y.onContentChange),M=n.useRef(0),E=n.useRef(""),P=n.useRef(0),I=n.useRef(null),T=n.useRef("right"),R=n.useRef(0),D=x?ee.RemoveScroll:n.Fragment;n.useEffect(()=>()=>window.clearTimeout(M.current),[]),(0,$.useFocusGuards)();let A=n.useCallback(e=>{var t,n;return T.current===I.current?.side&&(t=e,!!(n=I.current?.area)&&function(e,t){let{x:n,y:r}=e,l=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let a=t[e],o=t[i],s=a.x,c=a.y,u=o.x,d=o.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(l=!l)}return l}({x:t.clientX,y:t.clientY},n))},[]);return(0,t.jsx)(eC,{scope:l,searchRef:E,onItemEnter:n.useCallback(e=>{A(e)&&e.preventDefault()},[A]),onItemLeave:n.useCallback(e=>{A(e)||(C.current?.focus(),N(null))},[A]),onTriggerLeave:n.useCallback(e=>{A(e)&&e.preventDefault()},[A]),pointerGraceTimerRef:P,onPointerGraceIntentChange:n.useCallback(e=>{I.current=e},[]),children:(0,t.jsx)(D,{...x?{as:eI,allowPinchZoom:!0}:void 0,children:(0,t.jsx)(V.FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:(0,z.composeEventHandlers)(o,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,t.jsx)(q.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:(0,t.jsx)(X.Root,{asChild:!0,...k,dir:v.dir,orientation:"vertical",loop:i,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:(0,z.composeEventHandlers)(u,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(W.Content,{role:"menu","aria-orientation":"vertical","data-state":e4(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...g,ref:S,style:{outline:"none",...g.style},onKeyDown:(0,z.composeEventHandlers)(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;if(t){var l;let t,i,a,o,s,c;"Tab"===e.key&&e.preventDefault(),!n&&r&&(l=e.key,t=E.current+l,i=w().filter(e=>!e.disabled),a=document.activeElement,o=i.find(e=>e.ref.current===a)?.textValue,s=function(e,t,n){var r;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=(r=Math.max(i,0),e.map((t,n)=>e[(r+n)%e.length]));1===l.length&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(l.toLowerCase()));return o!==n?o:void 0}(i.map(e=>e.textValue),t,o),c=i.find(e=>e.textValue===s)?.ref.current,function e(t){E.current=t,window.clearTimeout(M.current),""!==t&&(M.current=window.setTimeout(()=>e(""),1e3))}(t),c&&setTimeout(()=>c.focus()))}let i=C.current;if(e.target!==i||!er.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);en.includes(e.key)&&a.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(a)}),onBlur:(0,z.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),E.current="")}),onPointerMove:(0,z.composeEventHandlers)(e.onPointerMove,e8(e=>{let t=e.target,n=R.current!==e.clientX;e.currentTarget.contains(t)&&n&&(T.current=e.clientX>R.current?"right":"left",R.current=e.clientX)}))})})})})})})});eM.displayName=eN;var eR=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e;return(0,t.jsx)(B.Primitive.div,{role:"group",...l,ref:n})});eR.displayName="MenuGroup";var eD=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e;return(0,t.jsx)(B.Primitive.div,{...l,ref:n})});eD.displayName="MenuLabel";var eA="MenuItem",eL="menu.itemSelect",ez=n.forwardRef((e,r)=>{let{disabled:l=!1,onSelect:i,...a}=e,o=n.useRef(null),s=eg(eA,e.__scopeMenu),c=eS(eA,e.__scopeMenu),u=(0,O.useComposedRefs)(r,o),d=n.useRef(!1);return(0,t.jsx)(eO,{...a,ref:u,disabled:l,onClick:(0,z.composeEventHandlers)(e.onClick,()=>{let e=o.current;if(!l&&e){let t=new CustomEvent(eL,{bubbles:!0,cancelable:!0});e.addEventListener(eL,e=>i?.(e),{once:!0}),(0,B.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?d.current=!1:s.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,z.composeEventHandlers)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;l||t&&" "===e.key||et.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ez.displayName=eA;var eO=n.forwardRef((e,r)=>{let{__scopeMenu:l,disabled:i=!1,textValue:a,...o}=e,s=eS(eA,l),c=ef(l),u=n.useRef(null),d=(0,O.useComposedRefs)(r,u),[p,f]=n.useState(!1),[h,m]=n.useState("");return n.useEffect(()=>{let e=u.current;e&&m((e.textContent??"").trim())},[o.children]),(0,t.jsx)(eo.ItemSlot,{scope:l,disabled:i,textValue:a??h,children:(0,t.jsx)(X.Item,{asChild:!0,...c,focusable:!i,children:(0,t.jsx)(B.Primitive.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...o,ref:d,onPointerMove:(0,z.composeEventHandlers)(e.onPointerMove,e8(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,z.composeEventHandlers)(e.onPointerLeave,e8(e=>s.onItemLeave(e))),onFocus:(0,z.composeEventHandlers)(e.onFocus,()=>f(!0)),onBlur:(0,z.composeEventHandlers)(e.onBlur,()=>f(!1))})})})}),eF=n.forwardRef((e,n)=>{let{checked:r=!1,onCheckedChange:l,...i}=e;return(0,t.jsx)(eK,{scope:e.__scopeMenu,checked:r,children:(0,t.jsx)(ez,{role:"menuitemcheckbox","aria-checked":e6(r)?"mixed":r,...i,ref:n,"data-state":e9(r),onSelect:(0,z.composeEventHandlers)(i.onSelect,()=>l?.(!!e6(r)||!r),{checkForDefaultPrevented:!1})})})});eF.displayName="MenuCheckboxItem";var e_="MenuRadioGroup",[eB,eH]=eu(e_,{value:void 0,onValueChange:()=>{}}),eU=n.forwardRef((e,n)=>{let{value:r,onValueChange:l,...i}=e,a=(0,Y.useCallbackRef)(l);return(0,t.jsx)(eB,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,t.jsx)(eR,{...i,ref:n})})});eU.displayName=e_;var eq="MenuRadioItem",e$=n.forwardRef((e,n)=>{let{value:r,...l}=e,i=eH(eq,e.__scopeMenu),a=r===i.value;return(0,t.jsx)(eK,{scope:e.__scopeMenu,checked:a,children:(0,t.jsx)(ez,{role:"menuitemradio","aria-checked":a,...l,ref:n,"data-state":e9(a),onSelect:(0,z.composeEventHandlers)(l.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});e$.displayName=eq;var eV="MenuItemIndicator",[eK,eW]=eu(eV,{checked:!1}),eG=n.forwardRef((e,n)=>{let{__scopeMenu:r,forceMount:l,...i}=e,a=eW(eV,r);return(0,t.jsx)(Q.Presence,{present:l||e6(a.checked)||!0===a.checked,children:(0,t.jsx)(B.Primitive.span,{...i,ref:n,"data-state":e9(a.checked)})})});eG.displayName=eV;var eQ=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e;return(0,t.jsx)(B.Primitive.div,{role:"separator","aria-orientation":"horizontal",...l,ref:n})});eQ.displayName="MenuSeparator";var eX=n.forwardRef((e,n)=>{let{__scopeMenu:r,...l}=e,i=ep(r);return(0,t.jsx)(W.Arrow,{...i,...l,ref:n})});eX.displayName="MenuArrow";var eJ="MenuSub",[eY,eZ]=eu(eJ),e0=e=>{let{__scopeMenu:r,children:l,open:i=!1,onOpenChange:a}=e,o=em(eJ,r),s=ep(r),[c,u]=n.useState(null),[d,p]=n.useState(null),f=(0,Y.useCallbackRef)(a);return n.useEffect(()=>(!1===o.open&&f(!1),()=>f(!1)),[o.open,f]),(0,t.jsx)(W.Root,{...s,children:(0,t.jsx)(eh,{scope:r,open:i,onOpenChange:f,content:d,onContentChange:p,children:(0,t.jsx)(eY,{scope:r,contentId:(0,K.useId)(),triggerId:(0,K.useId)(),trigger:c,onTriggerChange:u,children:l})})})};e0.displayName=eJ;var e1="MenuSubTrigger",e2=n.forwardRef((e,r)=>{let l=em(e1,e.__scopeMenu),i=eg(e1,e.__scopeMenu),a=eZ(e1,e.__scopeMenu),o=eS(e1,e.__scopeMenu),s=n.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},p=n.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return n.useEffect(()=>p,[p]),n.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),(0,t.jsx)(ev,{asChild:!0,...d,children:(0,t.jsx)(eO,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":a.contentId,"data-state":e4(l.open),...e,ref:(0,O.composeRefs)(r,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),l.open||l.onOpenChange(!0))},onPointerMove:(0,z.composeEventHandlers)(e.onPointerMove,e8(t=>{o.onItemEnter(t),!t.defaultPrevented&&(e.disabled||l.open||s.current||(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{l.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,z.composeEventHandlers)(e.onPointerLeave,e8(e=>{p();let t=l.content?.getBoundingClientRect();if(t){let n=l.content?.dataset.side,r="right"===n,i=t[r?"left":"right"],a=t[r?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:i,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,t=>{let n=""!==o.searchRef.current;e.disabled||n&&" "===t.key||el[i.dir].includes(t.key)&&(l.onOpenChange(!0),l.content?.focus(),t.preventDefault())})})})});e2.displayName=e1;var e5="MenuSubContent",e3=n.forwardRef((e,r)=>{let l=ew(eN,e.__scopeMenu),{forceMount:i=l.forceMount,...a}=e,o=em(eN,e.__scopeMenu),s=eg(eN,e.__scopeMenu),c=eZ(e5,e.__scopeMenu),u=n.useRef(null),d=(0,O.useComposedRefs)(r,u);return(0,t.jsx)(eo.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(Q.Presence,{present:i||o.open,children:(0,t.jsx)(eo.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(eT,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,z.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:(0,z.composeEventHandlers)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ei[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function e4(e){return e?"open":"closed"}function e6(e){return"indeterminate"===e}function e9(e){return e6(e)?"indeterminate":e?"checked":"unchecked"}function e8(e){return t=>"mouse"===t.pointerType?e(t):void 0}e3.displayName=e5;var e7="DropdownMenu",[te,tt]=(0,F.createContextScope)(e7,[ed]),tn=ed(),[tr,tl]=te(e7),ti=e=>{let{__scopeDropdownMenu:r,children:l,dir:i,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,u=tn(r),d=n.useRef(null),[p,f]=(0,_.useControllableState)({prop:a,defaultProp:o??!1,onChange:s,caller:e7});return(0,t.jsx)(tr,{scope:r,triggerId:(0,K.useId)(),triggerRef:d,contentId:(0,K.useId)(),open:p,onOpenChange:f,onOpenToggle:n.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,t.jsx)(ey,{...u,open:p,onOpenChange:f,dir:i,modal:c,children:l})})};ti.displayName=e7;var ta="DropdownMenuTrigger",to=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,disabled:l=!1,...i}=e,a=tl(ta,r),o=tn(r);return(0,t.jsx)(ev,{asChild:!0,...o,children:(0,t.jsx)(B.Primitive.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...i,ref:(0,O.composeRefs)(n,a.triggerRef),onPointerDown:(0,z.composeEventHandlers)(e.onPointerDown,e=>{!l&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,z.composeEventHandlers)(e.onKeyDown,e=>{!l&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});to.displayName=ta;var ts=e=>{let{__scopeDropdownMenu:n,...r}=e,l=tn(n);return(0,t.jsx)(ej,{...l,...r})};ts.displayName="DropdownMenuPortal";var tc="DropdownMenuContent",tu=n.forwardRef((e,r)=>{let{__scopeDropdownMenu:l,...i}=e,a=tl(tc,l),o=tn(l),s=n.useRef(!1);return(0,t.jsx)(eM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...i,ref:r,onCloseAutoFocus:(0,z.composeEventHandlers)(e.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:(0,z.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!a.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tu.displayName=tc;var td=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eR,{...i,...l,ref:n})});td.displayName="DropdownMenuGroup";var tp=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eD,{...i,...l,ref:n})});tp.displayName="DropdownMenuLabel";var tf=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(ez,{...i,...l,ref:n})});tf.displayName="DropdownMenuItem";var th=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eF,{...i,...l,ref:n})});th.displayName="DropdownMenuCheckboxItem";var tm=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eU,{...i,...l,ref:n})});tm.displayName="DropdownMenuRadioGroup";var tx=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(e$,{...i,...l,ref:n})});tx.displayName="DropdownMenuRadioItem";var tg=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eG,{...i,...l,ref:n})});tg.displayName="DropdownMenuItemIndicator";var ty=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eQ,{...i,...l,ref:n})});ty.displayName="DropdownMenuSeparator";var tv=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(eX,{...i,...l,ref:n})});tv.displayName="DropdownMenuArrow";var tb=e=>{let{__scopeDropdownMenu:n,children:r,open:l,onOpenChange:i,defaultOpen:a}=e,o=tn(n),[s,c]=(0,_.useControllableState)({prop:l,defaultProp:a??!1,onChange:i,caller:"DropdownMenuSub"});return(0,t.jsx)(e0,{...o,open:s,onOpenChange:c,children:r})},tk=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(e2,{...i,...l,ref:n})});tk.displayName="DropdownMenuSubTrigger";var tw=n.forwardRef((e,n)=>{let{__scopeDropdownMenu:r,...l}=e,i=tn(r);return(0,t.jsx)(e3,{...i,...l,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tw.displayName="DropdownMenuSubContent",e.s(["Arrow",()=>tv,"CheckboxItem",()=>th,"Content",()=>tu,"DropdownMenu",()=>ti,"DropdownMenuArrow",()=>tv,"DropdownMenuCheckboxItem",()=>th,"DropdownMenuContent",()=>tu,"DropdownMenuGroup",()=>td,"DropdownMenuItem",()=>tf,"DropdownMenuItemIndicator",()=>tg,"DropdownMenuLabel",()=>tp,"DropdownMenuPortal",()=>ts,"DropdownMenuRadioGroup",()=>tm,"DropdownMenuRadioItem",()=>tx,"DropdownMenuSeparator",()=>ty,"DropdownMenuSub",()=>tb,"DropdownMenuSubContent",()=>tw,"DropdownMenuSubTrigger",()=>tk,"DropdownMenuTrigger",()=>to,"Group",()=>td,"Item",()=>tf,"ItemIndicator",()=>tg,"Label",()=>tp,"Portal",()=>ts,"RadioGroup",()=>tm,"RadioItem",()=>tx,"Root",()=>ti,"Separator",()=>ty,"Sub",()=>tb,"SubContent",()=>tw,"SubTrigger",()=>tk,"Trigger",()=>to,"createDropdownMenuScope",()=>tt],61920);var tj=e.i(61920),tj=tj,tN=e.i(76016),tC=e.i(95812),tS=e.i(31777);let tM=tj.Root,tE=tj.Trigger;tj.Group,tj.Portal,tj.Sub,tj.RadioGroup,n.forwardRef(({className:e,inset:n,children:r,...l},i)=>(0,t.jsxs)(tj.SubTrigger,{ref:i,className:(0,tS.cn)("focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...l,children:[r,(0,t.jsx)(tN.ChevronRight,{className:"ml-auto"})]})).displayName=tj.SubTrigger.displayName,n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(tj.SubContent,{ref:r,className:(0,tS.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg",e),...n})).displayName=tj.SubContent.displayName;let tP=n.forwardRef(({className:e,sideOffset:n=4,...r},l)=>(0,t.jsx)(tj.Portal,{children:(0,t.jsx)(tj.Content,{ref:l,sideOffset:n,className:(0,tS.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),...r})}));tP.displayName=tj.Content.displayName;let tI=n.forwardRef(({className:e,inset:n,...r},l)=>(0,t.jsx)(tj.Item,{ref:l,className:(0,tS.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r}));tI.displayName=tj.Item.displayName,n.forwardRef(({className:e,children:n,checked:r,...l},i)=>(0,t.jsxs)(tj.CheckboxItem,{ref:i,className:(0,tS.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...l,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(tj.ItemIndicator,{children:(0,t.jsx)(u.Check,{className:"h-4 w-4"})})}),n]})).displayName=tj.CheckboxItem.displayName,n.forwardRef(({className:e,children:n,...r},l)=>(0,t.jsxs)(tj.RadioItem,{ref:l,className:(0,tS.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(tj.ItemIndicator,{children:(0,t.jsx)(tC.Circle,{className:"h-2 w-2 fill-current"})})}),n]})).displayName=tj.RadioItem.displayName;let tT=n.forwardRef(({className:e,inset:n,...r},l)=>(0,t.jsx)(tj.Label,{ref:l,className:(0,tS.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}));tT.displayName=tj.Label.displayName;let tR=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(tj.Separator,{ref:r,className:(0,tS.cn)("bg-muted -mx-1 my-1 h-px",e),...n}));function tD({actions:e,repositoryPath:r,showSpecs:l}){let[a,o]=(0,n.useState)(!1),s=e.ideLoading||e.shellLoading||e.specsLoading,p=e.ideError??e.shellError??e.specsError;return(0,t.jsxs)(tM,{modal:!1,children:[(0,t.jsx)(tE,{asChild:!0,children:(0,t.jsxs)(E.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:s,children:[s?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):p?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Open",(0,t.jsx)(A.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,t.jsxs)(tP,{align:"start",className:"w-48",children:[(0,t.jsx)(tT,{children:"Open in"}),(0,t.jsxs)(tI,{onClick:e.openInIde,disabled:e.ideLoading,className:"gap-2",children:[e.ideLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):e.ideError?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(d.Code2,{className:"size-4"}),"IDE"]}),(0,t.jsxs)(tI,{onClick:e.openInShell,disabled:e.shellLoading,className:"gap-2",children:[e.shellLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):e.shellError?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(R.Terminal,{className:"size-4"}),"Terminal"]}),(0,t.jsxs)(tI,{onClick:e.openSpecsFolder,disabled:e.specsLoading||!l,className:"gap-2",children:[e.specsLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):e.specsError?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,t.jsx)(D.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,t.jsx)(tR,{}),(0,t.jsxs)(tI,{onClick:()=>{navigator.clipboard.writeText(r),o(!0),setTimeout(()=>o(!1),2e3)},className:"gap-2",children:[a?(0,t.jsx)(u.Check,{className:"size-4 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-4"}),a?"Copied!":"Copy path"]})]})]})}tR.displayName=tj.Separator.displayName;var tA=e.i(68304);let tL=(0,f.createServerReference)("40d8c9a1c814a020107b865083bf89ac6223ca2015",f.callServer,void 0,f.findSourceMapURL,"getFeaturePhaseTimings"),tz=(0,f.createServerReference)("401b0111e67227ee0898ab67319fd310ced0b9894a",f.callServer,void 0,f.findSourceMapURL,"getFeaturePlan");var tO=e.i(11345),tF=e.i(81846),t_=e.i(16868),tB=e.i(3645);let tH=(0,tB.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var tU=e.i(48306);e.i(50032);var tq=e.i(86254),t$=e.i(42076);let tV=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function tK({onReject:e,onApprove:r,approveLabel:l,revisionPlaceholder:i,isProcessing:a=!1,isRejecting:o=!1,children:s,chatInput:c,onChatInputChange:d}){let[p,f]=(0,n.useState)(""),h=c??p,m=d??f,x=(0,k.useSoundAction)("approve"),g=a||o,[y,v]=(0,n.useState)([]),[b,w]=(0,n.useState)(!1),[j,N]=(0,n.useState)(null),[C,S]=(0,n.useState)(!1),[M,I]=(0,n.useState)(!1),[T,R]=(0,n.useState)(!1),D=C||M&&T,A=M&&!T,L=(0,n.useRef)(0),z=(0,n.useRef)(crypto.randomUUID()),O=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&I(!0),"Shift"===e.key&&R(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&I(!1),"Shift"===e.key&&R(!1)}function n(){I(!1),R(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",n)}},[]);let F=(0,n.useCallback)(async e=>{for(let t of(N(null),e)){if(t.size>0xa00000)return void N(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!tV.has(e))return void N(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();v(n=>[...n,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let n=new FormData;n.append("file",t),n.append("sessionId",z.current);let r=await fetch("/api/attachments/upload",{method:"POST",body:n});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));v(t=>t.filter(t=>t.id!==e)),N(t.error??"Upload failed");return}let l=await r.json();v(t=>t.some(t=>t.id!==e&&t.path===l.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...l,id:e,loading:!1}:t))}catch{v(t=>t.filter(t=>t.id!==e)),N("Upload failed")}}},[]),_=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L.current+=1,1===L.current&&w(!0)},[]),B=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L.current-=1,0===L.current&&w(!1)},[]),H=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),U=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L.current=0,w(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&F(t)},[F]),q=(0,n.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),F(n))},[F]),$=(0,n.useCallback)(async()=>{try{let e=await (0,t$.pickFiles)();e&&v(t=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return r.length>0?[...t,...r]:t})}catch{}},[]),V=(0,n.useCallback)(e=>{v(t=>t.filter(t=>t.id!==e))},[]),K=(0,n.useCallback)(()=>{m(""),v([]),N(null)},[m]),W=(0,n.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),O.current?.requestSubmit())},[]),G="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[s,e?(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:O,onSubmit:function(t){t.preventDefault();let n=h.trim();if(C||M&&T)x.play(),r(),K();else{if(!n||!e)return;e(n,y.filter(e=>!e.loading)),K()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":"File drop zone","data-drag-over":b?"true":"false",onDragEnter:_,onDragLeave:B,onDragOver:H,onDrop:U,className:(0,tS.cn)("rounded-md border-2 border-transparent transition-colors",b&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(tU.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:g,value:h,onChange:e=>m(e.target.value),onKeyDown:W,onPaste:q,rows:3,className:"max-h-[35dvh] min-h-0 flex-1 resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),y.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:y.map(e=>(0,t.jsx)(tq.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>V(e.id),disabled:g,loading:e.loading},e.id))}),j?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:j}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[G,"+Enter"]})," ","reject",(0,t.jsx)("span",{className:"mx-1 opacity-40",children:"|"}),(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[G,"+Shift+Enter"]})," ","approve"]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:$,disabled:g,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(t_.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:"Attach files"})]}),(0,t.jsx)("div",{onMouseLeave:()=>S(!1),children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:g,"data-testid":"drawer-action-submit",className:(0,tS.cn)("relative flex h-8 min-w-[10rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",D?"border-blue-400/60 text-white":A?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-blue-500/85 transition-transform duration-300 ease-in-out",style:{transform:D?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,tS.cn)("absolute inset-0 z-10 flex items-center justify-center gap-1.5 pr-8 transition-opacity duration-300",D?"opacity-0":"opacity-100"),children:[(0,t.jsx)(tH,{className:"h-3.5 w-3.5 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,tS.cn)("absolute inset-0 z-10 flex items-center justify-center gap-1.5 text-white transition-opacity duration-300",D?"opacity-100":"opacity-0"),children:[(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5 shrink-0"}),l]}),(0,t.jsx)("span",{className:(0,tS.cn)("border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l bg-blue-500/85 transition-opacity duration-300",D&&"pointer-events-none opacity-0"),onMouseEnter:()=>S(!0),children:(0,t.jsx)(tO.ChevronLeft,{className:"h-3.5 w-3.5 text-white"})})]})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:D?"Approve":"Send revision feedback"})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(E.Button,{type:"button",className:"flex-1",disabled:g,onClick:()=>{x.play(),r()},children:l})})]})}function tW({data:e,selections:r,onSelect:l,onApprove:i,onReject:a,isProcessing:o=!1,isRejecting:s=!1,showHeader:c=!1,chatInput:u,onChatInputChange:d}){let{question:p,context:f,questions:h,finalAction:m}=e,[x,g]=(0,n.useState)(0),y=(0,k.useSoundAction)("select"),v=(0,k.useSoundAction)("navigate"),b=h.length,w=x===b-1,j=h[x],N=(0,n.useMemo)(()=>Object.keys(r).length,[r]),C=(0,n.useCallback)((e,t)=>{y.play(),l(e,t),w||setTimeout(()=>g(e=>e+1),250)},[l,w,y]);return 0===b?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:p}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:f})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:j.question}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,n)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${n+1}`,className:(0,tS.cn)("h-1.5 rounded-full transition-all duration-200",n===x?"bg-primary w-4":"w-1.5",n!==x&&r[e.id]?"bg-primary/50":"",n===x||r[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),g(n)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:j.options.map((e,n)=>{let l=r[j.id]===e.id,i=String.fromCharCode(65+n);return(0,t.jsx)("button",{type:"button",className:(0,tS.cn)("border-border w-full rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",l&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:o,onClick:()=>C(j.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[i,"."]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-0.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:e.label}),e.recommended?(0,t.jsx)(tF.Badge,{className:"px-1.5 py-0 text-[10px]",children:"AI Recommended"}):null,e.isNew?(0,t.jsx)(tF.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] text-white hover:bg-emerald-600/80",children:"New"}):null]}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]})]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(E.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===x||o,onClick:()=>{v.play(),g(e=>e-1)},children:[(0,t.jsx)(tO.ChevronLeft,{className:"mr-1 h-4 w-4"}),"Previous"]}),w?null:(0,t.jsxs)(E.Button,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>{v.play(),g(e=>e+1)},children:[r[j.id]?"Next":"Skip",(0,t.jsx)(tN.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]}),(0,t.jsx)(tK,{onReject:a,onApprove:()=>i(m.id),approveLabel:m.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:o,isRejecting:s,chatInput:u,onChatInputChange:d,children:(0,t.jsx)("div",{className:(0,tS.cn)("bg-muted h-1.5 overflow-hidden",N>0&&N<b||o?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:o?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${b>0?N/b*100:0}%`},"data-testid":"progress-bar"})})})]})}function tG(){}function tQ(){}let tX=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tY={};function tZ(e,t){return((t||tY).jsx?tJ:tX).test(e)}let t0=/[ \t\n\f\r]/g;function t1(e){return""===e.replace(t0,"")}class t2{constructor(e,t){this.attribute=t,this.property=e}}t2.prototype.attribute="",t2.prototype.booleanish=!1,t2.prototype.boolean=!1,t2.prototype.commaOrSpaceSeparated=!1,t2.prototype.commaSeparated=!1,t2.prototype.defined=!1,t2.prototype.mustUseProperty=!1,t2.prototype.number=!1,t2.prototype.overloadedBoolean=!1,t2.prototype.property="",t2.prototype.spaceSeparated=!1,t2.prototype.space=void 0;let t5=0,t3=nt(),t4=nt(),t6=nt(),t9=nt(),t8=nt(),t7=nt(),ne=nt();function nt(){return 2**++t5}e.s(["boolean",0,t3,"booleanish",0,t4,"commaOrSpaceSeparated",0,ne,"commaSeparated",0,t7,"number",0,t9,"overloadedBoolean",0,t6,"spaceSeparated",0,t8],83954);var nn=e.i(83954);let nr=Object.keys(nn);class nl extends t2{constructor(e,t,n,r){let l=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++l<nr.length;){const e=nr[l];!function(e,t,n){n&&(e[t]=n)}(this,nr[l],(n&nn[e])===nn[e])}}}function ni(e){return e.toLowerCase()}nl.prototype.defined=!0;let na=/[A-Z]/g,no=/-[a-z]/g,ns=/^data[-\w.:]+$/i;function nc(e){return"-"+e.toLowerCase()}function nu(e){return e.charAt(1).toUpperCase()}let nd={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class np{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function nf(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new np(n,r,t)}function nh(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let i=new nl(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ni(r)]=r,n[ni(i.attribute)]=r}return new np(t,n,e.space)}np.prototype.normal={},np.prototype.property={},np.prototype.space=void 0;let nm=nh({properties:{ariaActiveDescendant:null,ariaAtomic:t4,ariaAutoComplete:null,ariaBusy:t4,ariaChecked:t4,ariaColCount:t9,ariaColIndex:t9,ariaColSpan:t9,ariaControls:t8,ariaCurrent:null,ariaDescribedBy:t8,ariaDetails:null,ariaDisabled:t4,ariaDropEffect:t8,ariaErrorMessage:null,ariaExpanded:t4,ariaFlowTo:t8,ariaGrabbed:t4,ariaHasPopup:null,ariaHidden:t4,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:t8,ariaLevel:t9,ariaLive:null,ariaModal:t4,ariaMultiLine:t4,ariaMultiSelectable:t4,ariaOrientation:null,ariaOwns:t8,ariaPlaceholder:null,ariaPosInSet:t9,ariaPressed:t4,ariaReadOnly:t4,ariaRelevant:null,ariaRequired:t4,ariaRoleDescription:t8,ariaRowCount:t9,ariaRowIndex:t9,ariaRowSpan:t9,ariaSelected:t4,ariaSetSize:t9,ariaSort:null,ariaValueMax:t9,ariaValueMin:t9,ariaValueNow:t9,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function nx(e,t){return t in e?e[t]:t}function ng(e,t){return nx(e,t.toLowerCase())}let ny=nh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:t7,acceptCharset:t8,accessKey:t8,action:null,allow:null,allowFullScreen:t3,allowPaymentRequest:t3,allowUserMedia:t3,alt:null,as:null,async:t3,autoCapitalize:null,autoComplete:t8,autoFocus:t3,autoPlay:t3,blocking:t8,capture:null,charSet:null,checked:t3,cite:null,className:t8,cols:t9,colSpan:null,content:null,contentEditable:t4,controls:t3,controlsList:t8,coords:t9|t7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:t3,defer:t3,dir:null,dirName:null,disabled:t3,download:t6,draggable:t4,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:t3,formTarget:null,headers:t8,height:t9,hidden:t6,high:t9,href:null,hrefLang:null,htmlFor:t8,httpEquiv:t8,id:null,imageSizes:null,imageSrcSet:null,inert:t3,inputMode:null,integrity:null,is:null,isMap:t3,itemId:null,itemProp:t8,itemRef:t8,itemScope:t3,itemType:t8,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:t3,low:t9,manifest:null,max:null,maxLength:t9,media:null,method:null,min:null,minLength:t9,multiple:t3,muted:t3,name:null,nonce:null,noModule:t3,noValidate:t3,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:t3,optimum:t9,pattern:null,ping:t8,placeholder:null,playsInline:t3,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:t3,referrerPolicy:null,rel:t8,required:t3,reversed:t3,rows:t9,rowSpan:t9,sandbox:t8,scope:null,scoped:t3,seamless:t3,selected:t3,shadowRootClonable:t3,shadowRootDelegatesFocus:t3,shadowRootMode:null,shape:null,size:t9,sizes:null,slot:null,span:t9,spellCheck:t4,src:null,srcDoc:null,srcLang:null,srcSet:null,start:t9,step:null,style:null,tabIndex:t9,target:null,title:null,translate:null,type:null,typeMustMatch:t3,useMap:null,value:t4,width:t9,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:t8,axis:null,background:null,bgColor:null,border:t9,borderColor:null,bottomMargin:t9,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:t3,declare:t3,event:null,face:null,frame:null,frameBorder:null,hSpace:t9,leftMargin:t9,link:null,longDesc:null,lowSrc:null,marginHeight:t9,marginWidth:t9,noResize:t3,noHref:t3,noShade:t3,noWrap:t3,object:null,profile:null,prompt:null,rev:null,rightMargin:t9,rules:null,scheme:null,scrolling:t4,standby:null,summary:null,text:null,topMargin:t9,valueType:null,version:null,vAlign:null,vLink:null,vSpace:t9,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:t3,disableRemotePlayback:t3,prefix:null,property:null,results:t9,security:null,unselectable:null},space:"html",transform:ng}),nv=nh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ne,accentHeight:t9,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:t9,amplitude:t9,arabicForm:null,ascent:t9,attributeName:null,attributeType:null,azimuth:t9,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:t9,by:null,calcMode:null,capHeight:t9,className:t8,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:t9,diffuseConstant:t9,direction:null,display:null,dur:null,divisor:t9,dominantBaseline:null,download:t3,dx:null,dy:null,edgeMode:null,editable:null,elevation:t9,enableBackground:null,end:null,event:null,exponent:t9,externalResourcesRequired:null,fill:null,fillOpacity:t9,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:t7,g2:t7,glyphName:t7,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:t9,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:t9,horizOriginX:t9,horizOriginY:t9,id:null,ideographic:t9,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:t9,k:t9,k1:t9,k2:t9,k3:t9,k4:t9,kernelMatrix:ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:t9,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:t9,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:t9,overlineThickness:t9,paintOrder:null,panose1:null,path:null,pathLength:t9,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:t8,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:t9,pointsAtY:t9,pointsAtZ:t9,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ne,rev:ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ne,requiredFeatures:ne,requiredFonts:ne,requiredFormats:ne,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:t9,specularExponent:t9,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:t9,strikethroughThickness:t9,string:null,stroke:null,strokeDashArray:ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:t9,strokeOpacity:t9,strokeWidth:null,style:null,surfaceScale:t9,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ne,tabIndex:t9,tableValues:null,target:null,targetX:t9,targetY:t9,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:t9,underlineThickness:t9,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:t9,values:null,vAlphabetic:t9,vMathematical:t9,vectorEffect:null,vHanging:t9,vIdeographic:t9,version:null,vertAdvY:t9,vertOriginX:t9,vertOriginY:t9,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:t9,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nx}),nb=nh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),nk=nh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ng}),nw=nh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),nj=nf([nm,ny,nb,nk,nw],"html"),nN=nf([nm,nv,nb,nk,nw],"svg");var nC=e.i(63185);let nS=nE("end"),nM=nE("start");function nE(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function nP(e){return e&&"object"==typeof e?"position"in e||"type"in e?nT(e.position):"start"in e||"end"in e?nT(e):"line"in e||"column"in e?nI(e):"":""}function nI(e){return nR(e&&e.line)+":"+nR(e&&e.column)}function nT(e){return nI(e&&e.start)+"-"+nI(e&&e.end)}function nR(e){return e&&"number"==typeof e?e:1}class nD extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},i=!1;if(t&&(l="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(i=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){const e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=nP(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=i&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nD.prototype.file="",nD.prototype.name="",nD.prototype.reason="",nD.prototype.message="",nD.prototype.stack="",nD.prototype.column=void 0,nD.prototype.line=void 0,nD.prototype.ancestors=void 0,nD.prototype.cause=void 0,nD.prototype.fatal=void 0,nD.prototype.place=void 0,nD.prototype.ruleId=void 0,nD.prototype.source=void 0;let nA={}.hasOwnProperty,nL=new Map,nz=/[A-Z]/g,nO=new Set(["table","tbody","thead","tfoot","tr"]),nF=new Set(["td","th"]),n_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nB(e,t,n){var r,l,i,a,o,s,c,u,d;let p,f,h,m,x,g,y,v,b,k,w;return"element"===t.type?(r=e,l=t,i=n,f=p=r.schema,"svg"===l.tagName.toLowerCase()&&"html"===p.space&&(r.schema=nN),r.ancestors.push(l),h=n$(r,l.tagName,!1),m=function(e,t){let n,r,l={};for(r in t.properties)if("children"!==r&&nA.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=ni(t),r=t,l=t2;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ns.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(no,nu);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!no.test(e)){let n=e.replace(na,nc);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=nl}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var l;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(l=n)[l.length-1]?[...l,""]:l).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,nC.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new nD("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=n_+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)nA.call(e,t)&&(n[function(e){let t=e.replace(nz,nK);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?nd[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,a]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&nF.has(t.tagName)?n=a:l[r]=a}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(r,l),x=nq(r,l),nO.has(l.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&t1(e.value):t1(e))})),nH(r,m,h,l),nU(m,x),r.ancestors.pop(),r.schema=p,r.create(l,h,m,i)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return tG("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}nV(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,o=t,s=n,y=g=a.schema,"svg"===o.name&&"html"===g.space&&(a.schema=nN),a.ancestors.push(o),v=null===o.name?a.Fragment:n$(a,o.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];tG("ExpressionStatement"===t.type);let l=t.expression;tG("ObjectExpression"===l.type);let i=l.properties[0];tG("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else nV(e,t.position);else{let l,i=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];tG("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else nV(e,t.position);else l=null===r.value||r.value;n[i]=l}return n}(a,o),k=nq(a,o),nH(a,b,v,o),nU(b,k),a.ancestors.pop(),a.schema=g,a.create(o,v,b,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nV(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,nU(w={},nq(c,u)),c.create(u,c.Fragment,w,d)):"text"===t.type?t.value:void 0}function nH(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nU(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function nq(e,t){let n=[],r=-1,l=e.passKeys?new Map:nL;for(;++r<t.children.length;){let i,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=l.get(e)||0;i=e+"-"+t,l.set(e,t+1)}}let o=nB(e,a,i);void 0!==o&&n.push(o)}return n}function n$(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),l=-1;for(;++l<n.length;){let t=tZ(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}tG(e,"always a result"),r=e}else r=tZ(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return nA.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);nV(e)}function nV(e,t){let n=new nD("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=n_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function nK(e){return"-"+e.toLowerCase()}let nW={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},nG={};function nQ(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return nX(e.children,t,n)}return Array.isArray(e)?nX(e,t,n):""}function nX(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=nQ(e[l],t,n);return r.join("")}function nJ(e,t,n,r){let l,i=e.length,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)(l=r.slice(a,a+1e4)).unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function nY(e,t){return e.length>0?(nJ(e,e.length,0,t),e):t}let nZ={}.hasOwnProperty,n0=rn(/[A-Za-z]/),n1=rn(/[\dA-Za-z]/),n2=rn(/[#-'*+\--9=?A-Z^-~]/);function n5(e){return null!==e&&(e<32||127===e)}let n3=rn(/\d/),n4=rn(/[\dA-Fa-f]/),n6=rn(/[!-/:-@[-`{-~]/);function n9(e){return null!==e&&e<-2}function n8(e){return null!==e&&(e<0||32===e)}function n7(e){return -2===e||-1===e||32===e}let re=rn(/\p{P}|\p{S}/u),rt=rn(/\s/);function rn(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function rr(e,t,n,r){let l=r?r-1:1/0,i=0;return function(r){return n7(r)?(e.enter(n),function r(a){return n7(a)&&i++<l?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let rl={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rr(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return n9(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},ri={tokenize:function(e){let t,n,r,l=this,i=[],a=0;return o;function o(t){if(a<i.length){let n=i[a];return l.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&g();let r=l.events.length,i=r;for(;i--;)if("exit"===l.events[i][0]&&"chunkFlow"===l.events[i][1].type){n=l.events[i][1].end;break}x(a);let o=r;for(;o<l.events.length;)l.events[o][1].end={...n},o++;return nJ(l.events,i+1,0,l.events.slice(r)),l.events.length=o,c(e)}return o(e)}function c(n){if(a===i.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(ra,u,d)(n)}function u(e){return t&&g(),x(a),p(e)}function d(e){return l.parser.lazy[l.now().line]=a!==i.length,r=l.now().offset,h(e)}function p(t){return l.containerState={},e.attempt(ra,f,h)(t)}function f(e){return a++,i.push([l.currentConstruct,l.containerState]),p(e)}function h(r){if(null===r){t&&g(),x(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return n9(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,l.interrupt=void 0,o):(e.consume(n),t)}(r)}function m(e,i){let o=l.sliceStream(e);if(i&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),l.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let o=l.events.length,s=o;for(;s--;)if("exit"===l.events[s][0]&&"chunkFlow"===l.events[s][1].type){if(e){n=l.events[s][1].end;break}e=!0}for(x(a),i=o;i<l.events.length;)l.events[i][1].end={...n},i++;nJ(l.events,s+1,0,l.events.slice(o)),l.events.length=i}}function x(t){let n=i.length;for(;n-- >t;){let t=i[n];l.containerState=t[1],t[0].exit.call(l,e)}i.length=t}function g(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},ra={tokenize:function(e,t,n){return rr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ro={partial:!0,tokenize:function(e,t,n){return function(t){return n7(t)?rr(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||n9(e)?t(e):n(e)}}};class rs{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&rc(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),rc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),rc(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);rc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);rc(this.left,t.reverse())}}}function rc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ru(e){let t,n,r,l,i,a,o,s={},c=-1,u=new rs(e);for(;++c<u.length;){for(;c in s;)c=s[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,l=e.get(t)[1],i=e.get(t)[2],a=t-1,o=[],s=l._tokenizer;!s&&(s=i.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,u=[],d={},p=-1,f=l,h=0,m=0,x=[0];for(;f;){for(;e.get(++a)[1]!==f;);o.push(a),!f._tokenizer&&(n=i.sliceStream(f),f.next||n.push(null),r&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=f,f=f.next}for(f=l;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(m=p+1,x.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):x.pop(),p=x.length;p--;){let t=c.slice(x[p],x[p+1]),n=o.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[h+u[p][0]]=h+u[p][1],h+=u[p][1]-u[p][0]-1;return d}(u,c)),c=s[c],o=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(l=u.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(i=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,i))}}return nJ(e,0,1/0,u.slice(0)),!o}let rd={resolve:function(e){return ru(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):n9(t)?e.check(rp,i,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},rp={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rr(e,l,"linePrefix")};function l(l){if(null===l||n9(l))return n(l);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},rf={tokenize:function(e){let t=this,n=e.attempt(ro,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,rr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(rd,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},rh={resolveAll:ry()},rm=rg("string"),rx=rg("text");function rg(e){return{resolveAll:ry("text"===e?rv:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,i,a);return i;function i(e){return s(e)?l(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return s(e)?(t.exit("data"),l(e)):(t.consume(e),o)}function s(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function ry(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function rv(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,l=e[n-1][1],i=t.sliceStream(l),a=i.length,o=-1,s=0;for(;a--;){let e=i[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)s++,o--;if(o)break;o=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:l.start._bufferIndex+o,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...i.start},l.start.offset===l.end.offset?Object.assign(l,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function rb(e){return null===e||n8(e)||rt(e)?1:re(e)?2:void 0}function rk(e,t,n){let r=[],l=-1;for(;++l<e.length;){let i=e[l].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let rw={name:"attention",resolveAll:function(e,t){let n,r,l,i,a,o,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};rj(d,-o),rj(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},l={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=nY(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=nY(s,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",l,t]]),s=nY(s,rk(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=nY(s,[["exit",l,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=nY(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,nJ(e,n-1,u-n+3,s),u=n+s.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,l=this.previous,i=rb(l);return function(a){return n=a,e.enter("attentionSequence"),function a(o){if(o===n)return e.consume(o),a;let s=e.exit("attentionSequence"),c=rb(o),u=!c||2===c&&i||r.includes(o),d=!i||2===i&&c||r.includes(l);return s._open=!!(42===n?u:u&&(i||!d)),s._close=!!(42===n?d:d&&(c||!u)),t(o)}(a)}}};function rj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let rN={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return n7(t)?rr(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(rN,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return n7(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},rC={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return n6(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},rS=document.createElement("i");function rM(e){let t="&"+e+";";rS.innerHTML=t;let n=rS.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let rE={name:"characterReference",tokenize:function(e,t,n){let r,l,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,l=n1,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=n4,c):(e.enter("characterReferenceValue"),r=7,l=n3,c(t))}function c(o){if(59===o&&a){let r=e.exit("characterReferenceValue");return l!==n1||rM(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return l(o)&&a++<r?(e.consume(o),c):n(o)}}},rP={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},rI={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,l=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),n7(t)?rr(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(i++,e.consume(l),t):i>=o?(e.exit("codeFencedFenceSequence"),n7(l)?rr(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||n9(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,o=0;return function(t){var i;let c;return i=t,a=(c=l.events[l.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(o++,e.consume(l),t):o<3?n(l):(e.exit("codeFencedFenceSequence"),n7(l)?rr(e,s,"whitespace")(l):s(l))}(i)};function s(i){return null===i||n9(i)?(e.exit("codeFencedFence"),l.interrupt?t(i):e.check(rP,u,h)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||n9(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(l)):n7(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rr(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(i))}function c(t){return null===t||n9(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||n9(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function u(t){return e.attempt(i,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return a>0&&n7(t)?rr(e,f,"linePrefix",a+1)(t):f(t)}function f(t){return null===t||n9(t)?e.check(rP,u,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||n9(n)?(e.exit("codeFlowValue"),f(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},rT={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),rr(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?i(n):n9(n)?e.attempt(rR,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||n9(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},rR={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):n9(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):rr(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):n9(e)?l(e):n(e)}}};function rD(e,t,n,r,l,i,a,o,s){let c=s||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||n5(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(l),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||n9(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(l){return!u&&(null===l||41===l||n8(l))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(l)):u<c&&40===l?(e.consume(l),u++,h):41===l?(e.consume(l),u--,h):null===l||32===l||40===l||n5(l)?n(l):(e.consume(l),92===l?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function rA(e,t,n,r,l,i){let a,o=this,s=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(i),c};function c(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):93===d?(e.exit(i),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):n9(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||n9(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!n7(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function rL(e,t,n,r,l,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(i),s(n))}function s(t){return t===a?(e.exit(i),o(a)):null===t?n(t):n9(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rr(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||n9(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function rz(e,t){let n;return function r(l){return n9(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):n7(l)?rr(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}function rO(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let rF={partial:!0,tokenize:function(e,t,n){return function(t){return n8(t)?rz(e,r)(t):n(t)};function r(t){return rL(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return n7(t)?rr(e,i,"whitespace")(t):i(t)}function i(e){return null===e||n9(e)?t(e):n(e)}}},r_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rB=["pre","script","style","textarea"],rH={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ro,t,n)}}},rU={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return n9(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},rq={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&nJ(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,i,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(l=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},u={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[l-2][1].start}};return i=nY(i=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+o+3)),i=nY(i,[["enter",u,t]]),i=nY(i,rk(t.parser.constructs.insideSpan.null,e.slice(r+o+4,l-3),t)),i=nY(i,[["exit",u,t],e[l-2],e[l-1],["exit",c,t]]),i=nY(i,e.slice(l+1)),i=nY(i,[["exit",s,t]]),nJ(e,r,e.length,i),e},tokenize:function(e,t,n){let r,l,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){return r?r._inactive?u(t):(l=i.parser.defined.includes(rO(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(r$,c,l?c:u)(t):91===t?e.attempt(rV,c,l?s:u)(t):l?c(t):u(t)}function s(t){return e.attempt(rK,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},r$={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return n8(t)?rz(e,l)(t):l(t)}function l(t){return 41===t?c(t):rD(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return n8(t)?rz(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?rL(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return n8(t)?rz(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},rV={tokenize:function(e,t,n){let r=this;return function(t){return rA.call(r,e,l,i,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes(rO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},rK={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},rW={name:"labelStartImage",resolveAll:rq.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},rG={name:"labelStartLink",resolveAll:rq.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},rQ={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),rr(e,t,"linePrefix")}}},rX={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(i){var a;return e.enter("thematicBreak"),r=a=i,function i(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),n7(n)?rr(e,i,"whitespace")(n):i(n))}(a)):l>=3&&(null===a||n9(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},rJ={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ro,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rr(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!n7(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rZ,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,rr(e,e.attempt(rJ,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],i=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,a=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:n3(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(rX,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return n3(l)&&++a<10?(e.consume(l),t):(!r.interrupt||a<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),o(l)):n(l)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(ro,r.interrupt?n:s,e.attempt(rY,u,c))}function s(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return n7(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},rY={partial:!0,tokenize:function(e,t,n){let r=this;return rr(e,function(e){let l=r.events[r.events.length-1];return!n7(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},rZ={partial:!0,tokenize:function(e,t,n){let r=this;return rr(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},r0={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",a,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,l=this;return function(t){var a;let o,s=l.events.length;for(;s--;)if("lineEnding"!==l.events[s][1].type&&"linePrefix"!==l.events[s][1].type&&"content"!==l.events[s][1].type){o="paragraph"===l.events[s][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||o)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),n7(n)?rr(e,i,"lineSuffix")(n):i(n))}(a)):n(t)};function i(r){return null===r||n9(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,l=this;return function(t){var r;return e.enter("definition"),r=t,rA.call(l,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function i(t){return(r=rO(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return n8(t)?rz(e,o)(t):o(t)}function o(t){return rD(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(rF,c,c)(t)}function c(t){return n7(t)?rr(e,u,"whitespace")(t):u(t)}function u(i){return null===i||n9(i)?(e.exit("definition"),l.parser.defined.push(r),t(i)):n(i)}}}},"disable",0,{null:[]},"document",0,{42:rJ,43:rJ,45:rJ,48:rJ,49:rJ,50:rJ,51:rJ,52:rJ,53:rJ,54:rJ,55:rJ,56:rJ,57:rJ,62:rN},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),l-2>i&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},nJ(e,i,l-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){var i;return e.enter("atxHeading"),i=l,e.enter("atxHeadingSequence"),function l(i){return 35===i&&r++<6?(e.consume(i),l):null===i||n8(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||n9(r)?(e.exit("atxHeading"),t(r)):n7(r)?rr(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||n8(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(i)}}},42:rX,45:[r0,rX],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,l,i,a,o,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),l=!0,f):63===a?(e.consume(a),r=3,s.interrupt?t:R):n0(a)?(e.consume(a),i=String.fromCharCode(a),h):n(a)}function u(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,a=0,p):n0(l)?(e.consume(l),r=4,s.interrupt?t:R):n(l)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:R):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(a++)?(e.consume(r),a===l.length)?s.interrupt?t:N:p:n(r)}function f(t){return n0(t)?(e.consume(t),i=String.fromCharCode(t),h):n(t)}function h(a){if(null===a||47===a||62===a||n8(a)){let o=47===a,c=i.toLowerCase();return!o&&!l&&rB.includes(c)?(r=1,s.interrupt?t(a):N(a)):r_.includes(i.toLowerCase())?(r=6,o)?(e.consume(a),m):s.interrupt?t(a):N(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):l?function t(n){return n7(n)?(e.consume(n),t):w(n)}(a):x(a))}return 45===a||n1(a)?(e.consume(a),i+=String.fromCharCode(a),h):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:N):n(r)}function x(t){return 47===t?(e.consume(t),w):58===t||95===t||n0(t)?(e.consume(t),g):n7(t)?(e.consume(t),x):w(t)}function g(t){return 45===t||46===t||58===t||95===t||n1(t)?(e.consume(t),g):y(t)}function y(t){return 61===t?(e.consume(t),v):n7(t)?(e.consume(t),y):x(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,b):n7(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||n8(n)?y(n):(e.consume(n),t)}(t)}function b(t){return t===o?(e.consume(t),o=null,k):null===t||n9(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||n7(e)?x(e):n(e)}function w(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||n9(t)?N(t):n7(t)?(e.consume(t),j):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),P):62===t&&4===r?(e.consume(t),D):63===t&&3===r?(e.consume(t),R):93===t&&5===r?(e.consume(t),T):n9(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(rH,A,C)(t)):null===t||n9(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),N)}function C(t){return e.check(rU,S,A)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return null===t||n9(t)?C(t):(e.enter("htmlFlowData"),N(t))}function E(t){return 45===t?(e.consume(t),R):N(t)}function P(t){return 47===t?(e.consume(t),i="",I):N(t)}function I(t){if(62===t){let n=i.toLowerCase();return rB.includes(n)?(e.consume(t),D):N(t)}return n0(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),I):N(t)}function T(t){return 93===t?(e.consume(t),R):N(t)}function R(t){return 62===t?(e.consume(t),D):45===t&&2===r?(e.consume(t),R):N(t)}function D(t){return null===t||n9(t)?(e.exit("htmlFlowData"),A(t)):(e.consume(t),D)}function A(n){return e.exit("htmlFlow"),t(n)}}},61:r0,95:rX,96:rI,126:rI},"flowInitial",0,{[-2]:rT,[-1]:rT,32:rT},"insideSpan",0,{null:[rw,rh]},"string",0,{38:rE,92:rC},"text",0,{[-5]:rQ,[-4]:rQ,[-3]:rQ,33:rW,38:rE,42:rw,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return n0(t)?(e.consume(t),i):64===t?n(t):o(t)}function i(t){return 43===t||45===t||46===t||n1(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||n1(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||n5(r)?n(r):(e.consume(r),a)}function o(t){return 64===t?(e.consume(t),s):n2(t)?(e.consume(t),o):n(t)}function s(l){return n1(l)?function l(i){return 46===i?(e.consume(i),r=0,s):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||n1(i))&&r++<63){let n=45===i?t:l;return e.consume(i),n}return n(i)}(i)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,i,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),b):63===t?(e.consume(t),y):n0(t)?(e.consume(t),w):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,f):n0(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):n9(t)?(i=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?P(e):45===e?d(e):u(e)}function f(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):n9(t)?(i=h,I(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),x):h(t)}function x(t){return 62===t?P(t):93===t?(e.consume(t),x):h(t)}function g(t){return null===t||62===t?P(t):n9(t)?(i=g,I(t)):(e.consume(t),g)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):n9(t)?(i=y,I(t)):(e.consume(t),y)}function v(e){return 62===e?P(e):y(e)}function b(t){return n0(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||n1(t)?(e.consume(t),k):function t(n){return n9(n)?(i=t,I(n)):n7(n)?(e.consume(n),t):P(n)}(t)}function w(t){return 45===t||n1(t)?(e.consume(t),w):47===t||62===t||n8(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),P):58===t||95===t||n0(t)?(e.consume(t),N):n9(t)?(i=j,I(t)):n7(t)?(e.consume(t),j):P(t)}function N(t){return 45===t||46===t||58===t||95===t||n1(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),C):n9(n)?(i=t,I(n)):n7(n)?(e.consume(n),t):j(n)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):n9(t)?(i=C,I(t)):n7(t)?(e.consume(t),C):(e.consume(t),M)}function S(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):n9(t)?(i=S,I(t)):(e.consume(t),S)}function M(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||n8(t)?j(t):(e.consume(t),M)}function E(e){return 47===e||62===e||n8(e)?j(e):n(e)}function P(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return n7(t)?rr(e,R,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),i(t)}}}],91:rG,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return n9(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},rC],93:rq,95:rw,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(l=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(l.type="codeTextData",o(a))}(s)):n9(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),o(s))}function o(t){return null===t||32===t||96===t||n9(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),o)}}}}],19210);var r1=e.i(19210);let r2=/[\0\t\n\r]/g;function r5(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let r3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function r4(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return r5(n.slice(t?2:1),t?16:10)}return rM(n)||e}let r6={}.hasOwnProperty;function r9(e){return{line:e.line,column:e.column,offset:e.offset}}function r8(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+nP({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nP({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+nP({start:t.start,end:t.end})+") is still open")}function r7(e){let t=this;t.parser=function(n){var r,l;let i,a,o,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(l=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(f),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(f,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(x,l),htmlFlowData:c,htmlText:r(x,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=r5(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=rM(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=r9(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rO(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(r3,r4),n.identifier=rO(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=r9(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rO(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(r6.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:i,exit:o,buffer:l,resume:s,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,l,i,a,o=t-1,s=-1,c=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||i||(i=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(l=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",l=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!l||i<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(o,0,["enter",l,t[2]]),o++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];r6.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||r8).call(a,void 0,e[0])}for(r.position={start:r9(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:r9(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:r9(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||r8).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+nP({start:e.start,end:e.end})+"): it’s not open");n.position.end=r9(e.end)}function s(){var e;return e=this.stack.pop(),nQ(e,"boolean"!=typeof nG.includeImageAlt||nG.includeImageAlt,"boolean"!=typeof nG.includeHtml||nG.includeHtml)}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:r9(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=r9(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function x(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(l)(function(e){for(;!ru(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,l=(nZ.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){nZ.call(l,r)||(l[r]=[]);let e=i[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);nJ(e,0,0,r)}(l[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([r1,...(e||{}).extensions||[]]),content:n(rl),defined:[],document:n(ri),flow:n(rf),lazy:{},string:n(rm),text:n(rx)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},l={},i=[],a=[],o=[],s={attempt:h(function(e,t){m(e,t.from)}),check:h(f),consume:function(e){n9(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:h(f,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let i,a=e[r];if("string"==typeof a)i=a;else switch(a){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(a)}n=-2===a,l.push(i)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=nY(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==a[a.length-1])?[]:(m(t,0),c.events=rk(i,c.events,c),c.events)}},u=t.tokenize.call(c,s);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,l=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;if(r===i)n=[e[r].slice(l,a)];else{if(n=e.slice(r,i),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}a>0&&n.push(e[i].slice(0,a))}return n}(a,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:i}}function f(e,t){t.restore()}function h(e,t){return function(n,l,i){var a;let u,d,f,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?i:g(e[d])}function g(e){return function(n){let l,i,a,u,d;return(l=p(),i=c.previous,a=c.currentConstruct,u=c.events.length,d=Array.from(o),h={from:u,restore:function(){r=l,c.previous=i,c.currentConstruct=a,c.events.length=u,o=d,x()}},f=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,y,v)(n)}}function y(t){return e(f,h),l}function v(e){return(h.restore(),++d<u.length)?g(u[d]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&nJ(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function x(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(l).document().write((a=1,o="",s=!0,function(e,t,n){let r,l,c,u,d,p=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,o="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(r2.lastIndex=c,u=(r=r2.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){o=e.slice(c);break}if(10===d&&c===u&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),c<u&&(p.push(e.slice(c,u)),a+=u-c),d){case 0:p.push(65533),a++;break;case 9:for(l=4*Math.ceil(a/4),p.push(-2);a++<l;)p.push(-1);break;case 10:p.push(-4),a=1;break;default:i=!0,a=1}c=u+1}return n&&(i&&p.push(-5),o&&p.push(o),p.push(null)),p})(n,r,!0))))}}let le="object"==typeof self?self:globalThis,lt=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=l=>{if(t.has(l))return t.get(l);let[i,a]=e[l];switch(i){case 0:case -1:return n(a,l);case 1:{let e=n([],l);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),l);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new le[e](t),l)}case 8:return n(BigInt(a),l);case"BigInt":return n(Object(BigInt(a)),l);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new le[i](a),l)})(0)},{toString:ln}={},{keys:lr}=Object,ll=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=ln.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},li=([e,t])=>0===e&&("function"===t||"symbol"===t),la=(e,{json:t,lossy:n}={})=>{var r,l,i;let a,o,s=[];return(r=!(t||n),l=!!t,i=new Map,a=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},o=e=>{if(i.has(e))return i.get(e);let[t,n]=ll(e);switch(t){case 0:{let l=e;switch(n){case"bigint":t=8,l=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);l=null;break;case"undefined":return a([-1],e)}return a([t,l],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],l=a([t,r],e);for(let t of e)r.push(o(t));return l}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(l&&"toJSON"in e)return o(e.toJSON());let i=[],s=a([t,i],e);for(let t of lr(e))(r||!li(ll(e[t])))&&i.push([o(t),o(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],l=a([t,n],e);for(let[t,l]of e)(r||!(li(ll(t))||li(ll(l))))&&n.push([o(t),o(l)]);return l}case 6:{let n=[],l=a([t,n],e);for(let t of e)(r||!li(ll(t)))&&n.push(o(t));return l}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},lo="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?lt(la(e,t)):structuredClone(e):(e,t)=>lt(la(e,t));function ls(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let i=e.charCodeAt(n),a="";if(37===i&&n1(e.charCodeAt(n+1))&&n1(e.charCodeAt(n+2)))l=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),l=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+l+1,a=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function lc(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function lu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let ld=function(e){var t,n;if(null==e)return lf;if("function"==typeof e)return lp(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ld(e[n]);return lp(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,lp(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,lp(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function lp(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function lf(){return!0}let lh=[];function lm(e,t,n,r){var l,i,a;let o,s,c,u,d,p;"function"==typeof t&&"function"!=typeof n?(s=void 0,c=t,o=n):(s=t,c=n,o=r),l=s,i=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return c(e,r,n)},a=o,"function"==typeof l&&"function"!=typeof i?(a=i,i=l):u=l,d=ld(u),p=a?-1:1,(function e(t,n,r){let o=t&&"object"==typeof t?t:{};if("string"==typeof o.type){let e="string"==typeof o.tagName?o.tagName:"string"==typeof o.name?o.name:void 0;Object.defineProperty(s,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return s;function s(){var o;let s,c,u,f=lh;if((!l||d(t,n,r[r.length-1]||void 0))&&!1===(f=Array.isArray(o=i(t,r))?o:"number"==typeof o?[!0,o]:null==o?lh:[o])[0])return f;if("children"in t&&t.children&&t.children&&"skip"!==f[0])for(c=(a?t.children.length:-1)+p,u=r.concat(t);c>-1&&c<t.children.length;){if(!1===(s=e(t.children[c],c,u)())[0])return s;c="number"==typeof s[1]?s[1]:c+p}return f}})(e,void 0,[])()}function lx(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),i=l[0];i&&"text"===i.type?i.value="["+i.value:l.unshift({type:"text",value:"["});let a=l[l.length-1];return a&&"text"===a.type?a.value+=r:l.push({type:"text",value:r}),l}function lg(e){let t=e.spread;return null==t?e.children.length>1:t}function ly(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let lv={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),i=ls(l.toLowerCase()),a=e.footnoteOrder.indexOf(l),o=e.footnoteCounts.get(l);void 0===o?(o=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=a+1,o+=1,e.footnoteCounts.set(l,o);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lx(e,t);let l={src:ls(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:ls(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lx(e,t);let l={href:ls(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:ls(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=lg(n[r])}return t}(n):lg(t),i={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(l||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(l||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=nM(t.children[1]),a=nS(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),l.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length,o=-1,s=[];for(;++o<a;){let n=t.children[o],r={},a=i?i[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:l,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,i=[];for(;r;)i.push(ly(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return i.push(ly(t.slice(l),l>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:lb,yaml:lb,definition:lb,footnoteDefinition:lb};function lb(){}let lk={}.hasOwnProperty,lw={};function lj(e,t){e.position&&(t.position=function(e){let t=nM(e),n=nS(e);if(t&&n)return{start:t,end:n}}(e))}function lN(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,lo(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function lC(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function lS(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function lM(e,t){let n,r,l,i,a=(n=t||lw,r=new Map,l=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=i.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=lS(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=lS(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:lN,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...lv,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(lk.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=lo(n);return r.children=i.all(e),r}return lo(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(lk.call(n,"hProperties")||lk.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:lj,wrap:lC},lm(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i),o=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lc,r=e.options.footnoteBackLabel||lu,l=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],s=-1;for(;++s<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[s]);if(!l)continue;let i=e.all(l),a=String(l.identifier).toUpperCase(),c=ls(a.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){let e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else i.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(l,h),o.push(h)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...lo(a),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&(tG("children"in c),c.children.push({type:"text",value:"\n"},s)),c}function lE(e,t){return e&&"run"in e?async function(n,r){let l=lM(n,{file:r,...t});await e.run(l,r)}:function(n,r){return lM(n,{file:r,...e||t})}}function lP(e){if(e)throw e}var lI=e.i(75609);function lT(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let lR=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');lz(e);let r=0,l=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(l=i):(o=-1,l=a));return r===l?l=a:l<0&&(l=e.length),e.slice(r,l)},lD=function(e){let t;if(lz(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},lA=function(e){let t;lz(e);let n=e.length,r=-1,l=0,i=-1,a=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1)}return i<0||r<0||0===a||1===a&&i===r-1&&i===l+1?"":e.slice(i,r)},lL=function(...e){var t;let n,r,l,i=-1;for(;++i<e.length;)lz(e[i]),e[i]&&(l=void 0===l?e[i]:l+"/"+e[i]);return void 0===l?".":(lz(t=l),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,l="",i=0,a=-1,o=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(l.length<2||2!==i||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),a=s,o=0;continue}}else if(l.length>0){l="",i=0,a=s,o=0;continue}}t&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(a+1,s):l=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&o>-1?o++:o=-1}return l}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function lz(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function lO(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let lF=["history","path","basename","stem","extname","dirname"];class l_{constructor(e){let t,n;t=e?lO(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<lF.length;){const e=lF[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)lF.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?lR(this.path):void 0}set basename(e){lH(e,"basename"),lB(e,"basename"),this.path=lL(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?lD(this.path):void 0}set dirname(e){lU(this.basename,"dirname"),this.path=lL(e||"",this.basename)}get extname(){return"string"==typeof this.path?lA(this.path):void 0}set extname(e){if(lB(e,"extname"),lU(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=lL(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){lO(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!lO(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),lH(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?lR(this.path,this.extname):void 0}set stem(e){lH(e,"stem"),lB(e,"stem"),this.path=lL(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new nD(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function lB(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function lH(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function lU(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let lq=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},l$={}.hasOwnProperty;class lV extends lq{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function l(i,...a){let o=e[++n],s=-1;if(i)return void r(i);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,o?(function(e,t){let n;return function(...t){let i,a=e.length>t.length;a&&t.push(r);try{i=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(i&&i.then&&"function"==typeof i.then?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(o,l)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new lV,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,lI.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(lQ("data",this.frozen),this.namespace[e]=t,this):l$.call(this.namespace,e)&&this.namespace[e]||void 0:e?(lQ("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=lY(e),n=this.parser||this.Parser;return lW("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),lW("process",this.parser||this.Parser),lG("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let i=lY(e),a=n.parse(i);function o(e,n){e||!n?l(e):r?r(n):(tG(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){var l,i;if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof(l=a)||(i=l)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),lW("processSync",this.parser||this.Parser),lG("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,lP(e),t=r}),lJ("processSync","process",n),tG(t,"we either bailed on an error or have a tree"),t}run(e,t,n){lX(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,i){tG("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=lY(t);r.run(e,a,function(t,r,a){let o=r||e;t?i(t):l?l(o):(tG(n,"`done` is defined if `resolve` is not"),n(void 0,o,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){lP(e),n=t,r=!0}),lJ("runSync","run",r),tG(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=lY(t),r=this.compiler||this.Compiler;return lG("stringify",r),lX(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(lQ("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=(0,lI.default)(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else l(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,a=n[l][1];lT(a)&&lT(r)&&(r=(0,lI.default)(!0,a,r)),n[l]=[e,r,...i]}}}}let lK=new lV().freeze();function lW(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function lG(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function lQ(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lX(e){if(!lT(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function lJ(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function lY(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new l_(e)}let lZ=[],l0={allowDangerousHtml:!0},l1=/^(https?|ircs?|mailto|xmpp)$/i,l2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function l5(e){var n;let r,l,i,a,o,s=(r=(n=e).rehypePlugins||lZ,l=n.remarkPlugins||lZ,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...l0}:l0,lK().use(r7).use(l).use(lE,i).use(r)),c=(a=e.children||"",o=new l_,"string"==typeof a?o.value=a:tQ("Unexpected value `"+a+"` for `children` prop, expected `string`"),o);return function(e,n){let r=n.allowedElements,l=n.allowElement,i=n.components,a=n.disallowedElements,o=n.skipHtml,s=n.unwrapDisallowed,c=n.urlTransform||l3;for(let e of l2)Object.hasOwn(n,e.from)&&tQ("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&tQ("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),lm(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return o?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in nW)if(Object.hasOwn(nW,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=nW[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&l&&"number"==typeof t&&(i=!l(e,t,n)),i&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,l,i;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,a=function(e,t,l,i){let a=Array.isArray(l.children),o=nM(e);return r(t,l,i,a,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");l=t.jsx,i=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?i:l;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?nN:nj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=nB(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(c),c),e)}function l3(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||l1.test(e.slice(0,t))?e:""}let l4=(0,tB.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),l6=(0,tB.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),l9={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:n})=>n?(0,t.jsx)("code",{className:`${n} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:n})=>(0,t.jsx)("a",{href:n,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function l8({decision:e,index:r}){let[l,i]=(0,n.useState)(!1),a=(0,k.useSoundAction)("expand"),o=(0,k.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:r+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(tF.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(l5,{components:l9,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{l?o.play():a.play(),i(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(tN.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${l?"rotate-90":""}`}),(0,t.jsx)(l6,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),l?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function l7({data:e}){let{summary:n,decisions:r}=e;return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),n?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:n}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(l4,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),r.map((e,n)=>(0,t.jsx)(l8,{decision:e,index:n},e.title))]})}let ie=(0,tB.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);function it({item:e,index:n}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:n+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(tF.Badge,{className:"px-1.5 py-0 text-[10px]",children:"AI Recommended"}):null]})]})]})})})}function ir({data:e}){let{questions:n}=e;return 0===n.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ie,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),n.map((e,n)=>(0,t.jsx)(it,{item:e,index:n},e.question))]})}let il=(0,tB.default)("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"}]]),ii=(0,tB.default)("file-diff",[["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:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),ia=(0,tB.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var io=e.i(49228);let is=(0,tB.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var ic=e.i(35e3),iu=e.i(30090),iu=iu,id=e.i(17406);function ip({status:e}){switch(e){case id.CiStatus.Success:return(0,t.jsxs)(tF.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(ic.CheckCircle2,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case id.CiStatus.Pending:return(0,t.jsxs)(tF.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(i.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case id.CiStatus.Failure:return(0,t.jsxs)(tF.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(iu.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}var ih=e.i(70471);let im=(0,tB.default)("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"}]]),ix=(0,tB.default)("file-minus",[["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"}]]),ig=(0,tB.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),iy={added:{icon:im,label:"A",className:"text-green-600"},modified:{icon:ig,label:"M",className:"text-amber-600"},deleted:{icon:ix,label:"D",className:"text-red-600"},renamed:{icon:ig,label:"R",className:"text-blue-600"}};function iv({status:e}){let n=iy[e],r=n.icon;return(0,t.jsx)(r,{className:(0,tS.cn)("h-3.5 w-3.5 shrink-0",n.className)})}function ib({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,tS.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,tS.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pr-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function ik({file:e}){let[r,l]=(0,n.useState)(!1),i=e.path.split("/").pop()??e.path,a=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(!r),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-left",children:[(0,t.jsx)(tN.ChevronRight,{className:(0,tS.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",r&&"rotate-90")}),(0,t.jsx)(iv,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[a,"/"]}),i]}):i}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),r&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(ib,{hunk:e},e.header))}):null]})}function iw({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(ih.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(ik,{file:e},e.path))})]})}function ij({data:e,onApprove:n,onReject:r,isProcessing:l=!1,isRejecting:i=!1,chatInput:a,onChatInputChange:o}){let{pr:s,diffSummary:c,fileDiffs:u,branch:d,warning:f}=e;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),d?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(io.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(tF.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:d.source}),(0,t.jsx)(is,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(tF.Badge,{variant:"outline",className:"font-mono text-[11px]",children:d.target})]})}):null,s?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",s.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(tF.Badge,{variant:"outline",className:"text-xs",children:s.status})]}),s.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(ip,{status:s.ciStatus})]}):null,s.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ia,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:s.commitHash.slice(0,7)})]})]}):null]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(ii,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",c.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",c.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):f?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(il,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:f})]})}):null,u&&u.length>0?(0,t.jsx)(iw,{fileDiffs:u}):null]}),(0,t.jsx)(tK,{onReject:r,onApprove:n,approveLabel:"Approve Merge",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:l,isRejecting:i,chatInput:a,onChatInputChange:o})]})}var iN=e.i(53360),iC=e.i(2287),iS=e.i(28267),iM=e.i(80436);let iE=(0,tB.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),iP=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function iI(e){let t=e.lastIndexOf(".");return t>=0&&iP.has(e.slice(t).toLowerCase())}function iT(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",n=iI(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",r=new URLSearchParams({path:e,...n&&{mimeType:n}});return`/api/attachments/preview?${r.toString()}`}let iR=/(?:^|\s)@(\/[^\s]+)/g;function iD({text:e,attachmentPaths:n}){let r=function(e){let t=[],n=0;for(let r of e.matchAll(iR)){let l=r.index,i=l+(r[0].length-r[0].trimStart().length);i>n&&t.push({type:"text",value:e.slice(n,i)}),t.push({type:"attachment",path:r[1]}),n=l+r[0].length}return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}(e),l=r.some(e=>"attachment"===e.type),i=n?.filter(Boolean)??[];return l||0!==i.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[r.map(e=>{if("text"===e.type){let n=e.value.trim();return n?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:n},`text-${n.slice(0,40)}`):null}return(0,t.jsx)(iA,{path:e.path},`att-${e.path}`)}),i.map(e=>(0,t.jsx)(iA,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function iA({path:e}){let r=e.split("/").pop()??e,[l,i]=(0,n.useState)(!1);return iI(e)?l?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(iE,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:r})]}):(0,t.jsxs)(iC.Dialog,{children:[(0,t.jsx)(iC.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:iT(e),alt:r,"data-testid":"inline-attachment-image",onError:()=>i(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(iC.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(iS.VisuallyHidden.Root,{children:(0,t.jsxs)(iC.DialogTitle,{children:["Preview: ",r]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:iT(e),alt:r,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:r})}),(0,t.jsx)("a",{href:iT(e),download:r,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${r}`,children:(0,t.jsx)(iM.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:iT(e),download:r,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:r})}var iL=e.i(25235);let iz=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),iO=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function iF({className:e,size:n="md",duration:r=5,...l}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,tS.cn)(iz({size:n}),e),...l,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),iO.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}e.i(47506);var i_=e.i(2929),iB=e.i(86782);function iH({data:e}){let n="maintain"===e.lifecycle;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:i_.lifecycleDisplayLabels[e.lifecycle]}),(0,t.jsx)(iU,{data:e}),!n&&e.progress>0?(0,t.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{children:"Progress"}),(0,t.jsxs)("span",{children:[e.progress,"%"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,tS.cn)("h-full rounded-full transition-all",i_.featureNodeStateConfig[e.state].progressClass),style:{width:`${e.progress}%`}})})]}):null,n&&e.pr?(0,t.jsx)(iV,{pr:e.pr}):null]}),(0,t.jsx)(iq,{data:e}),!n&&e.pr?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iL.Separator,{}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)(iV,{pr:e.pr})})]}):null,(0,t.jsx)(iK,{data:e})]})}function iU({data:e}){let n=i_.featureNodeStateConfig[e.state],r=n.icon;return(0,t.jsxs)("div",{className:(0,tS.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",n.badgeBgClass,n.badgeClass),children:["running"===e.state?(0,t.jsx)(iF,{size:"sm",className:"shrink-0"}):(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n.label})]})}function iq({data:e}){var n;let r,l,i,a,o;return e.branch||e.oneLiner||e.summary||e.userQuery||e.createdAt?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iL.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[e.branch?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,t.jsx)(io.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:e.branch}),e.baseBranch?(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",e.baseBranch]}):null]})]}):null,e.oneLiner?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.oneLiner})]}):null,e.userQuery?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,t.jsx)(iD,{text:e.userQuery})]}):null,e.summary?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e.summary})]}):null,e.createdAt?(0,t.jsx)(iG,{label:"Created",value:(n=e.createdAt,r=Date.now(),(o=Math.floor((a=Math.floor((i=Math.floor(Math.floor((r-(l="string"==typeof n?new Date(n).getTime():n))/1e3)/60))/60))/24))>30?new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):o>0?`${o} day${1===o?"":"s"} ago`:a>0?`${a} hour${1===a?"":"s"} ago`:i>0?`${i} minute${1===i?"":"s"} ago`:"just now")}):null]})]}):null}let i$={[id.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[id.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[id.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function iV({pr:e}){return(0,t.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",e.number,(0,t.jsx)(p.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(tF.Badge,{className:i$[e.status],children:e.status})]}),e.ciStatus?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(ip,{status:e.ciStatus})]}):null,e.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(ia,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e.commitHash.slice(0,7)})]})]}):null]})})}function iK({data:e}){return e.fastMode??e.agentType??e.runtime??e.blockedBy??e.errorMessage?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iL.Separator,{}),(0,t.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[e.fastMode?(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(iN.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,e.agentType?(0,t.jsx)(iW,{agentType:e.agentType}):null,e.runtime?(0,t.jsx)(iG,{label:"Runtime",value:e.runtime}):null,e.blockedBy?(0,t.jsx)(iG,{label:"Blocked by",value:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(iG,{label:"Error",value:e.errorMessage}):null]})]}):null}function iW({agentType:e}){let n=(0,iB.getAgentTypeIcon)(e),r=iB.agentTypeLabels[e]??e;return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),r]})]})}function iG({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-sm",children:n})]})}var iQ=e.i(14748),iQ=iQ;let iX=(0,tB.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function iJ(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let n=Math.floor(t/3600),r=Math.floor(t%3600/60),l=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${l}s`:`${l}s`}let iY={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",merge:"Merging"},iZ={"run:started":{label:"started",colorClass:"text-blue-600"},"run:resumed":{label:"resumed",colorClass:"text-blue-600"},"run:completed":{label:"completed",colorClass:"text-emerald-600"},"run:failed":{label:"failed",colorClass:"text-red-600"},"run:stopped":{label:"stopped",colorClass:"text-amber-600"},"run:crashed":{label:"crashed",colorClass:"text-red-600"},"run:rejected":{label:"rejected",colorClass:"text-orange-600"}};function i0(e){return e.startsWith("run:")}function i1({timings:e,loading:n,error:r,rejectionFeedback:l}){if(n)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(r)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(iQ.default,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:r})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(iX,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No activity recorded yet"})]});let a=e.filter(e=>!i0(e.phase)),o=Math.max(...a.map(e=>e.durationMs??0),...a.map(e=>e.approvalWaitMs??0),0),s=function(e,t){if(!e.length)return[];let n=e.filter(e=>"run:rejected"===e.phase).length,r=t?.length??0,l=e;if(r>n){l=[...e];let i=e[e.length-1].agentRunId;for(let e=n;e<r;e++){let r=t[e];e>n&&l.push({agentRunId:i,phase:"run:resumed",startedAt:r.timestamp??`synthetic-resumed-${e}`}),l.push({agentRunId:i,phase:"run:rejected",startedAt:r.timestamp??`synthetic-${e}`})}}let i=[],a=[],o=0;for(let e of l)if(a.push(e),"run:rejected"===e.phase){let e=t?.[o];i.push({number:i.length+1,timings:a,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),a=[],o++}return a.length>0&&i.push({number:i.length+1,timings:a}),i}(e,l),c=s.length>1,u=a.reduce((e,t)=>e+(t.durationMs??0),0),d=a.reduce((e,t)=>e+(t.approvalWaitMs??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:s.map(e=>(0,t.jsx)(i2,{iteration:e,showHeader:c,maxDurationMs:o},e.number))}),u>0?(0,t.jsx)(i6,{totalExecMs:u,totalWaitMs:d}):null]})}function i2({iteration:e,showHeader:n,maxDurationMs:r}){return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"flex flex-col gap-1.5",children:[n?(0,t.jsxs)("div",{className:"text-muted-foreground text-xs font-medium",children:["Iteration ",e.number]}):null,e.timings.map(n=>{if(i0(n.phase)){let r="run:rejected"===n.phase;return(0,t.jsx)(i5,{timing:n,message:r?e.rejectionMessage:void 0,attachments:r?e.rejectionAttachments:void 0},`${n.agentRunId}-${n.phase}-${n.startedAt}`)}return(0,t.jsx)(i3,{timing:n,maxDurationMs:r},`${n.agentRunId}-${n.phase}-${n.startedAt}`)})]})}function i5({timing:e,message:n,attachments:r}){let l=iZ[e.phase];if(!l)return null;let i=r&&r.length>0;return(0,t.jsxs)("div",{className:`text-xs ${l.colorClass}`,children:[(0,t.jsx)("span",{children:l.label}),n?(0,t.jsxs)("span",{"data-testid":"rejection-feedback-text",className:"text-muted-foreground ml-2 font-normal italic",children:["— ",n]}):null,i?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"mt-1.5 ml-2",children:(0,t.jsx)(iD,{text:"",attachmentPaths:r})}):null]})}function i3({timing:e,maxDurationMs:n}){let r=e.phase.includes(":")?`rev ${e.phase.split(":")[1]}`:iY[e.phase]??e.phase,l=e.durationMs??0,i=n>0?Math.max(2,l/n*100):2,a=e.completedAt?"bg-emerald-500":"bg-blue-500";return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-24 shrink-0 text-xs",children:r}),(0,t.jsx)("div",{className:"bg-muted h-3 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:`h-full rounded-full ${a}`,style:{width:`${Math.min(i,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs",children:iJ(l)})]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(i4,{timing:e,maxDurationMs:n}):null]})}function i4({timing:e,maxDurationMs:n}){let r=e.approvalWaitMs??0,l=n>0?Math.max(2,r/n*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"flex items-center gap-3 pl-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-20 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-2.5 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(l,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs",children:iJ(r)})]})}function i6({totalExecMs:e,totalWaitMs:n}){return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border flex flex-col gap-1.5 border-t pt-3",children:[(0,t.jsx)(i9,{label:"Total execution",value:iJ(e)}),n>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i9,{label:"Total wait",value:iJ(n)}),(0,t.jsx)(i9,{label:"Total wall-clock",value:iJ(e+n)})]}):null]})}function i9({label:e,value:n}){return(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:e}),(0,t.jsx)("span",{className:"text-xs font-medium",children:n})]})}var iQ=iQ;let i8=(0,tB.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function i7({content:e,isConnected:r,error:l}){let i=(0,n.useRef)(null),[a,o]=(0,n.useState)(!0),s=(0,n.useCallback)(()=>{let e=i.current;e&&o(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),c=(0,n.useCallback)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight,o(!0))},[]);return((0,n.useEffect)(()=>{a&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,a]),l)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(iQ.default,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:l})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:r?"Live":"Disconnected"}),a?null:(0,t.jsxs)("button",{type:"button",onClick:c,className:"text-muted-foreground hover:text-foreground ml-auto flex items-center gap-1 text-xs",children:[(0,t.jsx)(i8,{className:"h-3 w-3"}),"Jump to bottom"]})]}),(0,t.jsx)("div",{ref:i,onScroll:s,className:"flex-1 overflow-y-auto bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300",children:e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(R.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No log output yet"}),r?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}var iQ=iQ;let ae=(0,tB.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var at=e.i(87889);let an=(0,tB.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),ar={Todo:{icon:tC.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:i.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:u.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:at.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},al={icon:tC.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function ai({tasks:e}){return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tasks defined yet"})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(aa,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,n)=>(0,t.jsx)(as,{task:e,index:n},e.title||`task-${n}`))})]})}function aa({tasks:e}){let r=(0,n.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,n=e.filter(e=>"Work in Progress"===e.state).length,r=e.filter(e=>"Review"===e.state).length,l=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,i=e.length,a=i>0?Math.round(t/i*100):0;return{done:t,wip:n,review:r,todo:l,total:i,percent:a}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[r.done," of ",r.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${r.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r.done>0?(0,t.jsx)(ao,{icon:u.Check,label:"Done",count:r.done,className:"text-emerald-600"}):null,r.wip>0?(0,t.jsx)(ao,{icon:i.Loader2,label:"In Progress",count:r.wip,className:"text-blue-600"}):null,r.review>0?(0,t.jsx)(ao,{icon:at.Eye,label:"Review",count:r.review,className:"text-amber-600"}):null,r.todo>0?(0,t.jsx)(ao,{icon:tC.Circle,label:"Todo",count:r.todo,className:"text-muted-foreground"}):null]})]})}function ao({icon:e,label:n,count:r,className:l}){return(0,t.jsxs)("span",{className:(0,tS.cn)("flex items-center gap-1 text-xs",l),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),r," ",n]})}function as({task:e,index:r}){let[l,i]=(0,n.useState)(!1),a=ar[e.state]??al,o=a.icon,s=e.actionItems.length>0,c=(0,n.useCallback)(()=>{s&&i(e=>!e)},[s]);return(0,t.jsxs)("div",{"data-testid":`task-card-${r}`,className:(0,tS.cn)("rounded-lg border",a.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:c,disabled:!s,className:(0,tS.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-left",s&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(o,{className:(0,tS.cn)("mt-0.5 h-4 w-4 shrink-0",a.colorClass,a.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,tS.cn)("text-sm font-medium",a.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),s?(0,t.jsx)(tN.ChevronRight,{className:(0,tS.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",l&&"rotate-90")}):null]}),l&&s?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,n)=>(0,t.jsx)(ac,{item:e},e.name||`ai-${n}`))})}):null]})}function ac({item:e}){let n=e.acceptanceCriteria.length,r=e.acceptanceCriteria.filter(e=>e.verified).length,l=n>0&&r===n;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[l?(0,t.jsx)(ic.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(an,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),n>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[r,"/",n]}):null]}),n>0?(0,t.jsx)("div",{className:"ml-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,n)=>(0,t.jsx)(au,{criterion:e},e.description||`ac-${n}`))}):null]})}function au({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(u.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(tC.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,tS.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let ad={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function ap({plan:e,loading:n,error:r}){return n?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):r?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(iQ.default,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:r})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(tF.Badge,{className:ad[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(ai,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(ae,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}function af(){return{data:null,loading:!1,error:null}}let ah=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"}],am=new Set(["implementation","review","deploy","maintain"]),ax={activity:async function(e){let t=await tL(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await tz(e);if("error"in t)throw Error(t.error);return t.plan}};function ag({featureNode:e,featureId:l,initialTab:a,urlTab:o,prdData:s,prdSelections:c,onPrdSelect:u,onPrdApprove:d,onPrdReject:p,isPrdLoading:f,techData:h,onTechApprove:m,onTechReject:x,isTechLoading:g,productData:y,mergeData:v,onMergeApprove:b,onMergeReject:k,isMergeLoading:w,isRejecting:j,chatInput:N,onChatInputChange:C}){let S=(0,r.usePathname)(),M=function(e){let[t,r]=(0,n.useState)(""),[l,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(null),s=(0,n.useRef)(null),c=(0,n.useCallback)(()=>{s.current&&(s.current.close(),s.current=null),i(!1)},[]);return(0,n.useEffect)(()=>{if(!e){r(""),i(!1),o(null);return}r(""),o(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return s.current=t,t.onopen=()=>{i(!0)},t.addEventListener("initial",e=>{r(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);r(e=>e+t.content)}),t.addEventListener("error",e=>{o(JSON.parse(e.data).error)}),t.onerror=()=>{i(!1)},()=>{t.close(),s.current=null}},[e,c]),{content:t,isConnected:l,error:a}}(l),E=(0,n.useMemo)(()=>{let t;return t=["overview","activity","log"],am.has(e.lifecycle)&&("implementation"!==e.lifecycle||"action-required"!==e.state)&&t.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&t.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&t.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&t.push("merge-review"),t},[e]),P=(0,n.useMemo)(()=>ah.filter(e=>E.includes(e.key)),[E]),I=(0,n.useMemo)(()=>{let e=S.match(/^(\/feature\/[^/]+)/);return e?e[1]:S},[S]),T=(0,n.useMemo)(()=>o&&E.includes(o)?o:a&&E.includes(a)?a:"overview",[]),[R,D]=(0,n.useState)(T),{tabs:A,fetchTab:L,refreshTab:z}=function(e,t){let r=Object.keys(t),[l,i]=(0,n.useState)(()=>{let e={};for(let t of r)e[t]=af();return e}),a=(0,n.useRef)(t);a.current=t;let o=(0,n.useRef)(e);o.current=e;let s=(0,n.useRef)(!0);(0,n.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let c=(0,n.useRef)(e);(0,n.useEffect)(()=>{c.current!==e&&(c.current=e,i(e=>{let t={};for(let n of Object.keys(e))t[n]=af();return t}))},[e]);let u=(0,n.useCallback)(async e=>{let t=a.current[e],n=o.current;if(t){s.current&&i(t=>({...t,[e]:{...t[e],loading:!0,error:null}}));try{let r=await t(n);s.current&&i(t=>({...t,[e]:{data:r,loading:!1,error:null}}))}catch(t){if(s.current){let n=t instanceof Error?t.message:"Failed to fetch tab data";i(t=>({...t,[e]:{data:null,loading:!1,error:n}}))}}}},[]),d=(0,n.useCallback)(async e=>{let t=l[e];t&&null!==t.data||t&&t.loading||await u(e)},[l,u]);return{tabs:l,fetchTab:d,refreshTab:(0,n.useCallback)(async e=>{await u(e)},[u])}}(l,ax),O=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!O.current)return;O.current=!1;let e="overview"===R?I:`${I}/${R}`;e!==S&&window.history.pushState(null,"",e)},[R,I,S]);let F=(0,n.useRef)(S);(0,n.useEffect)(()=>{if(F.current===S||(F.current=S,O.current))return;let e=S.split("/"),t=e.length>=4?e[3]:void 0,n=t&&E.includes(t)?t:"overview";n!==R&&(D(n),("activity"===n||"plan"===n)&&L(n))},[S]);let _=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!_.current&&(_.current=!0,!o&&"overview"!==T)){let e=`${I}/${T}`;e!==S&&window.history.replaceState(null,"",e)}},[]);let B=(0,n.useRef)(!1);(0,n.useEffect)(()=>{B.current||(B.current=!0,("activity"===R||"plan"===R)&&L(R))},[R,L]);let H=(0,n.useRef)(l);(0,n.useEffect)(()=>{H.current!==l&&(H.current=l,D("overview"))},[l]);let U=(0,n.useRef)(a);(0,n.useEffect)(()=>{if(U.current!==a&&a&&E.includes(a)){U.current=a,D(a);let e="overview"===a?I:`${I}/${a}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[a,E,I]),(0,n.useEffect)(()=>{E.includes(R)||(D("overview"),window.location.pathname!==I&&window.history.replaceState(null,"",I))},[E,R,I]);let q=(0,n.useRef)(e),$=(0,n.useRef)(R);$.current=R,(0,n.useEffect)(()=>{if(q.current!==e){q.current=e;let t=$.current;("activity"===t||"plan"===t)&&z(t)}},[e,z]);let V=(0,n.useCallback)(e=>{O.current=!0,D(e),("activity"===e||"plan"===e)&&L(e)},[L]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)(tA.Tabs,{value:R,onValueChange:V,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"shrink-0 overflow-x-auto px-4 pt-4",children:(0,t.jsx)(tA.TabsList,{className:"flex w-full",children:P.map(e=>(0,t.jsx)(tA.TabsTrigger,{value:e.key,className:"flex-1",children:e.label},e.key))})}),(0,t.jsx)(tA.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(iH,{data:e})}),(0,t.jsx)(tA.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(i1,{timings:A.activity.data?.timings??null,loading:A.activity.loading,error:A.activity.error,rejectionFeedback:A.activity.data?.rejectionFeedback})}),(0,t.jsx)(tA.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(i7,{content:M.content,isConnected:M.isConnected,error:M.error})}),(0,t.jsx)(tA.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(ap,{plan:A.plan.data,loading:A.plan.loading,error:A.plan.error})}),E.includes("prd-review")?(0,t.jsx)(tA.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:s?(0,t.jsx)(tW,{data:s,selections:c??{},onSelect:u??(()=>void 0),onApprove:d??(()=>void 0),onReject:p,isProcessing:f,isRejecting:j,chatInput:N,onChatInputChange:C}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,E.includes("tech-decisions")?(0,t.jsx)(tA.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:h?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(l7,{data:h})}),(0,t.jsx)(ay,{onApprove:m??(()=>void 0),onReject:x,isProcessing:g,isRejecting:j,chatInput:N,onChatInputChange:C})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,E.includes("product-decisions")?(0,t.jsx)(tA.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===y?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):y?(0,t.jsx)(ir,{data:y}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,E.includes("merge-review")?(0,t.jsx)(tA.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:v?(0,t.jsx)(ij,{data:v,onApprove:b??(()=>void 0),onReject:k,isProcessing:w,isRejecting:j,chatInput:N,onChatInputChange:C}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null]})})}function ay({onApprove:e,onReject:n,isProcessing:r,isRejecting:l,chatInput:i,onChatInputChange:a}){return(0,t.jsx)(tK,{onReject:n,onApprove:e,approveLabel:"Approve Plan",revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:r,isRejecting:l,chatInput:i,onChatInputChange:a})}var av=e.i(79304),ab=e.i(34553),ak=e.i(89078),aw=e.i(99045);function aj(e,t,r,i,a){let[o,s]=(0,n.useState)(!1),c=(0,n.useRef)(r),u=(0,n.useRef)(i);return c.current=r,u.current=i,(0,n.useEffect)(()=>{if(u.current(),!e)return;let n=!1;return s(!0),t(e).then(e=>{n||c.current(e)}).catch(()=>{!n&&a&&l.toast.error(a)}).finally(()=>{n||s(!1)}),()=>{n=!0}},[e,t,a]),o}function aN({view:e,urlTab:f}){let R,D=(0,b.useFeatureFlags)(),A=(0,r.useRouter)(),L=(0,k.useSoundAction)("delete"),z=(0,k.useSoundAction)("reject"),[O,F]=(0,n.useState)(e);(0,n.useEffect)(()=>{F(e)},[e]);let _="feature"===O.type?O.node:null,{events:B}=(0,N.useAgentEventsContext)(),H=(0,n.useRef)(0);(0,n.useEffect)(()=>{if(H.current>B.length&&(H.current=0),!_||B.length<=H.current)return;let e=B.slice(H.current);for(let t of(H.current=B.length,(0,aw.resolveSseEventUpdates)(e)))t.featureId===_.featureId&&(!q.current||ew.current||ep.current||A.refresh(),(void 0!==t.state||void 0!==t.lifecycle)&&F(e=>{if("feature"!==e.type)return e;let n={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:n,initialTab:"requirements"===n.lifecycle&&"action-required"===n.state?"prd-review":"implementation"===n.lifecycle&&"action-required"===n.state?"tech-decisions":"review"===n.lifecycle&&("action-required"===n.state||"error"===n.state)?"merge-review":"overview"}}))},[B,_,A]);let U=(0,r.usePathname)().startsWith("/feature/"),q=(0,n.useRef)(U),$=(0,n.useRef)(U);(0,n.useEffect)(()=>{U&&!$.current&&A.refresh(),$.current=U},[U,A]),q.current=U;let V=(0,n.useCallback)(()=>{A.push("/")},[A]),[K,W]=(0,n.useState)(""),[G,Q]=(0,n.useState)(null),[X,J]=(0,n.useState)({}),[Y,Z]=(0,n.useState)({}),[ee,et]=(0,n.useState)(null),[en,er]=(0,n.useState)(void 0),[el,ei]=(0,n.useState)(null),[ea,eo]=(0,n.useState)(!1),[es,ec]=(0,n.useState)(!1),[eu,ed]=(0,n.useState)(!1),ep=(0,n.useRef)(!1),ef="feature"===O.type?O.initialTab:void 0;(0,n.useEffect)(()=>{W("")},[ef]);let eh=aj(_?.lifecycle==="requirements"&&_?.state==="action-required"?_.featureId:null,x,e=>{if(e.error)return void l.toast.error(e.error);if(e.questionnaire){Q(e.questionnaire);let t={};for(let n of e.questionnaire.questions){let e=n.options.find(e=>e.recommended);e&&(t[n.id]=e.id)}J(t),Z(t)}},()=>{J({}),Z({}),Q(null)},"Failed to load questionnaire"),em=_?.lifecycle==="implementation"&&_?.state==="action-required"?_.featureId:null,ex=aj(em,g,e=>{e.error?l.toast.error(e.error):e.techDecisions&&et(e.techDecisions)},()=>et(null),"Failed to load tech decisions"),eg=aj(em,x,e=>{e.productDecisions&&er(e.productDecisions)},()=>er(void 0)),ey=aj(_?.lifecycle==="review"&&(_?.state==="action-required"||_?.state==="error")?_.featureId:null,y,e=>{"error"in e?l.toast.error(e.error):ei(e)},()=>ei(null),"Failed to load merge review data"),ev=K.trim().length>0,eb=_?.lifecycle==="requirements"&&_?.state==="action-required"&&Object.keys(Y).some(e=>Y[e]!==X[e]),ek=ev||eb,ew=(0,n.useRef)(ek);ew.current=ek;let ej=(0,n.useCallback)(()=>{W(""),J({...Y})},[Y]),{attemptClose:eN}=(0,w.useGuardedDrawerClose)({open:U,isDirty:ek,onClose:V,onReset:ej}),eC=(0,n.useCallback)(async(e,t,n=[],r)=>{if(_?.featureId){ep.current=!0,ed(!0);try{let i=n.map(e=>e.path).filter(Boolean),a=await m(_.featureId,e,i);if(!a.rejected)return void l.toast.error(a.error??`Failed to reject ${t.toLowerCase()}`);z.play(),W(""),l.toast.success(`${t} rejected — agent re-iterating (iteration ${a.iteration})`),a.iterationWarning&&l.toast.warning(`Iteration ${a.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),V(),r?.()}finally{ep.current=!1,ed(!1)}}},[_,V,z]),eS=(0,n.useCallback)((e,t)=>eC(e,"Requirements",t,()=>J({})),[eC]),eM=(0,n.useCallback)((e,t)=>eC(e,"Plan",t),[eC]),eE=(0,n.useCallback)((e,t)=>eC(e,"Merge",t),[eC]),eP=(0,n.useCallback)(async e=>{if(!_?.featureId)return;let t=await h(_.featureId);t.approved?(W(""),l.toast.success(`${e} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:_.featureId}})),V()):l.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[_,V]),eI=(0,n.useCallback)(async e=>{let t;if("feature"!==O.type||!_)return;if(G){let e=[];for(let[t,n]of Object.entries(X)){let r=G.questions.find(e=>e.id===t),l=r?.options.find(e=>e.id===n);r&&l&&e.push({questionId:r.question,selectedOption:l.label})}t={approved:!0,changedSelections:e}}let n=await h(_.featureId,t);n.approved?(W(""),l.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:_.featureId}})),J({}),V()):l.toast.error(n.error??"Failed to approve requirements")},[O,_,G,X,V]),eT=(0,n.useCallback)(()=>eP("Plan"),[eP]),eR=(0,n.useCallback)(()=>eP("Merge"),[eP]),eD=(0,n.useCallback)(async(e,t)=>{eo(!0);try{let n=await (0,v.deleteFeature)(e,t);if(n.error)return void l.toast.error(n.error);L.play(),l.toast.success("Feature deleted successfully"),A.push("/"),A.refresh()}catch{l.toast.error("Failed to delete feature")}finally{eo(!1)}},[A,L]),eA=_?.repositoryPath&&_?.branch?{repositoryPath:_.repositoryPath,branch:_.branch,specPath:_.specPath}:null,eL=function(e){let[t,r]=(0,n.useState)(!1),[l,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(null),[p,f]=(0,n.useState)(null),h=(0,n.useRef)(null),m=(0,n.useRef)(null),x=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=[h,m,x];return()=>{for(let t of e)t.current&&clearTimeout(t.current)}},[]);let g=(0,n.useCallback)(async(t,n,r,l,i)=>{if(e&&!i){l.current&&clearTimeout(l.current),n(!0),r(null);try{let n=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!n.success){let e=n.error??"An unexpected error occurred";r(e),l.current=setTimeout(()=>r(null),5e3)}}catch(e){r(e instanceof Error?e.message:"An unexpected error occurred"),l.current=setTimeout(()=>r(null),5e3)}finally{n(!1)}}},[e]);return{openInIde:(0,n.useCallback)(()=>g(av.openIde,r,c,h,t),[g,t]),openInShell:(0,n.useCallback)(()=>g(ab.openShell,i,d,m,l),[g,l]),openSpecsFolder:(0,n.useCallback)(async()=>{if(e?.specPath&&!a){x.current&&clearTimeout(x.current),o(!0),f(null);try{let t=await (0,ak.openFolder)(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";f(e),x.current=setTimeout(()=>f(null),5e3)}}catch(e){f(e instanceof Error?e.message:"An unexpected error occurred"),x.current=setTimeout(()=>f(null),5e3)}finally{o(!1)}}},[e,a]),ideLoading:t,shellLoading:l,specsLoading:a,ideError:s,shellError:u,specsError:p}}(eA),ez=_?.repositoryPath&&_.branch?{targetId:_.featureId,targetType:"feature",repositoryPath:_.repositoryPath,branch:_.branch}:null,eO=(0,j.useDeployAction)(ez),eF="Booting"===eO.status||"Ready"===eO.status,[e_,eB]=(0,n.useState)(!1),eH=(0,n.useCallback)(()=>{_?.featureId&&(navigator.clipboard.writeText(_.featureId),eB(!0),setTimeout(()=>eB(!1),2e3))},[_?.featureId]);if(_){let e=_.featureId.slice(0,8),n=_.repositoryName??_.repositoryPath.split("/").filter(Boolean).at(-1)??"";R=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"feature-drawer-header",children:[(0,t.jsx)(M.DrawerTitle,{children:_.name}),n?(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[(0,t.jsx)(d.Code2,{className:"text-muted-foreground size-3.5 shrink-0"}),_.remoteUrl?(0,t.jsxs)("a",{href:_.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors","data-testid":"feature-drawer-repo-link",children:[n,(0,t.jsx)(p.ExternalLink,{className:"size-3"})]}):(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]}):null,(0,t.jsx)(M.DrawerDescription,{className:"sr-only",children:_.name})]}),eA?(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-2","data-testid":"feature-drawer-actions",children:[(0,t.jsx)(tD,{actions:eL,repositoryPath:eA.repositoryPath,showSpecs:!!eA.specPath}),D.envDeploy&&ez?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.TooltipProvider,{children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(T.ActionButton,{label:eF?"Stop Dev Server":"Start Dev Server",onClick:eF?eO.stop:eO.deploy,loading:eO.deployLoading||eO.stopLoading,error:!!eO.deployError,icon:eF?s.Square:o.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(P.TooltipContent,{children:eF?"Stop Dev Server":"Start Dev Server"})]})}),eF?(0,t.jsx)(S.DeploymentStatusBadge,{status:eO.status,url:eO.url,targetId:ez?.targetId}):null]}):null,(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:e}),(0,t.jsx)("button",{type:"button",onClick:eH,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors","aria-label":"Copy feature ID","data-testid":"feature-drawer-copy-id",children:e_?(0,t.jsx)(u.Check,{className:"size-3.5 text-green-600"}):(0,t.jsx)(c.Copy,{className:"size-3.5"})})]}),_.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.Button,{variant:"ghost",size:"icon-sm","aria-label":"Delete feature",disabled:ea,className:"text-muted-foreground hover:text-destructive","data-testid":"feature-drawer-delete",onClick:()=>ec(!0),children:ea?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(a.Trash2,{className:"size-4"})}),(0,t.jsx)(I.DeleteFeatureDialog,{open:es,onOpenChange:ec,onConfirm:e=>eD(_.featureId,e),isDeleting:ea,featureName:_.name,featureId:_.featureId})]}):null]}):null]})}let eU=null;return"feature"===O.type&&_&&(eU=(0,t.jsx)(ag,{featureNode:_,featureId:_.featureId,initialTab:O.initialTab,urlTab:f,prdData:G,prdSelections:X,onPrdSelect:(e,t)=>J(n=>({...n,[e]:t})),onPrdApprove:eI,onPrdReject:eS,isPrdLoading:eh,techData:ee,onTechApprove:eT,onTechReject:eM,isTechLoading:ex,productData:eg?null:en,mergeData:el,onMergeApprove:eR,onMergeReject:eE,isMergeLoading:ey,isRejecting:eu,chatInput:K,onChatInputChange:W})),(0,t.jsx)(C.BaseDrawer,{open:U,onClose:eN,size:"md",modal:!1,header:R,"data-testid":"feature"===O.type?"feature-drawer":"repository-drawer",children:eU})}e.s(["FeatureDrawerClient",()=>aN],36986)}]);