@shepai/cli 1.110.2 → 1.110.3

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 (125) hide show
  1. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +1 -1
  2. package/dist/tsconfig.build.tsbuildinfo +1 -1
  3. package/package.json +1 -1
  4. package/web/.next/BUILD_ID +1 -1
  5. package/web/.next/build-manifest.json +2 -2
  6. package/web/.next/fallback-build-manifest.json +2 -2
  7. package/web/.next/prerender-manifest.json +3 -3
  8. package/web/.next/required-server-files.js +2 -2
  9. package/web/.next/required-server-files.json +2 -2
  10. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
  11. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  12. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  13. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
  14. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  15. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  16. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
  17. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  18. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  20. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  21. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
  23. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  24. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  25. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
  26. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
  29. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
  32. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  35. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/_global-error.html +2 -2
  38. package/web/.next/server/app/_global-error.rsc +1 -1
  39. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  40. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  41. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  42. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  43. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  44. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  45. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
  47. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  48. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  50. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  51. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  52. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  53. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  54. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  56. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  57. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  58. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
  59. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
  60. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
  61. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
  62. package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +1 -1
  63. package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +1 -1
  64. package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js +1 -1
  65. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
  66. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
  67. package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
  68. package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +1 -1
  69. package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +1 -1
  70. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
  71. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
  72. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
  73. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
  74. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  75. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  76. package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +1 -1
  77. package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +1 -1
  78. package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +1 -1
  79. package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +1 -1
  80. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
  81. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
  82. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  83. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  84. package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
  85. package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
  86. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  87. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  88. package/web/.next/server/chunks/ssr/{_c3e94166._.js → _f1813cc9._.js} +2 -2
  89. package/web/.next/server/chunks/ssr/{_c3e94166._.js.map → _f1813cc9._.js.map} +1 -1
  90. package/web/.next/server/chunks/ssr/{_36e6c63e._.js → _f72a8e94._.js} +2 -2
  91. package/web/.next/server/chunks/ssr/{_36e6c63e._.js.map → _f72a8e94._.js.map} +1 -1
  92. package/web/.next/server/chunks/ssr/{_d30d1666._.js → _fa9391f6._.js} +2 -2
  93. package/web/.next/server/chunks/ssr/{_d30d1666._.js.map → _fa9391f6._.js.map} +1 -1
  94. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  95. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  96. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
  97. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
  98. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  99. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  100. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  101. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  102. package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
  103. package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
  104. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  105. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  106. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  107. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  108. package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
  109. package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js.map +1 -1
  110. package/web/.next/server/pages/500.html +2 -2
  111. package/web/.next/server/server-reference-manifest.js +1 -1
  112. package/web/.next/server/server-reference-manifest.json +31 -31
  113. package/web/.next/static/chunks/{aea99c2ead055dd7.js → 99d95e27c983676b.js} +1 -1
  114. package/web/.next/static/chunks/{510b0e18fd6a6bb1.js → a632082ec74e9e77.js} +1 -1
  115. package/web/.next/static/chunks/{6326ac057b3cf1ec.js → abfde6b6c1311e66.js} +1 -1
  116. package/web/.next/static/chunks/{4c9d5c620e73a238.js → be653215ca39b03f.js} +1 -1
  117. package/web/.next/static/chunks/{93e7d25e3f7691d6.js → c04028882e64cde5.js} +1 -1
  118. package/web/.next/static/chunks/{dcd1f42edffddd69.js → c85b04913dbfc155.js} +2 -2
  119. package/web/.next/static/chunks/{14341a985824ea0e.js → dcd5768d0ac43c93.js} +1 -1
  120. package/web/.next/static/chunks/{2bee1b4e1ac5f8fe.js → e2c9d2a3a2fbcb1b.js} +1 -1
  121. package/web/.next/static/chunks/{ed1a1346ef1548a5.js → e3dfbca6b2344ef2.js} +2 -2
  122. package/web/.next/static/chunks/{0a0240036fd5c60f.js → e4b0b67a6c65e1b8.js} +1 -1
  123. /package/web/.next/static/{tEzQMnQ_hniXYIiigpsSj → p3M6fkb_G1jIRm7aHekMe}/_buildManifest.js +0 -0
  124. /package/web/.next/static/{tEzQMnQ_hniXYIiigpsSj → p3M6fkb_G1jIRm7aHekMe}/_clientMiddlewareManifest.json +0 -0
  125. /package/web/.next/static/{tEzQMnQ_hniXYIiigpsSj → p3M6fkb_G1jIRm7aHekMe}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));c.displayName=i.Root.displayName,e.s(["Label",()=>c],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},61569,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>t])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[c,d]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",h=(0,o.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=d(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(h,{ref:a,children:o})});f.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),c=(0,s.useComposedRefs)(r,l),u=d(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:c,children:n})});return g.displayName=m,[{Provider:u,Slot:f,ItemSlot:g},function(r){let s=d(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=c(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=c(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<d;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},66702,81967,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("0084d7129453f0a3005d5d0c0f120c0a36cc9baee6",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],66702);let s=(0,t.createServerReference)("602c06f2c7167bb0881aa7800f0f4ce121535e5cc8",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],81967)},26370,e=>{"use strict";let t=(0,e.i(3645).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",()=>t],26370)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,i.createContextScope)(d),[h,f]=u(d),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:f,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,R]=r.useState(null),C=(0,o.useComposedRefs)(i,e=>R(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(h,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":f,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:C,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:f,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=f(v,s);return(0,t.jsx)(c.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...c},d)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,d),h=(0,a.usePrevious)(i),f=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[h,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:p,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[d.createPopperScope]),b=(0,d.createPopperScope)(),[w,R]=y(g),C=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[h,f]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:o})})};C.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=R(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=R(A,i),l=b(i),c=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:c,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,O]=y(S,{forceMount:void 0}),T=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=R(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};T.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=O(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=R(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(q,{...i,ref:r})})});E.displayName=z;var F=(0,f.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=R(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),c=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,s)=>{let o=R(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(I,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...v}=e,x=R(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=R(L,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(d.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>C,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>T,"PopoverTrigger",()=>N,"Portal",()=>T,"Root",()=>C,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let G=U.Root,V=U.Trigger;U.Anchor;let X=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.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 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>X,"PopoverTrigger",()=>V],90382)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(23925),o=e.i(11345),i=e.i(76016),n=e.i(66702),a=e.i(81967),l=e.i(86782),c=e.i(29847),d=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:f,disabled:m,className:v,mode:x}){let[g,y]=r.useState(!1),[k,b]=r.useState([]),[w,R]=r.useState(!0),[C,j]=r.useState(e),[P,A]=r.useState(h),[N,S]=r.useState(null),[M,O]=r.useState(0),[T,z]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(b).finally(()=>R(!1))},[]),r.useEffect(()=>{if(!g){let e=setTimeout(()=>{O(0),z(null)},150);return()=>clearTimeout(e)}},[g]);let E=async(e,t)=>{if(y(!1),e!==C||t!==P){if("override"===x){j(e),A(t),f?.(e,t);return}j(e),A(t),f?.(e,t),S(null);try{let r=await (0,a.updateAgentAndModel)(e,t||null);r.ok||(j(C),A(P),f?.(C,P),S(r.error??"Failed to save"))}catch{j(C),A(P),f?.(C,P),S("Failed to save")}}},F=(0,l.getAgentTypeIcon)(C),D=k.find(e=>e.agentType===C)?.label??C,q=P?(0,c.getModelMeta)(P).displayName||P:null,I=T?k.find(e=>e.agentType===T):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",v),children:[(0,t.jsxs)(u.Popover,{open:g,onOpenChange:y,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",role:"combobox","aria-expanded":g,disabled:(m??!1)||w,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),w?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:q})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===M?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=C===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>O(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(i.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{O(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),I.label]}),I.models.map(e=>{let r=C===I.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(I.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!N&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:N})]})}e.s(["AgentModelPicker",()=>h])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));c.displayName=i.Root.displayName,e.s(["Label",()=>c],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},61569,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>t])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[c,d]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",h=(0,o.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=d(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(h,{ref:a,children:o})});f.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),c=(0,s.useComposedRefs)(r,l),u=d(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:c,children:n})});return g.displayName=m,[{Provider:u,Slot:f,ItemSlot:g},function(r){let s=d(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=c(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function c(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,o=this.has(t),i=this.#e.length,n=c(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<d;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>n])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},80407,20417,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("0020086594da53928abe0c61e6aef5d49b957c99d3",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],80407);let s=(0,t.createServerReference)("60f555a9d1c85251117d96fad0d90f857c12692f49",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],20417)},26370,e=>{"use strict";let t=(0,e.i(3645).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",()=>t],26370)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,i.createContextScope)(d),[h,f]=u(d),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:f,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,R]=r.useState(null),C=(0,o.useComposedRefs)(i,e=>R(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(h,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":f,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:C,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:f,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=f(v,s);return(0,t.jsx)(c.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...c},d)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,d),h=(0,a.usePrevious)(i),f=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[h,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:p,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[d.createPopperScope]),b=(0,d.createPopperScope)(),[w,R]=y(g),C=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[h,f]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:o})})};C.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=R(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=R(A,i),l=b(i),c=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:c,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,O]=y(S,{forceMount:void 0}),T=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=R(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};T.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=O(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=R(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(q,{...i,ref:r})})});E.displayName=z;var F=(0,f.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=R(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),c=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,s)=>{let o=R(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(I,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...v}=e,x=R(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=R(L,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(d.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>C,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>T,"PopoverTrigger",()=>N,"Portal",()=>T,"Root",()=>C,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let G=U.Root,V=U.Trigger;U.Anchor;let X=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.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 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>X,"PopoverTrigger",()=>V],90382)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(23925),o=e.i(11345),i=e.i(76016),n=e.i(80407),a=e.i(20417),l=e.i(86782),c=e.i(29847),d=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:f,disabled:m,className:v,mode:x}){let[g,y]=r.useState(!1),[k,b]=r.useState([]),[w,R]=r.useState(!0),[C,j]=r.useState(e),[P,A]=r.useState(h),[N,S]=r.useState(null),[M,O]=r.useState(0),[T,z]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(b).finally(()=>R(!1))},[]),r.useEffect(()=>{if(!g){let e=setTimeout(()=>{O(0),z(null)},150);return()=>clearTimeout(e)}},[g]);let E=async(e,t)=>{if(y(!1),e!==C||t!==P){if("override"===x){j(e),A(t),f?.(e,t);return}j(e),A(t),f?.(e,t),S(null);try{let r=await (0,a.updateAgentAndModel)(e,t||null);r.ok||(j(C),A(P),f?.(C,P),S(r.error??"Failed to save"))}catch{j(C),A(P),f?.(C,P),S("Failed to save")}}},F=(0,l.getAgentTypeIcon)(C),D=k.find(e=>e.agentType===C)?.label??C,q=P?(0,c.getModelMeta)(P).displayName||P:null,I=T?k.find(e=>e.agentType===T):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",v),children:[(0,t.jsxs)(u.Popover,{open:g,onOpenChange:y,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",role:"combobox","aria-expanded":g,disabled:(m??!1)||w,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),w?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:q})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===M?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=C===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>O(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(i.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{O(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),I.label]}),I.models.map(e=>{let r=C===I.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(I.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!N&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:N})]})}e.s(["AgentModelPicker",()=>h])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),a=e.i(87889),o=e.i(3645);let l=(0,o.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var r=e.i(23925),i=e.i(26370),s=e.i(38573),d=e.i(49228);let c=(0,o.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,o.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),p=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),h=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var m=e.i(61569),m=m,f=e.i(3214),g=e.i(30702);let x=(0,o.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var v=e.i(60112),w=e.i(31777),b=e.i(41957),y=e.i(98127),j=e.i(35364),C=e.i(51911),k=e.i(2828),S=e.i(26036),N=e.i(27069),I=e.i(91967),E=e.i(87342),P=e.i(5978),M=e.i(22528),T=e.i(66033),A=e.i(53532),R=e.i(41687),D=e.i(56720),L=e.i(13123),F=e.i(52740),H=e.i(39979),B=e.i(87620),V=e.i(86874),_=e.i(29297),O=e.i(36589),W=e.i(5192),z=e.i(23405),U=e.i(1693),K=e.i(73772),G=e.i(13044),q=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[Q,X,$]=(0,E.createCollection)(Z),[J,ee]=(0,M.createContextScope)(Z,[$,F.createPopperScope]),et=(0,F.createPopperScope)(),[en,ea]=J(Z),[eo,el]=J(Z),er=e=>{let{__scopeSelect:a,children:o,open:l,defaultOpen:r,onOpenChange:i,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:f,form:g}=e,x=et(a),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,C]=n.useState(!1),k=(0,T.useDirection)(u),[S,N]=(0,O.useControllableState)({prop:l,defaultProp:r??!1,onChange:i,caller:Z}),[I,E]=(0,O.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),P=n.useRef(null),M=!v||g||!!v.closest("form"),[A,R]=n.useState(new Set),D=Array.from(A).map(e=>e.props.value).join(";");return(0,t.jsx)(F.Root,{...x,children:(0,t.jsxs)(en,{required:f,scope:a,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:(0,L.useId)(),value:I,onValueChange:E,open:S,onOpenChange:N,dir:k,triggerPointerDownPosRef:P,disabled:m,children:[(0,t.jsx)(Q.Provider,{scope:a,children:(0,t.jsx)(eo,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:o})}),M?(0,t.jsxs)(eq,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:h,value:I,onChange:e=>E(e.target.value),disabled:m,form:g,children:[void 0===I?(0,t.jsx)("option",{value:""}):null,Array.from(A)]},D):null]})})};er.displayName=Z;var ei="SelectTrigger",es=n.forwardRef((e,a)=>{let{__scopeSelect:o,disabled:l=!1,...r}=e,i=et(o),s=ea(ei,o),d=s.disabled||l,c=(0,P.useComposedRefs)(a,s.onTriggerChange),u=X(o),p=n.useRef("touch"),[h,m,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),a=eQ(t,e,n);void 0!==a&&s.onValueChange(a.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(F.Anchor,{asChild:!0,...i,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...r,ref:c,onClick:(0,I.composeEventHandlers)(r.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(r.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&q.includes(e.key)&&(g(),e.preventDefault())})})})});es.displayName=ei;var ed="SelectValue",ec=n.forwardRef((e,n)=>{let{__scopeSelect:a,className:o,style:l,children:r,placeholder:i="",...s}=e,d=ea(ed,a),{onValueNodeHasChildrenChange:c}=d,u=void 0!==r,p=(0,P.useComposedRefs)(n,d.onValueNodeChange);return(0,W.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:i}):r})});ec.displayName=ed;var eu=n.forwardRef((e,n)=>{let{__scopeSelect:a,children:o,...l}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})});eu.displayName="SelectIcon";var ep=e=>(0,t.jsx)(H.Portal,{asChild:!0,...e});ep.displayName="SelectPortal";var eh="SelectContent",em=n.forwardRef((e,a)=>{let o=ea(eh,e.__scopeSelect),[l,r]=n.useState();return((0,W.useLayoutEffect)(()=>{r(new DocumentFragment)},[]),o.open)?(0,t.jsx)(ev,{...e,ref:a}):l?S.createPortal((0,t.jsx)(ef,{scope:e.__scopeSelect,children:(0,t.jsx)(Q.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});em.displayName=eh;var[ef,eg]=J(eh),ex=(0,V.createSlot)("SelectContent.RemoveScroll"),ev=n.forwardRef((e,a)=>{let{__scopeSelect:o,position:l="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(eh,o),[y,j]=n.useState(null),[C,k]=n.useState(null),S=(0,P.useComposedRefs)(a,e=>j(e)),[N,E]=n.useState(null),[M,T]=n.useState(null),L=X(o),[F,H]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(y)return(0,K.hideOthers)(y)},[y]),(0,R.useFocusGuards)();let V=n.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[a]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&C&&(C.scrollTop=0),n===a&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==o))return},[L,C]),_=n.useCallback(()=>V([N,y]),[V,N,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:O,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||O(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,O,W]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[z,U]=eZ(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),a=eQ(t,e,n);a&&setTimeout(()=>a.ref.current.focus())}),q=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&(E(e),a&&(B.current=!0))},[b.value]),Y=n.useCallback(()=>y?.focus(),[y]),Z=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&T(e)},[b.value]),Q="popper"===l?eb:ew,$=Q===eb?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(ef,{scope:o,content:y,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:N,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:_,selectedItemText:M,position:l,isPositioned:F,searchRef:z,children:(0,t.jsx)(G.RemoveScroll,{as:ex,allowPinchZoom:!0,children:(0,t.jsx)(D.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,I.composeEventHandlers)(r,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...$,onPlaced:()=>H(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,I.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,a=t.indexOf(n);t=t.slice(a+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});ev.displayName="SelectContentImpl";var ew=n.forwardRef((e,a)=>{let{__scopeSelect:o,onPlaced:l,...r}=e,i=ea(eh,o),s=eg(eh,o),[d,c]=n.useState(null),[u,p]=n.useState(null),h=(0,P.useComposedRefs)(a,e=>p(e)),m=X(o),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(i.trigger&&i.valueNode&&d&&u&&x&&v&&w){let e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),a=w.getBoundingClientRect();if("rtl"!==i.dir){let o=a.left-t.left,l=n.left-o,r=e.left-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.left=u+"px"}else{let o=t.right-a.right,l=window.innerWidth-n.right-o,r=window.innerWidth-e.right-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.right=u+"px"}let o=m(),r=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+h+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),C=parseInt(j.paddingTop,10),k=parseInt(j.paddingBottom,10),S=e.top+e.height/2-10,I=v.offsetHeight/2,E=p+h+(v.offsetTop+I);if(E<=S){let e=o.length>0&&v===o[o.length-1].ref.current;d.style.bottom="0px";let t=Math.max(r-S,I+(e?k:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=E+t+"px"}else{let e=o.length>0&&v===o[0].ref.current;d.style.top="0px";let t=Math.max(S,p+x.offsetTop+(e?C:0)+I);d.style.height=t+(b-E)+"px",x.scrollTop=E-S+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=r+"px",l?.(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,d,u,x,v,w,i.dir,l]);(0,W.useLayoutEffect)(()=>y(),[y]);let[j,C]=n.useState();(0,W.useLayoutEffect)(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);let k=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ey,{scope:o,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:k,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ew.displayName="SelectItemAlignedPosition";var eb=n.forwardRef((e,n)=>{let{__scopeSelect:a,align:o="start",collisionPadding:l=10,...r}=e,i=et(a);return(0,t.jsx)(F.Content,{...i,...r,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eb.displayName="SelectPopperPosition";var[ey,ej]=J(eh,{}),eC="SelectViewport",ek=n.forwardRef((e,a)=>{let{__scopeSelect:o,nonce:l,...r}=e,i=eg(eC,o),s=ej(eC,o),d=(0,P.useComposedRefs)(a,i.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(Q.Slot,{scope:o,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:(0,I.composeEventHandlers)(r.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:a}=s;if(a?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let a=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<a){let l=o+e,r=Math.min(a,l),i=l-r;n.style.height=r+"px","0px"===n.style.bottom&&(t.scrollTop=i>0?i:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ek.displayName=eC;var eS="SelectGroup",[eN,eI]=J(eS),eE=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=(0,L.useId)();return(0,t.jsx)(eN,{scope:a,id:l,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":l,...o,ref:n})})});eE.displayName=eS;var eP="SelectLabel",eM=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=eI(eP,a);return(0,t.jsx)(B.Primitive.div,{id:l.id,...o,ref:n})});eM.displayName=eP;var eT="SelectItem",[eA,eR]=J(eT),eD=n.forwardRef((e,a)=>{let{__scopeSelect:o,value:l,disabled:r=!1,textValue:i,...s}=e,d=ea(eT,o),c=eg(eT,o),u=d.value===l,[p,h]=n.useState(i??""),[m,f]=n.useState(!1),g=(0,P.useComposedRefs)(a,e=>c.itemRefCallback?.(e,l,r)),x=(0,L.useId)(),v=n.useRef("touch"),w=()=>{r||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:o,value:l,disabled:r,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(Q.ItemSlot,{scope:o,value:l,disabled:r,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:g,onFocus:(0,I.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,I.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,I.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,I.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,I.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,I.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,r?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,I.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,I.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eD.displayName=eT;var eL="SelectItemText",eF=n.forwardRef((e,a)=>{let{__scopeSelect:o,className:l,style:r,...i}=e,s=ea(eL,o),d=eg(eL,o),c=eR(eL,o),u=el(eL,o),[p,h]=n.useState(null),m=(0,P.useComposedRefs)(a,e=>h(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,W.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?S.createPortal(i.children,s.valueNode):null]})});eF.displayName=eL;var eH="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return eR(eH,a).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...o,ref:n}):null});eB.displayName=eH;var eV="SelectScrollUpButton",e_=n.forwardRef((e,a)=>{let o=eg(eV,e.__scopeSelect),l=ej(eV,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,P.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){i(t.scrollTop>0)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});e_.displayName=eV;var eO="SelectScrollDownButton",eW=n.forwardRef((e,a)=>{let o=eg(eO,e.__scopeSelect),l=ej(eO,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,P.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eW.displayName=eO;var ez=n.forwardRef((e,a)=>{let{__scopeSelect:o,onAutoScroll:l,...r}=e,i=eg("SelectScrollButton",o),s=n.useRef(null),d=X(o),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,W.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...r,ref:a,style:{flexShrink:0,...r.style},onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(l,50))}),onPointerMove:(0,I.composeEventHandlers)(r.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(l,50))}),onPointerLeave:(0,I.composeEventHandlers)(r.onPointerLeave,()=>{c()})})}),eU=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:n})});eU.displayName="SelectSeparator";var eK="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=et(a),r=ea(eK,a),i=eg(eK,a);return r.open&&"popper"===i.position?(0,t.jsx)(F.Arrow,{...l,...o,ref:n}):null});eG.displayName=eK;var eq=n.forwardRef(({__scopeSelect:e,value:a,...o},l)=>{let r=n.useRef(null),i=(0,P.useComposedRefs)(l,r),s=(0,z.usePrevious)(a);return n.useEffect(()=>{let e=r.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==a&&t){let n=new Event("change",{bubbles:!0});t.call(e,a),e.dispatchEvent(n)}},[s,a]),(0,t.jsx)(B.Primitive.select,{...o,style:{...U.VISUALLY_HIDDEN_STYLES,...o.style},ref:i,defaultValue:a})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,_.useCallbackRef)(e),a=n.useRef(""),o=n.useRef(0),l=n.useCallback(e=>{let n=a.current+e;t(n),function e(t){a.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),r=n.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,l,r]}function eQ(e,t,n){var a,o;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1,i=(a=e,o=Math.max(r,0),a.map((e,t)=>a[(o+t)%a.length]));1===l.length&&(i=i.filter(e=>e!==n));let s=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==n?s:void 0}eq.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>em,"Group",()=>eE,"Icon",()=>eu,"Item",()=>eD,"ItemIndicator",()=>eB,"ItemText",()=>eF,"Label",()=>eM,"Portal",()=>ep,"Root",()=>er,"ScrollDownButton",()=>eW,"ScrollUpButton",()=>e_,"Select",()=>er,"SelectArrow",()=>eG,"SelectContent",()=>em,"SelectGroup",()=>eE,"SelectIcon",()=>eu,"SelectItem",()=>eD,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eF,"SelectLabel",()=>eM,"SelectPortal",()=>ep,"SelectScrollDownButton",()=>eW,"SelectScrollUpButton",()=>e_,"SelectSeparator",()=>eU,"SelectTrigger",()=>es,"SelectValue",()=>ec,"SelectViewport",()=>ek,"Separator",()=>eU,"Trigger",()=>es,"Value",()=>ec,"Viewport",()=>ek,"createSelectScope",()=>ee],83830);var eX=e.i(83830),eX=eX,e$=e.i(99105);let eJ=(0,o.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e0=eX.Root;eX.Group;let e1=eX.Value,e2=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Trigger,{ref:o,className:(0,w.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[n,(0,t.jsx)(eX.Icon,{asChild:!0,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e2.displayName=eX.Trigger.displayName;let e4=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollUpButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ,{className:"h-4 w-4"})}));e4.displayName=eX.ScrollUpButton.displayName;let e3=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollDownButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4"})}));e3.displayName=eX.ScrollDownButton.displayName;let e5=n.forwardRef(({className:e,children:n,position:a="popper",...o},l)=>(0,t.jsx)(eX.Portal,{children:(0,t.jsxs)(eX.Content,{ref:l,className:(0,w.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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...o,children:[(0,t.jsx)(e4,{}),(0,t.jsx)(eX.Viewport,{className:(0,w.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e3,{})]})}));e5.displayName=eX.Content.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Label,{ref:a,className:(0,w.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eX.Label.displayName;let e8=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Item,{ref:o,className:(0,w.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eX.ItemIndicator,{children:(0,t.jsx)(r.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eX.ItemText,{children:n})]}));e8.displayName=eX.Item.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Separator,{ref:a,className:(0,w.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eX.Separator.displayName;var e6=e.i(21023);let e9=(0,e6.createServerReference)("4091d206bc8e297449d714da14b2f8f48f4d6bef10",e6.callServer,void 0,e6.findSourceMapURL,"updateSettingsAction");var e7=e.i(17406),te=e.i(98804),tt=e.i(93752),tt=tt,tn=e.i(83902);function ta(e){return(0,t.jsx)(tt.default,{className:(0,w.cn)("h-4 w-4",e.className),...e})}function to({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(te.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tr({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ti({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ts({className:e,...n}){return(0,t.jsx)(tn.Rocket,{className:(0,w.cn)("h-4 w-4",e),...n})}to.displayName="VsCodeIcon",tl.displayName="CursorEditorIcon",tr.displayName="WindsurfIcon",ti.displayName="ZedIcon",ts.displayName="AntigravityIcon";let td={vscode:to,cursor:tl,windsurf:tr,zed:ti,antigravity:ts};var tc=e.i(41413);let tu=[{value:e7.AgentAuthMethod.Session,label:"Session"},{value:e7.AgentAuthMethod.Token,label:"Token"}],tp=[{value:e7.EditorType.VsCode,label:"VS Code"},{value:e7.EditorType.Cursor,label:"Cursor"},{value:e7.EditorType.Windsurf,label:"Windsurf"},{value:e7.EditorType.Zed,label:"Zed"},{value:e7.EditorType.Antigravity,label:"Antigravity"}],th=[{id:"agent",label:"Agent",icon:i.Bot},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:h}];function tm({label:e,description:n,htmlFor:a,children:o}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(b.Label,{htmlFor:a,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}function tf({label:e,description:n,id:a,testId:o,checked:l,onChange:r,disabled:i}){return(0,t.jsx)(tm,{label:e,description:n,htmlFor:a,children:(0,t.jsx)(C.Switch,{id:a,"data-testid":o,checked:l,onCheckedChange:r,disabled:i,className:(0,w.cn)("cursor-pointer",i&&"cursor-not-allowed opacity-50")})})}function tg({icon:e,title:n,description:a,badge:o,testId:l,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":l,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),o?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:o}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:a})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function tx({id:e,testId:n,value:a,onChange:o,onBlur:l,placeholder:r,min:i=1,max:s,step:d=1,suffix:c}){let u=""===a?void 0:parseInt(a,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{o(String(Math.max(i,(u??parseInt(r,10))-d)))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(m.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:a,placeholder:r,onChange:e=>{o(e.target.value.replace(/[^0-9]/g,""))},onBlur:l,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(r,10),o(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function tv({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function tw({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function tb({settings:e,shepHome:o,dbFileSize:m}){let{showSaving:f,showSaved:g,save:b}=function(){let[e,t]=(0,n.useTransition)(),[a,o]=(0,n.useState)(!1),[l,r]=(0,n.useState)(!1),i=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!a&&(o(!0),s.current=!1,i.current=setTimeout(()=>{i.current=null,s.current&&(o(!1),r(!0),setTimeout(()=>r(!1),2e3))},350)),!e&&a&&(s.current=!0,i.current||(o(!1),r(!0),setTimeout(()=>r(!1),2e3)))},[e,a]),{showSaving:a,showSaved:l,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e9(e);t.success||v.toast.error(t.error??"Failed to save settings")})},[t])}}(),C=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[S,N]=(0,n.useState)(e.agent.type),I=e.agent.authMethod,[E,P]=(0,n.useState)(e.agent.token??""),[M,T]=(0,n.useState)(!1),[A,R]=(0,n.useState)(e.environment.defaultEditor),D=e.environment.shellPreference,[L,F]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[H,B]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[V,_]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[O,W]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[z,U]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[K,G]=(0,n.useState)(e.workflow.enableEvidence),[q,Y]=(0,n.useState)(e.workflow.commitEvidence),[Z,Q]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[X,$]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[J,ee]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[et,en]=(0,n.useState)(e.notifications.inApp.enabled),[ea,eo]=(0,n.useState)(e.notifications.browser.enabled),[el,er]=(0,n.useState)(e.notifications.desktop.enabled),[ei,es]=(0,n.useState)({...e.notifications.events}),[ed,ec]=(0,n.useState)({...C}),eu=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",ep=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",eh=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"";function em(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function ef(e={}){let t=em(e.ciTimeout??X);return{workflow:{openPrOnImplementationComplete:e.openPr??L,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??H,allowPrd:e.allowPrd??V,allowPlan:e.allowPlan??O,allowMerge:e.allowMerge??z},enableEvidence:e.enableEvidence??K,commitEvidence:e.commitEvidence??q,ciMaxFixAttempts:em(e.ciMaxFix??Z),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:em(e.ciLogMax??J)}}}function eg(e={}){return{notifications:{inApp:{enabled:e.inApp??et},browser:{enabled:e.browser??ea},desktop:{enabled:e.desktop??el},events:e.events??ei}}}let[ex,ev]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=th.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&ev(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let ew=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,w.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",f?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,w.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",g&&!f?"opacity-100":"opacity-0"),children:[(0,t.jsx)(r.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:th.map(e=>{let n=e.icon,a=ex===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>ew(e.id),className:(0,w.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",a?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:i.Bot,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tm,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tc.AgentModelPicker,{initialAgentType:S,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tm,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(k.TooltipProvider,{children:(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e0,{value:I,disabled:!0,children:[(0,t.jsx)(e2,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e5,{children:tu.map(e=>(0,t.jsx)(e8,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(k.TooltipContent,{children:"Coming soon"})]})})}),I===e7.AgentAuthMethod.Token&&(0,t.jsx)(tm,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(y.Input,{id:"agent-token","data-testid":"agent-token-input",type:M?"text":"password",value:E,onChange:e=>P(e.target.value),onBlur:()=>{E!==(e.agent.token??"")&&b(function(e={}){let t={type:S,authMethod:I,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===e7.AgentAuthMethod.Token&&(n.token=e.token??E),{agent:n}}({token:E}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(j.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>T(!M),"data-testid":"toggle-token-visibility","aria-label":M?"Hide token":"Show token",children:M?(0,t.jsx)(l,{className:"h-3 w-3"}):(0,t.jsx)(a.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(tw,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(tg,{icon:s.Terminal,title:"Environment",description:"Editor and shell preferences",testId:"environment-settings-section",children:(0,t.jsx)(tm,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e0,{value:A,onValueChange:e=>{R(e),b({environment:{defaultEditor:e,shellPreference:D}})},children:[(0,t.jsx)(e2,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e5,{children:tp.map(e=>{var n;let a=(n=e.value)&&n in td?td[n]:ta;return(0,t.jsx)(e8,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})})}),(0,t.jsx)(tw,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor is used when opening files for review or editing during the development workflow."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(tv,{children:"Approve"}),(0,t.jsx)(tf,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:V,onChange:e=>{_(e),b(ef({allowPrd:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:O,onChange:e=>{W(e),b(ef({allowPlan:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:z,onChange:e=>{U(e),b(ef({allowMerge:e}))}}),(0,t.jsx)(tv,{children:"Evidence"}),(0,t.jsx)(tf,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:K,onChange:e=>{G(e),e?b(ef({enableEvidence:e})):(Y(!1),b(ef({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tf,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:q,disabled:!K||!L,onChange:e=>{Y(e),b(ef({commitEvidence:e}))}}),(0,t.jsx)(tv,{children:"Git"}),(0,t.jsx)(tf,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:H,onChange:e=>{B(e),b(ef({pushOnComplete:e}))}}),(0,t.jsx)(tf,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:L,onChange:e=>{F(e),e?b(ef({openPr:e})):(Y(!1),b(ef({openPr:e,commitEvidence:!1})))}})]}),(0,t.jsx)(tw,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tm,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tx,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:Z,onChange:Q,onBlur:()=>{Z!==eu&&b(ef({ciMaxFix:Z}))},min:1,max:10})}),(0,t.jsx)(tm,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tx,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:X,onChange:$,onBlur:()=>{X!==ep&&b(ef({ciTimeout:X}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tm,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tx,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:J,onChange:ee,onBlur:()=>{J!==eh&&b(ef({ciLogMax:J}))},min:1e3,step:5e3,suffix:"chars"})})]}),(0,t.jsx)(tw,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(tv,{children:"Channels"}),(0,t.jsx)(tf,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:et,onChange:e=>{en(e),b(eg({inApp:e}))}}),(0,t.jsx)(tf,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:ea,onChange:e=>{eo(e),b(eg({browser:e}))}}),(0,t.jsx)(tf,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:el,onChange:e=>{er(e),b(eg({desktop:e}))}}),(0,t.jsx)(tv,{children:"Agent Events"}),(0,t.jsx)(tf,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ei.agentStarted,onChange:e=>{let t={...ei,agentStarted:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ei.phaseCompleted,onChange:e=>{let t={...ei,phaseCompleted:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ei.waitingApproval,onChange:e=>{let t={...ei,waitingApproval:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ei.agentCompleted,onChange:e=>{let t={...ei,agentCompleted:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ei.agentFailed,onChange:e=>{let t={...ei,agentFailed:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tv,{children:"Pull Request Events"}),(0,t.jsx)(tf,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ei.prMerged,onChange:e=>{let t={...ei,prMerged:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ei.prClosed,onChange:e=>{let t={...ei,prClosed:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ei.prChecksPassed,onChange:e=>{let t={...ei,prChecksPassed:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ei.prChecksFailed,onChange:e=>{let t={...ei,prChecksFailed:e};es(t),b(eg({events:t}))}})]}),(0,t.jsx)(tw,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tf,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:ed.skills,onChange:e=>{let t={...ed,skills:e};ec(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ed.envDeploy,onChange:e=>{let t={...ed,envDeploy:e};ec(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:ed.debug,onChange:e=>{let t={...ed,debug:e};ec(t),b({featureFlags:t})}})]}),(0,t.jsx)(tw,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:h,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tm,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:o})}),(0,t.jsx)(tm,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:m})})]}),(0,t.jsx)(tw,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>tb],41952)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(20314),n=e.i(79054),a=e.i(87889),o=e.i(3645);let l=(0,o.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var r=e.i(23925),i=e.i(26370),s=e.i(38573),d=e.i(49228);let c=(0,o.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),u=(0,o.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),p=(0,o.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),h=(0,o.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var m=e.i(61569),m=m,f=e.i(3214),g=e.i(30702);let x=(0,o.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var v=e.i(60112),w=e.i(31777),b=e.i(41957),y=e.i(98127),j=e.i(35364),C=e.i(51911),k=e.i(2828),S=e.i(26036),N=e.i(27069),I=e.i(91967),E=e.i(87342),P=e.i(5978),M=e.i(22528),T=e.i(66033),A=e.i(53532),R=e.i(41687),D=e.i(56720),L=e.i(13123),F=e.i(52740),H=e.i(39979),B=e.i(87620),V=e.i(86874),_=e.i(29297),O=e.i(36589),W=e.i(5192),z=e.i(23405),U=e.i(1693),K=e.i(73772),G=e.i(13044),q=[" ","Enter","ArrowUp","ArrowDown"],Y=[" ","Enter"],Z="Select",[Q,X,$]=(0,E.createCollection)(Z),[J,ee]=(0,M.createContextScope)(Z,[$,F.createPopperScope]),et=(0,F.createPopperScope)(),[en,ea]=J(Z),[eo,el]=J(Z),er=e=>{let{__scopeSelect:a,children:o,open:l,defaultOpen:r,onOpenChange:i,value:s,defaultValue:d,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:f,form:g}=e,x=et(a),[v,w]=n.useState(null),[b,y]=n.useState(null),[j,C]=n.useState(!1),k=(0,T.useDirection)(u),[S,N]=(0,O.useControllableState)({prop:l,defaultProp:r??!1,onChange:i,caller:Z}),[I,E]=(0,O.useControllableState)({prop:s,defaultProp:d,onChange:c,caller:Z}),P=n.useRef(null),M=!v||g||!!v.closest("form"),[A,R]=n.useState(new Set),D=Array.from(A).map(e=>e.props.value).join(";");return(0,t.jsx)(F.Root,{...x,children:(0,t.jsxs)(en,{required:f,scope:a,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:(0,L.useId)(),value:I,onValueChange:E,open:S,onOpenChange:N,dir:k,triggerPointerDownPosRef:P,disabled:m,children:[(0,t.jsx)(Q.Provider,{scope:a,children:(0,t.jsx)(eo,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{R(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:o})}),M?(0,t.jsxs)(eq,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:h,value:I,onChange:e=>E(e.target.value),disabled:m,form:g,children:[void 0===I?(0,t.jsx)("option",{value:""}):null,Array.from(A)]},D):null]})})};er.displayName=Z;var ei="SelectTrigger",es=n.forwardRef((e,a)=>{let{__scopeSelect:o,disabled:l=!1,...r}=e,i=et(o),s=ea(ei,o),d=s.disabled||l,c=(0,P.useComposedRefs)(a,s.onTriggerChange),u=X(o),p=n.useRef("touch"),[h,m,f]=eZ(e=>{let t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),a=eQ(t,e,n);void 0!==a&&s.onValueChange(a.value)}),g=e=>{d||(s.onOpenChange(!0),f()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,t.jsx)(F.Anchor,{asChild:!0,...i,children:(0,t.jsx)(B.Primitive.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eY(s.value)?"":void 0,...r,ref:c,onClick:(0,I.composeEventHandlers)(r.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(r.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&q.includes(e.key)&&(g(),e.preventDefault())})})})});es.displayName=ei;var ed="SelectValue",ec=n.forwardRef((e,n)=>{let{__scopeSelect:a,className:o,style:l,children:r,placeholder:i="",...s}=e,d=ea(ed,a),{onValueNodeHasChildrenChange:c}=d,u=void 0!==r,p=(0,P.useComposedRefs)(n,d.onValueNodeChange);return(0,W.useLayoutEffect)(()=>{c(u)},[c,u]),(0,t.jsx)(B.Primitive.span,{...s,ref:p,style:{pointerEvents:"none"},children:eY(d.value)?(0,t.jsx)(t.Fragment,{children:i}):r})});ec.displayName=ed;var eu=n.forwardRef((e,n)=>{let{__scopeSelect:a,children:o,...l}=e;return(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})});eu.displayName="SelectIcon";var ep=e=>(0,t.jsx)(H.Portal,{asChild:!0,...e});ep.displayName="SelectPortal";var eh="SelectContent",em=n.forwardRef((e,a)=>{let o=ea(eh,e.__scopeSelect),[l,r]=n.useState();return((0,W.useLayoutEffect)(()=>{r(new DocumentFragment)},[]),o.open)?(0,t.jsx)(ev,{...e,ref:a}):l?S.createPortal((0,t.jsx)(ef,{scope:e.__scopeSelect,children:(0,t.jsx)(Q.Slot,{scope:e.__scopeSelect,children:(0,t.jsx)("div",{children:e.children})})}),l):null});em.displayName=eh;var[ef,eg]=J(eh),ex=(0,V.createSlot)("SelectContent.RemoveScroll"),ev=n.forwardRef((e,a)=>{let{__scopeSelect:o,position:l="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v,...w}=e,b=ea(eh,o),[y,j]=n.useState(null),[C,k]=n.useState(null),S=(0,P.useComposedRefs)(a,e=>j(e)),[N,E]=n.useState(null),[M,T]=n.useState(null),L=X(o),[F,H]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(y)return(0,K.hideOthers)(y)},[y]),(0,R.useFocusGuards)();let V=n.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[a]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&C&&(C.scrollTop=0),n===a&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==o))return},[L,C]),_=n.useCallback(()=>V([N,y]),[V,N,y]);n.useEffect(()=>{F&&_()},[F,_]);let{onOpenChange:O,triggerPointerDownPosRef:W}=b;n.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||O(!1),document.removeEventListener("pointermove",t),W.current=null};return null!==W.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[y,O,W]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[z,U]=eZ(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),a=eQ(t,e,n);a&&setTimeout(()=>a.ref.current.focus())}),q=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&(E(e),a&&(B.current=!0))},[b.value]),Y=n.useCallback(()=>y?.focus(),[y]),Z=n.useCallback((e,t,n)=>{let a=!B.current&&!n;(void 0!==b.value&&b.value===t||a)&&T(e)},[b.value]),Q="popper"===l?eb:ew,$=Q===eb?{side:d,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:f,sticky:g,hideWhenDetached:x,avoidCollisions:v}:{};return(0,t.jsx)(ef,{scope:o,content:y,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:N,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:_,selectedItemText:M,position:l,isPositioned:F,searchRef:z,children:(0,t.jsx)(G.RemoveScroll,{as:ex,allowPinchZoom:!0,children:(0,t.jsx)(D.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,I.composeEventHandlers)(r,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,t.jsx)(A.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,t.jsx)(Q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...w,...$,onPlaced:()=>H(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:(0,I.composeEventHandlers)(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,a=t.indexOf(n);t=t.slice(a+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});ev.displayName="SelectContentImpl";var ew=n.forwardRef((e,a)=>{let{__scopeSelect:o,onPlaced:l,...r}=e,i=ea(eh,o),s=eg(eh,o),[d,c]=n.useState(null),[u,p]=n.useState(null),h=(0,P.useComposedRefs)(a,e=>p(e)),m=X(o),f=n.useRef(!1),g=n.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=s,y=n.useCallback(()=>{if(i.trigger&&i.valueNode&&d&&u&&x&&v&&w){let e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),a=w.getBoundingClientRect();if("rtl"!==i.dir){let o=a.left-t.left,l=n.left-o,r=e.left-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.left=u+"px"}else{let o=t.right-a.right,l=window.innerWidth-n.right-o,r=window.innerWidth-e.right-l,i=e.width+r,s=Math.max(i,t.width),c=window.innerWidth-10,u=(0,N.clamp)(l,[10,Math.max(10,c-s)]);d.style.minWidth=i+"px",d.style.right=u+"px"}let o=m(),r=window.innerHeight-20,s=x.scrollHeight,c=window.getComputedStyle(u),p=parseInt(c.borderTopWidth,10),h=parseInt(c.paddingTop,10),g=parseInt(c.borderBottomWidth,10),b=p+h+s+parseInt(c.paddingBottom,10)+g,y=Math.min(5*v.offsetHeight,b),j=window.getComputedStyle(x),C=parseInt(j.paddingTop,10),k=parseInt(j.paddingBottom,10),S=e.top+e.height/2-10,I=v.offsetHeight/2,E=p+h+(v.offsetTop+I);if(E<=S){let e=o.length>0&&v===o[o.length-1].ref.current;d.style.bottom="0px";let t=Math.max(r-S,I+(e?k:0)+(u.clientHeight-x.offsetTop-x.offsetHeight)+g);d.style.height=E+t+"px"}else{let e=o.length>0&&v===o[0].ref.current;d.style.top="0px";let t=Math.max(S,p+x.offsetTop+(e?C:0)+I);d.style.height=t+(b-E)+"px",x.scrollTop=E-S+x.offsetTop}d.style.margin="10px 0",d.style.minHeight=y+"px",d.style.maxHeight=r+"px",l?.(),requestAnimationFrame(()=>f.current=!0)}},[m,i.trigger,i.valueNode,d,u,x,v,w,i.dir,l]);(0,W.useLayoutEffect)(()=>y(),[y]);let[j,C]=n.useState();(0,W.useLayoutEffect)(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);let k=n.useCallback(e=>{e&&!0===g.current&&(y(),b?.(),g.current=!1)},[y,b]);return(0,t.jsx)(ey,{scope:o,contentWrapper:d,shouldExpandOnScrollRef:f,onScrollButtonChange:k,children:(0,t.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,t.jsx)(B.Primitive.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ew.displayName="SelectItemAlignedPosition";var eb=n.forwardRef((e,n)=>{let{__scopeSelect:a,align:o="start",collisionPadding:l=10,...r}=e,i=et(a);return(0,t.jsx)(F.Content,{...i,...r,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eb.displayName="SelectPopperPosition";var[ey,ej]=J(eh,{}),eC="SelectViewport",ek=n.forwardRef((e,a)=>{let{__scopeSelect:o,nonce:l,...r}=e,i=eg(eC,o),s=ej(eC,o),d=(0,P.useComposedRefs)(a,i.onViewportChange),c=n.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,t.jsx)(Q.Slot,{scope:o,children:(0,t.jsx)(B.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:(0,I.composeEventHandlers)(r.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:a}=s;if(a?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let a=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<a){let l=o+e,r=Math.min(a,l),i=l-r;n.style.height=r+"px","0px"===n.style.bottom&&(t.scrollTop=i>0?i:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ek.displayName=eC;var eS="SelectGroup",[eN,eI]=J(eS),eE=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=(0,L.useId)();return(0,t.jsx)(eN,{scope:a,id:l,children:(0,t.jsx)(B.Primitive.div,{role:"group","aria-labelledby":l,...o,ref:n})})});eE.displayName=eS;var eP="SelectLabel",eM=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=eI(eP,a);return(0,t.jsx)(B.Primitive.div,{id:l.id,...o,ref:n})});eM.displayName=eP;var eT="SelectItem",[eA,eR]=J(eT),eD=n.forwardRef((e,a)=>{let{__scopeSelect:o,value:l,disabled:r=!1,textValue:i,...s}=e,d=ea(eT,o),c=eg(eT,o),u=d.value===l,[p,h]=n.useState(i??""),[m,f]=n.useState(!1),g=(0,P.useComposedRefs)(a,e=>c.itemRefCallback?.(e,l,r)),x=(0,L.useId)(),v=n.useRef("touch"),w=()=>{r||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(eA,{scope:o,value:l,disabled:r,textId:x,isSelected:u,onItemTextChange:n.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,t.jsx)(Q.ItemSlot,{scope:o,value:l,disabled:r,textValue:p,children:(0,t.jsx)(B.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:g,onFocus:(0,I.composeEventHandlers)(s.onFocus,()=>f(!0)),onBlur:(0,I.composeEventHandlers)(s.onBlur,()=>f(!1)),onClick:(0,I.composeEventHandlers)(s.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,I.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,I.composeEventHandlers)(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:(0,I.composeEventHandlers)(s.onPointerMove,e=>{v.current=e.pointerType,r?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,I.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:(0,I.composeEventHandlers)(s.onKeyDown,e=>{(c.searchRef?.current===""||" "!==e.key)&&(Y.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});eD.displayName=eT;var eL="SelectItemText",eF=n.forwardRef((e,a)=>{let{__scopeSelect:o,className:l,style:r,...i}=e,s=ea(eL,o),d=eg(eL,o),c=eR(eL,o),u=el(eL,o),[p,h]=n.useState(null),m=(0,P.useComposedRefs)(a,e=>h(e),c.onItemTextChange,e=>d.itemTextRefCallback?.(e,c.value,c.disabled)),f=p?.textContent,g=n.useMemo(()=>(0,t.jsx)("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return(0,W.useLayoutEffect)(()=>(x(g),()=>v(g)),[x,v,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Primitive.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?S.createPortal(i.children,s.valueNode):null]})});eF.displayName=eL;var eH="SelectItemIndicator",eB=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return eR(eH,a).isSelected?(0,t.jsx)(B.Primitive.span,{"aria-hidden":!0,...o,ref:n}):null});eB.displayName=eH;var eV="SelectScrollUpButton",e_=n.forwardRef((e,a)=>{let o=eg(eV,e.__scopeSelect),l=ej(eV,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,P.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){i(t.scrollTop>0)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});e_.displayName=eV;var eO="SelectScrollDownButton",eW=n.forwardRef((e,a)=>{let o=eg(eO,e.__scopeSelect),l=ej(eO,e.__scopeSelect),[r,i]=n.useState(!1),s=(0,P.useComposedRefs)(a,l.onScrollButtonChange);return(0,W.useLayoutEffect)(()=>{if(o.viewport&&o.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),r?(0,t.jsx)(ez,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eW.displayName=eO;var ez=n.forwardRef((e,a)=>{let{__scopeSelect:o,onAutoScroll:l,...r}=e,i=eg("SelectScrollButton",o),s=n.useRef(null),d=X(o),c=n.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),(0,W.useLayoutEffect)(()=>{let e=d().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[d]),(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...r,ref:a,style:{flexShrink:0,...r.style},onPointerDown:(0,I.composeEventHandlers)(r.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(l,50))}),onPointerMove:(0,I.composeEventHandlers)(r.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(l,50))}),onPointerLeave:(0,I.composeEventHandlers)(r.onPointerLeave,()=>{c()})})}),eU=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e;return(0,t.jsx)(B.Primitive.div,{"aria-hidden":!0,...o,ref:n})});eU.displayName="SelectSeparator";var eK="SelectArrow",eG=n.forwardRef((e,n)=>{let{__scopeSelect:a,...o}=e,l=et(a),r=ea(eK,a),i=eg(eK,a);return r.open&&"popper"===i.position?(0,t.jsx)(F.Arrow,{...l,...o,ref:n}):null});eG.displayName=eK;var eq=n.forwardRef(({__scopeSelect:e,value:a,...o},l)=>{let r=n.useRef(null),i=(0,P.useComposedRefs)(l,r),s=(0,z.usePrevious)(a);return n.useEffect(()=>{let e=r.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==a&&t){let n=new Event("change",{bubbles:!0});t.call(e,a),e.dispatchEvent(n)}},[s,a]),(0,t.jsx)(B.Primitive.select,{...o,style:{...U.VISUALLY_HIDDEN_STYLES,...o.style},ref:i,defaultValue:a})});function eY(e){return""===e||void 0===e}function eZ(e){let t=(0,_.useCallbackRef)(e),a=n.useRef(""),o=n.useRef(0),l=n.useCallback(e=>{let n=a.current+e;t(n),function e(t){a.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),r=n.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,l,r]}function eQ(e,t,n){var a,o;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1,i=(a=e,o=Math.max(r,0),a.map((e,t)=>a[(o+t)%a.length]));1===l.length&&(i=i.filter(e=>e!==n));let s=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==n?s:void 0}eq.displayName="SelectBubbleInput",e.s(["Arrow",()=>eG,"Content",()=>em,"Group",()=>eE,"Icon",()=>eu,"Item",()=>eD,"ItemIndicator",()=>eB,"ItemText",()=>eF,"Label",()=>eM,"Portal",()=>ep,"Root",()=>er,"ScrollDownButton",()=>eW,"ScrollUpButton",()=>e_,"Select",()=>er,"SelectArrow",()=>eG,"SelectContent",()=>em,"SelectGroup",()=>eE,"SelectIcon",()=>eu,"SelectItem",()=>eD,"SelectItemIndicator",()=>eB,"SelectItemText",()=>eF,"SelectLabel",()=>eM,"SelectPortal",()=>ep,"SelectScrollDownButton",()=>eW,"SelectScrollUpButton",()=>e_,"SelectSeparator",()=>eU,"SelectTrigger",()=>es,"SelectValue",()=>ec,"SelectViewport",()=>ek,"Separator",()=>eU,"Trigger",()=>es,"Value",()=>ec,"Viewport",()=>ek,"createSelectScope",()=>ee],83830);var eX=e.i(83830),eX=eX,e$=e.i(99105);let eJ=(0,o.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),e0=eX.Root;eX.Group;let e1=eX.Value,e2=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Trigger,{ref:o,className:(0,w.cn)("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[n,(0,t.jsx)(eX.Icon,{asChild:!0,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));e2.displayName=eX.Trigger.displayName;let e3=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollUpButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(eJ,{className:"h-4 w-4"})}));e3.displayName=eX.ScrollUpButton.displayName;let e5=n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.ScrollDownButton,{ref:a,className:(0,w.cn)("flex cursor-default items-center justify-center py-1",e),...n,children:(0,t.jsx)(e$.ChevronDown,{className:"h-4 w-4"})}));e5.displayName=eX.ScrollDownButton.displayName;let e4=n.forwardRef(({className:e,children:n,position:a="popper",...o},l)=>(0,t.jsx)(eX.Portal,{children:(0,t.jsxs)(eX.Content,{ref:l,className:(0,w.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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...o,children:[(0,t.jsx)(e3,{}),(0,t.jsx)(eX.Viewport,{className:(0,w.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,t.jsx)(e5,{})]})}));e4.displayName=eX.Content.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Label,{ref:a,className:(0,w.cn)("px-2 py-1.5 text-sm font-semibold",e),...n})).displayName=eX.Label.displayName;let e8=n.forwardRef(({className:e,children:n,...a},o)=>(0,t.jsxs)(eX.Item,{ref:o,className:(0,w.cn)("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,t.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(eX.ItemIndicator,{children:(0,t.jsx)(r.Check,{className:"h-4 w-4"})})}),(0,t.jsx)(eX.ItemText,{children:n})]}));e8.displayName=eX.Item.displayName,n.forwardRef(({className:e,...n},a)=>(0,t.jsx)(eX.Separator,{ref:a,className:(0,w.cn)("bg-muted -mx-1 my-1 h-px",e),...n})).displayName=eX.Separator.displayName;var e9=e.i(21023);let e6=(0,e9.createServerReference)("4070ce28e615e0395eda0718ef3f91c7ab9cb94d16",e9.callServer,void 0,e9.findSourceMapURL,"updateSettingsAction");var e7=e.i(17406),te=e.i(98804),tt=e.i(93752),tt=tt,tn=e.i(83902);function ta(e){return(0,t.jsx)(tt.default,{className:(0,w.cn)("h-4 w-4",e.className),...e})}function to({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tl({className:e}){return(0,t.jsx)(te.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function tr({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ti({className:e}){return(0,t.jsx)(te.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,w.cn)("rounded-sm object-contain",e)})}function ts({className:e,...n}){return(0,t.jsx)(tn.Rocket,{className:(0,w.cn)("h-4 w-4",e),...n})}to.displayName="VsCodeIcon",tl.displayName="CursorEditorIcon",tr.displayName="WindsurfIcon",ti.displayName="ZedIcon",ts.displayName="AntigravityIcon";let td={vscode:to,cursor:tl,windsurf:tr,zed:ti,antigravity:ts};var tc=e.i(41413);let tu=[{value:e7.AgentAuthMethod.Session,label:"Session"},{value:e7.AgentAuthMethod.Token,label:"Token"}],tp=[{value:e7.EditorType.VsCode,label:"VS Code"},{value:e7.EditorType.Cursor,label:"Cursor"},{value:e7.EditorType.Windsurf,label:"Windsurf"},{value:e7.EditorType.Zed,label:"Zed"},{value:e7.EditorType.Antigravity,label:"Antigravity"}],th=[{id:"agent",label:"Agent",icon:i.Bot},{id:"environment",label:"Environment",icon:s.Terminal},{id:"workflow",label:"Workflow",icon:d.GitBranch},{id:"ci",label:"CI",icon:c},{id:"notifications",label:"Notifications",icon:u},{id:"feature-flags",label:"Flags",icon:p},{id:"database",label:"Database",icon:h}];function tm({label:e,description:n,htmlFor:a,children:o}){return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(b.Label,{htmlFor:a,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),n?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:n}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}function tf({label:e,description:n,id:a,testId:o,checked:l,onChange:r,disabled:i}){return(0,t.jsx)(tm,{label:e,description:n,htmlFor:a,children:(0,t.jsx)(C.Switch,{id:a,"data-testid":o,checked:l,onCheckedChange:r,disabled:i,className:(0,w.cn)("cursor-pointer",i&&"cursor-not-allowed opacity-50")})})}function tg({icon:e,title:n,description:a,badge:o,testId:l,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":l,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:n}),o?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:o}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:a})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function tx({id:e,testId:n,value:a,onChange:o,onBlur:l,placeholder:r,min:i=1,max:s,step:d=1,suffix:c}){let u=""===a?void 0:parseInt(a,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{o(String(Math.max(i,(u??parseInt(r,10))-d)))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":"Decrease",children:(0,t.jsx)(m.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":n,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:a,placeholder:r,onChange:e=>{o(e.target.value.replace(/[^0-9]/g,""))},onBlur:l,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=u??parseInt(r,10),o(String(null!=s?Math.min(s,e+d):e+d))},onMouseUp:l,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":"Increase",children:(0,t.jsx)(f.Plus,{className:"h-3 w-3"})})]}),c?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:c}):null]})}function tv({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function tw({children:e,links:n}){return(0,t.jsxs)("div",{className:"hidden pt-2 lg:block",children:[(0,t.jsx)("p",{className:"text-muted-foreground/70 text-[11px] leading-relaxed",children:e}),null!=n&&n.length>0?(0,t.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors",children:[(0,t.jsx)(g.ExternalLink,{className:"h-2.5 w-2.5"}),e.label]},e.href))}):null]})}function tb({settings:e,shepHome:o,dbFileSize:m}){let{showSaving:f,showSaved:g,save:b}=function(){let[e,t]=(0,n.useTransition)(),[a,o]=(0,n.useState)(!1),[l,r]=(0,n.useState)(!1),i=(0,n.useRef)(null),s=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{e&&!a&&(o(!0),s.current=!1,i.current=setTimeout(()=>{i.current=null,s.current&&(o(!1),r(!0),setTimeout(()=>r(!1),2e3))},350)),!e&&a&&(s.current=!0,i.current||(o(!1),r(!0),setTimeout(()=>r(!1),2e3)))},[e,a]),{showSaving:a,showSaved:l,save:(0,n.useCallback)(e=>{t(async()=>{let t=await e6(e);t.success||v.toast.error(t.error??"Failed to save settings")})},[t])}}(),C=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1},[S,N]=(0,n.useState)(e.agent.type),I=e.agent.authMethod,[E,P]=(0,n.useState)(e.agent.token??""),[M,T]=(0,n.useState)(!1),[A,R]=(0,n.useState)(e.environment.defaultEditor),D=e.environment.shellPreference,[L,F]=(0,n.useState)(e.workflow.openPrOnImplementationComplete),[H,B]=(0,n.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[V,_]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPrd),[O,W]=(0,n.useState)(e.workflow.approvalGateDefaults.allowPlan),[z,U]=(0,n.useState)(e.workflow.approvalGateDefaults.allowMerge),[K,G]=(0,n.useState)(e.workflow.enableEvidence),[q,Y]=(0,n.useState)(e.workflow.commitEvidence),[Z,Q]=(0,n.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[X,$]=(0,n.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[J,ee]=(0,n.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[et,en]=(0,n.useState)(e.notifications.inApp.enabled),[ea,eo]=(0,n.useState)(e.notifications.browser.enabled),[el,er]=(0,n.useState)(e.notifications.desktop.enabled),[ei,es]=(0,n.useState)({...e.notifications.events}),[ed,ec]=(0,n.useState)({...C}),eu=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",ep=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",eh=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"";function em(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function ef(e={}){let t=em(e.ciTimeout??X);return{workflow:{openPrOnImplementationComplete:e.openPr??L,approvalGateDefaults:{pushOnImplementationComplete:e.pushOnComplete??H,allowPrd:e.allowPrd??V,allowPlan:e.allowPlan??O,allowMerge:e.allowMerge??z},enableEvidence:e.enableEvidence??K,commitEvidence:e.commitEvidence??q,ciMaxFixAttempts:em(e.ciMaxFix??Z),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:em(e.ciLogMax??J)}}}function eg(e={}){return{notifications:{inApp:{enabled:e.inApp??et},browser:{enabled:e.browser??ea},desktop:{enabled:e.desktop??el},events:e.events??ei}}}let[ex,ev]=(0,n.useState)("agent");(0,n.useEffect)(()=>{let e=th.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&ev(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let n of e)t.observe(n);return()=>t.disconnect()},[]);let ew=(0,n.useCallback)(e=>{let t=document.getElementById(`section-${e}`);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),t.style.animation="none",t.offsetHeight,t.style.animation="section-flash 1s ease-out")},[]);return(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl",children:[(0,t.jsx)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Settings"}),(0,t.jsxs)("span",{className:"relative h-4 w-16",children:[(0,t.jsx)("span",{className:(0,w.cn)("text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300",f?"opacity-100":"opacity-0"),children:"Saving..."}),(0,t.jsxs)("span",{className:(0,w.cn)("absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300",g&&!f?"opacity-100":"opacity-0"),children:[(0,t.jsx)(r.Check,{className:"h-3 w-3"}),"Saved"]})]}),(0,t.jsx)("nav",{className:"ml-auto flex items-center gap-0.5",children:th.map(e=>{let n=e.icon,a=ex===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>ew(e.id),className:(0,w.cn)("flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all",a?"bg-accent text-foreground font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(n,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.id)})})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{id:"section-agent",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:i.Bot,title:"Agent",description:"AI coding agent and authentication",testId:"agent-settings-section",children:[(0,t.jsx)(tm,{label:"Agent & Model",description:"Provider and model for all operations",htmlFor:"agent-model-picker",children:(0,t.jsx)(tc.AgentModelPicker,{initialAgentType:S,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>N(e),className:"w-55"})}),(0,t.jsx)(tm,{label:"Authentication",description:"How the agent authenticates",htmlFor:"auth-method",children:(0,t.jsx)(k.TooltipProvider,{children:(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsxs)(e0,{value:I,disabled:!0,children:[(0,t.jsx)(e2,{id:"auth-method","data-testid":"auth-method-select",className:"w-55 cursor-not-allowed text-xs opacity-60",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e4,{children:tu.map(e=>(0,t.jsx)(e8,{value:e.value,children:e.label},e.value))})]})})}),(0,t.jsx)(k.TooltipContent,{children:"Coming soon"})]})})}),I===e7.AgentAuthMethod.Token&&(0,t.jsx)(tm,{label:"API Token",htmlFor:"agent-token",children:(0,t.jsxs)("div",{className:"relative w-45",children:[(0,t.jsx)(y.Input,{id:"agent-token","data-testid":"agent-token-input",type:M?"text":"password",value:E,onChange:e=>P(e.target.value),onBlur:()=>{E!==(e.agent.token??"")&&b(function(e={}){let t={type:S,authMethod:I,...e},n={type:t.type,authMethod:t.authMethod};return t.authMethod===e7.AgentAuthMethod.Token&&(n.token=e.token??E),{agent:n}}({token:E}))},placeholder:"Enter token",className:"pr-8"}),(0,t.jsx)(j.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-2 hover:bg-transparent",onClick:()=>T(!M),"data-testid":"toggle-token-visibility","aria-label":M?"Hide token":"Show token",children:M?(0,t.jsx)(l,{className:"h-3 w-3"}):(0,t.jsx)(a.Eye,{className:"h-3 w-3"})})]})})]}),(0,t.jsx)(tw,{links:[{label:"Agent system",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md"},{label:"Adding agents",href:"https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md"},{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Choose which AI coding agent powers your features. Each agent supports different models and capabilities. Authentication is resolved automatically via your active session."})]}),(0,t.jsxs)("div",{id:"section-environment",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsx)(tg,{icon:s.Terminal,title:"Environment",description:"Editor and shell preferences",testId:"environment-settings-section",children:(0,t.jsx)(tm,{label:"Default Editor",description:"Editor launched for file operations",htmlFor:"default-editor",children:(0,t.jsxs)(e0,{value:A,onValueChange:e=>{R(e),b({environment:{defaultEditor:e,shellPreference:D}})},children:[(0,t.jsx)(e2,{id:"default-editor","data-testid":"editor-select",className:"w-55 cursor-pointer text-xs",children:(0,t.jsx)(e1,{})}),(0,t.jsx)(e4,{children:tp.map(e=>{var n;let a=(n=e.value)&&n in td?td[n]:ta;return(0,t.jsx)(e8,{value:e.value,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(a,{className:"h-4 w-4 shrink-0"}),e.label]})},e.value)})})]})})}),(0,t.jsx)(tw,{links:[{label:"Configuration guide",href:"https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md"}],children:"Your preferred editor is used when opening files for review or editing during the development workflow."})]}),(0,t.jsxs)("div",{id:"section-workflow",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:d.GitBranch,title:"Workflow",description:"Automation behavior after implementation",testId:"workflow-settings-section",children:[(0,t.jsx)(tv,{children:"Approve"}),(0,t.jsx)(tf,{label:"Auto-approve PRD",description:"Skip manual review of requirements",id:"allow-prd",testId:"switch-allow-prd",checked:V,onChange:e=>{_(e),b(ef({allowPrd:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Plan",description:"Skip manual review of implementation plan",id:"allow-plan",testId:"switch-allow-plan",checked:O,onChange:e=>{W(e),b(ef({allowPlan:e}))}}),(0,t.jsx)(tf,{label:"Auto-approve Merge",description:"Merge without manual review",id:"allow-merge",testId:"switch-allow-merge",checked:z,onChange:e=>{U(e),b(ef({allowMerge:e}))}}),(0,t.jsx)(tv,{children:"Evidence"}),(0,t.jsx)(tf,{label:"Collect evidence",description:"Capture screenshots and artifacts after implementation",id:"enable-evidence",testId:"switch-enable-evidence",checked:K,onChange:e=>{G(e),e?b(ef({enableEvidence:e})):(Y(!1),b(ef({enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(tf,{label:"Add evidence to PR",description:"Include evidence in the pull request body",id:"commit-evidence",testId:"switch-commit-evidence",checked:q,disabled:!K||!L,onChange:e=>{Y(e),b(ef({commitEvidence:e}))}}),(0,t.jsx)(tv,{children:"Git"}),(0,t.jsx)(tf,{label:"Push on complete",description:"Push to remote when implementation finishes",id:"push-on-complete",testId:"switch-push-on-complete",checked:H,onChange:e=>{B(e),b(ef({pushOnComplete:e}))}}),(0,t.jsx)(tf,{label:"Open PR on complete",description:"Create a pull request when done",id:"open-pr",testId:"switch-open-pr",checked:L,onChange:e=>{F(e),e?b(ef({openPr:e})):(Y(!1),b(ef({openPr:e,commitEvidence:!1})))}})]}),(0,t.jsx)(tw,{links:[{label:"Approval gates",href:"https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:"Push & PR flags",href:"https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:"Control how autonomous each feature run is. Auto-approve skips the human review pause at each phase. Push and PR options control what happens after successful implementation."})]}),(0,t.jsxs)("div",{id:"section-ci",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:c,title:"Continuous Integration",description:"Limits and timeouts for CI monitoring",testId:"ci-settings-section",children:[(0,t.jsx)(tm,{label:"Max fix attempts",description:"Agent retries on failing CI",htmlFor:"ci-max-fix",children:(0,t.jsx)(tx,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:Z,onChange:Q,onBlur:()=>{Z!==eu&&b(ef({ciMaxFix:Z}))},min:1,max:10})}),(0,t.jsx)(tm,{label:"Watch timeout",description:"Max wait for CI completion",htmlFor:"ci-timeout",children:(0,t.jsx)(tx,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:X,onChange:$,onBlur:()=>{X!==ep&&b(ef({ciTimeout:X}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(tm,{label:"Max log size",description:"Truncate CI logs beyond this limit",htmlFor:"ci-log-max",children:(0,t.jsx)(tx,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:J,onChange:ee,onBlur:()=>{J!==eh&&b(ef({ciLogMax:J}))},min:1e3,step:5e3,suffix:"chars"})})]}),(0,t.jsx)(tw,{links:[{label:"CI/CD pipeline",href:"https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md"},{label:"CI security gates",href:"https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md"}],children:"When a feature completes, the agent can watch CI and auto-fix failures. These limits prevent runaway retries and control how much log output is sent to the agent for analysis."})]}),(0,t.jsxs)("div",{id:"section-notifications",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:u,title:"Notifications",description:"How and when you get notified",testId:"notification-settings-section",children:[(0,t.jsx)(tv,{children:"Channels"}),(0,t.jsx)(tf,{label:"In-app",description:"Notifications inside the Shep UI",id:"notif-in-app",testId:"switch-in-app",checked:et,onChange:e=>{en(e),b(eg({inApp:e}))}}),(0,t.jsx)(tf,{label:"Browser",description:"Push notifications via the browser",id:"notif-browser",testId:"switch-browser",checked:ea,onChange:e=>{eo(e),b(eg({browser:e}))}}),(0,t.jsx)(tf,{label:"Desktop",description:"Native OS notifications",id:"notif-desktop",testId:"switch-desktop",checked:el,onChange:e=>{er(e),b(eg({desktop:e}))}}),(0,t.jsx)(tv,{children:"Agent Events"}),(0,t.jsx)(tf,{label:"Agent started",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:ei.agentStarted,onChange:e=>{let t={...ei,agentStarted:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Phase completed",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:ei.phaseCompleted,onChange:e=>{let t={...ei,phaseCompleted:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Waiting approval",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:ei.waitingApproval,onChange:e=>{let t={...ei,waitingApproval:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Agent completed",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:ei.agentCompleted,onChange:e=>{let t={...ei,agentCompleted:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"Agent failed",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:ei.agentFailed,onChange:e=>{let t={...ei,agentFailed:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tv,{children:"Pull Request Events"}),(0,t.jsx)(tf,{label:"PR merged",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:ei.prMerged,onChange:e=>{let t={...ei,prMerged:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"PR closed",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:ei.prClosed,onChange:e=>{let t={...ei,prClosed:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks passed",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:ei.prChecksPassed,onChange:e=>{let t={...ei,prChecksPassed:e};es(t),b(eg({events:t}))}}),(0,t.jsx)(tf,{label:"PR checks failed",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:ei.prChecksFailed,onChange:e=>{let t={...ei,prChecksFailed:e};es(t),b(eg({events:t}))}})]}),(0,t.jsx)(tw,{links:[{label:"Notification system",href:"https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml"}],children:"Three notification channels keep you in the loop: in-app toasts, browser push notifications, and native desktop alerts. Fine-tune which agent lifecycle events trigger a notification."})]}),(0,t.jsxs)("div",{id:"section-feature-flags",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:p,title:"Feature Flags",description:"Enable or disable experimental features",badge:"Experimental",testId:"feature-flags-settings-section",children:[(0,t.jsx)(tf,{label:"Skills",description:"Enable the skills system for agent capabilities",id:"flag-skills",testId:"switch-flag-skills",checked:ed.skills,onChange:e=>{let t={...ed,skills:e};ec(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Deployments",description:"Enable environment deployment workflows",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:ed.envDeploy,onChange:e=>{let t={...ed,envDeploy:e};ec(t),b({featureFlags:t})}}),(0,t.jsx)(tf,{label:"Debug",description:"Show debug panels and verbose logging",id:"flag-debug",testId:"switch-flag-debug",checked:ed.debug,onChange:e=>{let t={...ed,debug:e};ec(t),b({featureFlags:t})}})]}),(0,t.jsx)(tw,{children:"Experimental features that are still under development. Enable at your own risk — they may change or be removed in future versions. Debug mode adds verbose logging useful for troubleshooting."})]}),(0,t.jsxs)("div",{id:"section-database",className:"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]",children:[(0,t.jsxs)(tg,{icon:h,title:"Database",description:"Local storage information",testId:"database-settings-section",children:[(0,t.jsx)(tm,{label:"Location",description:"Path to the local SQLite database",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shep-home-path",children:o})}),(0,t.jsx)(tm,{label:"Size",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:m})})]}),(0,t.jsx)(tw,{links:[{label:"Settings service",href:"https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md"},{label:"Settings spec",href:"https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md"}],children:"All settings are stored in a local SQLite database at ~/.shep/data. The database uses a singleton record pattern with automatic migrations on startup."})]})]})]})}e.s(["SettingsPageClient",()=>tb],41952)}]);