@jiangxiaosheng/digital-agent-platform 1.0.3 → 1.0.5

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 (119) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +71 -67
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/eslint/.cache_1bmmeh3 +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/3.pack +0 -0
  10. package/.next/cache/webpack/client-production/4.pack +0 -0
  11. package/.next/cache/webpack/client-production/5.pack +0 -0
  12. package/.next/cache/webpack/client-production/6.pack +0 -0
  13. package/.next/cache/webpack/client-production/7.pack +0 -0
  14. package/.next/cache/webpack/client-production/8.pack +0 -0
  15. package/.next/cache/webpack/client-production/9.pack +0 -0
  16. package/.next/cache/webpack/client-production/index.pack +0 -0
  17. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  18. package/.next/cache/webpack/edge-server-production/1.pack +0 -0
  19. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  20. package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
  21. package/.next/cache/webpack/server-production/0.pack +0 -0
  22. package/.next/cache/webpack/server-production/1.pack +0 -0
  23. package/.next/cache/webpack/server-production/3.pack +0 -0
  24. package/.next/cache/webpack/server-production/4.pack +0 -0
  25. package/.next/cache/webpack/server-production/5.pack +0 -0
  26. package/.next/cache/webpack/server-production/6.pack +0 -0
  27. package/.next/cache/webpack/server-production/7.pack +0 -0
  28. package/.next/cache/webpack/server-production/8.pack +0 -0
  29. package/.next/cache/webpack/server-production/index.pack +0 -0
  30. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  31. package/.next/next-minimal-server.js.nft.json +1 -1
  32. package/.next/next-server.js.nft.json +1 -1
  33. package/.next/prerender-manifest.json +1 -1
  34. package/.next/server/app/[locale]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/[locale]/agents/[id]/edit/page.js +1 -1
  36. package/.next/server/app/[locale]/agents/[id]/edit/page.js.nft.json +1 -1
  37. package/.next/server/app/[locale]/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/[locale]/agents/new/page.js +1 -1
  39. package/.next/server/app/[locale]/agents/new/page.js.nft.json +1 -1
  40. package/.next/server/app/[locale]/agents/new/page_client-reference-manifest.js +1 -1
  41. package/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/[locale]/knowledge/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/[locale]/settings/page.js +1 -1
  45. package/.next/server/app/[locale]/settings/page.js.nft.json +1 -1
  46. package/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
  47. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/_not-found.html +1 -1
  49. package/.next/server/app/_not-found.rsc +1 -1
  50. package/.next/server/app/api/agents/[id]/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/auth-config/test/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/bash-output/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/chat/[agentId]/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/env-vars/[key]/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/env-vars/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/env-vars/scan/route.js +1 -1
  58. package/.next/server/app/api/env-vars/scan/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/file-serve/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/knowledge/[id]/documents/[docId]/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/knowledge/[id]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/knowledge/[id]/upload/route.js +1 -1
  64. package/.next/server/app/api/knowledge/[id]/upload/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/knowledge/search/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/models/route.js +1 -1
  68. package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/sessions/[agentId]/[sessionId]/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/sessions/[agentId]/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/sessions/history/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/[name]/route.js +1 -1
  76. package/.next/server/app/api/skills/[name]/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/install/route.js +1 -1
  78. package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/skills/route.js +1 -1
  80. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/tts/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/voice-provider/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/workspace-files/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/index.html +1 -1
  86. package/.next/server/app/index.rsc +1 -1
  87. package/.next/server/app/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app-paths-manifest.json +17 -17
  89. package/.next/server/chunks/1354.js +1 -0
  90. package/.next/server/chunks/7420.js +1 -0
  91. package/.next/server/chunks/7555.js +1 -0
  92. package/.next/server/chunks/9576.js +1 -0
  93. package/.next/server/middleware-manifest.json +4 -4
  94. package/.next/server/pages/404.html +1 -1
  95. package/.next/server/pages/500.html +1 -1
  96. package/.next/server/pages/_error.js +1 -1
  97. package/.next/static/chunks/3763-85d191447a96df85.js +1 -0
  98. package/.next/static/chunks/5822-2ca912318cc34b52.js +1 -0
  99. package/.next/static/chunks/5964-cdb47df650c9e359.js +1 -0
  100. package/.next/static/chunks/6009-1f2b513c3fe454c1.js +1 -0
  101. package/.next/static/chunks/app/[locale]/agents/[id]/edit/{page-8d0cc73c7aff7774.js → page-74a70d27b56ead9b.js} +1 -1
  102. package/.next/static/chunks/app/[locale]/agents/new/{page-aeaa197c0ccfd2f9.js → page-11833508212d4d80.js} +1 -1
  103. package/.next/static/chunks/app/[locale]/knowledge/{page-7b4b6aa0a07d7da3.js → page-4928374e08e30a81.js} +1 -1
  104. package/.next/static/chunks/app/[locale]/settings/page-472b2cd8df49bf94.js +1 -0
  105. package/.next/trace +4 -4
  106. package/package.json +1 -1
  107. package/src/app/[locale]/settings/page.tsx +3 -3
  108. package/src/app/api/models/route.ts +8 -2
  109. package/src/components/agents/model-selector.tsx +6 -0
  110. package/src/lib/skills.ts +2 -1
  111. package/.next/server/chunks/1285.js +0 -1
  112. package/.next/server/chunks/2112.js +0 -1
  113. package/.next/server/chunks/4125.js +0 -1
  114. package/.next/static/chunks/2733-714d0e6cd51477c7.js +0 -1
  115. package/.next/static/chunks/3923-e04a628626d77a16.js +0 -1
  116. package/.next/static/chunks/6742-ad22486f7c4c8592.js +0 -1
  117. package/.next/static/chunks/app/[locale]/settings/page-71d67c3b9f712584.js +0 -1
  118. /package/.next/static/{jzQoM_kWiDDx3mIoxV6tk → rUwWYP4-J64RRKJv93Ihp}/_buildManifest.js +0 -0
  119. /package/.next/static/{jzQoM_kWiDDx3mIoxV6tk → rUwWYP4-J64RRKJv93Ihp}/_ssgManifest.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiangxiaosheng/digital-agent-platform",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "dap": "bin/dap.js"
@@ -21,6 +21,7 @@ import { cn } from "@/lib/utils";
21
21
  import type { ModelsConfig, ProviderEntry, ModelEntry } from "@/lib/models-config";
22
22
  import type { VoiceProviderConfig } from "@/lib/voice-providers-config";
23
23
  import { SkillsManager } from "@/components/agents/skills-manager";
24
+ import { clearModelCache } from "@/components/agents/model-selector";
24
25
 
25
26
  // ─── Built-in provider definitions ────────────────────────────────────────
26
27
  const BUILTIN_PROVIDERS = [
@@ -100,6 +101,7 @@ export default function SettingsPage() {
100
101
  setTimeout(() => setSaveStatus("idle"), 2500);
101
102
  // Bust model cache so ModelSelector picks up changes
102
103
  await fetch("/api/models");
104
+ clearModelCache(); // Clear the frontend cache
103
105
  }, [apiKeys, modelsConfig, voiceConfig]);
104
106
 
105
107
  const switchLocale = (newLocale: string) => {
@@ -1039,9 +1041,7 @@ function BuiltinProvidersPanel({ apiKeys, onKeysChange, onSave }: BuiltinProvide
1039
1041
  };
1040
1042
 
1041
1043
  const removeProvider = async (id: string) => {
1042
- const updated = { ...apiKeys };
1043
- delete updated[id];
1044
- onKeysChange(updated);
1044
+ onKeysChange({ ...apiKeys, [id]: "" }); // Set to empty string for deletion
1045
1045
  await onSave();
1046
1046
  };
1047
1047
 
@@ -56,10 +56,16 @@ export async function GET() {
56
56
  const { ModelRuntime } = await import("@earendil-works/pi-coding-agent");
57
57
 
58
58
  const agentDir = getAgentDir();
59
- const modelsStorePath = path.join(agentDir, "models.json");
59
+ const modelsPath = path.join(agentDir, "models.json");
60
+ const modelsStorePath = path.join(agentDir, "models-store.json");
60
61
  const authPath = path.join(agentDir, "auth.json");
61
62
 
62
- const runtime = await ModelRuntime.create({ authPath, modelsStorePath });
63
+ const runtime = await ModelRuntime.create({
64
+ authPath,
65
+ modelsPath,
66
+ modelsStorePath,
67
+ allowModelNetwork: false // 禁用网络请求,使用本地内置目录
68
+ });
63
69
 
64
70
  const sdkProviders = runtime.getProviders();
65
71
  const providerNameMap = new Map<string, string>(sdkProviders.map((p) => [p.id, p.name]));
@@ -38,6 +38,12 @@ function fetchGroups(): Promise<ProviderGroup[]> {
38
38
  return _groupsPromise;
39
39
  }
40
40
 
41
+ // Clear the model cache (call after updating provider config)
42
+ export function clearModelCache() {
43
+ _groupsCache = null;
44
+ _groupsPromise = null;
45
+ }
46
+
41
47
  function findModel(groups: ProviderGroup[], providerId: string, modelId: string): ModelInfo | undefined {
42
48
  return groups.find((g) => g.id === providerId)?.models.find((m) => m.id === modelId);
43
49
  }
package/src/lib/skills.ts CHANGED
@@ -13,7 +13,8 @@ export interface SkillInfo {
13
13
  }
14
14
 
15
15
  export function getSkillsDir(): string {
16
- return path.join(os.homedir(), ".pi", "agent", "skills");
16
+ const base = process.env.PI_AGENT_DIR ?? path.join(os.homedir(), ".pi", "agent");
17
+ return path.join(base, "skills");
17
18
  }
18
19
 
19
20
  export function parseFrontmatter(content: string): Record<string, unknown> {
@@ -1 +0,0 @@
1
- "use strict";exports.id=1285,exports.ids=[1285],exports.modules={16873:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(41680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},20169:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(41680).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},39217:(e,t,n)=>{n.d(t,{N:()=>c});var r=n(58009),o=n(6004),i=n(29952),l=n(12705),a=n(45512),s=Object.defineProperty,u=(e,t)=>s(e,"name",{value:t,configurable:!0});function c(e){let t=e+"CollectionProvider",[n,s]=(0,o.A)(t),[c,f]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=u(e=>{let{scope:t,children:n}=e,o=r.useRef(null),i=r.useRef(new Map).current;return(0,a.jsx)(c,{scope:t,itemMap:i,collectionRef:o,children:n})},"CollectionProvider");d.displayName=t;let p=e+"CollectionSlot",h=(0,l.TL)(p),m=r.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=f(p,n),l=(0,i.s)(t,o.collectionRef);return(0,a.jsx)(h,{ref:l,children:r})});m.displayName=p;let g=e+"CollectionItemSlot",y="data-radix-collection-item",v=(0,l.TL)(g),w=r.forwardRef((e,t)=>{let{scope:n,children:o,...l}=e,s=r.useRef(null),u=(0,i.s)(t,s),c=f(g,n);return r.useEffect(()=>(c.itemMap.set(s,{ref:s,...l}),()=>void c.itemMap.delete(s))),(0,a.jsx)(v,{[y]:"",ref:u,children:o})});function x(t){let n=f(e+"CollectionConsumer",t);return r.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${y}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return w.displayName=g,u(x,"useCollection"),[{Provider:d,Slot:m,ItemSlot:w},x,s]}u(c,"createCollection");var f=new WeakMap,d=class e extends Map{static{u(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],f.set(this,!0)}set(e,t){return f.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r;let o=this.has(t),i=this.#e.length,l=m(e),a=l>=0?l:i+l,s=a<0||a>=i?-1:a;if(s===this.size||o&&s===this.size-1||-1===s)return this.set(t,n),this;let u=this.size+(o?0:1);l<0&&a++;let c=[...this.#e],f=!1;for(let e=a;e<u;e++)if(a===e){let i=c[e];c[e]===t&&(i=c[e+1]),o&&this.delete(t),r=this.get(i),this.set(t,n)}else{f||c[e-1]!==t||(f=!0);let n=c[f?e:e-1],o=r;r=this.get(n),this.delete(n),this.set(n,o)}return this}with(t,n,r){let o=new e(this);return o.insert(t,n,r),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}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,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}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=p(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=p(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return p(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],o=0;for(let e of this)Reflect.apply(t,n,[e,o,this])&&r.push(e),o++;return new e(r)}map(t,n){let r=[],o=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,o,this])]),o++;return new e(r)}reduce(...e){let[t,n]=e,r=0,o=n??this.at(0);for(let n of this)o=0===r&&1===e.length?n:Reflect.apply(t,this,[o,n,r,this]),r++;return o}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let o=this.at(n);r=n===this.size-1&&1===e.length?o:Reflect.apply(t,this,[r,o,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,o=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(o=n-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function p(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=h(e,t);return -1===n?void 0:e[n]}function h(e,t){let n=e.length,r=m(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}function m(e){return e!=e||0===e?0:Math.trunc(e)}function g(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function y(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function v(e,t){return e[1].element&&t[1].element?y(e[1].element,t[1].element)?-1:1:0}function w(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type){e();return}})}u(p,"at"),u(h,"toSafeIndex"),u(m,"toSafeInteger"),u(function(e){let t=e+"CollectionProvider",[n,s]=(0,o.A)(t),[c,f]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new d,setItemMap:u(()=>void 0,"setItemMap")}),p=u(({state:e,...t})=>e?(0,a.jsx)(m,{...t,state:e}):(0,a.jsx)(h,{...t}),"CollectionProvider");p.displayName=t;let h=u(e=>{let t=j();return(0,a.jsx)(m,{...e,state:t})},"CollectionInit");h.displayName=t+"Init";let m=u(e=>{let{scope:t,children:n,state:o}=e,l=r.useRef(null),[s,u]=r.useState(null),f=(0,i.s)(l,u),[d,p]=o;return r.useEffect(()=>{if(!s)return;let e=w(()=>{});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s]),(0,a.jsx)(c,{scope:t,itemMap:d,setItemMap:p,collectionRef:f,collectionRefObject:l,collectionElement:s,children:n})},"CollectionProviderImpl");m.displayName=t+"Impl";let y=e+"CollectionSlot",x=(0,l.TL)(y),b=r.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=f(y,n),l=(0,i.s)(t,o.collectionRef);return(0,a.jsx)(x,{ref:l,children:r})});b.displayName=y;let S=e+"CollectionItemSlot",R=(0,l.TL)(S),C=r.forwardRef((e,t)=>{let{scope:n,children:o,...l}=e,s=r.useRef(null),[u,c]=r.useState(null),p=(0,i.s)(t,s,c),{setItemMap:h}=f(S,n),m=r.useRef(l);g(m.current,l)||(m.current=l);let y=m.current;return r.useEffect(()=>(h(e=>u?e.has(u)?e.set(u,{...y,element:u}).toSorted(v):(e.set(u,{...y,element:u}),e.toSorted(v)):e),()=>{h(e=>u&&e.has(u)?(e.delete(u),new d(e)):e)}),[u,y,h]),(0,a.jsx)(R,{"data-radix-collection-item":"",ref:p,children:o})});function j(){return r.useState(new d)}function A(t){let{itemMap:n}=f(e+"CollectionConsumer",t);return n}return C.displayName=S,u(j,"useInitCollection"),u(A,"useCollection"),[{Provider:p,Slot:b,ItemSlot:C},{createCollectionScope:s,useCollection:A,useInitCollection:j}]},"createCollection"),u(g,"shallowEqual"),u(y,"isElementPreceding"),u(v,"sortByDocumentPosition"),u(w,"getChildListObserver")},92405:(e,t,n)=>{n.d(t,{b:()=>a});var r=n(58009),o=n(30830),i=n(45512),l=Object.defineProperty,a=r.forwardRef(l(function(e,t){return(0,i.jsx)(o.sG.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},16091:(e,t,n)=>{let r;n.d(t,{UC:()=>tE,YJ:()=>tW,In:()=>tj,q7:()=>tX,VF:()=>tJ,p4:()=>tY,JU:()=>t_,ZL:()=>tk,bL:()=>tS,wv:()=>tQ,l9:()=>tR,WT:()=>tC,LM:()=>tB});var o=n(58009),i=n(55740),l=n(29374),a=n(31412),s=n(39217),u=n(29952),c=n(6004),f=n(59018),d=n(42155),p=n(19632),h=n(82534),m=n(30096);let g=["top","right","bottom","left"],y=Math.min,v=Math.max,w=Math.round,x=Math.floor,b=e=>({x:e,y:e}),S={left:"right",right:"left",bottom:"top",top:"bottom"};function R(e,t){return"function"==typeof e?e(t):e}function C(e){return e.split("-")[0]}function j(e){return e.split("-")[1]}function A(e){return"x"===e?"y":"x"}function T(e){return"y"===e?"height":"width"}function k(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function P(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let E=["left","right"],I=["right","left"],O=["top","bottom"],L=["bottom","top"];function D(e){let t=C(e);return S[t]+e.slice(t.length)}function M(e){var t,n,r,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function F(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function K(e,t,n){let r,{reference:o,floating:i}=e,l=k(t),a=A(k(t)),s=T(a),u=C(t),c=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[s]/2-i[s]/2;switch(u){case"top":r={x:c,y:o.y-i.height};break;case"bottom":r={x:c,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:f};break;case"left":r={x:o.x-i.width,y:f};break;default:r={x:o.x,y:o.y}}let p=j(t);return p&&(r[a]+=d*("end"===p?1:-1)*(n&&"y"===l?-1:1)),r}async function H(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=R(t,e),h=M(p),m=a[d?"floating"===f?"reference":"floating":f],g=F(await i.getClippingRect({element:null==(n=await (null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:s})),y="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,v=await (null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await (null==i.isElement?void 0:i.isElement(v))&&await (null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=F(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:s}):y);return{top:(g.top-x.top+h.top)/w.y,bottom:(x.bottom-g.bottom+h.bottom)/w.y,left:(g.left-x.left+h.left)/w.x,right:(x.right-g.right+h.right)/w.x}}let N=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:H},s=await (null==l.isRTL?void 0:l.isRTL(t)),u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=K(u,r,s),d=r,p=0,h={};for(let n=0;n<i.length;n++){let m=i[n];if(!m)continue;let{name:g,fn:y}=m,{x:v,y:w,data:x,reset:b}=await y({x:c,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=v?v:c,f=null!=w?w:f,h[g]={...h[g],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:c,y:f}=K(u,d,s)),n=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}};function z(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function B(e){return g.some(t=>e[t]>=0)}let G=new Set(["left","top"]);async function V(e,t){let{placement:n,platform:r,elements:o}=e,i=await (null==r.isRTL?void 0:r.isRTL(o.floating)),l=C(n),a=j(n),s="y"===k(n),u=G.has(l)?-1:1,c=i&&s?-1:1,f=R(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),s?{x:p*c,y:d*u}:{x:d*u,y:p*c}}function W(){return"undefined"!=typeof window}function _(e){return U(e)?(e.nodeName||"").toLowerCase():"#document"}function $(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function q(e){var t;return null==(t=(U(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function U(e){return!!W()&&(e instanceof Node||e instanceof $(e).Node)}function X(e){return!!W()&&(e instanceof Element||e instanceof $(e).Element)}function Z(e){return!!W()&&(e instanceof HTMLElement||e instanceof $(e).HTMLElement)}function Y(e){return!!W()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof $(e).ShadowRoot)}function J(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=el(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function Q(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ee=/transform|translate|scale|rotate|perspective|filter/,et=/paint|layout|strict|content/,en=e=>!!e&&"none"!==e;function er(e){let t=X(e)?el(e):e;return en(t.transform)||en(t.translate)||en(t.scale)||en(t.rotate)||en(t.perspective)||!eo()&&(en(t.backdropFilter)||en(t.filter))||ee.test(t.willChange||"")||et.test(t.contain||"")}function eo(){return null==r&&(r="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),r}function ei(e){return/^(html|body|#document)$/.test(_(e))}function el(e){return $(e).getComputedStyle(e)}function ea(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function es(e){if("html"===_(e))return e;let t=e.assignedSlot||e.parentNode||Y(e)&&e.host||q(e);return Y(t)?t.host:t}function eu(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=es(t);return ei(n)?(t.ownerDocument||t).body:Z(n)&&J(n)?n:e(n)}(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=$(o);if(!i)return t.concat(o,eu(o,[],n));{let e=ec(l);return t.concat(l,l.visualViewport||[],J(o)?o:[],e&&n?eu(e):[])}}function ec(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ef(e){let t=el(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=Z(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=w(n)!==i||w(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function ed(e){return X(e)?e:e.contextElement}function ep(e){let t=ed(e);if(!Z(t))return b(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ef(t),l=(i?w(n.width):n.width)/r,a=(i?w(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eh=b(0);function em(e){let t=$(e);return eo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eh}function eg(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),l=ed(e),a=b(1);t&&(r?X(r)&&(a=ep(r)):a=ep(e));let s=(void 0===(o=n)&&(o=!1),r&&o&&r===$(l))?em(l):b(0),u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(l&&r){let e=$(l),t=X(r)?$(r):r,n=e,o=ec(n);for(;o&&t!==n;){let e=ep(o),t=o.getBoundingClientRect(),r=el(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,f*=e.x,d*=e.y,u+=i,c+=l,o=ec(n=$(o))}}return F({width:f,height:d,x:u,y:c})}function ey(e,t){let n=ea(e).scrollLeft;return t?t.left+n:eg(q(e)).left+n}function ev(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ey(e,n),y:n.top+t.scrollTop}}function ew(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,o=$(e),i=q(e),l=o.visualViewport,a=i.clientWidth,s=i.clientHeight,u=0,c=0;if(l){let e=!eo()||"fixed"===t;r?e||(u=-l.offsetLeft,c=-l.offsetTop):(a=l.width,s=l.height,e&&(u=l.offsetLeft,c=l.offsetTop))}if(0>=ey(i)){let e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),l="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;l<=25&&(a-=l)}return{width:a,height:s,x:u,y:c}}(e,n,t);else if("document"===t)r=function(e){let t=ea(e),n=e.ownerDocument.body,r=v(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=v(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+ey(e),l=-t.scrollTop;return"rtl"===el(n).direction&&(i+=v(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:l}}(q(e));else if(X(t))r=function(e,t){let n=eg(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ep(e),l=e.clientWidth*i.x;return{width:l,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{let n=em(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return F(r)}function ex(e){return"static"===el(e).position}function eb(e,t){if(!Z(e)||"fixed"===el(e).position)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function eS(e,t){var n;let r=$(e);if(Q(e))return r;if(!Z(e)){let t=es(e);for(;t&&!ei(t);){if(X(t)&&!ex(t))return t;t=es(t)}return r}let o=eb(e,t);for(;o&&(n=o,/^(table|td|th)$/.test(_(n)))&&ex(o);)o=eb(o,t);return o&&ei(o)&&ex(o)&&!er(o)?r:o||function(e){let t=es(e);for(;Z(t)&&!ei(t);){if(er(t))return t;if(Q(t))break;t=es(t)}return null}(e)||r}let eR=async function(e){let t=this.getOffsetParent||eS,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=Z(t),o=q(t),i="fixed"===n,l=eg(e,!0,i,t),a={scrollLeft:0,scrollTop:0},s=b(0);if((r||!i)&&(("body"!==_(t)||J(o))&&(a=ea(t)),r)){let e=eg(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&o&&(s.x=ey(o));let u=!o||r||i?b(0):ev(o,a);return{x:l.left+a.scrollLeft-s.x-u.x,y:l.top+a.scrollTop-s.y-u.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i="fixed"===o,l=q(r),a=!!t&&Q(t.floating);if(r===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},u=b(1),c=b(0),f=Z(r);if((f||!i)&&(("body"!==_(r)||J(l))&&(s=ea(r)),f)){let e=eg(r);u=ep(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let d=!l||f||i?b(0):ev(l,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-s.scrollTop*u.y+c.y+d.y}},getDocumentElement:q,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[..."clippingAncestors"===n?Q(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=eu(e,[],!1).filter(e=>X(e)&&"body"!==_(e)),o=null,i="fixed"===el(e).position,l=i?es(e):e;for(;X(l)&&!ei(l);){let e=el(l),t=er(l),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==l),l=es(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=ew(t,i[0],o),a=l.top,s=l.right,u=l.bottom,c=l.left;for(let e=1;e<i.length;e++){let n=ew(t,i[e],o);a=v(n.top,a),s=y(n.right,s),u=y(n.bottom,u),c=v(n.left,c)}return{width:s-c,height:u-a,x:c,y:a}},getOffsetParent:eS,getElementRects:eR,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=ef(e);return{width:t,height:n}},getScale:ep,isElement:X,isRTL:function(e){return"rtl"===el(e).direction}};function ej(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let eA=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:s}=t,{element:u,padding:c=0}=R(e,t)||{};if(null==u)return{};let f=M(c),d={x:n,y:r},p=A(k(o)),h=T(p),m=await l.getDimensions(u),g="y"===p,w=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-d[p]-i.floating[h],b=d[p]-i.reference[p],S=await (null==l.getOffsetParent?void 0:l.getOffsetParent(u)),C=S?S[w]:0;C&&await (null==l.isElement?void 0:l.isElement(S))||(C=a.floating[w]||i.floating[h]);let P=C/2-m[h]/2-1,E=y(f[g?"top":"left"],P),I=y(f[g?"bottom":"right"],P),O=C-m[h]-I,L=C/2-m[h]/2+(x/2-b/2),D=v(E,y(L,O)),F=!s.arrow&&null!=j(o)&&L!==D&&i.reference[h]/2-(L<E?E:I)-m[h]/2<0,K=F?L<E?L-E:L-O:0;return{[p]:d[p]+K,data:{[p]:D,centerOffset:L-D-K,...F&&{alignmentOffset:K}},reset:F}}}),eT=(e,t,n)=>{let r=new Map,o=null!=n?n:{},i={...eC,...o.platform,_c:r};return N(e,t,{...o,platform:i})};var ek="undefined"!=typeof document?o.useLayoutEffect:function(){};function eP(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eP(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!eP(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eE(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eI(e,t){let n=eE(e);return Math.round(t*n)/n}function eO(e){let t=o.useRef(e);return ek(()=>{t.current=e}),t}let eL=e=>({name:"arrow",options:e,fn(t){let{element:n,padding:r}="function"==typeof e?e(t):e;return n&&({}).hasOwnProperty.call(n,"current")?null!=n.current?eA({element:n.current,padding:r}).fn(t):{}:n?eA({element:n,padding:r}).fn(t):{}}}),eD=(e,t)=>{let n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:l,middlewareData:a}=t,s=await V(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eM=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=R(e,t),c={x:n,y:r},f=await i.detectOverflow(t,u),d=k(o),p=A(d),h=c[p],m=c[d],g=(e,t)=>v(t+f["y"===e?"top":"left"],y(t,t-f["y"===e?"bottom":"right"]));l&&(h=g(p,h)),a&&(m=g(d,m));let w=s.fn({...t,[p]:h,[d]:m});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:l,[d]:a}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eF=(e,t)=>({fn:function(e){return void 0===e&&(e={}),{options:e,fn(t){var n,r,o,i;let{x:l,y:a,placement:s,rects:u,middlewareData:c}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=R(e,t),h={x:l,y:a},m=k(s),g=A(m),y=h[g],v=h[m],w=R(f,t),x="number"==typeof w?{mainAxis:w,crossAxis:0}:{mainAxis:null!=(n=w.mainAxis)?n:0,crossAxis:null!=(r=w.crossAxis)?r:0};if(d){let e="y"===g?"height":"width",t=u.reference[g]-u.floating[e]+x.mainAxis,n=u.reference[g]+u.reference[e]-x.mainAxis;y<t?y=t:y>n&&(y=n)}if(p){let e="y"===g?"width":"height",t=G.has(C(s)),n=u.reference[m]-u.floating[e]+(t&&(null==(o=c.offset)?void 0:o[m])||0)+(t?0:x.crossAxis),r=u.reference[m]+u.reference[e]+(t?0:(null==(i=c.offset)?void 0:i[m])||0)-(t?x.crossAxis:0);v<n?v=n:v>r&&(v=r)}return{[g]:y,[m]:v}}}}(e).fn,options:[e,t]}),eK=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,o,i,l;let{placement:a,middlewareData:s,rects:u,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...w}=R(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};let x=C(a),b=k(c),S=C(c)===c,M=await (null==f.isRTL?void 0:f.isRTL(d.floating)),F=m||(S||!v?[D(c)]:function(e){let t=D(e);return[P(e),t,P(t)]}(c)),K="none"!==y;!m&&K&&F.push(...function(e,t,n,r){let o=j(e),i=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?I:E;return t?E:I;case"left":case"right":return t?O:L;default:return[]}}(C(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(P)))),i}(c,v,y,M));let H=[c,...F],N=await f.detectOverflow(t,w),z=[],B=(null==(r=s.flip)?void 0:r.overflows)||[];if(p&&z.push(N[x]),h){let e=function(e,t,n){void 0===n&&(n=!1);let r=j(e),o=A(k(e)),i=T(o),l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=D(l)),[l,D(l)]}(a,u,M);z.push(N[e[0]],N[e[1]])}if(B=[...B,{placement:a,overflows:z}],!z.every(e=>e<=0)){let e=((null==(o=s.flip)?void 0:o.index)||0)+1,t=H[e];if(t&&(!("alignment"===h&&b!==k(t))||B.every(e=>k(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:B},reset:{placement:t}};let n=null==(i=B.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(g){case"bestFit":{let e=null==(l=B.filter(e=>{if(K){let t=k(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:l[0];e&&(n=e);break}case"initialPlacement":n=c}if(a!==n)return{reset:{placement:n}}}return{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eH=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let n,r;let{placement:o,rects:i,platform:l,elements:a}=t,{apply:s=()=>{},...u}=R(e,t),c=await l.detectOverflow(t,u),f=C(o),d=j(o),p="y"===k(o),{width:h,height:m}=i.floating;"top"===f||"bottom"===f?(n=f,r=d===(await (null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(r=f,n="end"===d?"top":"bottom");let g=m-c.top-c.bottom,w=h-c.left-c.right,x=y(m-c[n],g),b=y(h-c[r],w),S=t.middlewareData.shift,A=!S,T=x,P=b;null!=S&&S.enabled.x&&(P=w),null!=S&&S.enabled.y&&(T=g),A&&!d&&(p?P=h-2*v(c.left,c.right):T=m-2*v(c.top,c.bottom)),await s({...t,availableWidth:P,availableHeight:T});let E=await l.getDimensions(a.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eN=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=R(e,t);switch(o){case"referenceHidden":{let e=z(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:B(e)}}}case"escaped":{let e=z(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:B(e)}}}default:return{}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},ez=(e,t)=>{let n=eL(e);return{name:n.name,fn:n.fn,options:[e,t]}};var eB=n(30830),eG=n(92828),eV=n(49397),eW=n(38762),e_=n(45512),e$=Object.defineProperty,eq=(e,t)=>e$(e,"name",{value:t,configurable:!0}),eU="Popper",[eX,eZ]=(0,c.A)(eU),[eY,eJ]=eX(eU),eQ=eq(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[l,a]=o.useState(void 0);return(0,e_.jsx)(eY,{scope:t,anchor:r,onAnchorChange:i,placementState:l,setPlacementState:a,children:n})},"Popper"),e0=o.forwardRef(eq(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,l=eJ("PopperAnchor",n),a=o.useRef(null),s=l.onAnchorChange,c=o.useCallback(e=>{a.current=e,e&&s(e)},[s]),f=(0,u.s)(t,c),d=o.useRef(null);o.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&s(d.current)});let p=l.placementState&&e4(l.placementState),h=p?.[0],m=p?.[1];return r?null:(0,e_.jsx)(eB.sG.div,{"data-radix-popper-side":h,"data-radix-popper-align":m,...i,ref:f})},"PopperAnchor")),e1="PopperContent",[e2,e9]=eX(e1),e5=o.forwardRef(eq(function(e,t){let{__scopePopper:n,side:r="bottom",sideOffset:l=0,align:a="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:w,...b}=e,S=eJ(e1,n),[R,C]=o.useState(null),j=(0,u.s)(t,C),[A,T]=o.useState(null),k=(0,eW.X)(A),P=k?.width??0,E=k?.height??0,I="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},O=Array.isArray(d)?d:[d],L=O.length>0,D={padding:I,boundary:O.filter(e8),altBoundary:L},{refs:M,floatingStyles:F,placement:K,isPositioned:H,middlewareData:N}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:l,elements:{reference:a,floating:s}={},transform:u=!0,whileElementsMounted:c,open:f}=e,[d,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);eP(h,r)||m(r);let[g,y]=o.useState(null),[v,w]=o.useState(null),x=o.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),b=o.useCallback(e=>{e!==j.current&&(j.current=e,w(e))},[]),S=a||g,R=s||v,C=o.useRef(null),j=o.useRef(null),A=o.useRef(d),T=null!=c,k=eO(c),P=eO(l),E=eO(f),I=o.useCallback(()=>{if(!C.current||!j.current)return;let e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),eT(C.current,j.current,e).then(e=>{let t={...e,isPositioned:!1!==E.current};O.current&&!eP(A.current,t)&&(A.current=t,i.flushSync(()=>{p(t)}))})},[h,t,n,P,E]);ek(()=>{!1===f&&A.current.isPositioned&&(A.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[f]);let O=o.useRef(!1);ek(()=>(O.current=!0,()=>{O.current=!1}),[]),ek(()=>{if(S&&(C.current=S),R&&(j.current=R),S&&R){if(k.current)return k.current(S,R,I);I()}},[S,R,I,k,T]);let L=o.useMemo(()=>({reference:C,floating:j,setReference:x,setFloating:b}),[x,b]),D=o.useMemo(()=>({reference:S,floating:R}),[S,R]),M=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eI(D.floating,d.x),r=eI(D.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+r+"px)",...eE(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,u,D.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:I,refs:L,elements:D,floatingStyles:M}),[d,I,L,D,M])}({strategy:"fixed",placement:r+("center"!==a?"-"+a:""),whileElementsMounted:eq((...e)=>(function(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,c=ed(e),f=i||l?[...c?eu(c):[],...t?eu(t):[]]:[];f.forEach(e=>{i&&e.addEventListener("scroll",n),l&&e.addEventListener("resize",n)});let d=c&&s?function(e,t,n){let r,o=null,i=q(e);function l(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function a(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),l();let u=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=u;if(n||t(),!d||!p)return;let h=x(f),m=x(i.clientWidth-(c+d)),g={rootMargin:-h+"px "+-m+"px "+-x(i.clientHeight-(f+p))+"px "+-x(c)+"px",threshold:v(0,y(1,s))||1},w=!0;function b(t){let n=t[0].intersectionRatio;if(!ej(u,e.getBoundingClientRect()))return a();if(n!==s){if(!w)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{o=new IntersectionObserver(b,{...g,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(b,g)}o.observe(e)}let s=$(e),u=()=>a(n);return s.addEventListener("resize",u),a(!0),()=>{s.removeEventListener("resize",u),l()}}(c,n,l):null,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!u&&h.observe(c),t&&h.observe(t));let m=u?eg(e):null;return u&&function t(){let r=eg(e);m&&!ej(m,r)&&n(),m=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{i&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,u&&cancelAnimationFrame(o)}})(...e,{animationFrame:"always"===g}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[eD({mainAxis:l+E,alignmentAxis:s}),f&&eM({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?eF():void 0,...D}),f&&eK({...D}),eH({...D,apply:eq(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:o,height:i}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${o}px`),l.setProperty("--radix-popper-anchor-height",`${i}px`)},"apply")}),A&&ez({element:A,padding:c}),e3({arrowWidth:P,arrowHeight:E}),m&&eN({strategy:"referenceHidden",...D,boundary:L?D.boundary:void 0})]}),z=S.setPlacementState;(0,eV.N)(()=>(z(K),()=>{z(void 0)}),[K,z]);let[B,G]=e4(K),V=(0,eG.c)(w);(0,eV.N)(()=>{H&&V?.()},[H,V]);let W=N.arrow?.x,_=N.arrow?.y,U=N.arrow?.centerOffset!==0,[X,Z]=o.useState();return(0,eV.N)(()=>{R&&Z(window.getComputedStyle(R).zIndex)},[R]),(0,e_.jsx)("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:H?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,e_.jsx)(e2,{scope:n,placedSide:B,placedAlign:G,onArrowChange:T,arrowX:W,arrowY:_,shouldHideArrow:U,children:(0,e_.jsx)(eB.sG.div,{"data-side":B,"data-align":G,...b,ref:j,style:{...b.style,animation:H?b.style?.animation:"none"}})})})},"PopperContent"));function e8(e){return null!==e}eq(e8,"isNotNull");var e3=eq(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[s,u]=e4(n),c={start:"0%",center:"50%",end:"100%"}[u],f=(o.arrow?.x??0)+l/2,d=(o.arrow?.y??0)+a/2,p="",h="";return"bottom"===s?(p=i?c:`${f}px`,h=`${-a}px`):"top"===s?(p=i?c:`${f}px`,h=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,h=i?c:`${d}px`):"left"===s&&(p=`${r.floating.width+a}px`,h=i?c:`${d}px`),{data:{x:p,y:h}}}}),"transformOrigin");function e4(e){let[t,n="center"]=e.split("-");return[t,n]}eq(e4,"getSideAndAlignFromPlacement");var e6=n(80707),e7=n(98060),te=n(12705),tt=n(80397),tn=n(66582),tr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),to=n(72421),ti=n(54669),tl=Object.defineProperty,ta=(e,t)=>tl(e,"name",{value:t,configurable:!0}),ts=[" ","Enter","ArrowUp","ArrowDown"],tu=[" ","Enter"],tc="Select",[tf,td,tp]=(0,s.N)(tc),[th,tm]=(0,c.A)(tc,[tp,eZ]),tg=eZ(),[ty,tv]=th(tc),[tw,tx]=th(tc);function tb(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:l,value:a,defaultValue:s,onValueChange:u,dir:c,name:d,autoComplete:p,disabled:h,required:g,form:y,internal_do_not_use_render:v}=e,w=tg(t),[x,b]=o.useState(null),[S,R]=o.useState(null),[C,j]=o.useState(!1),A=(0,f.jH)(c),[T,k]=(0,tt.i)({prop:r,defaultProp:i??!1,onChange:l,caller:tc}),[P,E]=(0,tt.i)({prop:a,defaultProp:s,onChange:u,caller:tc}),I=o.useRef(null),O=o.useRef(P);o.useEffect(()=>{let e=y?x?.ownerDocument.getElementById(y):x?.form;if(e instanceof HTMLFormElement){let t=ta(()=>E(O.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[y,x,E]);let L=!x||!!y||!!x.closest("form"),[D,M]=o.useState(new Set),F=(0,m.B)(),K=Array.from(D).map(e=>e.props.value).join(";"),H=o.useCallback(e=>{M(t=>new Set(t).add(e))},[]),N=o.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:g,trigger:x,onTriggerChange:b,valueNode:S,onValueNodeChange:R,valueNodeHasChildren:C,onValueNodeHasChildrenChange:j,contentId:F,value:P,onValueChange:E,open:T,onOpenChange:k,dir:A,triggerPointerDownPosRef:I,disabled:h,name:d,autoComplete:p,form:y,nativeOptions:D,nativeSelectKey:K,isFormControl:L};return(0,e_.jsx)(eQ,{...w,children:(0,e_.jsx)(ty,{scope:t,...z,children:(0,e_.jsx)(tf.Provider,{scope:t,children:(0,e_.jsx)(tw,{scope:t,onNativeOptionAdd:H,onNativeOptionRemove:N,children:t1(v)?v(z):n})})})})}ta(tb,"SelectProvider");var tS=ta(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,e_.jsx)(tb,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,e_.jsxs)(e_.Fragment,{children:[n,e?(0,e_.jsx)(t0,{__scopeSelect:t}):null]})})},"Select"),tR=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,l=tg(n),s=tv("SelectTrigger",n),c=s.disabled||r,f=(0,u.s)(t,s.onTriggerChange),d=td(n),p=o.useRef("touch"),[h,m,g]=t9(e=>{let t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=t5(t,e,n);void 0!==r&&s.onValueChange(r.value)}),y=ta(e=>{c||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,e_.jsx)(e0,{asChild:!0,...l,children:(0,e_.jsx)(eB.sG.button,{type:"button",role:"combobox","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":t2(s.value)?"":void 0,...i,ref:f,onClick:(0,a.mK)(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&y(e)}),onPointerDown:(0,a.mK)(i.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&&(y(e),e.preventDefault())}),onKeyDown:(0,a.mK)(i.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&ts.includes(e.key)&&(y(),e.preventDefault())})})})},"SelectTrigger")),tC=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,className:r,style:i,children:l,placeholder:a="",...s}=e,c=tv("SelectValue",n),{onValueNodeHasChildrenChange:f}=c,d=void 0!==l,p=(0,u.s)(t,c.onValueNodeChange);(0,eV.N)(()=>{f(d)},[f,d]);let h=t2(c.value);return(0,e_.jsx)(eB.sG.span,{...s,asChild:!h&&s.asChild,ref:p,style:{pointerEvents:"none"},children:(0,e_.jsx)(o.Fragment,{children:h?a:l},h?"placeholder":"value")})},"SelectValue")),tj=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,children:r,...o}=e;return(0,e_.jsx)(eB.sG.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})},"SelectIcon")),[tA,tT]=th("SelectPortal",{forceMount:void 0}),tk=ta(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,e_.jsx)(tA,{scope:e.__scopeSelect,forceMount:n,children:(0,e_.jsx)(e6.Z,{asChild:!0,...r})})},"SelectPortal"),tP="SelectContent",tE=o.forwardRef(ta(function(e,t){let n=tT(tP,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,l=tv(tP,e.__scopeSelect),[a,s]=o.useState();return(0,eV.N)(()=>{s(new DocumentFragment)},[]),(0,e_.jsx)(e7.C,{present:r||l.open,children:({present:e})=>e?(0,e_.jsx)(tM,{...i,ref:t}):(0,e_.jsx)(tI,{...i,fragment:a})})},"SelectContent")),tI=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,children:r,fragment:o}=e;return o?i.createPortal((0,e_.jsx)(tO,{scope:n,children:(0,e_.jsx)(tf.Slot,{scope:n,children:(0,e_.jsx)("div",{ref:t,children:r})})}),o):null},"SelectContentFragment")),[tO,tL]=th(tP),tD=(0,te.TL)("SelectContent.RemoveScroll"),tM=o.forwardRef(ta(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:s,side:c,sideOffset:f,align:m,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:w,sticky:x,hideWhenDetached:b,avoidCollisions:S,...R}=e,C=tv(tP,n),[j,A]=o.useState(null),[T,k]=o.useState(null),P=(0,u.s)(t,A),[E,I]=o.useState(null),[O,L]=o.useState(null),D=td(n),[M,F]=o.useState(!1),K=o.useRef(!1);o.useEffect(()=>{if(j)return(0,to.Eq)(j)},[j]),(0,p.Oh)();let H=o.useCallback(e=>{let[t,...n]=D().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&T&&(T.scrollTop=0),n===r&&T&&(T.scrollTop=T.scrollHeight),n?.focus(),document.activeElement!==o))return},[D,T]),N=o.useCallback(()=>H([E,j]),[H,E,j]);o.useEffect(()=>{M&&N()},[M,N]);let{onOpenChange:z,triggerPointerDownPosRef:B}=C;o.useEffect(()=>{if(j){let e={x:0,y:0},t=ta(t=>{e={x:Math.abs(Math.round(t.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(B.current?.y??0))}},"handlePointerMove"),n=ta(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(j)||z(!1),document.removeEventListener("pointermove",t),B.current=null},"handlePointerUp");return null!==B.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[j,z,B]),o.useEffect(()=>{let e=ta(()=>z(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);let[G,V]=t9(e=>{let t=D().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=t5(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),W=o.useCallback((e,t,n)=>{let r=!K.current&&!n;(void 0!==C.value&&C.value===t||r)&&(I(e),r&&(K.current=!0))},[C.value]),_=o.useCallback(()=>j?.focus(),[j]),$=o.useCallback((e,t,n)=>{let r=!K.current&&!n;(void 0!==C.value&&C.value===t||r)&&L(e)},[C.value]),q="popper"===r?tK:tF;return(0,e_.jsx)(tO,{scope:n,content:j,viewport:T,onViewportChange:k,itemRefCallback:W,selectedItem:E,onItemLeave:_,itemTextRefCallback:$,focusSelectedItem:N,selectedItemText:O,position:r,isPositioned:M,searchRef:G,children:(0,e_.jsx)(ti.A,{as:tD,allowPinchZoom:!0,children:(0,e_.jsx)(h.n,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,a.mK)(i,e=>{C.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,e_.jsx)(d.qW,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,e_.jsx)(q,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:e=>e.preventDefault(),...R,...q===tK?{side:c,sideOffset:f,align:m,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:w,sticky:x,hideWhenDetached:b,avoidCollisions:S}:{},onPlaced:()=>F(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:(0,a.mK)(R.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||V(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=D().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,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),tF=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=tv(tP,n),s=tL(tP,n),[c,f]=o.useState(null),[d,p]=o.useState(null),h=(0,u.s)(t,p),m=td(n),g=o.useRef(!1),y=o.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=s,S=o.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&w&&x){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==a.dir){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,u=Math.max(s,t.width),f=window.innerWidth-10,d=(0,l.q)(i,[10,Math.max(10,f-u)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,u=Math.max(s,t.width),f=window.innerWidth-10,d=(0,l.q)(i,[10,Math.max(10,f-u)]);c.style.minWidth=s+"px",c.style.right=d+"px"}let i=m(),s=window.innerHeight-20,u=v.scrollHeight,f=window.getComputedStyle(d),p=parseInt(f.borderTopWidth,10),h=parseInt(f.paddingTop,10),y=parseInt(f.borderBottomWidth,10),b=p+h+u+parseInt(f.paddingBottom,10)+y,S=Math.min(5*w.offsetHeight,b),R=window.getComputedStyle(v),C=parseInt(R.paddingTop,10),j=parseInt(R.paddingBottom,10),A=e.top+e.height/2-10,T=w.offsetHeight/2,k=p+h+(w.offsetTop+T);if(k<=A){let e=i.length>0&&w===i[i.length-1].ref.current;c.style.bottom="0px";let t=Math.max(s-A,T+(e?j:0)+(d.clientHeight-v.offsetTop-v.offsetHeight)+y);c.style.height=k+t+"px"}else{let e=i.length>0&&w===i[0].ref.current;c.style.top="0px";let t=Math.max(A,p+v.offsetTop+(e?C:0)+T);c.style.height=t+(b-k)+"px",v.scrollTop=k-A+v.offsetTop}c.style.margin="10px 0",c.style.minHeight=S+"px",c.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[m,a.trigger,a.valueNode,c,d,v,w,x,a.dir,r]);(0,eV.N)(()=>S(),[S]);let[R,C]=o.useState();(0,eV.N)(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);let j=o.useCallback(e=>{e&&!0===y.current&&(S(),b?.(),y.current=!1)},[S,b]);return(0,e_.jsx)(tH,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:j,children:(0,e_.jsx)("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:(0,e_.jsx)(eB.sG.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),tK=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:o=10,...i}=e,l=tg(n);return(0,e_.jsx)(e5,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})},"SelectPopperPosition")),[tH,tN]=th(tP,{}),tz="SelectViewport",tB=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,l=tL(tz,n),s=tN(tz,n),c=(0,u.s)(t,l.onViewportChange),f=o.useRef(0);return(0,e_.jsxs)(e_.Fragment,{children:[(0,e_.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:r}),(0,e_.jsx)(tf.Slot,{scope:n,children:(0,e_.jsx)(eB.sG.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:(0,a.mK)(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(f.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<r){let i=o+e,l=Math.min(r,i),a=i-l;n.style.height=l+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})},"SelectViewport")),[tG,tV]=th("SelectGroup"),tW=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,o=(0,m.B)();return(0,e_.jsx)(tG,{scope:n,id:o,children:(0,e_.jsx)(eB.sG.div,{role:"group","aria-labelledby":o,...r,ref:t})})},"SelectGroup")),t_=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,o=tV("SelectLabel",n);return(0,e_.jsx)(eB.sG.div,{id:o.id,...r,ref:t})},"SelectLabel")),t$="SelectItem",[tq,tU]=th(t$),tX=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:l,...s}=e,c=tv(t$,n),f=tL(t$,n),d=c.value===r,[p,h]=o.useState(l??""),[g,y]=o.useState(!1),v=(0,eG.c)(e=>f.itemRefCallback?.(e,r,i)),w=(0,u.s)(t,v),x=(0,m.B)(),b=o.useRef("touch"),S=ta(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},"handleSelect");return(0,e_.jsx)(tq,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:o.useCallback(e=>{h(t=>t||(e?.textContent??"").trim())},[]),children:(0,e_.jsx)(tf.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,e_.jsx)(eB.sG.div,{role:"option","aria-labelledby":x,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:(0,a.mK)(s.onFocus,()=>y(!0)),onBlur:(0,a.mK)(s.onBlur,()=>y(!1)),onClick:(0,a.mK)(s.onClick,()=>{"mouse"!==b.current&&S()}),onPointerUp:(0,a.mK)(s.onPointerUp,()=>{"mouse"===b.current&&S()}),onPointerDown:(0,a.mK)(s.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:(0,a.mK)(s.onPointerMove,e=>{b.current=e.pointerType,i?f.onItemLeave?.():"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,a.mK)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:(0,a.mK)(s.onKeyDown,e=>{i||e.target!==e.currentTarget||f.searchRef?.current!==""&&" "===e.key||(tu.includes(e.key)&&S()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),tZ="SelectItemText",tY=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,className:r,style:l,...a}=e,s=tv(tZ,n),c=tL(tZ,n),f=tU(tZ,n),d=tx(tZ,n),[p,h]=o.useState(null),m=(0,eG.c)(e=>c.itemTextRefCallback?.(e,f.value,f.disabled)),g=(0,u.s)(t,h,f.onItemTextChange,m),y=p?.textContent,v=o.useMemo(()=>(0,e_.jsx)("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=d;return(0,eV.N)(()=>(w(v),()=>x(v)),[w,x,v]),(0,e_.jsxs)(e_.Fragment,{children:[(0,e_.jsx)(eB.sG.span,{id:f.textId,...a,ref:g}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!t2(s.value)?i.createPortal(a.children,s.valueNode):null]})},"SelectItemText")),tJ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e;return tU("SelectItemIndicator",n).isSelected?(0,e_.jsx)(eB.sG.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),tQ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e;return(0,e_.jsx)(eB.sG.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),t0=o.forwardRef(ta(function({__scopeSelect:e,...t},n){let r=tv("SelectBubbleInput",e),{value:i,onValueChange:l,required:a,disabled:s,name:c,autoComplete:f,form:d}=r,{nativeOptions:p,nativeSelectKey:h}=r,m=o.useRef(null),g=(0,u.s)(n,m),y=i??"",v=(0,tn.Z)(y),w=Array.from(p).some(e=>(e.props.value??"")==="");return o.useEffect(()=>{let e=m.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(v!==y&&t){let n=new Event("change",{bubbles:!0});t.call(e,y),e.dispatchEvent(n)}},[v,y]),(0,e_.jsxs)(eB.sG.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:c,autoComplete:f,disabled:s,form:d,onChange:e=>l(e.target.value),...t,style:{...tr,...t.style},ref:g,defaultValue:y,children:[t2(i)&&!w?(0,e_.jsx)("option",{value:""}):null,Array.from(p)]},h)},"SelectBubbleInput"));function t1(e){return"function"==typeof e}function t2(e){return""===e||void 0===e}function t9(e){let t=(0,eG.c)(e),n=o.useRef(""),r=o.useRef(0),i=o.useCallback(e=>{t(n.current+e)},[t]),l=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,l]}function t5(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,i=t8(e,Math.max(o,0));1===r.length&&(i=i.filter(e=>e!==n));let l=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function t8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ta(t1,"isFunction"),ta(t2,"shouldShowPlaceholder"),ta(t9,"useTypeaheadSearch"),ta(t5,"findNextItem"),ta(t8,"wrapArray")},84969:(e,t,n)=>{n.d(t,{bL:()=>x,zi:()=>b});var r=n(58009),o=n(31412),i=n(29952),l=n(6004),a=n(80397),s=n(38762),u=n(30830),c=n(45512),f=Object.defineProperty,d=(e,t)=>f(e,"name",{value:t,configurable:!0}),p="Switch",[h,m]=(0,l.A)(p),[g,y]=h(p);function v(e){let{__scopeSwitch:t,checked:n,children:o,defaultChecked:i,disabled:l,form:s,name:u,onCheckedChange:f,required:d,value:h="on",internal_do_not_use_render:m}=e,[y,v]=(0,a.i)({prop:n,defaultProp:i??!1,onChange:f,caller:p}),[w,x]=r.useState(null),[b,S]=r.useState(null),C=r.useRef(!1),[j,A]=r.useReducer(e=>e+1,0),T=!w||!!s||!!w.closest("form"),k={checked:y,setChecked:v,disabled:l,control:w,setControl:x,name:u,form:s,value:h,hasConsumerStoppedPropagationRef:C,userInteractionCount:j,onUserInteraction:A,required:d,defaultChecked:i,isFormControl:T,bubbleInput:b,setBubbleInput:S};return(0,c.jsx)(g,{scope:t,...k,children:R(m)?m(k):o})}d(v,"SwitchProvider");var w=r.forwardRef(d(function({__scopeSwitch:e,onClick:t,...n},l){let{control:a,form:s,value:f,disabled:p,checked:h,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:w,onUserInteraction:x,isFormControl:b,bubbleInput:S}=y("SwitchTrigger",e),R=(0,i.s)(l,g),j=r.useRef(h);return r.useEffect(()=>{let e=s?a?.ownerDocument.getElementById(s):a?.form;if(e instanceof HTMLFormElement){let t=d(()=>v(j.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[a,s,v]),(0,c.jsx)(u.sG.button,{type:"button",role:"switch","aria-checked":h,"aria-required":m,"data-state":C(h),"data-disabled":p?"":void 0,disabled:p,value:f,...n,ref:R,onClick:(0,o.mK)(t,e=>{x(),v(e=>!e),S&&b&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())})})},"SwitchTrigger")),x=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:l,disabled:a,value:s,onCheckedChange:u,form:f,...d}=e;return(0,c.jsx)(v,{__scopeSwitch:n,checked:o,defaultChecked:i,disabled:a,required:l,onCheckedChange:u,name:r,form:f,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(w,{...d,ref:t,__scopeSwitch:n}),e&&(0,c.jsx)(S,{__scopeSwitch:n})]})})},"Switch")),b=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,...r}=e,o=y("SwitchThumb",n);return(0,c.jsx)(u.sG.span,{"data-state":C(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),S=r.forwardRef(d(function({__scopeSwitch:e,onClick:t,...n},l){let{control:a,hasConsumerStoppedPropagationRef:f,userInteractionCount:d,checked:p,defaultChecked:h,required:m,disabled:g,name:v,value:w,form:x,bubbleInput:b,setBubbleInput:S}=y("SwitchBubbleInput",e),R=(0,i.s)(l,S),C=(0,s.X)(a),j=r.useRef(!1),A=r.useRef(p),T=r.useRef(d);r.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=d!==T.current;T.current=d;let n=A.current!==p;A.current=p;let r=!(t&&f.current);if(n&&e){j.current=!t;let n=new Event("click",{bubbles:r});e.call(b,p),b.dispatchEvent(n),j.current=!1}},[b,p,f,d]);let k=r.useRef(p);return(0,c.jsx)(u.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??k.current,required:m,disabled:g,name:v,value:w,form:x,...n,tabIndex:-1,ref:R,onClick:(0,o.mK)(t,e=>{j.current&&e.stopPropagation()}),style:{...n.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function R(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}d(R,"isFunction"),d(C,"getState")},93607:(e,t,n)=>{n.d(t,{UC:()=>es,B8:()=>el,bL:()=>ei,l9:()=>ea});var r=n(58009),o=n.t(r,2),i=n(31412),l=n(6004),a=n(39217),s=n(29952),u=n(30096),c=n(30830),f=n(92828),d=n(80397),p=n(59018),h=n(49397),m=Object.defineProperty,g=(e,t)=>m(e,"name",{value:t,configurable:!0}),y=!1;function v(){let[e,t]=r.useState(y);return r.useEffect(()=>{y||(y=!0,t(!0))},[]),e}g(v,"useIsHydrated");var w=o[" useSyncExternalStore ".trim().toString()];function x(){return()=>{}}function b(){return w(x,()=>!0,()=>!1)}g(x,"subscribe"),g(b,"useIsHydratedModern");var S="function"==typeof w?b:v,R=n(45512),C=Object.defineProperty,j=(e,t)=>C(e,"name",{value:t,configurable:!0}),A="rovingFocusGroup.onEntryFocus",T={bubbles:!1,cancelable:!0},k="RovingFocusGroup",[P,E,I]=(0,a.N)(k),[O,L]=(0,l.A)(k,[I]),[D,M]=O(k),F=r.forwardRef(j(function(e,t){return(0,R.jsx)(P.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(P.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(K,{...e,ref:t})})})},"RovingFocusGroup")),K=r.forwardRef(j(function(e,t){let{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:a,currentTabStopId:u,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:g,preventScrollOnEntryFocus:y=!1,...v}=e,w=r.useRef(null),x=(0,s.s)(t,w),b=(0,p.jH)(a),[S,C]=(0,d.i)({prop:u,defaultProp:h??null,onChange:m,caller:k}),[j,P]=r.useState(!1),I=(0,f.c)(g),O=E(n),L=r.useRef(!1),[M,F]=r.useState(0);return r.useEffect(()=>{let e=w.current;if(e)return e.addEventListener(A,I),()=>e.removeEventListener(A,I)},[I]),(0,R.jsx)(D,{scope:n,orientation:o,dir:b,loop:l,currentTabStopId:S,onItemFocus:r.useCallback(e=>C(e),[C]),onItemShiftTab:r.useCallback(()=>P(!0),[]),onFocusableItemAdd:r.useCallback(()=>F(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>F(e=>e-1),[]),children:(0,R.jsx)(c.sG.div,{tabIndex:j||0===M?-1:0,"data-orientation":o,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:(0,i.mK)(e.onMouseDown,()=>{L.current=!0}),onFocus:(0,i.mK)(e.onFocus,e=>{let t=!L.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(A,T);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=O().filter(e=>e.focusable);G([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),y)}}L.current=!1}),onBlur:(0,i.mK)(e.onBlur,()=>P(!1))})})},"RovingFocusGroupImpl")),H=r.forwardRef(j(function(e,t){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:a,children:s,...f}=e,d=(0,u.B)(),p=a||d,m=M("RovingFocusGroupItem",n),g=m.currentTabStopId===p,y=E(n),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:x}=m,b=S();return(0,h.N)(()=>{if(b&&o)return v(),()=>w()},[b,o,v,w]),r.useEffect(()=>{if(!b&&o)return v(),()=>w()},[b,o,v,w]),(0,R.jsx)(P.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,R.jsx)(c.sG.span,{tabIndex:g?0:-1,"data-orientation":m.orientation,...f,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{o?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,i.mK)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){m.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=B(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=y().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=m.loop?V(n,r+1):n.slice(r+1)}setTimeout(()=>G(n))}}),children:"function"==typeof s?s({isCurrentTabStop:g,hasTabStop:null!=x}):s})})},"RovingFocusGroupItem")),N={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function B(e,t,n){let r=z(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return N[r]}function G(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function V(e,t){return e.map((n,r)=>e[(t+r)%e.length])}j(z,"getDirectionAwareKey"),j(B,"getFocusIntent"),j(G,"focusFirst"),j(V,"wrapArray");var W=n(98060),_=Object.defineProperty,$=(e,t)=>_(e,"name",{value:t,configurable:!0}),q="Tabs",[U,X]=(0,l.A)(q,[L]),Z=L(),[Y,J]=U(q),Q=r.forwardRef($(function(e,t){let{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:a,activationMode:s="automatic",...f}=e,h=(0,p.jH)(a),[m,g]=(0,d.i)({prop:r,onChange:o,defaultProp:i??"",caller:q});return(0,R.jsx)(Y,{scope:n,baseId:(0,u.B)(),value:m,onValueChange:g,orientation:l,dir:h,activationMode:s,children:(0,R.jsx)(c.sG.div,{dir:h,"data-orientation":l,...f,ref:t})})},"Tabs")),ee=r.forwardRef($(function(e,t){let{__scopeTabs:n,loop:r=!0,...o}=e,i=J("TabsList",n),l=Z(n);return(0,R.jsx)(F,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:(0,R.jsx)(c.sG.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})},"TabsList")),et=r.forwardRef($(function(e,t){let{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,a=J("TabsTrigger",n),s=Z(n),u=er(a.baseId,r),f=eo(a.baseId,r),d=r===a.value;return(0,R.jsx)(H,{asChild:!0,...s,focusable:!o,active:d,children:(0,R.jsx)(c.sG.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...l,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(r)}),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{!o&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&a.onValueChange(r)}),onFocus:(0,i.mK)(e.onFocus,()=>{let e="manual"!==a.activationMode;d||o||!e||a.onValueChange(r)})})})},"TabsTrigger")),en=r.forwardRef($(function(e,t){let{__scopeTabs:n,value:o,forceMount:i,children:l,...a}=e,s=J("TabsContent",n),u=er(s.baseId,o),f=eo(s.baseId,o),d=o===s.value,p=r.useRef(d);return r.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(W.C,{present:i||d,children:({present:n})=>(0,R.jsx)(c.sG.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:n&&l})})},"TabsContent"));function er(e,t){return`${e}-trigger-${t}`}function eo(e,t){return`${e}-content-${t}`}$(er,"makeTriggerId"),$(eo,"makeContentId");var ei=Q,el=ee,ea=et,es=en},66582:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(58009);function o(e){let t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(0,Object.defineProperty)(o,"name",{value:"usePrevious",configurable:!0})},38762:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(58009),o=n(49397);function i(e){let[t,n]=r.useState(void 0);return(0,o.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(i,"name",{value:"useSize",configurable:!0})}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=2112,exports.ids=[2112],exports.modules={78397:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])},67497:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]])},52706:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},28638:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},17803:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},31393:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},27413:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]])},20554:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("FolderSearch",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]])},87137:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]])},65213:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]])},73388:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(41680).A)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]])},84732:(e,t,r)=>{r.d(t,{CC:()=>z,Q6:()=>q,bL:()=>P,zi:()=>B});var n=r(58009),o=r(29374),i=r(31412),a=r(29952),l=r(6004),d=r(80397),u=r(59018),s=r(66582),c=r(38762),h=r(30830),f=r(39217),p=r(45512),m=Object.defineProperty,y=(e,t)=>m(e,"name",{value:t,configurable:!0}),g=["PageUp","PageDown"],v=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],w={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},b="Slider",[S,x,k]=(0,f.N)(b),[M,A]=(0,l.A)(b,[k]),[j,D]=M(b),P=n.forwardRef(y(function(e,t){let{name:r,min:l=0,max:u=100,step:s=1,orientation:c="horizontal",disabled:h=!1,minStepsBetweenThumbs:f=0,defaultValue:m=[l],value:w,onValueChange:b=y(()=>{},"onValueChange"),onValueCommit:x=y(()=>{},"onValueCommit"),inverted:k=!1,form:M,...A}=e,D=n.useRef(new Set),P=n.useRef(0),R=n.useRef(!1),E="horizontal"===c,[H,z]=n.useState(null),T=(0,a.s)(t,z),[q=[],I]=(0,d.i)({prop:w,defaultProp:m,onChange:y(e=>{let t=[...D.current];t[P.current]?.focus({preventScroll:!0,focusVisible:R.current}),R.current=!1,b(e)},"onChange")}),K=n.useRef(q),_=n.useRef(q);function L(e){let t=X(q,e);O(e,t)}function F(e){O(e,P.current)}function B(){String(q)!==String(K.current)&&x(q)}function O(e,t,{commit:r}={commit:!1}){let n=J(s),i=W(Math.round((e-l)/s)*s+l,n),a=(0,o.q)(i,[l,u]);I((e=[])=>{let n=U(e,a,t);if(!Y(n,f*s))return e;{P.current=n.indexOf(a);let t=String(n)!==String(e);return t&&r&&x(n),t?n:e}})}return n.useEffect(()=>{let e=M?H?.ownerDocument.getElementById(M):H?.closest("form");if(e instanceof HTMLFormElement){let t=y(()=>I(_.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[H,M,I]),y(L,"handleSlideStart"),y(F,"handleSlideMove"),y(B,"handleSlideEnd"),y(O,"updateValues"),(0,p.jsx)(j,{scope:e.__scopeSlider,name:r,disabled:h,min:l,max:u,valueIndexToChangeRef:P,thumbs:D.current,values:q,orientation:c,form:M,children:(0,p.jsx)(S.Provider,{scope:e.__scopeSlider,children:(0,p.jsx)(S.Slot,{scope:e.__scopeSlider,children:(0,p.jsx)(E?V:C,{"aria-disabled":h,"data-disabled":h?"":void 0,...A,ref:T,onPointerDown:(0,i.mK)(A.onPointerDown,()=>{h||(K.current=q,R.current=!1)}),min:l,max:u,inverted:k,onSlideStart:h?void 0:L,onSlideMove:h?void 0:F,onSlideEnd:h?void 0:B,onHomeKeyDown:()=>{h||(R.current=!0,O(l,0,{commit:!0}))},onEndKeyDown:()=>{h||(R.current=!0,O(u,q.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!h){R.current=!0;let r=g.includes(e.key)||e.shiftKey&&v.includes(e.key),n=P.current;O(ee(q[n],{min:l,step:s,direction:t,multiplier:r?10:1}),n,{commit:!0})}}})})})})},"Slider")),[R,E]=M(b,{startEdge:"left",endEdge:"right",size:"width",direction:1}),V=n.forwardRef(y(function(e,t){let{min:r,max:o,dir:i,inverted:l,onSlideStart:d,onSlideMove:s,onSlideEnd:c,onStepKeyDown:h,...f}=e,[m,g]=n.useState(null),v=(0,a.s)(t,g),b=n.useRef(void 0),S=(0,u.jH)(i),x="ltr"===S,k=x&&!l||!x&&l;function M(e){let t=b.current||m.getBoundingClientRect(),n=Q([0,t.width],k?[r,o]:[o,r]);return b.current=t,n(e-t.left)}return y(M,"getValueFromPointer"),(0,p.jsx)(R,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:(0,p.jsx)(H,{dir:S,"data-orientation":"horizontal",...f,ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=M(e.clientX);d?.(t)},onSlideMove:e=>{let t=M(e.clientX);s?.(t)},onSlideEnd:()=>{b.current=void 0,c?.()},onStepKeyDown:e=>{let t=w[k?"from-left":"from-right"].includes(e.key);h?.({event:e,direction:t?-1:1})}})})},"SliderHorizontal")),C=n.forwardRef(y(function(e,t){let{min:r,max:o,inverted:i,onSlideStart:l,onSlideMove:d,onSlideEnd:u,onStepKeyDown:s,...c}=e,h=n.useRef(null),f=(0,a.s)(t,h),m=n.useRef(void 0),g=!i;function v(e){let t=m.current||h.current.getBoundingClientRect(),n=Q([0,t.height],g?[o,r]:[r,o]);return m.current=t,n(e-t.top)}return y(v,"getValueFromPointer"),(0,p.jsx)(R,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:(0,p.jsx)(H,{"data-orientation":"vertical",...c,ref:f,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=v(e.clientY);l?.(t)},onSlideMove:e=>{let t=v(e.clientY);d?.(t)},onSlideEnd:()=>{m.current=void 0,u?.()},onStepKeyDown:e=>{let t=w[g?"from-bottom":"from-top"].includes(e.key);s?.({event:e,direction:t?-1:1})}})})},"SliderVertical")),H=n.forwardRef(y(function(e,t){let{__scopeSlider:r,onSlideStart:n,onSlideMove:o,onSlideEnd:a,onHomeKeyDown:l,onEndKeyDown:d,onStepKeyDown:u,...s}=e,c=D(b,r);return(0,p.jsx)(h.sG.span,{...s,ref:t,onKeyDown:(0,i.mK)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(d(e),e.preventDefault()):g.concat(v).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:(0,i.mK)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),c.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):n(e)}),onPointerMove:(0,i.mK)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)}),onPointerUp:(0,i.mK)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},"SliderImpl")),z=n.forwardRef(y(function(e,t){let{__scopeSlider:r,...n}=e,o=D("SliderTrack",r);return(0,p.jsx)(h.sG.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...n,ref:t})},"SliderTrack")),T="SliderRange",q=n.forwardRef(y(function(e,t){let{__scopeSlider:r,...o}=e,i=D(T,r),l=E(T,r),d=n.useRef(null),u=(0,a.s)(t,d),s=i.values.length,c=i.values.map(e=>G(e,i.min,i.max)),f=s>1?Math.min(...c):0,m=100-Math.max(...c);return(0,p.jsx)(h.sG.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:u,style:{...e.style,[l.startEdge]:f+"%",[l.endEdge]:m+"%"}})},"SliderRange")),[I,K]=M("SliderThumb");function _(e){let{__scopeSlider:t,name:r,children:o,internal_do_not_use_render:i}=e,a=D("SliderThumbProvider",t),l=x(t),[d,u]=n.useState(null),s=n.useMemo(()=>d?l().findIndex(e=>e.ref.current===d):-1,[l,d]),h=(0,c.X)(d),f=!d||!!a.form||!!d.closest("form"),m=a.values[s],y=r??(a.name?a.name+(a.values.length>1?"[]":""):void 0),g=void 0===m?0:G(m,a.min,a.max);n.useEffect(()=>{if(d)return a.thumbs.add(d),()=>{a.thumbs.delete(d)}},[d,a.thumbs]);let v={value:m,name:y,form:a.form,isFormControl:f,index:s,thumb:d,onThumbChange:u,percent:g,size:h};return(0,p.jsx)(I,{scope:t,...v,children:et(i)?i(v):o})}y(_,"SliderThumbProvider");var L="SliderThumbTrigger",F=n.forwardRef(y(function(e,t){let{__scopeSlider:r,...n}=e,o=D(L,r),l=E(L,r),{index:d,value:u,percent:s,size:c,onThumbChange:f}=K(L,r),m=(0,a.s)(t,f),y=N(d,o.values.length),g=c?.[l.size],v=g?Z(g,s,l.direction):0;return(0,p.jsx)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${s}% + ${v}px)`},children:(0,p.jsx)(S.ItemSlot,{scope:r,children:(0,p.jsx)(h.sG.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":o.min,"aria-valuenow":u,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...n,ref:m,style:void 0===u?{display:"none"}:e.style,onFocus:(0,i.mK)(e.onFocus,()=>{o.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),B=n.forwardRef(y(function(e,t){let{__scopeSlider:r,name:n,...o}=e;return(0,p.jsx)(_,{__scopeSlider:r,name:n,internal_do_not_use_render:({index:e,isFormControl:n})=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(F,{...o,ref:t,__scopeSlider:r}),n?(0,p.jsx)(O,{__scopeSlider:r},e):null]})})},"SliderThumb")),O=n.forwardRef(y(function({__scopeSlider:e,...t},r){let{value:o,name:i,form:l}=K("SliderBubbleInput",e),d=n.useRef(null),u=(0,a.s)(d,r),c=(0,s.Z)(o);return n.useEffect(()=>{let e=d.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(c!==o&&t){let r=new Event("input",{bubbles:!0});t.call(e,o),e.dispatchEvent(r)}},[c,o]),(0,p.jsx)(h.sG.input,{style:{display:"none"},name:i,form:l,...t,ref:u,defaultValue:o})},"SliderBubbleInput"));function U(e=[],t,r){let n=[...e];return n[r]=t,n.sort((e,t)=>e-t)}function G(e,t,r){return(0,o.q)(100/(r-t)*(e-t),[0,100])}function N(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}function X(e,t){if(1===e.length)return 0;let r=e.map(e=>Math.abs(e-t)),n=Math.min(...r);return r.indexOf(n)}function Z(e,t,r){let n=e/2,o=Q([0,50],[0,n]);return(n-o(t)*r)*r}function $(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function Y(e,t){return!(t>0)||Math.min(...$(e))>=t}function Q(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function J(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[e,r]=t.split("e"),n=e.split(".")[1]||"",o=Number(r);return Math.max(0,n.length-o)}let r=t.split(".")[1];return r?r.length:0}function W(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}function ee(e,{min:t,step:r,direction:n,multiplier:o}){let i;let a=J(r),l=(e-t)/r,d=Math.round(l);return i=W(d*r+t,a)===W(e,a)?d+o*n:n>0?Math.ceil(l):Math.floor(l),W(i*r+t,a)}function et(e){return"function"==typeof e}y(U,"getNextSortedValues"),y(G,"convertValueToPercentage"),y(N,"getLabel"),y(X,"getClosestValueIndex"),y(Z,"getThumbInBoundsOffset"),y($,"getStepsBetweenValues"),y(Y,"hasMinStepsBetweenValues"),y(Q,"linearScale"),y(J,"getDecimalCount"),y(W,"roundValue"),y(ee,"getNextStepValue"),y(et,"isFunction")}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=4125,exports.ids=[4125],exports.modules={54125:(e,s,t)=>{t.d(s,{S:()=>W});var a=t(45512),r=t(58009);t(28531);var n=t(29362),l=t(20169),i=t(61075),d=t(27413),o=t(16873),c=t(20554),x=t(67497),m=t(73388),u=t(39400),p=t(77722),h=t(75002),g=t(52628),f=t(28712),b=t(84732),j=t(44195);let v=r.forwardRef(({className:e,...s},t)=>(0,a.jsxs)(b.bL,{ref:t,className:(0,j.cn)("relative flex w-full touch-none select-none items-center",e),...s,children:[(0,a.jsx)(b.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-600",children:(0,a.jsx)(b.Q6,{className:"absolute h-full bg-[#57BE6B]"})}),(0,a.jsx)(b.zi,{className:(0,j.cn)("block h-4 w-4 rounded-full bg-white shadow-md ring-0 transition-all","border-2 border-[#57BE6B]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#57BE6B] focus-visible:ring-offset-2","hover:scale-110","disabled:pointer-events-none disabled:opacity-50")})]}));v.displayName=b.bL.displayName;var y=t(78447),N=t(17524),k=t(93732),w=t(98755),C=t(24849),T=t(31393),B=t(17803),L=t(78397),A=t(65213),E=t(37637),R=t(43264);function z({providerId:e,modelId:s,onChange:t}){let[n,l]=(0,r.useState)(!1),[i,d]=(0,r.useState)([]),[c,x]=(0,r.useState)(!1),[m,h]=(0,r.useState)(""),[g,f]=(0,r.useState)(e||"anthropic"),b=(0,r.useCallback)(()=>{f(e||i[0]?.id||"anthropic"),h(""),l(!0)},[e,i]),v=i.find(s=>s.id===e),y=v?.models.find(e=>e.id===s),N=y?`${v?.name} / ${y.name}`:e&&s?`${e} / ${s}`:"选择模型…",k=i.find(e=>e.id===g),z=(k?.models??[]).filter(e=>{if(!m)return!0;let s=m.toLowerCase();return e.id.toLowerCase().includes(s)||e.name.toLowerCase().includes(s)}),S=e=>{t(e.providerId,e.id,{supportsThinking:e.supportsThinking,supportsTemperature:e.supportsTemperature,thinkingLevels:e.thinkingLevels,contextWindow:e.contextWindow,maxTokens:e.maxTokens}),l(!1),h("")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.$,{type:"button",variant:"outline",onClick:b,className:"w-full justify-between font-normal h-10",children:[(0,a.jsx)("span",{className:"truncate text-sm",children:N}),(0,a.jsx)(w.A,{className:"ml-2 h-4 w-4 flex-shrink-0 opacity-50"})]}),(0,a.jsx)(R.lG,{open:n,onOpenChange:l,children:(0,a.jsxs)(R.Cf,{className:"max-w-2xl p-0 gap-0 overflow-hidden",children:[(0,a.jsx)(R.c7,{className:"px-4 pt-4 pb-3 border-b shrink-0",children:(0,a.jsx)(R.L3,{className:"text-base",children:"选择模型"})}),(0,a.jsxs)("div",{className:"flex",style:{height:520},children:[(0,a.jsxs)("div",{className:"w-48 shrink-0 border-r flex flex-col",children:[(0,a.jsx)("div",{className:"px-2 py-1.5 border-b",children:(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-1",children:"提供商"})}),(0,a.jsx)(E.F,{className:"flex-1",children:(0,a.jsxs)("div",{className:"p-1.5 space-y-0.5",children:[c&&!i.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground text-center py-6",children:"加载中…"}),i.map(s=>{let t=s.id===g,r=s.id===e;return(0,a.jsxs)("button",{type:"button",onClick:()=>{f(s.id),h("")},className:(0,j.cn)("w-full text-left rounded-md px-2.5 py-2 transition-colors",t?"bg-secondary":"hover:bg-secondary/40"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[r&&(0,a.jsx)(C.A,{className:"h-3 w-3 text-primary shrink-0"}),(0,a.jsx)("span",{className:(0,j.cn)("text-sm truncate",!t&&"text-muted-foreground"),children:s.name})]}),(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground pl-0",children:[s.models.length," 个模型"]})]},s.id)})]})})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,a.jsx)("div",{className:"px-2 py-1.5 border-b shrink-0",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(o.A,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)(p.p,{placeholder:"搜索模型名称或 ID…",value:m,onChange:e=>h(e.target.value),className:"pl-8 h-8 text-sm",autoFocus:!0})]})}),(0,a.jsx)(E.F,{className:"flex-1",children:(0,a.jsxs)("div",{className:"p-2 space-y-1",children:[0===z.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center py-10",children:m?"无匹配模型":"该提供商暂无模型"}),z.map(t=>{var r;let n=t.providerId===e&&t.id===s;return(0,a.jsxs)("button",{type:"button",onClick:()=>S(t),className:(0,j.cn)("w-full text-left rounded-lg px-3 py-2.5 border transition-colors",n?"border-primary/50 bg-primary/5 dark:bg-primary/10":"border-transparent hover:border-border hover:bg-secondary/40"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium leading-tight",children:t.name}),n&&(0,a.jsx)(C.A,{className:"h-3.5 w-3.5 text-primary shrink-0"})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate mt-0.5",children:t.id})]}),void 0!==t.costInput&&(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground flex items-center gap-0.5 shrink-0 mt-0.5",children:[(0,a.jsx)(T.A,{className:"h-2.5 w-2.5"}),t.costInput,"/",t.costOutput,"/M"]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[(0,a.jsx)($,{icon:(0,a.jsx)(B.A,{className:"h-2.5 w-2.5"}),label:(r=t.contextWindow)>=1e6?`${(r/1e6).toFixed(0)}M ctx`:r>=1e3?`${(r/1e3).toFixed(0)}K ctx`:`${r} ctx`}),t.supportsThinking&&(0,a.jsx)($,{icon:(0,a.jsx)(L.A,{className:"h-2.5 w-2.5"}),label:t.thinkingLevels.length>0?`Thinking (${t.thinkingLevels.join("/")})`:"Thinking",className:"text-purple-600 dark:text-purple-400 border-purple-300 dark:border-purple-700"}),!t.supportsTemperature&&(0,a.jsx)($,{icon:(0,a.jsx)(A.A,{className:"h-2.5 w-2.5"}),label:"无 Temp",className:"text-amber-600 dark:text-amber-400 border-amber-300 dark:border-amber-700"}),t.inputTypes.includes("image")&&(0,a.jsx)($,{label:"\uD83D\uDC41 Vision"})]})]},t.id)})]})})]})]})]})})]})}function $({icon:e,label:s,className:t}){return(0,a.jsxs)("span",{className:(0,j.cn)("inline-flex items-center gap-0.5 rounded border px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground",t),children:[e,s]})}var S=t(6394),F=t(87137),J=t(99905),K=t(28638),I=t(23545);function D({value:e,onChange:s,placeholder:t}){let[n,l]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null),[o,c]=(0,r.useState)(!1),[x,m]=(0,r.useState)(""),h=(0,r.useCallback)(async e=>{c(!0);try{let s=await fetch(`/api/fs/browse?path=${encodeURIComponent(e)}`),t=await s.json();d(t)}catch{}finally{c(!1)}},[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(p.p,{value:e,onChange:e=>s(e.target.value),placeholder:t??"~/projects/my-project",className:"font-mono text-sm flex-1"}),(0,a.jsxs)(u.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let s=e?.trim().replace(/^~/,"~")||"~";m(e||""),h(s.replace(/^~/,"")?s:"~"),l(!0)},className:"shrink-0 gap-1.5",children:[(0,a.jsx)(S.A,{className:"h-4 w-4"}),"浏览"]})]}),(0,a.jsx)(R.lG,{open:n,onOpenChange:l,children:(0,a.jsxs)(R.Cf,{className:"max-w-lg p-0 gap-0",children:[(0,a.jsx)(R.c7,{className:"px-4 pt-4 pb-3 border-b",children:(0,a.jsx)(R.L3,{className:"text-base",children:"选择工作区目录"})}),(0,a.jsxs)("div",{className:"flex items-center gap-1 px-3 py-2 border-b bg-secondary/30 flex-wrap",children:[(0,a.jsx)("button",{type:"button",onClick:()=>h("~"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(0,a.jsx)(F.A,{className:"h-3.5 w-3.5"})}),i?.breadcrumb.slice(1).map((e,s)=>a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(J.A,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("button",{type:"button",onClick:()=>h(e.path),className:"text-xs text-muted-foreground hover:text-foreground transition-colors max-w-[120px] truncate",children:e.label})]},s))]}),(0,a.jsx)(E.F,{className:"h-64",children:(0,a.jsxs)("div",{className:"p-2 space-y-0.5",children:[i?.canGoUp&&(0,a.jsxs)("button",{type:"button",onClick:()=>h(i.parent),className:"w-full flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm text-muted-foreground hover:bg-secondary/60 transition-colors",children:[(0,a.jsx)(K.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"text-xs",children:"返回上级"})]}),o&&!i&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中…"}),!o&&i?.entries.length===0&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"此目录为空"}),i?.entries.map(e=>{let s=x===e.path;return a.jsxs("div",{className:"flex items-center group",children:[a.jsxs("button",{type:"button",onClick:()=>m(e.path),onDoubleClick:()=>h(e.path),className:j.cn("flex-1 flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm transition-colors text-left",s?"bg-[#57BE6B]/15 dark:bg-[#57BE6B]/20 border border-[#57BE6B]/40":"hover:bg-secondary/60 border border-transparent"),children:[a.jsx(I.A,{className:j.cn("h-4 w-4 shrink-0",s?"text-[#57BE6B]":"text-amber-500")}),a.jsx("span",{className:"truncate font-medium",children:e.name}),s&&a.jsx(C.A,{className:"ml-auto h-3.5 w-3.5 text-[#57BE6B] shrink-0"})]}),a.jsx("button",{type:"button",onClick:()=>h(e.path),className:"opacity-0 group-hover:opacity-100 p-2 text-muted-foreground hover:text-foreground transition-all",title:"进入目录",children:a.jsx(J.A,{className:"h-4 w-4"})})]},e.path)})]})}),(0,a.jsx)("div",{className:"px-4 py-2.5 border-t bg-secondary/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:"选中:"}),(0,a.jsx)("code",{className:"text-xs font-mono text-foreground truncate flex-1",children:x||i?.current||"未选择"})]})}),(0,a.jsxs)(R.Es,{className:"px-4 py-3 border-t",children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>l(!1),children:"取消"}),(0,a.jsxs)(u.$,{onClick:()=>{s(x||i?.current||""),l(!1)},disabled:!x&&!i?.current,children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4"}),"选择此目录"]})]})]})})]})}var U=t(68473);let P={off:"关闭",minimal:"最低",low:"低",medium:"中等",high:"高",xhigh:"极高",max:"最大"},V=[{key:"bash",icon:l.A,color:"bg-orange-100 text-orange-600 dark:bg-orange-900/40 dark:text-orange-400",labelKey:"bash",hintKey:"bashHint"},{key:"fileRead",icon:i.A,color:"bg-blue-100 text-blue-600 dark:bg-blue-900/40 dark:text-blue-400",labelKey:"fileRead",hintKey:"fileReadHint"},{key:"fileWrite",icon:d.A,color:"bg-violet-100 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400",labelKey:"fileWrite",hintKey:"fileWriteHint"},{key:"grep",icon:o.A,color:"bg-green-100 text-green-600 dark:bg-green-900/40 dark:text-green-400",labelKey:"grep",hintKey:"grepHint"},{key:"find",icon:c.A,color:"bg-teal-100 text-teal-600 dark:bg-teal-900/40 dark:text-teal-400",labelKey:"find",hintKey:"findHint"},{key:"calculator",icon:x.A,color:"bg-yellow-100 text-yellow-600 dark:bg-yellow-900/40 dark:text-yellow-400",labelKey:"calculator",hintKey:"calculatorHint"}];function W({initialValues:e,onSave:s,saving:t,submitLabel:l}){let i=(0,n.useTranslations)("agents.form"),d=(0,n.useTranslations)("common"),[o,c]=(0,r.useState)({...e}),[x,b]=(0,r.useState)([]),w=function(e,s){let[t,a]=(0,r.useState)({supportsThinking:!1,supportsTemperature:!0,thinkingLevels:[],contextWindow:2e5,maxTokens:8192});return t}(o.model.provider,o.model.modelId),[C,T]=(0,r.useState)(w),B=(e,s)=>c(t=>({...t,[e]:s})),L=(e,s)=>c(t=>({...t,model:{...t.model,[e]:s}})),A=(e,s)=>c(t=>({...t,persona:{...t.persona,[e]:s}})),E=e=>c(s=>({...s,tools:{...s.tools,[e]:!s.tools[e]}})),R=e=>c(s=>({...s,knowledgeBases:s.knowledgeBases.includes(e)?s.knowledgeBases.filter(s=>s!==e):[...s.knowledgeBases,e]})),$=C.supportsThinking&&C.thinkingLevels.length>0?C.thinkingLevels:C.supportsThinking?["low","medium","high","xhigh","max"]:[],S=$.includes(o.model.thinkingLevel)?o.model.thinkingLevel:$[0]??"off",F=Object.values(o.tools).filter(Boolean).length,J=(o.enabledSkills??[]).length;return(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),s(o)},children:[(0,a.jsxs)(N.tU,{defaultValue:"basic",children:[(0,a.jsxs)(N.j7,{className:"mb-6 w-full grid grid-cols-5 h-10",children:[(0,a.jsx)(N.Xi,{value:"basic",className:"text-xs",children:"基本信息"}),(0,a.jsx)(N.Xi,{value:"model",className:"text-xs",children:i("modelConfig")}),(0,a.jsxs)(N.Xi,{value:"tools",className:"text-xs relative",children:[i("toolsConfig"),F>0&&(0,a.jsx)("span",{className:"ml-1 inline-flex items-center justify-center h-4 w-4 rounded-full bg-primary text-primary-foreground text-[9px] font-bold",children:F})]}),(0,a.jsxs)(N.Xi,{value:"skills",className:"text-xs relative",children:["Skills",J>0&&(0,a.jsx)("span",{className:"ml-1 inline-flex items-center justify-center h-4 w-4 rounded-full bg-purple-500 text-white text-[9px] font-bold",children:J})]})]}),(0,a.jsxs)(N.av,{value:"basic",className:"space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.J,{children:i("avatar")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:U.B.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>B("avatar",e),className:(0,j.cn)("h-10 w-10 rounded-xl text-xl transition-all hover:scale-110",o.avatar===e&&"ring-2 ring-primary ring-offset-2 bg-secondary"),children:e},e))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)(g.J,{htmlFor:"name",children:[i("name")," *"]}),(0,a.jsx)(p.p,{id:"name",required:!0,value:o.name,onChange:e=>B("name",e.target.value),placeholder:i("namePlaceholder")})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{htmlFor:"desc",children:i("description")}),(0,a.jsx)(p.p,{id:"desc",value:o.description,onChange:e=>B("description",e.target.value),placeholder:i("descriptionPlaceholder")})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{htmlFor:"prompt",children:i("systemPrompt")}),(0,a.jsx)(h.T,{id:"prompt",rows:8,value:o.systemPrompt,onChange:e=>B("systemPrompt",e.target.value),placeholder:i("systemPromptPlaceholder")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:i("tone")}),(0,a.jsxs)(k.l6,{value:o.persona.tone,onValueChange:e=>A("tone",e),children:[(0,a.jsx)(k.bq,{children:(0,a.jsx)(k.yv,{})}),(0,a.jsx)(k.gC,{children:["formal","casual","friendly","professional"].map(e=>(0,a.jsx)(k.eb,{value:e,children:i(`tones.${e}`)},e))})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:i("language")}),(0,a.jsxs)(k.l6,{value:o.persona.language,onValueChange:e=>A("language",e),children:[(0,a.jsx)(k.bq,{children:(0,a.jsx)(k.yv,{})}),(0,a.jsxs)(k.gC,{children:[(0,a.jsx)(k.eb,{value:"zh-CN",children:"中文(简体)"}),(0,a.jsx)(k.eb,{value:"zh-TW",children:"中文(繁體)"}),(0,a.jsx)(k.eb,{value:"en-US",children:"English"}),(0,a.jsx)(k.eb,{value:"ja-JP",children:"日本語"}),(0,a.jsx)(k.eb,{value:"ko-KR",children:"한국어"})]})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.J,{className:"text-gray-700 dark:text-gray-300",children:i("knowledgeConfig")}),(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:i("knowledgeHint")}),0===x.length?(0,a.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground py-2",children:i("noKnowledge")}):x.map(e=>(0,a.jsxs)("div",{className:"neo-card flex items-center gap-3 rounded-lg p-3 bg-white dark:bg-slate-800/50 hover:scale-[1.01] transition-transform",children:[(0,a.jsx)(f.d,{id:`kb-${e.id}`,checked:o.knowledgeBases.includes(e.id),onCheckedChange:()=>R(e.id)}),(0,a.jsxs)(g.J,{htmlFor:`kb-${e.id}`,className:"cursor-pointer font-normal flex-1 text-gray-800 dark:text-white",children:[e.name,(0,a.jsxs)("span",{className:"ml-2 text-xs text-gray-600 dark:text-muted-foreground",children:[e.documentCount," 文档 \xb7 ",e.chunkCount," 块"]})]})]},e.id))]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)(g.J,{className:"flex items-center gap-1.5",children:["工作区目录",(0,a.jsx)("span",{className:"text-xs text-muted-foreground font-normal",children:"(可选)"})]}),(0,a.jsx)(D,{value:o.workspacePath??"",onChange:e=>B("workspacePath",e),placeholder:"~/projects/my-project (留空使用默认工作区)"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"数字人使用工具时(bash/read/write)的根目录。留空则自动创建专属工作区。"})]})]}),(0,a.jsxs)(N.av,{value:"model",className:"space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:i("modelId")}),(0,a.jsx)(z,{providerId:o.model.provider,modelId:o.model.modelId,onChange:(e,s,t)=>{T(t),c(a=>({...a,model:{...a.model,provider:e,modelId:s,thinkingLevel:t.supportsThinking?"off"!==a.model.thinkingLevel?a.model.thinkingLevel:t.thinkingLevels[0]??"medium":"off"}}))}}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[(0,a.jsxs)(y.E,{variant:"secondary",className:"text-xs font-normal",children:["上下文 ",H(C.contextWindow)]}),(0,a.jsxs)(y.E,{variant:"secondary",className:"text-xs font-normal",children:["输出最大 ",H(C.maxTokens)]}),C.supportsThinking&&(0,a.jsx)(y.E,{className:"text-xs font-normal bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300 border-0 hover:bg-purple-100",children:"\uD83E\uDDE0 支持 Thinking"}),!C.supportsTemperature&&(0,a.jsx)(y.E,{variant:"outline",className:"text-xs font-normal text-amber-600 dark:text-amber-400 border-amber-300 dark:border-amber-600",children:"\uD83C\uDF21 无 Temperature"})]})]}),C.supportsThinking&&$.length>0&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:i("thinkingLevel")}),(0,a.jsxs)(k.l6,{value:S,onValueChange:e=>L("thinkingLevel",e),children:[(0,a.jsx)(k.bq,{children:(0,a.jsx)(k.yv,{})}),(0,a.jsx)(k.gC,{children:$.map(e=>(0,a.jsx)(k.eb,{value:e,children:P[e]??e},e))})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"思考深度越高,推理越准确,Token 消耗也会增加。"})]}),C.supportsTemperature&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(g.J,{children:i("temperature")}),(0,a.jsx)("span",{className:"text-sm tabular-nums text-muted-foreground",children:o.model.temperature.toFixed(2)})]}),(0,a.jsx)(v,{min:0,max:1,step:.01,value:[o.model.temperature],onValueChange:([e])=>L("temperature",e)}),(0,a.jsxs)("div",{className:"flex justify-between text-[11px] text-muted-foreground px-0.5",children:[(0,a.jsx)("span",{children:"精确 0.00"}),(0,a.jsx)("span",{children:"平衡 0.70"}),(0,a.jsx)("span",{children:"创意 1.00"})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(g.J,{children:i("maxTokens")}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["上限 ",H(C.maxTokens)]})]}),(0,a.jsx)(p.p,{type:"number",min:256,max:C.maxTokens||2e5,value:o.model.maxTokens,onChange:e=>L("maxTokens",Math.min(Number(e.target.value),C.maxTokens||2e5))})]})]}),(0,a.jsxs)(N.av,{value:"tools",className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:"开启后数字人可在对话中使用对应工具。点击卡片切换。"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[V.map(({key:e,icon:s,color:t,labelKey:r,hintKey:n})=>{let l=o.tools[e];return(0,a.jsxs)("button",{type:"button",onClick:()=>E(e),className:(0,j.cn)("flex items-center gap-4 rounded-xl p-4 text-left transition-all",l?"neo-card-inset border-2 border-blue-200 bg-blue-50 dark:border-[#57BE6B]/60 dark:bg-[#57BE6B]/20 shadow-sm":"neo-button bg-white dark:bg-transparent border border-gray-200 dark:border-border hover:border-blue-300 dark:hover:border-zinc-600 hover:scale-[1.01]"),children:[(0,a.jsx)("div",{className:(0,j.cn)("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",t),children:(0,a.jsx)(s,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-800 dark:text-white",children:i(`tools.${r}`)}),(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground mt-0.5",children:i(`tools.${n}`)})]}),(0,a.jsx)(q,{enabled:l})]},e)}),(0,a.jsxs)("button",{type:"button",onClick:()=>c(e=>({...e,voice:{enabled:!e.voice.enabled}})),className:(0,j.cn)("flex items-center gap-4 rounded-xl p-4 text-left transition-all",o.voice.enabled?"neo-card-inset border-2 border-green-200 bg-green-50 dark:border-green-500/60 dark:bg-green-500/20 shadow-sm":"neo-button bg-white dark:bg-transparent border border-gray-200 dark:border-border hover:border-green-300 dark:hover:border-zinc-600 hover:scale-[1.01]"),children:[(0,a.jsx)("div",{className:(0,j.cn)("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",o.voice.enabled?"bg-green-500 text-white":"bg-gray-100 text-gray-500 dark:bg-muted dark:text-muted-foreground"),children:(0,a.jsx)(m.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-800 dark:text-white",children:"语音功能"}),(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground mt-0.5",children:"启用语音朗读功能(全局供应商在设置中配置)"})]}),(0,a.jsx)(q,{enabled:o.voice.enabled})]})]})]}),(0,a.jsx)(N.av,{value:"skills",className:"space-y-3",children:(0,a.jsx)("div",{className:"neo-card flex items-start gap-3 rounded-xl border-2 border-purple-200 dark:border-purple-800 bg-purple-50 dark:bg-purple-900/20 p-4",children:(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Skills 功能允许agent使用自定义工具和能力。"})})})})]}),(0,a.jsx)("div",{className:"mt-6 flex justify-end",children:(0,a.jsx)(u.$,{type:"submit",disabled:t||!o.name.trim(),className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white",children:t?d("loading"):l??d("save")})})]})}function H(e){return e>=1e6?`${(e/1e6).toFixed(0)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function q({enabled:e,color:s="default"}){return(0,a.jsx)("div",{className:(0,j.cn)("h-[22px] w-10 rounded-full transition-colors duration-200 shrink-0 relative",e?"bg-[#57BE6B]":"bg-zinc-300 dark:bg-zinc-600"),children:(0,a.jsx)("div",{className:(0,j.cn)("absolute top-[3px] h-4 w-4 rounded-full bg-white shadow-md transition-transform duration-200",e?"translate-x-[19px]":"translate-x-[3px]")})})}},78447:(e,s,t)=>{t.d(s,{E:()=>i});var a=t(45512);t(58009);var r=t(21643),n=t(44195);let l=(0,r.F)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i({className:e,variant:s,...t}){return(0,a.jsx)("div",{className:(0,n.cn)(l({variant:s}),e),...t})}},39400:(e,s,t)=>{t.d(s,{$:()=>o});var a=t(45512),r=t(58009),n=t(12705),l=t(21643),i=t(44195);let d=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=r.forwardRef(({className:e,variant:s,size:t,asChild:r=!1,...l},o)=>{let c=r?n.DX:"button";return(0,a.jsx)(c,{className:(0,i.cn)(d({variant:s,size:t,className:e})),ref:o,...l})});o.displayName="Button"},43264:(e,s,t)=>{t.d(s,{Cf:()=>m,Es:()=>p,L3:()=>h,c7:()=>u,lG:()=>d,rr:()=>g});var a=t(45512),r=t(58009),n=t(27553),l=t(44269),i=t(44195);let d=n.bL;n.l9;let o=n.ZL,c=n.bm,x=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.hJ,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s}));x.displayName=n.hJ.displayName;let m=r.forwardRef(({className:e,children:s,...t},r)=>(0,a.jsxs)(o,{children:[(0,a.jsx)(x,{}),(0,a.jsxs)(n.UC,{ref:r,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 rounded-lg",e),...t,children:[s,(0,a.jsx)(c,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:(0,a.jsx)(l.A,{className:"h-4 w-4"})})]})]}));m.displayName=n.UC.displayName;let u=({className:e,...s})=>(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...s});u.displayName="DialogHeader";let p=({className:e,...s})=>(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});p.displayName="DialogFooter";let h=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",e),...s}));h.displayName=n.hE.displayName;let g=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",e),...s}));g.displayName=n.VY.displayName},77722:(e,s,t)=>{t.d(s,{p:()=>l});var a=t(45512),r=t(58009),n=t(44195);let l=r.forwardRef(({className:e,type:s,...t},r)=>(0,a.jsx)("input",{type:s,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));l.displayName="Input"},52628:(e,s,t)=>{t.d(s,{J:()=>i});var a=t(45512),r=t(58009),n=t(92405),l=t(44195);let i=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.b,{ref:t,className:(0,l.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...s}));i.displayName=n.b.displayName},93732:(e,s,t)=>{t.d(s,{bq:()=>x,eb:()=>u,gC:()=>m,l6:()=>o,yv:()=>c});var a=t(45512),r=t(58009),n=t(16091),l=t(98755),i=t(24849),d=t(44195);let o=n.bL;n.YJ;let c=n.WT,x=r.forwardRef(({className:e,children:s,...t},r)=>(0,a.jsxs)(n.l9,{ref:r,className:(0,d.cn)("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:[s,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(l.A,{className:"h-4 w-4 opacity-50"})})]}));x.displayName=n.l9.displayName;let m=r.forwardRef(({className:e,children:s,position:t="popper",...r},l)=>(0,a.jsx)(n.ZL,{children:(0,a.jsx)(n.UC,{ref:l,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-white dark:bg-zinc-800 text-foreground shadow-xl animate-in fade-in-0 zoom-in-95","popper"===t&&"translate-y-1",e),position:t,...r,children:(0,a.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===t&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:s})})}));m.displayName=n.UC.displayName;let u=r.forwardRef(({className:e,children:s,...t},r)=>(0,a.jsxs)(n.q7,{ref:r,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})}),(0,a.jsx)(n.p4,{children:s})]}));u.displayName=n.q7.displayName,r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.JU,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-xs font-semibold",e),...s})).displayName=n.JU.displayName,r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",e),...s})).displayName=n.wv.displayName},28712:(e,s,t)=>{t.d(s,{d:()=>i});var a=t(45512),r=t(58009),n=t(84969),l=t(44195);let i=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.bL,{className:(0,l.cn)("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=unchecked]:bg-zinc-300 dark:data-[state=unchecked]:bg-zinc-600","data-[state=checked]:bg-[#57BE6B]",e),...s,ref:t,children:(0,a.jsx)(n.zi,{className:(0,l.cn)("pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-md ring-0","transition-transform duration-200","data-[state=checked]:translate-x-[18px] data-[state=unchecked]:translate-x-0")})}));i.displayName=n.bL.displayName},17524:(e,s,t)=>{t.d(s,{Xi:()=>o,av:()=>c,j7:()=>d,tU:()=>i});var a=t(45512),r=t(58009),n=t(93607),l=t(44195);let i=n.bL,d=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.B8,{ref:t,className:(0,l.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...s}));d.displayName=n.B8.displayName;let o=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.l9,{ref:t,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...s}));o.displayName=n.l9.displayName;let c=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)(n.UC,{ref:t,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...s}));c.displayName=n.UC.displayName},75002:(e,s,t)=>{t.d(s,{T:()=>l});var a=t(45512),r=t(58009),n=t(44195);let l=r.forwardRef(({className:e,...s},t)=>(0,a.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...s}));l.displayName="Textarea"},68473:(e,s,t)=>{t.d(s,{B:()=>r,k:()=>a});let a={name:"",avatar:"\uD83E\uDD16",description:"",systemPrompt:"",persona:{tone:"friendly",language:"zh-CN"},model:{provider:"anthropic",modelId:"claude-opus-4-5",temperature:.7,maxTokens:8192,thinkingLevel:"medium"},voice:{enabled:!1},tools:{bash:!1,fileRead:!1,fileWrite:!1,grep:!1,find:!1,calculator:!1},knowledgeBases:[],enabledSkills:[],workspacePath:""},r=["\uD83E\uDD16","\uD83E\uDDE0","\uD83D\uDCA1","\uD83C\uDFAF","\uD83C\uDF1F","\uD83E\uDDBE","\uD83D\uDC7E","\uD83C\uDFAD","\uD83D\uDC68‍\uD83D\uDCBC","\uD83D\uDC69‍\uD83D\uDCBC","\uD83D\uDC68‍\uD83C\uDFEB","\uD83D\uDC69‍\uD83C\uDFEB","\uD83D\uDC68‍\uD83D\uDCBB","\uD83D\uDC69‍\uD83D\uDCBB","\uD83E\uDDD1‍\uD83C\uDFA8","\uD83E\uDDD1‍\uD83D\uDD2C","\uD83D\uDC09","\uD83E\uDD8A","\uD83D\uDC3C","\uD83E\uDD81","\uD83D\uDC2C","\uD83E\uDD8B","\uD83C\uDF08","⚡"]}};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2733],{8207:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])},8453:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]])},3518:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},1902:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},9257:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},4807:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},8501:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]])},4081:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},6308:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},5364:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FolderSearch",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]])},7257:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},6507:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]])},5027:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]])},5220:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]])},5900:(e,t,n)=>{n.d(t,{CC:()=>z,Q6:()=>_,bL:()=>P,zi:()=>B});var r=n(2115),o=n(1786),a=n(3610),l=n(8068),i=n(8166),d=n(7924),u=n(4256),s=n(858),h=n(7510),c=n(3360),f=n(8050),p=n(5155),m=Object.defineProperty,y=(e,t)=>m(e,"name",{value:t,configurable:!0}),g=["PageUp","PageDown"],v=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],k={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},w="Slider",[b,M,S]=(0,f.N)(w),[x,A]=(0,i.A)(w,[S]),[j,D]=x(w),P=r.forwardRef(y(function(e,t){let{name:n,min:i=0,max:u=100,step:s=1,orientation:h="horizontal",disabled:c=!1,minStepsBetweenThumbs:f=0,defaultValue:m=[i],value:k,onValueChange:w=y(()=>{},"onValueChange"),onValueCommit:M=y(()=>{},"onValueCommit"),inverted:S=!1,form:x,...A}=e,D=r.useRef(new Set),P=r.useRef(0),E=r.useRef(!1),H="horizontal"===h,[C,z]=r.useState(null),T=(0,l.s)(t,z),[_=[],q]=(0,d.i)({prop:k,defaultProp:m,onChange:y(e=>{var t;null===(t=[...D.current][P.current])||void 0===t||t.focus({preventScroll:!0,focusVisible:E.current}),E.current=!1,w(e)},"onChange")}),I=r.useRef(_),K=r.useRef(_);function F(e){let t=G(_,e);N(e,t)}function L(e){N(e,P.current)}function B(){String(_)!==String(I.current)&&M(_)}function N(e,t){let{commit:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{commit:!1},r=W(s),a=$(Math.round((e-i)/s)*s+i,r),l=(0,o.q)(a,[i,u]);q(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=O(e,l,t);if(!Q(r,f*s))return e;{P.current=r.indexOf(l);let t=String(r)!==String(e);return t&&n&&M(r),t?r:e}})}return r.useEffect(()=>{let e=x?null==C?void 0:C.ownerDocument.getElementById(x):null==C?void 0:C.closest("form");if(e instanceof HTMLFormElement){let t=y(()=>q(K.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[C,x,q]),y(F,"handleSlideStart"),y(L,"handleSlideMove"),y(B,"handleSlideEnd"),y(N,"updateValues"),(0,p.jsx)(j,{scope:e.__scopeSlider,name:n,disabled:c,min:i,max:u,valueIndexToChangeRef:P,thumbs:D.current,values:_,orientation:h,form:x,children:(0,p.jsx)(b.Provider,{scope:e.__scopeSlider,children:(0,p.jsx)(b.Slot,{scope:e.__scopeSlider,children:(0,p.jsx)(H?R:V,{"aria-disabled":c,"data-disabled":c?"":void 0,...A,ref:T,onPointerDown:(0,a.mK)(A.onPointerDown,()=>{c||(I.current=_,E.current=!1)}),min:i,max:u,inverted:S,onSlideStart:c?void 0:F,onSlideMove:c?void 0:L,onSlideEnd:c?void 0:B,onHomeKeyDown:()=>{c||(E.current=!0,N(i,0,{commit:!0}))},onEndKeyDown:()=>{c||(E.current=!0,N(u,_.length-1,{commit:!0}))},onStepKeyDown:e=>{let{event:t,direction:n}=e;if(!c){E.current=!0;let e=g.includes(t.key)||t.shiftKey&&v.includes(t.key),r=P.current;N(ee(_[r],{min:i,step:s,direction:n,multiplier:e?10:1}),r,{commit:!0})}}})})})})},"Slider")),[E,H]=x(w,{startEdge:"left",endEdge:"right",size:"width",direction:1}),R=r.forwardRef(y(function(e,t){let{min:n,max:o,dir:a,inverted:i,onSlideStart:d,onSlideMove:s,onSlideEnd:h,onStepKeyDown:c,...f}=e,[m,g]=r.useState(null),v=(0,l.s)(t,g),w=r.useRef(void 0),b=(0,u.jH)(a),M="ltr"===b,S=M&&!i||!M&&i;function x(e){let t=w.current||m.getBoundingClientRect(),r=J([0,t.width],S?[n,o]:[o,n]);return w.current=t,r(e-t.left)}return y(x,"getValueFromPointer"),(0,p.jsx)(E,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:(0,p.jsx)(C,{dir:b,"data-orientation":"horizontal",...f,ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=x(e.clientX);null==d||d(t)},onSlideMove:e=>{let t=x(e.clientX);null==s||s(t)},onSlideEnd:()=>{w.current=void 0,null==h||h()},onStepKeyDown:e=>{let t=k[S?"from-left":"from-right"].includes(e.key);null==c||c({event:e,direction:t?-1:1})}})})},"SliderHorizontal")),V=r.forwardRef(y(function(e,t){let{min:n,max:o,inverted:a,onSlideStart:i,onSlideMove:d,onSlideEnd:u,onStepKeyDown:s,...h}=e,c=r.useRef(null),f=(0,l.s)(t,c),m=r.useRef(void 0),g=!a;function v(e){let t=m.current||c.current.getBoundingClientRect(),r=J([0,t.height],g?[o,n]:[n,o]);return m.current=t,r(e-t.top)}return y(v,"getValueFromPointer"),(0,p.jsx)(E,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:(0,p.jsx)(C,{"data-orientation":"vertical",...h,ref:f,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=v(e.clientY);null==i||i(t)},onSlideMove:e=>{let t=v(e.clientY);null==d||d(t)},onSlideEnd:()=>{m.current=void 0,null==u||u()},onStepKeyDown:e=>{let t=k[g?"from-bottom":"from-top"].includes(e.key);null==s||s({event:e,direction:t?-1:1})}})})},"SliderVertical")),C=r.forwardRef(y(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:l,onHomeKeyDown:i,onEndKeyDown:d,onStepKeyDown:u,...s}=e,h=D(w,n);return(0,p.jsx)(c.sG.span,{...s,ref:t,onKeyDown:(0,a.mK)(e.onKeyDown,e=>{"Home"===e.key?(i(e),e.preventDefault()):"End"===e.key?(d(e),e.preventDefault()):g.concat(v).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:(0,a.mK)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),h.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:(0,a.mK)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)}),onPointerUp:(0,a.mK)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),l(e))})})},"SliderImpl")),z=r.forwardRef(y(function(e,t){let{__scopeSlider:n,...r}=e,o=D("SliderTrack",n);return(0,p.jsx)(c.sG.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})},"SliderTrack")),T="SliderRange",_=r.forwardRef(y(function(e,t){let{__scopeSlider:n,...o}=e,a=D(T,n),i=H(T,n),d=r.useRef(null),u=(0,l.s)(t,d),s=a.values.length,h=a.values.map(e=>U(e,a.min,a.max)),f=s>1?Math.min(...h):0,m=100-Math.max(...h);return(0,p.jsx)(c.sG.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...o,ref:u,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:m+"%"}})},"SliderRange")),[q,I]=x("SliderThumb");function K(e){let{__scopeSlider:t,name:n,children:o,internal_do_not_use_render:a}=e,l=D("SliderThumbProvider",t),i=M(t),[d,u]=r.useState(null),s=r.useMemo(()=>d?i().findIndex(e=>e.ref.current===d):-1,[i,d]),c=(0,h.X)(d),f=!d||!!l.form||!!d.closest("form"),m=l.values[s],y=null!=n?n:l.name?l.name+(l.values.length>1?"[]":""):void 0,g=void 0===m?0:U(m,l.min,l.max);r.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]);let v={value:m,name:y,form:l.form,isFormControl:f,index:s,thumb:d,onThumbChange:u,percent:g,size:c};return(0,p.jsx)(q,{scope:t,...v,children:et(a)?a(v):o})}y(K,"SliderThumbProvider");var F="SliderThumbTrigger",L=r.forwardRef(y(function(e,t){let{__scopeSlider:n,...r}=e,o=D(F,n),i=H(F,n),{index:d,value:u,percent:s,size:h,onThumbChange:f}=I(F,n),m=(0,l.s)(t,f),y=Z(d,o.values.length),g=null==h?void 0:h[i.size],v=g?X(g,s,i.direction):0;return(0,p.jsx)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:"calc(".concat(s,"% + ").concat(v,"px)")},children:(0,p.jsx)(b.ItemSlot,{scope:n,children:(0,p.jsx)(c.sG.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":o.min,"aria-valuenow":u,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...r,ref:m,style:void 0===u?{display:"none"}:e.style,onFocus:(0,a.mK)(e.onFocus,()=>{o.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),B=r.forwardRef(y(function(e,t){let{__scopeSlider:n,name:r,...o}=e;return(0,p.jsx)(K,{__scopeSlider:n,name:r,internal_do_not_use_render:e=>{let{index:r,isFormControl:a}=e;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(L,{...o,ref:t,__scopeSlider:n}),a?(0,p.jsx)(N,{__scopeSlider:n},r):null]})}})},"SliderThumb")),N=r.forwardRef(y(function(e,t){let{__scopeSlider:n,...o}=e,{value:a,name:i,form:d}=I("SliderBubbleInput",n),u=r.useRef(null),h=(0,l.s)(u,t),f=(0,s.Z)(a);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(f!==a&&t){let n=new Event("input",{bubbles:!0});t.call(e,a),e.dispatchEvent(n)}},[f,a]),(0,p.jsx)(c.sG.input,{style:{display:"none"},name:i,form:d,...o,ref:h,defaultValue:a})},"SliderBubbleInput"));function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function U(e,t,n){return(0,o.q)(100/(n-t)*(e-t),[0,100])}function Z(e,t){return t>2?"Value ".concat(e+1," of ").concat(t):2===t?["Minimum","Maximum"][e]:void 0}function G(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function X(e,t,n){let r=e/2,o=J([0,50],[0,r]);return(r-o(t)*n)*n}function Y(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Q(e,t){return!(t>0)||Math.min(...Y(e))>=t}function J(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function W(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[e,n]=t.split("e"),r=e.split(".")[1]||"",o=Number(n);return Math.max(0,r.length-o)}let n=t.split(".")[1];return n?n.length:0}function $(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}function ee(e,t){let n,{min:r,step:o,direction:a,multiplier:l}=t,i=W(o),d=(e-r)/o,u=Math.round(d);return n=$(u*o+r,i)===$(e,i)?u+l*a:a>0?Math.ceil(d):Math.floor(d),$(n*o+r,i)}function et(e){return"function"==typeof e}y(O,"getNextSortedValues"),y(U,"convertValueToPercentage"),y(Z,"getLabel"),y(G,"getClosestValueIndex"),y(X,"getThumbInBoundsOffset"),y(Y,"getStepsBetweenValues"),y(Q,"hasMinStepsBetweenValues"),y(J,"linearScale"),y(W,"getDecimalCount"),y($,"roundValue"),y(ee,"getNextStepValue"),y(et,"isFunction")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3923],{3923:(e,t,s)=>{s.d(t,{S:()=>X});var r=s(5155),a=s(2115);s(8173);var n=s(7266),l=s(6609),i=s(4081),o=s(8501),d=s(853),c=s(5364),x=s(8453),u=s(5220),m=s(3312),p=s(3900),h=s(6754),f=s(8986),g=s(488),b=s(5900),v=s(1567);let j=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsxs)(b.bL,{ref:t,className:(0,v.cn)("relative flex w-full touch-none select-none items-center",s),...a,children:[(0,r.jsx)(b.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-600",children:(0,r.jsx)(b.Q6,{className:"absolute h-full bg-[#57BE6B]"})}),(0,r.jsx)(b.zi,{className:(0,v.cn)("block h-4 w-4 rounded-full bg-white shadow-md ring-0 transition-all","border-2 border-[#57BE6B]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#57BE6B] focus-visible:ring-offset-2","hover:scale-110","disabled:pointer-events-none disabled:opacity-50")})]})});j.displayName=b.bL.displayName;var y=s(5121),N=s(2884),k=s(7528),w=s(1719),C=s(8867),T=s(4807),B=s(9257),L=s(8207),E=s(5027),A=s(7995),R=s(1344);let z=null,F=null;function S(){return z?Promise.resolve(z):F||(F=fetch("/api/models").then(e=>e.json()).then(e=>(z=e,e)))}function J(e){return{supportsThinking:e.supportsThinking,supportsTemperature:e.supportsTemperature,thinkingLevels:e.thinkingLevels,contextWindow:e.contextWindow,maxTokens:e.maxTokens}}function K(e){var t;let{providerId:s,modelId:n,onChange:l}=e,[i,o]=(0,a.useState)(!1),[c,x]=(0,a.useState)(null!=z?z:[]),[u,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(""),[b,j]=(0,a.useState)(s||"anthropic");(0,a.useEffect)(()=>{if(z){x(z);return}h(!0),S().then(e=>x(e)).finally(()=>h(!1))},[]),(0,a.useEffect)(()=>{s&&j(s)},[s]);let y=(0,a.useCallback)(()=>{var e;j(s||(null===(e=c[0])||void 0===e?void 0:e.id)||"anthropic"),g(""),o(!0)},[s,c]),N=c.find(e=>e.id===s),k=null==N?void 0:N.models.find(e=>e.id===n),F=k?"".concat(null==N?void 0:N.name," / ").concat(k.name):s&&n?"".concat(s," / ").concat(n):"选择模型…",K=c.find(e=>e.id===b),D=(null!==(t=null==K?void 0:K.models)&&void 0!==t?t:[]).filter(e=>{if(!f)return!0;let t=f.toLowerCase();return e.id.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)}),P=e=>{l(e.providerId,e.id,J(e)),o(!1),g("")};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m.$,{type:"button",variant:"outline",onClick:y,className:"w-full justify-between font-normal h-10",children:[(0,r.jsx)("span",{className:"truncate text-sm",children:F}),(0,r.jsx)(w.A,{className:"ml-2 h-4 w-4 flex-shrink-0 opacity-50"})]}),(0,r.jsx)(R.lG,{open:i,onOpenChange:o,children:(0,r.jsxs)(R.Cf,{className:"max-w-2xl p-0 gap-0 overflow-hidden",children:[(0,r.jsx)(R.c7,{className:"px-4 pt-4 pb-3 border-b shrink-0",children:(0,r.jsx)(R.L3,{className:"text-base",children:"选择模型"})}),(0,r.jsxs)("div",{className:"flex",style:{height:520},children:[(0,r.jsxs)("div",{className:"w-48 shrink-0 border-r flex flex-col",children:[(0,r.jsx)("div",{className:"px-2 py-1.5 border-b",children:(0,r.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-1",children:"提供商"})}),(0,r.jsx)(A.F,{className:"flex-1",children:(0,r.jsxs)("div",{className:"p-1.5 space-y-0.5",children:[u&&!c.length&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground text-center py-6",children:"加载中…"}),c.map(e=>{let t=e.id===b,a=e.id===s;return(0,r.jsxs)("button",{type:"button",onClick:()=>{j(e.id),g("")},className:(0,v.cn)("w-full text-left rounded-md px-2.5 py-2 transition-colors",t?"bg-secondary":"hover:bg-secondary/40"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[a&&(0,r.jsx)(C.A,{className:"h-3 w-3 text-primary shrink-0"}),(0,r.jsx)("span",{className:(0,v.cn)("text-sm truncate",!t&&"text-muted-foreground"),children:e.name})]}),(0,r.jsxs)("span",{className:"text-[11px] text-muted-foreground pl-0",children:[e.models.length," 个模型"]})]},e.id)})]})})]}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,r.jsx)("div",{className:"px-2 py-1.5 border-b shrink-0",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(d.A,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)(p.p,{placeholder:"搜索模型名称或 ID…",value:f,onChange:e=>g(e.target.value),className:"pl-8 h-8 text-sm",autoFocus:!0})]})}),(0,r.jsx)(A.F,{className:"flex-1",children:(0,r.jsxs)("div",{className:"p-2 space-y-1",children:[0===D.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground text-center py-10",children:f?"无匹配模型":"该提供商暂无模型"}),D.map(e=>{var t;let a=e.providerId===s&&e.id===n;return(0,r.jsxs)("button",{type:"button",onClick:()=>P(e),className:(0,v.cn)("w-full text-left rounded-lg px-3 py-2.5 border transition-colors",a?"border-primary/50 bg-primary/5 dark:bg-primary/10":"border-transparent hover:border-border hover:bg-secondary/40"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-sm font-medium leading-tight",children:e.name}),a&&(0,r.jsx)(C.A,{className:"h-3.5 w-3.5 text-primary shrink-0"})]}),(0,r.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate mt-0.5",children:e.id})]}),void 0!==e.costInput&&(0,r.jsxs)("span",{className:"text-[11px] text-muted-foreground flex items-center gap-0.5 shrink-0 mt-0.5",children:[(0,r.jsx)(T.A,{className:"h-2.5 w-2.5"}),e.costInput,"/",e.costOutput,"/M"]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[(0,r.jsx)(I,{icon:(0,r.jsx)(B.A,{className:"h-2.5 w-2.5"}),label:(t=e.contextWindow)>=1e6?"".concat((t/1e6).toFixed(0),"M ctx"):t>=1e3?"".concat((t/1e3).toFixed(0),"K ctx"):"".concat(t," ctx")}),e.supportsThinking&&(0,r.jsx)(I,{icon:(0,r.jsx)(L.A,{className:"h-2.5 w-2.5"}),label:e.thinkingLevels.length>0?"Thinking (".concat(e.thinkingLevels.join("/"),")"):"Thinking",className:"text-purple-600 dark:text-purple-400 border-purple-300 dark:border-purple-700"}),!e.supportsTemperature&&(0,r.jsx)(I,{icon:(0,r.jsx)(E.A,{className:"h-2.5 w-2.5"}),label:"无 Temp",className:"text-amber-600 dark:text-amber-400 border-amber-300 dark:border-amber-700"}),e.inputTypes.includes("image")&&(0,r.jsx)(I,{label:"\uD83D\uDC41 Vision"})]})]},e.id)})]})})]})]})]})})]})}function I(e){let{icon:t,label:s,className:a}=e;return(0,r.jsxs)("span",{className:(0,v.cn)("inline-flex items-center gap-0.5 rounded border px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground",a),children:[t,s]})}var D=s(6308),P=s(6507),U=s(6967),V=s(1902),W=s(7257);function H(e){let{value:t,onChange:s,placeholder:n}=e,[l,i]=(0,a.useState)(!1),[o,d]=(0,a.useState)(null),[c,x]=(0,a.useState)(!1),[u,h]=(0,a.useState)(""),f=(0,a.useCallback)(async e=>{x(!0);try{let t=await fetch("/api/fs/browse?path=".concat(encodeURIComponent(e))),s=await t.json();d(s)}catch(e){}finally{x(!1)}},[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(p.p,{value:t,onChange:e=>s(e.target.value),placeholder:null!=n?n:"~/projects/my-project",className:"font-mono text-sm flex-1"}),(0,r.jsxs)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e=(null==t?void 0:t.trim().replace(/^~/,"~"))||"~";h(t||""),f(e.replace(/^~/,"")?e:"~"),i(!0)},className:"shrink-0 gap-1.5",children:[(0,r.jsx)(D.A,{className:"h-4 w-4"}),"浏览"]})]}),(0,r.jsx)(R.lG,{open:l,onOpenChange:i,children:(0,r.jsxs)(R.Cf,{className:"max-w-lg p-0 gap-0",children:[(0,r.jsx)(R.c7,{className:"px-4 pt-4 pb-3 border-b",children:(0,r.jsx)(R.L3,{className:"text-base",children:"选择工作区目录"})}),(0,r.jsxs)("div",{className:"flex items-center gap-1 px-3 py-2 border-b bg-secondary/30 flex-wrap",children:[(0,r.jsx)("button",{type:"button",onClick:()=>f("~"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(0,r.jsx)(P.A,{className:"h-3.5 w-3.5"})}),null==o?void 0:o.breadcrumb.slice(1).map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(U.A,{className:"h-3 w-3 text-muted-foreground"}),(0,r.jsx)("button",{type:"button",onClick:()=>f(e.path),className:"text-xs text-muted-foreground hover:text-foreground transition-colors max-w-[120px] truncate",children:e.label})]},t))]}),(0,r.jsx)(A.F,{className:"h-64",children:(0,r.jsxs)("div",{className:"p-2 space-y-0.5",children:[(null==o?void 0:o.canGoUp)&&(0,r.jsxs)("button",{type:"button",onClick:()=>f(o.parent),className:"w-full flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm text-muted-foreground hover:bg-secondary/60 transition-colors",children:[(0,r.jsx)(V.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"text-xs",children:"返回上级"})]}),c&&!o&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中…"}),!c&&(null==o?void 0:o.entries.length)===0&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"此目录为空"}),null==o?void 0:o.entries.map(e=>{let t=u===e.path;return(0,r.jsxs)("div",{className:"flex items-center group",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>h(e.path),onDoubleClick:()=>f(e.path),className:(0,v.cn)("flex-1 flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm transition-colors text-left",t?"bg-[#57BE6B]/15 dark:bg-[#57BE6B]/20 border border-[#57BE6B]/40":"hover:bg-secondary/60 border border-transparent"),children:[(0,r.jsx)(W.A,{className:(0,v.cn)("h-4 w-4 shrink-0",t?"text-[#57BE6B]":"text-amber-500")}),(0,r.jsx)("span",{className:"truncate font-medium",children:e.name}),t&&(0,r.jsx)(C.A,{className:"ml-auto h-3.5 w-3.5 text-[#57BE6B] shrink-0"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>f(e.path),className:"opacity-0 group-hover:opacity-100 p-2 text-muted-foreground hover:text-foreground transition-all",title:"进入目录",children:(0,r.jsx)(U.A,{className:"h-4 w-4"})})]},e.path)})]})}),(0,r.jsx)("div",{className:"px-4 py-2.5 border-t bg-secondary/20",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:"选中:"}),(0,r.jsx)("code",{className:"text-xs font-mono text-foreground truncate flex-1",children:u||(null==o?void 0:o.current)||"未选择"})]})}),(0,r.jsxs)(R.Es,{className:"px-4 py-3 border-t",children:[(0,r.jsx)(m.$,{variant:"outline",onClick:()=>i(!1),children:"取消"}),(0,r.jsxs)(m.$,{onClick:()=>{s(u||(null==o?void 0:o.current)||""),i(!1)},disabled:!u&&!(null==o?void 0:o.current),children:[(0,r.jsx)(D.A,{className:"mr-2 h-4 w-4"}),"选择此目录"]})]})]})})]})}var M=s(3701);let q={off:"关闭",minimal:"最低",low:"低",medium:"中等",high:"高",xhigh:"极高",max:"最大"},$=[{key:"bash",icon:l.A,color:"bg-orange-100 text-orange-600 dark:bg-orange-900/40 dark:text-orange-400",labelKey:"bash",hintKey:"bashHint"},{key:"fileRead",icon:i.A,color:"bg-blue-100 text-blue-600 dark:bg-blue-900/40 dark:text-blue-400",labelKey:"fileRead",hintKey:"fileReadHint"},{key:"fileWrite",icon:o.A,color:"bg-violet-100 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400",labelKey:"fileWrite",hintKey:"fileWriteHint"},{key:"grep",icon:d.A,color:"bg-green-100 text-green-600 dark:bg-green-900/40 dark:text-green-400",labelKey:"grep",hintKey:"grepHint"},{key:"find",icon:c.A,color:"bg-teal-100 text-teal-600 dark:bg-teal-900/40 dark:text-teal-400",labelKey:"find",hintKey:"findHint"},{key:"calculator",icon:x.A,color:"bg-yellow-100 text-yellow-600 dark:bg-yellow-900/40 dark:text-yellow-400",labelKey:"calculator",hintKey:"calculatorHint"}];function X(e){var t,s,l;let{initialValues:i,onSave:o,saving:d,submitLabel:c}=e,x=(0,n.useTranslations)("agents.form"),b=(0,n.useTranslations)("common"),[w,C]=(0,a.useState)({...i}),[T,B]=(0,a.useState)([]),L=function(e,t){let[s,r]=(0,a.useState)({supportsThinking:!1,supportsTemperature:!0,thinkingLevels:[],contextWindow:2e5,maxTokens:8192});return(0,a.useEffect)(()=>{e&&t&&S().then(s=>{var a;let n=null===(a=s.find(t=>t.id===e))||void 0===a?void 0:a.models.find(e=>e.id===t);n&&r(J(n))})},[e,t]),s}(w.model.provider,w.model.modelId),[E,A]=(0,a.useState)(L);(0,a.useEffect)(()=>{A(L)},[L.supportsThinking,L.supportsTemperature,L.contextWindow,L.maxTokens]),(0,a.useEffect)(()=>{fetch("/api/knowledge").then(e=>e.json()).then(B).catch(()=>{})},[]);let R=(e,t)=>C(s=>({...s,[e]:t})),z=(e,t)=>C(s=>({...s,model:{...s.model,[e]:t}})),F=(e,t)=>C(s=>({...s,persona:{...s.persona,[e]:t}})),I=e=>C(t=>({...t,tools:{...t.tools,[e]:!t.tools[e]}})),D=e=>C(t=>({...t,knowledgeBases:t.knowledgeBases.includes(e)?t.knowledgeBases.filter(t=>t!==e):[...t.knowledgeBases,e]})),P=E.supportsThinking&&E.thinkingLevels.length>0?E.thinkingLevels:E.supportsThinking?["low","medium","high","xhigh","max"]:[],U=P.includes(w.model.thinkingLevel)?w.model.thinkingLevel:null!==(t=P[0])&&void 0!==t?t:"off",V=Object.values(w.tools).filter(Boolean).length,W=(null!==(s=w.enabledSkills)&&void 0!==s?s:[]).length;return(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),o(w)},children:[(0,r.jsxs)(N.tU,{defaultValue:"basic",children:[(0,r.jsxs)(N.j7,{className:"mb-6 w-full grid grid-cols-5 h-10",children:[(0,r.jsx)(N.Xi,{value:"basic",className:"text-xs",children:"基本信息"}),(0,r.jsx)(N.Xi,{value:"model",className:"text-xs",children:x("modelConfig")}),(0,r.jsxs)(N.Xi,{value:"tools",className:"text-xs relative",children:[x("toolsConfig"),V>0&&(0,r.jsx)("span",{className:"ml-1 inline-flex items-center justify-center h-4 w-4 rounded-full bg-primary text-primary-foreground text-[9px] font-bold",children:V})]}),(0,r.jsxs)(N.Xi,{value:"skills",className:"text-xs relative",children:["Skills",W>0&&(0,r.jsx)("span",{className:"ml-1 inline-flex items-center justify-center h-4 w-4 rounded-full bg-purple-500 text-white text-[9px] font-bold",children:W})]})]}),(0,r.jsxs)(N.av,{value:"basic",className:"space-y-5",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(f.J,{children:x("avatar")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:M.B.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>R("avatar",e),className:(0,v.cn)("h-10 w-10 rounded-xl text-xl transition-all hover:scale-110",w.avatar===e&&"ring-2 ring-primary ring-offset-2 bg-secondary"),children:e},e))})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)(f.J,{htmlFor:"name",children:[x("name")," *"]}),(0,r.jsx)(p.p,{id:"name",required:!0,value:w.name,onChange:e=>R("name",e.target.value),placeholder:x("namePlaceholder")})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(f.J,{htmlFor:"desc",children:x("description")}),(0,r.jsx)(p.p,{id:"desc",value:w.description,onChange:e=>R("description",e.target.value),placeholder:x("descriptionPlaceholder")})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(f.J,{htmlFor:"prompt",children:x("systemPrompt")}),(0,r.jsx)(h.T,{id:"prompt",rows:8,value:w.systemPrompt,onChange:e=>R("systemPrompt",e.target.value),placeholder:x("systemPromptPlaceholder")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(f.J,{children:x("tone")}),(0,r.jsxs)(k.l6,{value:w.persona.tone,onValueChange:e=>F("tone",e),children:[(0,r.jsx)(k.bq,{children:(0,r.jsx)(k.yv,{})}),(0,r.jsx)(k.gC,{children:["formal","casual","friendly","professional"].map(e=>(0,r.jsx)(k.eb,{value:e,children:x("tones.".concat(e))},e))})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(f.J,{children:x("language")}),(0,r.jsxs)(k.l6,{value:w.persona.language,onValueChange:e=>F("language",e),children:[(0,r.jsx)(k.bq,{children:(0,r.jsx)(k.yv,{})}),(0,r.jsxs)(k.gC,{children:[(0,r.jsx)(k.eb,{value:"zh-CN",children:"中文(简体)"}),(0,r.jsx)(k.eb,{value:"zh-TW",children:"中文(繁體)"}),(0,r.jsx)(k.eb,{value:"en-US",children:"English"}),(0,r.jsx)(k.eb,{value:"ja-JP",children:"日本語"}),(0,r.jsx)(k.eb,{value:"ko-KR",children:"한국어"})]})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(f.J,{className:"text-gray-700 dark:text-gray-300",children:x("knowledgeConfig")}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:x("knowledgeHint")}),0===T.length?(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground py-2",children:x("noKnowledge")}):T.map(e=>(0,r.jsxs)("div",{className:"neo-card flex items-center gap-3 rounded-lg p-3 bg-white dark:bg-slate-800/50 hover:scale-[1.01] transition-transform",children:[(0,r.jsx)(g.d,{id:"kb-".concat(e.id),checked:w.knowledgeBases.includes(e.id),onCheckedChange:()=>D(e.id)}),(0,r.jsxs)(f.J,{htmlFor:"kb-".concat(e.id),className:"cursor-pointer font-normal flex-1 text-gray-800 dark:text-white",children:[e.name,(0,r.jsxs)("span",{className:"ml-2 text-xs text-gray-600 dark:text-muted-foreground",children:[e.documentCount," 文档 \xb7 ",e.chunkCount," 块"]})]})]},e.id))]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)(f.J,{className:"flex items-center gap-1.5",children:["工作区目录",(0,r.jsx)("span",{className:"text-xs text-muted-foreground font-normal",children:"(可选)"})]}),(0,r.jsx)(H,{value:null!==(l=w.workspacePath)&&void 0!==l?l:"",onChange:e=>R("workspacePath",e),placeholder:"~/projects/my-project (留空使用默认工作区)"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"数字人使用工具时(bash/read/write)的根目录。留空则自动创建专属工作区。"})]})]}),(0,r.jsxs)(N.av,{value:"model",className:"space-y-5",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(f.J,{children:x("modelId")}),(0,r.jsx)(K,{providerId:w.model.provider,modelId:w.model.modelId,onChange:(e,t,s)=>{A(s),C(r=>{var a;return{...r,model:{...r.model,provider:e,modelId:t,thinkingLevel:s.supportsThinking?"off"!==r.model.thinkingLevel?r.model.thinkingLevel:null!==(a=s.thinkingLevels[0])&&void 0!==a?a:"medium":"off"}}})}}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[(0,r.jsxs)(y.E,{variant:"secondary",className:"text-xs font-normal",children:["上下文 ",O(E.contextWindow)]}),(0,r.jsxs)(y.E,{variant:"secondary",className:"text-xs font-normal",children:["输出最大 ",O(E.maxTokens)]}),E.supportsThinking&&(0,r.jsx)(y.E,{className:"text-xs font-normal bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300 border-0 hover:bg-purple-100",children:"\uD83E\uDDE0 支持 Thinking"}),!E.supportsTemperature&&(0,r.jsx)(y.E,{variant:"outline",className:"text-xs font-normal text-amber-600 dark:text-amber-400 border-amber-300 dark:border-amber-600",children:"\uD83C\uDF21 无 Temperature"})]})]}),E.supportsThinking&&P.length>0&&(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(f.J,{children:x("thinkingLevel")}),(0,r.jsxs)(k.l6,{value:U,onValueChange:e=>z("thinkingLevel",e),children:[(0,r.jsx)(k.bq,{children:(0,r.jsx)(k.yv,{})}),(0,r.jsx)(k.gC,{children:P.map(e=>{var t;return(0,r.jsx)(k.eb,{value:e,children:null!==(t=q[e])&&void 0!==t?t:e},e)})})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"思考深度越高,推理越准确,Token 消耗也会增加。"})]}),E.supportsTemperature&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(f.J,{children:x("temperature")}),(0,r.jsx)("span",{className:"text-sm tabular-nums text-muted-foreground",children:w.model.temperature.toFixed(2)})]}),(0,r.jsx)(j,{min:0,max:1,step:.01,value:[w.model.temperature],onValueChange:e=>{let[t]=e;return z("temperature",t)}}),(0,r.jsxs)("div",{className:"flex justify-between text-[11px] text-muted-foreground px-0.5",children:[(0,r.jsx)("span",{children:"精确 0.00"}),(0,r.jsx)("span",{children:"平衡 0.70"}),(0,r.jsx)("span",{children:"创意 1.00"})]})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(f.J,{children:x("maxTokens")}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["上限 ",O(E.maxTokens)]})]}),(0,r.jsx)(p.p,{type:"number",min:256,max:E.maxTokens||2e5,value:w.model.maxTokens,onChange:e=>z("maxTokens",Math.min(Number(e.target.value),E.maxTokens||2e5))})]})]}),(0,r.jsxs)(N.av,{value:"tools",className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:"开启后数字人可在对话中使用对应工具。点击卡片切换。"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[$.map(e=>{let{key:t,icon:s,color:a,labelKey:n,hintKey:l}=e,i=w.tools[t];return(0,r.jsxs)("button",{type:"button",onClick:()=>I(t),className:(0,v.cn)("flex items-center gap-4 rounded-xl p-4 text-left transition-all",i?"neo-card-inset border-2 border-blue-200 bg-blue-50 dark:border-[#57BE6B]/60 dark:bg-[#57BE6B]/20 shadow-sm":"neo-button bg-white dark:bg-transparent border border-gray-200 dark:border-border hover:border-blue-300 dark:hover:border-zinc-600 hover:scale-[1.01]"),children:[(0,r.jsx)("div",{className:(0,v.cn)("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",a),children:(0,r.jsx)(s,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-800 dark:text-white",children:x("tools.".concat(n))}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground mt-0.5",children:x("tools.".concat(l))})]}),(0,r.jsx)(G,{enabled:i})]},t)}),(0,r.jsxs)("button",{type:"button",onClick:()=>C(e=>({...e,voice:{enabled:!e.voice.enabled}})),className:(0,v.cn)("flex items-center gap-4 rounded-xl p-4 text-left transition-all",w.voice.enabled?"neo-card-inset border-2 border-green-200 bg-green-50 dark:border-green-500/60 dark:bg-green-500/20 shadow-sm":"neo-button bg-white dark:bg-transparent border border-gray-200 dark:border-border hover:border-green-300 dark:hover:border-zinc-600 hover:scale-[1.01]"),children:[(0,r.jsx)("div",{className:(0,v.cn)("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",w.voice.enabled?"bg-green-500 text-white":"bg-gray-100 text-gray-500 dark:bg-muted dark:text-muted-foreground"),children:(0,r.jsx)(u.A,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-gray-800 dark:text-white",children:"语音功能"}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground mt-0.5",children:"启用语音朗读功能(全局供应商在设置中配置)"})]}),(0,r.jsx)(G,{enabled:w.voice.enabled})]})]})]}),(0,r.jsx)(N.av,{value:"skills",className:"space-y-3",children:(0,r.jsx)("div",{className:"neo-card flex items-start gap-3 rounded-xl border-2 border-purple-200 dark:border-purple-800 bg-purple-50 dark:bg-purple-900/20 p-4",children:(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Skills 功能允许agent使用自定义工具和能力。"})})})})]}),(0,r.jsx)("div",{className:"mt-6 flex justify-end",children:(0,r.jsx)(m.$,{type:"submit",disabled:d||!w.name.trim(),className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white",children:d?b("loading"):null!=c?c:b("save")})})]})}function O(e){return e>=1e6?"".concat((e/1e6).toFixed(0),"M"):e>=1e3?"".concat((e/1e3).toFixed(0),"K"):String(e)}function G(e){let{enabled:t,color:s="default"}=e;return(0,r.jsx)("div",{className:(0,v.cn)("h-[22px] w-10 rounded-full transition-colors duration-200 shrink-0 relative",t?"bg-[#57BE6B]":"bg-zinc-300 dark:bg-zinc-600"),children:(0,r.jsx)("div",{className:(0,v.cn)("absolute top-[3px] h-4 w-4 rounded-full bg-white shadow-md transition-transform duration-200",t?"translate-x-[19px]":"translate-x-[3px]")})})}},5121:(e,t,s)=>{s.d(t,{E:()=>i});var r=s(5155);s(2115);var a=s(1027),n=s(1567);let l=(0,a.F)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:s,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)(l({variant:s}),t),...a})}},3312:(e,t,s)=>{s.d(t,{$:()=>d});var r=s(5155),a=s(2115),n=s(2317),l=s(1027),i=s(1567);let o=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>{let{className:s,variant:a,size:l,asChild:d=!1,...c}=e,x=d?n.DX:"button";return(0,r.jsx)(x,{className:(0,i.cn)(o({variant:a,size:l,className:s})),ref:t,...c})});d.displayName="Button"},1344:(e,t,s)=>{s.d(t,{Cf:()=>u,Es:()=>p,L3:()=>h,c7:()=>m,lG:()=>o,rr:()=>f});var r=s(5155),a=s(2115),n=s(6217),l=s(767),i=s(1567);let o=n.bL;n.l9;let d=n.ZL,c=n.bm,x=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.hJ,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...a})});x.displayName=n.hJ.displayName;let u=a.forwardRef((e,t)=>{let{className:s,children:a,...o}=e;return(0,r.jsxs)(d,{children:[(0,r.jsx)(x,{}),(0,r.jsxs)(n.UC,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 rounded-lg",s),...o,children:[a,(0,r.jsx)(c,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]})]})});u.displayName=n.UC.displayName;let m=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...s})};m.displayName="DialogHeader";let p=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};p.displayName="DialogFooter";let h=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",s),...a})});h.displayName=n.hE.displayName;let f=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",s),...a})});f.displayName=n.VY.displayName},3900:(e,t,s)=>{s.d(t,{p:()=>l});var r=s(5155),a=s(2115),n=s(1567);let l=a.forwardRef((e,t)=>{let{className:s,type:a,...l}=e;return(0,r.jsx)("input",{type:a,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...l})});l.displayName="Input"},8986:(e,t,s)=>{s.d(t,{J:()=>i});var r=s(5155),a=s(2115),n=s(6195),l=s(1567);let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.b,{ref:t,className:(0,l.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...a})});i.displayName=n.b.displayName},7995:(e,t,s)=>{s.d(t,{F:()=>i});var r=s(5155),a=s(2115),n=s(1868),l=s(1567);let i=a.forwardRef((e,t)=>{let{className:s,children:a,...i}=e;return(0,r.jsxs)(n.bL,{ref:t,className:(0,l.cn)("relative overflow-hidden",s),...i,children:[(0,r.jsx)(n.LM,{className:"h-full w-full rounded-[inherit]",children:a}),(0,r.jsx)(o,{}),(0,r.jsx)(n.OK,{})]})});i.displayName=n.bL.displayName;let o=a.forwardRef((e,t)=>{let{className:s,orientation:a="vertical",...i}=e;return(0,r.jsx)(n.VM,{ref:t,orientation:a,className:(0,l.cn)("flex touch-none select-none transition-colors","vertical"===a&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...i,children:(0,r.jsx)(n.lr,{className:"relative flex-1 rounded-full bg-border"})})});o.displayName=n.VM.displayName},7528:(e,t,s)=>{s.d(t,{bq:()=>x,eb:()=>m,gC:()=>u,l6:()=>d,yv:()=>c});var r=s(5155),a=s(2115),n=s(965),l=s(1719),i=s(8867),o=s(1567);let d=n.bL;n.YJ;let c=n.WT,x=a.forwardRef((e,t)=>{let{className:s,children:a,...i}=e;return(0,r.jsxs)(n.l9,{ref:t,className:(0,o.cn)("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),...i,children:[a,(0,r.jsx)(n.In,{asChild:!0,children:(0,r.jsx)(l.A,{className:"h-4 w-4 opacity-50"})})]})});x.displayName=n.l9.displayName;let u=a.forwardRef((e,t)=>{let{className:s,children:a,position:l="popper",...i}=e;return(0,r.jsx)(n.ZL,{children:(0,r.jsx)(n.UC,{ref:t,className:(0,o.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-white dark:bg-zinc-800 text-foreground shadow-xl animate-in fade-in-0 zoom-in-95","popper"===l&&"translate-y-1",s),position:l,...i,children:(0,r.jsx)(n.LM,{className:(0,o.cn)("p-1","popper"===l&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})})});u.displayName=n.UC.displayName;let m=a.forwardRef((e,t)=>{let{className:s,children:a,...l}=e;return(0,r.jsxs)(n.q7,{ref:t,className:(0,o.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(n.VF,{children:(0,r.jsx)(i.A,{className:"h-4 w-4"})})}),(0,r.jsx)(n.p4,{children:a})]})});m.displayName=n.q7.displayName,a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.JU,{ref:t,className:(0,o.cn)("py-1.5 pl-8 pr-2 text-xs font-semibold",s),...a})}).displayName=n.JU.displayName,a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.wv,{ref:t,className:(0,o.cn)("-mx-1 my-1 h-px bg-muted",s),...a})}).displayName=n.wv.displayName},488:(e,t,s)=>{s.d(t,{d:()=>i});var r=s(5155),a=s(2115),n=s(2413),l=s(1567);let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.bL,{className:(0,l.cn)("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=unchecked]:bg-zinc-300 dark:data-[state=unchecked]:bg-zinc-600","data-[state=checked]:bg-[#57BE6B]",s),...a,ref:t,children:(0,r.jsx)(n.zi,{className:(0,l.cn)("pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-md ring-0","transition-transform duration-200","data-[state=checked]:translate-x-[18px] data-[state=unchecked]:translate-x-0")})})});i.displayName=n.bL.displayName},2884:(e,t,s)=>{s.d(t,{Xi:()=>d,av:()=>c,j7:()=>o,tU:()=>i});var r=s(5155),a=s(2115),n=s(3078),l=s(1567);let i=n.bL,o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.B8,{ref:t,className:(0,l.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a})});o.displayName=n.B8.displayName;let d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.l9,{ref:t,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a})});d.displayName=n.l9.displayName;let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)(n.UC,{ref:t,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",s),...a})});c.displayName=n.UC.displayName},6754:(e,t,s)=>{s.d(t,{T:()=>l});var r=s(5155),a=s(2115),n=s(1567);let l=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...a})});l.displayName="Textarea"},1567:(e,t,s)=>{s.d(t,{cn:()=>n});var r=s(3463),a=s(9795);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,r.$)(t))}},3701:(e,t,s)=>{s.d(t,{B:()=>a,k:()=>r});let r={name:"",avatar:"\uD83E\uDD16",description:"",systemPrompt:"",persona:{tone:"friendly",language:"zh-CN"},model:{provider:"anthropic",modelId:"claude-opus-4-5",temperature:.7,maxTokens:8192,thinkingLevel:"medium"},voice:{enabled:!1},tools:{bash:!1,fileRead:!1,fileWrite:!1,grep:!1,find:!1,calculator:!1},knowledgeBases:[],enabledSkills:[],workspacePath:""},a=["\uD83E\uDD16","\uD83E\uDDE0","\uD83D\uDCA1","\uD83C\uDFAF","\uD83C\uDF1F","\uD83E\uDDBE","\uD83D\uDC7E","\uD83C\uDFAD","\uD83D\uDC68‍\uD83D\uDCBC","\uD83D\uDC69‍\uD83D\uDCBC","\uD83D\uDC68‍\uD83C\uDFEB","\uD83D\uDC69‍\uD83C\uDFEB","\uD83D\uDC68‍\uD83D\uDCBB","\uD83D\uDC69‍\uD83D\uDCBB","\uD83E\uDDD1‍\uD83C\uDFA8","\uD83E\uDDD1‍\uD83D\uDD2C","\uD83D\uDC09","\uD83E\uDD8A","\uD83D\uDC3C","\uD83E\uDD81","\uD83D\uDC2C","\uD83E\uDD8B","\uD83C\uDF08","⚡"]}}]);