@auto-ai/agent 2.1.165 → 2.1.167

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 (66) hide show
  1. package/dist/404/index.html +1 -1
  2. package/dist/404.html +1 -1
  3. package/dist/_next/static/chunks/{ecaea9e9321ec538.js → 04865c74d0dcb5b6.js} +1 -1
  4. package/dist/_next/static/chunks/{371449b804c846f7.js → 07cd0b140a56ee30.js} +1 -1
  5. package/dist/_next/static/chunks/1348edc568cfb2b2.js +1 -0
  6. package/dist/_next/static/chunks/22fb0418205bc3b6.js +1 -0
  7. package/dist/_next/static/chunks/2761e463114b018c.js +1 -0
  8. package/dist/_next/static/chunks/345032ba59cb60d8.js +1 -0
  9. package/dist/_next/static/chunks/4cc4bd81c5ae0c40.js +1 -0
  10. package/dist/_next/static/chunks/5cdf21cf7f4c7608.js +1 -0
  11. package/dist/_next/static/chunks/61b3d4c00499dd14.js +1 -0
  12. package/dist/_next/static/chunks/{46b326fcd7b2e8ab.js → 652e486c20710ca8.js} +1 -1
  13. package/dist/_next/static/chunks/6ddf95b168bfbc36.js +1 -0
  14. package/dist/_next/static/chunks/789aab39327312c3.js +1 -0
  15. package/dist/_next/static/chunks/{0fa3b1f693a23b15.js → 8085c74f26fa2c4e.js} +1 -1
  16. package/dist/_next/static/chunks/8a1a9a399fe2d329.js +1 -0
  17. package/dist/_next/static/chunks/b7546ebaecffed5f.js +1 -0
  18. package/dist/_next/static/chunks/{a7d1ae46740fe1db.js → b7f72bcb870dda3b.js} +1 -1
  19. package/dist/_next/static/chunks/bdd88bcfd223f52a.js +1 -0
  20. package/dist/_next/static/chunks/c73f7d77cbe3f2f1.css +1 -0
  21. package/dist/_next/static/chunks/cd4556cbed1f8957.js +1 -0
  22. package/dist/_next/static/chunks/d55f4f3df263ad3d.js +1 -0
  23. package/dist/_next/static/chunks/{d4fd1b2f761be57f.css → fa5420e426d2de9f.css} +1 -1
  24. package/dist/_next/static/chunks/{799f92e88bfeb469.js → fdecc614380e597a.js} +1 -1
  25. package/dist/index.html +2 -2
  26. package/dist/index.txt +19 -19
  27. package/dist/manage/about/index.html +2 -2
  28. package/dist/manage/about/index.txt +21 -21
  29. package/dist/manage/env/index.html +2 -2
  30. package/dist/manage/env/index.txt +24 -24
  31. package/dist/manage/general/index.html +2 -2
  32. package/dist/manage/general/index.txt +21 -21
  33. package/dist/manage/index.html +2 -2
  34. package/dist/manage/index.txt +18 -18
  35. package/dist/manage/mcp/index.html +2 -2
  36. package/dist/manage/mcp/index.txt +22 -22
  37. package/dist/manage/permissions/index.html +2 -2
  38. package/dist/manage/permissions/index.txt +21 -21
  39. package/dist/manage/skills/index.html +2 -2
  40. package/dist/manage/skills/index.txt +22 -22
  41. package/dist/manage/task/index.html +2 -2
  42. package/dist/manage/task/index.txt +22 -22
  43. package/dist/manage/teams/index.html +2 -2
  44. package/dist/manage/teams/index.txt +22 -22
  45. package/dist/manage/tools/index.html +2 -2
  46. package/dist/manage/tools/index.txt +22 -22
  47. package/package.json +6 -6
  48. package/dist/_next/static/chunks/06b383e8ee499be7.js +0 -1
  49. package/dist/_next/static/chunks/1cb7453376657ffb.css +0 -1
  50. package/dist/_next/static/chunks/2014b101125849fd.js +0 -1
  51. package/dist/_next/static/chunks/38b035f49fa68570.js +0 -1
  52. package/dist/_next/static/chunks/3ddf56f78e79b076.js +0 -1
  53. package/dist/_next/static/chunks/489266ff75dbd7fd.js +0 -1
  54. package/dist/_next/static/chunks/4b1cbde821e7ad65.js +0 -1
  55. package/dist/_next/static/chunks/5853f68e75f5f7ab.js +0 -1
  56. package/dist/_next/static/chunks/5f6769a92729c6c3.js +0 -1
  57. package/dist/_next/static/chunks/65efa67b7efe0f72.js +0 -1
  58. package/dist/_next/static/chunks/73930967cfa80238.js +0 -1
  59. package/dist/_next/static/chunks/73e518d4b3543b8f.js +0 -1
  60. package/dist/_next/static/chunks/7f52fbd725b13904.js +0 -1
  61. package/dist/_next/static/chunks/b896987ddf6315c9.js +0 -1
  62. package/dist/_next/static/chunks/c79da9dd69089e4f.js +0 -1
  63. package/dist/_next/static/chunks/da89e354de542422.js +0 -1
  64. /package/dist/_next/static/{vwMrLQGLViMpdiC9eEa7U → bgHnfEbjqZYUwK_KG6A0m}/_buildManifest.js +0 -0
  65. /package/dist/_next/static/{vwMrLQGLViMpdiC9eEa7U → bgHnfEbjqZYUwK_KG6A0m}/_clientMiddlewareManifest.json +0 -0
  66. /package/dist/_next/static/{vwMrLQGLViMpdiC9eEa7U → bgHnfEbjqZYUwK_KG6A0m}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67489,29402,e=>{"use strict";e.s(["Select",()=>rp,"SelectContent",()=>rg,"SelectGroup",()=>rh,"SelectItem",()=>rw,"SelectLabel",()=>ry,"SelectTrigger",()=>rm,"SelectValue",()=>rv],67489);var t,r,n,o,l,i=e.i(18050);e.s(["Content",()=>rt,"Group",()=>rn,"Icon",()=>t4,"Item",()=>rl,"ItemIndicator",()=>ra,"ItemText",()=>ri,"Label",()=>ro,"Portal",()=>re,"Root",()=>t7,"ScrollDownButton",()=>ru,"ScrollUpButton",()=>rs,"Separator",()=>rc,"Trigger",()=>t8,"Value",()=>t3,"Viewport",()=>rr],29402);var a=e.i(71645),s=e.i(74080);function u(e,t){let[r,n]=t;return Math.min(n,Math.max(r,e))}function c(e,t){let{checkForDefaultPrevented:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function d(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function f(e,t){var r=d(e,t,"get");return r.get?r.get.call(e):r.value}function p(e,t,r){var n=d(e,t,"set");if(n.set)n.set.call(e,r);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=r}return r}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[],n=()=>{let t=r.map(e=>a.createContext(e));return function(r){let n=(null==r?void 0:r[e])||t;return a.useMemo(()=>({["__scope".concat(e)]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let o=a.createContext(n),l=r.length;r=[...r,n];let s=t=>{var r;let{scope:n,children:s,...u}=t,c=(null==n||null==(r=n[e])?void 0:r[l])||o,d=a.useMemo(()=>u,Object.values(u));return(0,i.jsx)(c.Provider,{value:d,children:s})};return s.displayName=t+"Provider",[s,function(r,i){var s;let u=(null==i||null==(s=i[e])?void 0:s[l])||o,c=a.useContext(u);if(c)return c;if(void 0!==n)return n;throw Error("`".concat(r,"` must be used within `").concat(t,"`"))}]},function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=t[0];if(1===t.length)return n;let o=()=>{let e=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){let r=e.reduce((e,r)=>{let{useScope:n,scopeName:o}=r,l=n(t)["__scope".concat(o)];return{...e,...l}},{});return a.useMemo(()=>({["__scope".concat(n.scopeName)]:r}),[r])}};return o.scopeName=n.scopeName,o}(n,...t)]}"undefined"!=typeof window&&window.document&&window.document.createElement;var v=e.i(20783);function m(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var o,l,i;let e,s,u=(s=(e=null==(l=Object.getOwnPropertyDescriptor((o=r).props,"ref"))?void 0:l.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=null==(i=Object.getOwnPropertyDescriptor(o,"ref"))?void 0:i.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref,c=function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=l(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(c.ref=t?(0,v.composeRefs)(t,u):u),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),s=l.find(y);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,i.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}var g=Symbol("radix.slottable");function y(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===g}var w=new WeakMap;function b(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=function(e,t){let r=e.length,n=x(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}(e,t);return -1===r?void 0:e[r]}function x(e){return e!=e||0===e?0:Math.trunc(e)}r=new WeakMap,class e extends Map{set(e,t){return w.get(this)&&(this.has(e)?f(this,r)[f(this,r).indexOf(e)]=e:f(this,r).push(e)),super.set(e,t),this}insert(e,t,n){let o,l=this.has(t),i=f(this,r).length,a=x(e),s=a>=0?a:i+a,u=s<0||s>=i?-1:s;if(u===this.size||l&&u===this.size-1||-1===u)return this.set(t,n),this;let c=this.size+ +!l;a<0&&s++;let d=[...f(this,r)],p=!1;for(let e=s;e<c;e++)if(s===e){let r=d[e];d[e]===t&&(r=d[e+1]),l&&this.delete(t),o=this.get(r),this.set(t,n)}else{p||d[e-1]!==t||(p=!0);let r=d[p?e:e-1],n=o;o=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,n){let o=new e(this);return o.insert(t,r,n),o}before(e){let t=f(this,r).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let o=f(this,r).indexOf(e);return -1===o?this:this.insert(o,t,n)}after(e){let t=f(this,r).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let o=f(this,r).indexOf(e);return -1===o?this:this.insert(o+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return p(this,r,[]),super.clear()}delete(e){let t=super.delete(e);return t&&f(this,r).splice(f(this,r).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=b(f(this,r),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=b(f(this,r),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return f(this,r).indexOf(e)}keyAt(e){return b(f(this,r),e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&n.push(e),o++;return new e(n)}map(t,r){let n=[],o=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(n)}reduce(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,l=0,i=null!=o?o:this.at(0);for(let e of this)i=0===l&&1===t.length?e:Reflect.apply(n,this,[i,e,l,this]),l++;return i}reduceRight(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,l=null!=o?o:this.at(-1);for(let e=this.size-1;e>=0;e--){let r=this.at(e);l=e===this.size-1&&1===t.length?r:Reflect.apply(n,this,[l,r,e,this])}return l}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=[...this.entries()];return o.splice(...r),new e(o)}slice(t,r){let n=new e,o=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}constructor(e){super(e),function(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}(this,r,{writable:!0,value:void 0}),p(this,r,[...super.keys()]),w.set(this,!0)}};var E=a.createContext(void 0),S=Symbol("radix.slottable");function C(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===S}var R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=function(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var o,l,i;let e,s,u=(s=(e=null==(l=Object.getOwnPropertyDescriptor((o=r).props,"ref"))?void 0:l.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=null==(i=Object.getOwnPropertyDescriptor(o,"ref"))?void 0:i.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref,c=function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=l(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(c.ref=t?(0,v.composeRefs)(t,u):u),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),s=l.find(C);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,i.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}("Primitive.".concat(t)),n=a.forwardRef((e,n)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(o?r:t,{...l,ref:n})});return n.displayName="Primitive.".concat(t),{...e,[t]:n}},{});function j(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>function(){for(var e,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return null==(e=t.current)?void 0:e.call(t,...n)},[])}var A="dismissableLayer.update",N=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),P=a.forwardRef((e,t)=>{var r,o;let{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,...h}=e,m=a.useContext(N),[g,y]=a.useState(null),w=null!=(o=null==g?void 0:g.ownerDocument)?o:null==(r=globalThis)?void 0:r.document,[,b]=a.useState({}),x=(0,v.useComposedRefs)(t,e=>y(e)),E=Array.from(m.layers),[S]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),C=E.indexOf(S),P=g?E.indexOf(g):-1,O=m.layersWithOutsidePointerEventsDisabled.size>0,M=P>=C,I=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=j(e),o=a.useRef(!1),l=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){k("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,r=[...m.branches].some(e=>e.contains(t));M&&!r&&(null==u||u(e),null==f||f(e),e.defaultPrevented||null==p||p())},w),L=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=j(e),o=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!o.current&&k("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;![...m.branches].some(e=>e.contains(t))&&(null==d||d(e),null==f||f(e),e.defaultPrevented||null==p||p())},w);return!function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=j(e);a.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e,{capture:!0}),()=>r.removeEventListener("keydown",e,{capture:!0})},[n,r])}(e=>{P===m.layers.size-1&&(null==s||s(e),!e.defaultPrevented&&p&&(e.preventDefault(),p()))},w),a.useEffect(()=>{if(g)return l&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(n=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),T(),()=>{l&&1===m.layersWithOutsidePointerEventsDisabled.size&&(w.body.style.pointerEvents=n)}},[g,w,l,m]),a.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),T())},[g,m]),a.useEffect(()=>{let e=()=>b({});return document.addEventListener(A,e),()=>document.removeEventListener(A,e)},[]),(0,i.jsx)(R.div,{...h,ref:x,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:c(e.onFocusCapture,L.onFocusCapture),onBlurCapture:c(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,I.onPointerDownCapture)})});function T(){let e=new CustomEvent(A);document.dispatchEvent(e)}function k(e,t,r,n){let{discrete:o}=n,l=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&l.addEventListener(e,t,{once:!0}),o)l&&s.flushSync(()=>l.dispatchEvent(i));else l.dispatchEvent(i)}P.displayName="DismissableLayer",a.forwardRef((e,t)=>{let r=a.useContext(N),n=a.useRef(null),o=(0,v.useComposedRefs)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,i.jsx)(R.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var O=0;function M(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var I="focusScope.autoFocusOnMount",L="focusScope.autoFocusOnUnmount",D={bubbles:!1,cancelable:!0},W=a.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...s}=e,[u,c]=a.useState(null),d=j(o),f=j(l),p=a.useRef(null),h=(0,v.useComposedRefs)(t,e=>c(e)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(n){let e=function(e){if(m.paused||!u)return;let t=e.target;u.contains(t)?p.current=t:B(p.current,{select:!0})},t=function(e){if(m.paused||!u)return;let t=e.relatedTarget;null!==t&&(u.contains(t)||B(p.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&B(u)});return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,u,m.paused]),a.useEffect(()=>{if(u){F.add(m);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(I,D);u.addEventListener(I,d),u.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(B(n,{select:t}),document.activeElement!==r)return}(_(u).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&B(u))}return()=>{u.removeEventListener(I,d),setTimeout(()=>{let t=new CustomEvent(L,D);u.addEventListener(L,f),u.dispatchEvent(t),t.defaultPrevented||B(null!=e?e:document.body,{select:!0}),u.removeEventListener(L,f),F.remove(m)},0)}}},[u,d,f,m]);let g=a.useCallback(e=>{if(!r&&!n||m.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,l]=function(e){let t=_(e);return[z(t,e),z(t.reverse(),e)]}(t);n&&l?e.shiftKey||o!==l?e.shiftKey&&o===n&&(e.preventDefault(),r&&B(l,{select:!0})):(e.preventDefault(),r&&B(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,m.paused]);return(0,i.jsx)(R.div,{tabIndex:-1,...s,ref:h,onKeyDown:g})});function _(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function z(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function B(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}W.displayName="FocusScope";var F=function(){let e=[];return{add(t){let r=e[0];t!==r&&(null==r||r.pause()),(e=H(e,t)).unshift(t)},remove(t){var r;null==(r=(e=H(e,t))[0])||r.resume()}}}();function H(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var V=(null==(o=globalThis)?void 0:o.document)?a.useLayoutEffect:()=>{},K=a[" useId ".trim().toString()]||(()=>void 0),U=0;function Y(e){let[t,r]=a.useState(K());return V(()=>{e||r(e=>null!=e?e:String(U++))},[e]),e||(t?"radix-".concat(t):"")}var X=e.i(58950),Z=e.i(53760),q=a.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...l}=e;return(0,i.jsx)(R.svg,{...l,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,i.jsx)("polygon",{points:"0,0 30,0 15,10"})})});q.displayName="Arrow";var G="Popper",[J,Q]=h(G),[$,ee]=J(G),et=e=>{let{__scopePopper:t,children:r}=e,[n,o]=a.useState(null);return(0,i.jsx)($,{scope:t,anchor:n,onAnchorChange:o,children:r})};et.displayName=G;var er="PopperAnchor",en=a.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,l=ee(er,r),s=a.useRef(null),u=(0,v.useComposedRefs)(t,s),c=a.useRef(null);return a.useEffect(()=>{let e=c.current;c.current=(null==n?void 0:n.current)||s.current,e!==c.current&&l.onAnchorChange(c.current)}),n?null:(0,i.jsx)(R.div,{...o,ref:u})});en.displayName=er;var eo="PopperContent",[el,ei]=J(eo),ea=a.forwardRef((e,t)=>{var r,n,o,l,s,u,c,d;let{__scopePopper:f,side:p="bottom",sideOffset:h=0,align:m="center",alignOffset:g=0,arrowPadding:y=0,avoidCollisions:w=!0,collisionBoundary:b=[],collisionPadding:x=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:C="optimized",onPlaced:A,...N}=e,P=ee(eo,f),[T,k]=a.useState(null),O=(0,v.useComposedRefs)(t,e=>k(e)),[M,I]=a.useState(null),L=function(e){let[t,r]=a.useState(void 0);return V(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let l=t[0];if("borderBoxSize"in l){let e=l.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(M),D=null!=(c=null==L?void 0:L.width)?c:0,W=null!=(d=null==L?void 0:L.height)?d:0,_="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},z=Array.isArray(b)?b:[b],B=z.length>0,F={padding:_,boundary:z.filter(ed),altBoundary:B},{refs:H,floatingStyles:K,placement:U,isPositioned:Y,middlewareData:q}=(0,X.useFloating)({strategy:"fixed",placement:p+("center"!==m?"-"+m:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,Z.autoUpdate)(...t,{animationFrame:"always"===C})},elements:{reference:P.anchor},middleware:[(0,X.offset)({mainAxis:h+W,alignmentAxis:g}),w&&(0,X.shift)({mainAxis:!0,crossAxis:!1,limiter:"partial"===E?(0,X.limitShift)():void 0,...F}),w&&(0,X.flip)({...F}),(0,X.size)({...F,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:l,height:i}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(l,"px")),a.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),M&&(0,X.arrow)({element:M,padding:y}),ef({arrowWidth:D,arrowHeight:W}),S&&(0,X.hide)({strategy:"referenceHidden",...F})]}),[G,J]=ep(U),Q=j(A);V(()=>{Y&&(null==Q||Q())},[Y,Q]);let $=null==(r=q.arrow)?void 0:r.x,et=null==(n=q.arrow)?void 0:n.y,er=(null==(o=q.arrow)?void 0:o.centerOffset)!==0,[en,ei]=a.useState();return V(()=>{T&&ei(window.getComputedStyle(T).zIndex)},[T]),(0,i.jsx)("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Y?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:en,"--radix-popper-transform-origin":[null==(l=q.transformOrigin)?void 0:l.x,null==(s=q.transformOrigin)?void 0:s.y].join(" "),...(null==(u=q.hide)?void 0:u.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,i.jsx)(el,{scope:f,placedSide:G,onArrowChange:I,arrowX:$,arrowY:et,shouldHideArrow:er,children:(0,i.jsx)(R.div,{"data-side":G,"data-align":J,...N,ref:O,style:{...N.style,animation:Y?void 0:"none"}})})})});ea.displayName=eo;var es="PopperArrow",eu={top:"bottom",right:"left",bottom:"top",left:"right"},ec=a.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=ei(es,r),l=eu[o.placedSide];return(0,i.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,i.jsx)(q,{...n,ref:t,style:{...n.style,display:"block"}})})});function ed(e){return null!==e}ec.displayName=es;var ef=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,l,i;let{placement:a,rects:s,middlewareData:u}=t,c=(null==(r=u.arrow)?void 0:r.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,h]=ep(a),v={start:"0%",center:"50%",end:"100%"}[h],m=(null!=(l=null==(n=u.arrow)?void 0:n.x)?l:0)+d/2,g=(null!=(i=null==(o=u.arrow)?void 0:o.y)?i:0)+f/2,y="",w="";return"bottom"===p?(y=c?v:"".concat(m,"px"),w="".concat(-f,"px")):"top"===p?(y=c?v:"".concat(m,"px"),w="".concat(s.floating.height+f,"px")):"right"===p?(y="".concat(-f,"px"),w=c?v:"".concat(g,"px")):"left"===p&&(y="".concat(s.floating.width+f,"px"),w=c?v:"".concat(g,"px")),{data:{x:y,y:w}}}});function ep(e){let[t,r="center"]=e.split("-");return[t,r]}var eh=a.forwardRef((e,t)=>{var r,n;let{container:o,...l}=e,[u,c]=a.useState(!1);V(()=>c(!0),[]);let d=o||u&&(null==(n=globalThis)||null==(r=n.document)?void 0:r.body);return d?s.default.createPortal((0,i.jsx)(R.div,{...l,ref:t}),d):null});eh.displayName="Portal";var ev=Symbol("radix.slottable");function em(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ev}a[" useEffectEvent ".trim().toString()],a[" useInsertionEffect ".trim().toString()];var eg=a[" useInsertionEffect ".trim().toString()]||V;function ey(e){let{prop:t,defaultProp:r,onChange:n=()=>{},caller:o}=e,[l,i,s]=function(e){let{defaultProp:t,onChange:r}=e,[n,o]=a.useState(t),l=a.useRef(n),i=a.useRef(r);return eg(()=>{i.current=r},[r]),a.useEffect(()=>{if(l.current!==n){var e;null==(e=i.current)||e.call(i,n),l.current=n}},[n,l]),[n,o,i]}({defaultProp:r,onChange:n}),u=void 0!==t,c=u?t:l;{let e=a.useRef(void 0!==t);a.useEffect(()=>{let t=e.current;if(t!==u){let e=u?"controlled":"uncontrolled";console.warn("".concat(o," is changing from ").concat(t?"controlled":"uncontrolled"," to ").concat(e,". Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component."))}e.current=u},[u,o])}return[c,a.useCallback(e=>{if(u){let n="function"==typeof e?e(t):e;if(n!==t){var r;null==(r=s.current)||r.call(s,n)}}else i(e)},[u,t,i,s])]}Symbol("RADIX:SYNC_STATE");var ew=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"});a.forwardRef((e,t)=>(0,i.jsx)(R.span,{...e,ref:t,style:{...ew,...e.style}})).displayName="VisuallyHidden";var eb=new WeakMap,ex=new WeakMap,eE={},eS=0,eC=function(e){return e&&(e.host||eC(e.parentNode))},eR=function(e,t,r,n){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=eC(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eE[r]||(eE[r]=new WeakMap);var l=eE[r],i=[],a=new Set,s=new Set(o),u=function(e){!e||a.has(e)||(a.add(e),u(e.parentNode))};o.forEach(u);var c=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(a.has(e))c(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,s=(eb.get(e)||0)+1,u=(l.get(e)||0)+1;eb.set(e,s),l.set(e,u),i.push(e),1===s&&o&&ex.set(e,!0),1===u&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),a.clear(),eS++,function(){i.forEach(function(e){var t=eb.get(e)-1,o=l.get(e)-1;eb.set(e,t),l.set(e,o),t||(ex.has(e)||e.removeAttribute(n),ex.delete(e)),o||e.removeAttribute(r)}),--eS||(eb=new WeakMap,eb=new WeakMap,ex=new WeakMap,eE={})}},ej=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),eR(n,o,r,"aria-hidden")):function(){return null}},eA=function(){return(eA=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function eN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}Object.create;Object.create;var eP=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),eT="width-before-scroll-bar";function ek(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var eO="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,eM=new WeakMap;function eI(e){return e}var eL=function(e){void 0===e&&(e={});var t,r,n,o=(void 0===t&&(t=eI),r=[],n=!1,{read:function(){if(n)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:null},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var l=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(l)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}});return o.options=eA({async:!0,ssr:!1},e),o}(),eD=function(){},eW=a.forwardRef(function(e,t){var r,n,o,l,i=a.useRef(null),s=a.useState({onScrollCapture:eD,onWheelCapture:eD,onTouchMoveCapture:eD}),u=s[0],c=s[1],d=e.forwardProps,f=e.children,p=e.className,h=e.removeScrollBar,v=e.enabled,m=e.shards,g=e.sideCar,y=e.noRelative,w=e.noIsolation,b=e.inert,x=e.allowPinchZoom,E=e.as,S=e.gapMode,C=eN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=(r=[i,t],n=function(e){return r.forEach(function(t){return ek(t,e)})},(o=(0,a.useState)(function(){return{value:null,callback:n,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=n,l=o.facade,eO(function(){var e=eM.get(l);if(e){var t=new Set(e),n=new Set(r),o=l.current;t.forEach(function(e){n.has(e)||ek(e,null)}),n.forEach(function(e){t.has(e)||ek(e,o)})}eM.set(l,r)},[r]),l),j=eA(eA({},C),u);return a.createElement(a.Fragment,null,v&&a.createElement(g,{sideCar:eL,removeScrollBar:h,shards:m,noRelative:y,noIsolation:w,inert:b,setCallbacks:c,allowPinchZoom:!!x,lockRef:i,gapMode:S}),d?a.cloneElement(a.Children.only(f),eA(eA({},j),{ref:R})):a.createElement(void 0===E?"div":E,eA({},j,{className:p,ref:R}),f))});eW.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eW.classNames={fullWidth:eT,zeroRight:eP};var e_=function(e){var t=e.sideCar,r=eN(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return a.createElement(n,eA({},r))};e_.isSideCarExport=!0;var ez=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=l||("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,o;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),o=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(o)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eB=function(){var e=ez();return function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},eF=function(){var e=eB();return function(t){return e(t.styles,t.dynamic),null}},eH={left:0,top:0,right:0,gap:0},eV=function(e){return parseInt(e||"",10)||0},eK=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[eV(r),eV(n),eV(o)]},eU=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return eH;var t=eK(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},eY=eF(),eX="data-scroll-locked",eZ=function(e,t,r,n){var o=e.left,l=e.top,i=e.right,a=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(a,"px ").concat(n,";\n }\n body[").concat(eX,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(l,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(eP," {\n right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(eT," {\n margin-right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(eP," .").concat(eP," {\n right: 0 ").concat(n,";\n }\n \n .").concat(eT," .").concat(eT," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(eX,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},eq=function(){var e=parseInt(document.body.getAttribute(eX)||"0",10);return isFinite(e)?e:0},eG=function(){a.useEffect(function(){return document.body.setAttribute(eX,(eq()+1).toString()),function(){var e=eq()-1;e<=0?document.body.removeAttribute(eX):document.body.setAttribute(eX,e.toString())}},[])},eJ=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;eG();var l=a.useMemo(function(){return eU(o)},[o]);return a.createElement(eY,{styles:eZ(l,!t,o,r?"":"!important")})},eQ=!1;if("undefined"!=typeof window)try{var e$=Object.defineProperty({},"passive",{get:function(){return eQ=!0,!0}});window.addEventListener("test",e$,e$),window.removeEventListener("test",e$,e$)}catch(e){eQ=!1}var e0=!!eQ&&{passive:!1},e1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},e2=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),e5(e,n)){var o=e9(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},e5=function(e,t){return"v"===e?e1(t,"overflowY"):e1(t,"overflowX")},e9=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},e6=function(e,t,r,n,o){var l,i=(l=window.getComputedStyle(t).direction,"h"===e&&"rtl"===l?-1:1),a=i*n,s=r.target,u=t.contains(s),c=!1,d=a>0,f=0,p=0;do{if(!s)break;var h=e9(e,s),v=h[0],m=h[1]-h[2]-i*v;(v||m)&&e5(e,s)&&(f+=m,p+=v);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!u&&s!==document.body||u&&(t.contains(s)||t===s))return d&&(o&&1>Math.abs(f)||!o&&a>f)?c=!0:!d&&(o&&1>Math.abs(p)||!o&&-a>p)&&(c=!0),c},e7=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e8=function(e){return[e.deltaX,e.deltaY]},e3=function(e){return e&&"current"in e?e.current:e},e4=0,te=[];let tt=(t=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(e4++)[0],l=a.useState(eF)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,o=0,l=t.length;o<l;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(e3),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,l=e7(e),a=r.current,s="deltaX"in e?e.deltaX:a[0]-l[0],u="deltaY"in e?e.deltaY:a[1]-l[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var h=e2(d,c);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=e2(d,c)),!h)return!1;if(!n.current&&"changedTouches"in e&&(s||u)&&(n.current=o),!o)return!0;var v=n.current||o;return e6(v,t,e,"h"===v?s:u,!0)},[]),u=a.useCallback(function(e){if(te.length&&te[te.length-1]===l){var r="deltaY"in e?e8(e):e7(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(i.current.shards||[]).map(e3).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?s(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=a.useCallback(function(e,r,n,o){var l={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(l),setTimeout(function(){t.current=t.current.filter(function(e){return e!==l})},1)},[]),d=a.useCallback(function(e){r.current=e7(e),n.current=void 0},[]),f=a.useCallback(function(t){c(t.type,e8(t),t.target,s(t,e.lockRef.current))},[]),p=a.useCallback(function(t){c(t.type,e7(t),t.target,s(t,e.lockRef.current))},[]);a.useEffect(function(){return te.push(l),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,e0),document.addEventListener("touchmove",u,e0),document.addEventListener("touchstart",d,e0),function(){te=te.filter(function(e){return e!==l}),document.removeEventListener("wheel",u,e0),document.removeEventListener("touchmove",u,e0),document.removeEventListener("touchstart",d,e0)}},[]);var h=e.removeScrollBar,v=e.inert;return a.createElement(a.Fragment,null,v?a.createElement(l,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,h?a.createElement(eJ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},eL.useMedium(t),e_);var tr=a.forwardRef(function(e,t){return a.createElement(eW,eA({},e,{ref:t,sideCar:tt}))});tr.classNames=eW.classNames;var tn=[" ","Enter","ArrowUp","ArrowDown"],to=[" ","Enter"],tl="Select",[ti,ta,ts]=function(e){let t=e+"CollectionProvider",[r,n]=h(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:r}=e,n=a.default.useRef(null),l=a.default.useRef(new Map).current;return(0,i.jsx)(o,{scope:t,itemMap:l,collectionRef:n,children:r})};s.displayName=t;let u=e+"CollectionSlot",c=m(u),d=a.default.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=l(u,r),a=(0,v.useComposedRefs)(t,o.collectionRef);return(0,i.jsx)(c,{ref:a,children:n})});d.displayName=u;let f=e+"CollectionItemSlot",p="data-radix-collection-item",g=m(f),y=a.default.forwardRef((e,t)=>{let{scope:r,children:n,...o}=e,s=a.default.useRef(null),u=(0,v.useComposedRefs)(t,s),c=l(f,r);return a.default.useEffect(()=>(c.itemMap.set(s,{ref:s,...o}),()=>void c.itemMap.delete(s))),(0,i.jsx)(g,{...{[p]:""},ref:u,children:n})});return y.displayName=f,[{Provider:s,Slot:d,ItemSlot:y},function(t){let r=l(e+"CollectionConsumer",t);return a.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(p,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(tl),[tu,tc]=h(tl,[ts,Q]),td=Q(),[tf,tp]=tu(tl),[th,tv]=tu(tl),tm=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:l,value:s,defaultValue:u,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:h,required:v,form:m}=e,g=td(t),[y,w]=a.useState(null),[b,x]=a.useState(null),[S,C]=a.useState(!1),R=function(e){let t=a.useContext(E);return e||t||"ltr"}(d),[j,A]=ey({prop:n,defaultProp:null!=o&&o,onChange:l,caller:tl}),[N,P]=ey({prop:s,defaultProp:u,onChange:c,caller:tl}),T=a.useRef(null),k=!y||m||!!y.closest("form"),[O,M]=a.useState(new Set),I=Array.from(O).map(e=>e.props.value).join(";");return(0,i.jsx)(et,{...g,children:(0,i.jsxs)(tf,{required:v,scope:t,trigger:y,onTriggerChange:w,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Y(),value:N,onValueChange:P,open:j,onOpenChange:A,dir:R,triggerPointerDownPosRef:T,disabled:h,children:[(0,i.jsx)(ti.Provider,{scope:t,children:(0,i.jsx)(th,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{M(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:r})}),k?(0,i.jsxs)(t2,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>P(e.target.value),disabled:h,form:m,children:[void 0===N?(0,i.jsx)("option",{value:""}):null,Array.from(O)]},I):null]})})};tm.displayName=tl;var tg="SelectTrigger",ty=a.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...o}=e,l=td(r),s=tp(tg,r),u=s.disabled||n,d=(0,v.useComposedRefs)(t,s.onTriggerChange),f=ta(r),p=a.useRef("touch"),[h,m,g]=t9(e=>{let t=f().filter(e=>!e.disabled),r=t.find(e=>e.value===s.value),n=t6(t,e,r);void 0!==n&&s.onValueChange(n.value)}),y=e=>{u||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,i.jsx)(en,{asChild:!0,...l,children:(0,i.jsx)(R.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":t5(s.value)?"":void 0,...o,ref:d,onClick:c(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&y(e)}),onPointerDown:c(o.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:c(o.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&tn.includes(e.key)&&(y(),e.preventDefault())})})})});ty.displayName=tg;var tw="SelectValue",tb=a.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,children:l,placeholder:a="",...s}=e,u=tp(tw,r),{onValueNodeHasChildrenChange:c}=u,d=void 0!==l,f=(0,v.useComposedRefs)(t,u.onValueNodeChange);return V(()=>{c(d)},[c,d]),(0,i.jsx)(R.span,{...s,ref:f,style:{pointerEvents:"none"},children:t5(u.value)?(0,i.jsx)(i.Fragment,{children:a}):l})});tb.displayName=tw;var tx=a.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...o}=e;return(0,i.jsx)(R.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});tx.displayName="SelectIcon";var tE=e=>(0,i.jsx)(eh,{asChild:!0,...e});tE.displayName="SelectPortal";var tS="SelectContent",tC=a.forwardRef((e,t)=>{let r=tp(tS,e.__scopeSelect),[n,o]=a.useState();return(V(()=>{o(new DocumentFragment)},[]),r.open)?(0,i.jsx)(tN,{...e,ref:t}):n?s.createPortal((0,i.jsx)(tR,{scope:e.__scopeSelect,children:(0,i.jsx)(ti.Slot,{scope:e.__scopeSelect,children:(0,i.jsx)("div",{children:e.children})})}),n):null});tC.displayName=tS;var[tR,tj]=tu(tS),tA=function(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var o,l,i;let e,s,u=(s=(e=null==(l=Object.getOwnPropertyDescriptor((o=r).props,"ref"))?void 0:l.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=null==(i=Object.getOwnPropertyDescriptor(o,"ref"))?void 0:i.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref,c=function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=l(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(c.ref=t?(0,v.composeRefs)(t,u):u),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),s=l.find(em);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,i.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}("SelectContent.RemoveScroll"),tN=a.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:s,side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:w,avoidCollisions:b,...x}=e,E=tp(tS,r),[S,C]=a.useState(null),[R,j]=a.useState(null),A=(0,v.useComposedRefs)(t,e=>C(e)),[N,T]=a.useState(null),[k,I]=a.useState(null),L=ta(r),[D,_]=a.useState(!1),z=a.useRef(!1);a.useEffect(()=>{if(S)return ej(S)},[S]),a.useEffect(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!=(e=r[0])?e:M()),document.body.insertAdjacentElement("beforeend",null!=(t=r[1])?t:M()),O++,()=>{1===O&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),O--}},[]);let B=a.useCallback(e=>{let[t,...r]=L().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(let r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&R&&(R.scrollTop=0),r===n&&R&&(R.scrollTop=R.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[L,R]),F=a.useCallback(()=>B([N,S]),[B,N,S]);a.useEffect(()=>{D&&F()},[D,F]);let{onOpenChange:H,triggerPointerDownPosRef:V}=E;a.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{var r,n,o,l;e={x:Math.abs(Math.round(t.pageX)-(null!=(o=null==(r=V.current)?void 0:r.x)?o:0)),y:Math.abs(Math.round(t.pageY)-(null!=(l=null==(n=V.current)?void 0:n.y)?l:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():S.contains(r.target)||H(!1),document.removeEventListener("pointermove",t),V.current=null};return null!==V.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[S,H,V]),a.useEffect(()=>{let e=()=>H(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[H]);let[K,U]=t9(e=>{let t=L().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=t6(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),Y=a.useCallback((e,t,r)=>{let n=!z.current&&!r;(void 0!==E.value&&E.value===t||n)&&(T(e),n&&(z.current=!0))},[E.value]),X=a.useCallback(()=>null==S?void 0:S.focus(),[S]),Z=a.useCallback((e,t,r)=>{let n=!z.current&&!r;(void 0!==E.value&&E.value===t||n)&&I(e)},[E.value]),q="popper"===n?tT:tP,G=q===tT?{side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:w,avoidCollisions:b}:{};return(0,i.jsx)(tR,{scope:r,content:S,viewport:R,onViewportChange:j,itemRefCallback:Y,selectedItem:N,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:F,selectedItemText:k,position:n,isPositioned:D,searchRef:K,children:(0,i.jsx)(tr,{as:tA,allowPinchZoom:!0,children:(0,i.jsx)(W,{asChild:!0,trapped:E.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:c(o,e=>{var t;null==(t=E.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,i.jsx)(P,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:(0,i.jsx)(q,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:e=>e.preventDefault(),...x,...G,onPlaced:()=>_(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:c(x.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});tN.displayName="SelectContentImpl";var tP=a.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...o}=e,l=tp(tS,r),s=tj(tS,r),[c,d]=a.useState(null),[f,p]=a.useState(null),h=(0,v.useComposedRefs)(t,e=>p(e)),m=ta(r),g=a.useRef(!1),y=a.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:x,focusSelectedItem:E}=s,S=a.useCallback(()=>{if(l.trigger&&l.valueNode&&c&&f&&w&&b&&x){let e=l.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),r=l.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==l.dir){let n=o.left-t.left,l=r.left-n,i=e.left-l,a=e.width+i,s=Math.max(a,t.width),d=u(l,[10,Math.max(10,window.innerWidth-10-s)]);c.style.minWidth=a+"px",c.style.left=d+"px"}else{let n=t.right-o.right,l=window.innerWidth-r.right-n,i=window.innerWidth-e.right-l,a=e.width+i,s=Math.max(a,t.width),d=u(l,[10,Math.max(10,window.innerWidth-10-s)]);c.style.minWidth=a+"px",c.style.right=d+"px"}let i=m(),a=window.innerHeight-20,s=w.scrollHeight,d=window.getComputedStyle(f),p=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),y=p+h+s+parseInt(d.paddingBottom,10)+v,E=Math.min(5*b.offsetHeight,y),S=window.getComputedStyle(w),C=parseInt(S.paddingTop,10),R=parseInt(S.paddingBottom,10),j=e.top+e.height/2-10,A=b.offsetHeight/2,N=p+h+(b.offsetTop+A);if(N<=j){let e=i.length>0&&b===i[i.length-1].ref.current;c.style.bottom="0px";let t=Math.max(a-j,A+(e?R:0)+(f.clientHeight-w.offsetTop-w.offsetHeight)+v);c.style.height=N+t+"px"}else{let e=i.length>0&&b===i[0].ref.current;c.style.top="0px";let t=Math.max(j,p+w.offsetTop+(e?C:0)+A);c.style.height=t+(y-N)+"px",w.scrollTop=N-j+w.offsetTop}c.style.margin="".concat(10,"px 0"),c.style.minHeight=E+"px",c.style.maxHeight=a+"px",null==n||n(),requestAnimationFrame(()=>g.current=!0)}},[m,l.trigger,l.valueNode,c,f,w,b,x,l.dir,n]);V(()=>S(),[S]);let[C,j]=a.useState();V(()=>{f&&j(window.getComputedStyle(f).zIndex)},[f]);let A=a.useCallback(e=>{e&&!0===y.current&&(S(),null==E||E(),y.current=!1)},[S,E]);return(0,i.jsx)(tk,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:A,children:(0,i.jsx)("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,i.jsx)(R.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});tP.displayName="SelectItemAlignedPosition";var tT=a.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=10,...l}=e,a=td(r);return(0,i.jsx)(ea,{...a,...l,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...l.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)"}})});tT.displayName="SelectPopperPosition";var[tk,tO]=tu(tS,{}),tM="SelectViewport",tI=a.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...o}=e,l=tj(tM,r),s=tO(tM,r),u=(0,v.useComposedRefs)(t,l.onViewportChange),d=a.useRef(0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.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:n}),(0,i.jsx)(ti.Slot,{scope:r,children:(0,i.jsx)(R.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:c(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=s;if((null==n?void 0:n.current)&&r){let e=Math.abs(d.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,o=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(o<n){let l=o+e,i=Math.min(n,l),a=l-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=a>0?a:0,r.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});tI.displayName=tM;var tL="SelectGroup",[tD,tW]=tu(tL),t_=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=Y();return(0,i.jsx)(tD,{scope:r,id:o,children:(0,i.jsx)(R.div,{role:"group","aria-labelledby":o,...n,ref:t})})});t_.displayName=tL;var tz="SelectLabel",tB=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=tW(tz,r);return(0,i.jsx)(R.div,{id:o.id,...n,ref:t})});tB.displayName=tz;var tF="SelectItem",[tH,tV]=tu(tF),tK=a.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:l,...s}=e,u=tp(tF,r),d=tj(tF,r),f=u.value===n,[p,h]=a.useState(null!=l?l:""),[m,g]=a.useState(!1),y=(0,v.useComposedRefs)(t,e=>{var t;return null==(t=d.itemRefCallback)?void 0:t.call(d,e,n,o)}),w=Y(),b=a.useRef("touch"),x=()=>{o||(u.onValueChange(n),u.onOpenChange(!1))};if(""===n)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,i.jsx)(tH,{scope:r,value:n,disabled:o,textId:w,isSelected:f,onItemTextChange:a.useCallback(e=>{h(t=>{var r;return t||(null!=(r=null==e?void 0:e.textContent)?r:"").trim()})},[]),children:(0,i.jsx)(ti.ItemSlot,{scope:r,value:n,disabled:o,textValue:p,children:(0,i.jsx)(R.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:y,onFocus:c(s.onFocus,()=>g(!0)),onBlur:c(s.onBlur,()=>g(!1)),onClick:c(s.onClick,()=>{"mouse"!==b.current&&x()}),onPointerUp:c(s.onPointerUp,()=>{"mouse"===b.current&&x()}),onPointerDown:c(s.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:c(s.onPointerMove,e=>{if(b.current=e.pointerType,o){var t;null==(t=d.onItemLeave)||t.call(d)}else"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:c(s.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null==(t=d.onItemLeave)||t.call(d)}}),onKeyDown:c(s.onKeyDown,e=>{var t;((null==(t=d.searchRef)?void 0:t.current)===""||" "!==e.key)&&(to.includes(e.key)&&x()," "===e.key&&e.preventDefault())})})})})});tK.displayName=tF;var tU="SelectItemText",tY=a.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,...l}=e,u=tp(tU,r),c=tj(tU,r),d=tV(tU,r),f=tv(tU,r),[p,h]=a.useState(null),m=(0,v.useComposedRefs)(t,e=>h(e),d.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,d.value,d.disabled)}),g=null==p?void 0:p.textContent,y=a.useMemo(()=>(0,i.jsx)("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:b}=f;return V(()=>(w(y),()=>b(y)),[w,b,y]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(R.span,{id:d.textId,...l,ref:m}),d.isSelected&&u.valueNode&&!u.valueNodeHasChildren?s.createPortal(l.children,u.valueNode):null]})});tY.displayName=tU;var tX="SelectItemIndicator",tZ=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return tV(tX,r).isSelected?(0,i.jsx)(R.span,{"aria-hidden":!0,...n,ref:t}):null});tZ.displayName=tX;var tq="SelectScrollUpButton",tG=a.forwardRef((e,t)=>{let r=tj(tq,e.__scopeSelect),n=tO(tq,e.__scopeSelect),[o,l]=a.useState(!1),s=(0,v.useComposedRefs)(t,n.onScrollButtonChange);return V(()=>{if(r.viewport&&r.isPositioned){let e=function(){l(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,i.jsx)(t$,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});tG.displayName=tq;var tJ="SelectScrollDownButton",tQ=a.forwardRef((e,t)=>{let r=tj(tJ,e.__scopeSelect),n=tO(tJ,e.__scopeSelect),[o,l]=a.useState(!1),s=(0,v.useComposedRefs)(t,n.onScrollButtonChange);return V(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)<e)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,i.jsx)(t$,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});tQ.displayName=tJ;var t$=a.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=e,l=tj("SelectScrollButton",r),s=a.useRef(null),u=ta(r),d=a.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),V(()=>{var e;let t=u().find(e=>e.ref.current===document.activeElement);null==t||null==(e=t.ref.current)||e.scrollIntoView({block:"nearest"})},[u]),(0,i.jsx)(R.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:c(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(n,50))}),onPointerMove:c(o.onPointerMove,()=>{var e;null==(e=l.onItemLeave)||e.call(l),null===s.current&&(s.current=window.setInterval(n,50))}),onPointerLeave:c(o.onPointerLeave,()=>{d()})})}),t0=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,i.jsx)(R.div,{"aria-hidden":!0,...n,ref:t})});t0.displayName="SelectSeparator";var t1="SelectArrow";a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=td(r),l=tp(t1,r),a=tj(t1,r);return l.open&&"popper"===a.position?(0,i.jsx)(ec,{...o,...n,ref:t}):null}).displayName=t1;var t2=a.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,...o}=e,l=a.useRef(null),s=(0,v.useComposedRefs)(t,l),u=function(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(n);return a.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(u!==n&&t){let r=new Event("change",{bubbles:!0});t.call(e,n),e.dispatchEvent(r)}},[u,n]),(0,i.jsx)(R.select,{...o,style:{...ew,...o.style},ref:s,defaultValue:n})});function t5(e){return""===e||void 0===e}function t9(e){let t=j(e),r=a.useRef(""),n=a.useRef(0),o=a.useCallback(e=>{let o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),l=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,l]}function t6(e,t,r){var n,o;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,a=(n=e,o=Math.max(i,0),n.map((e,t)=>n[(o+t)%n.length]));1===l.length&&(a=a.filter(e=>e!==r));let s=a.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==r?s:void 0}t2.displayName="SelectBubbleInput";var t7=tm,t8=ty,t3=tb,t4=tx,re=tE,rt=tC,rr=tI,rn=t_,ro=tB,rl=tK,ri=tY,ra=tZ,rs=tG,ru=tQ,rc=t0,rd=e.i(72064),rf=e.i(75157);function rp(e){let{...t}=e;return(0,i.jsx)(t7,{"data-slot":"select",...t})}function rh(e){let{...t}=e;return(0,i.jsx)(rn,{"data-slot":"select-group",...t})}function rv(e){let{...t}=e;return(0,i.jsx)(t3,{"data-slot":"select-value",...t})}function rm(e){let{className:t,size:r="default",children:n,...o}=e;return(0,i.jsxs)(t8,{"data-slot":"select-trigger","data-size":r,className:(0,rf.cn)("flex h-9 w-fit min-w-24 items-center justify-between gap-2 whitespace-nowrap rounded-md border !border-solid border-[var(--ds-border,var(--input))] bg-transparent px-2.5 py-1 text-base outline-none transition-[color,box-shadow,border-color] duration-150 ease-in-out placeholder:text-muted-foreground hover:border-[var(--border-hover)] focus-visible:border-[var(--border-focus)] focus-visible:[box-shadow:var(--ring-focus-sm)] disabled:cursor-not-allowed disabled:opacity-50 disabled:focus-visible:border-[var(--ds-border,var(--input))] disabled:focus-visible:[box-shadow:none] data-[size=default]:h-9 data-[size=sm]:h-7 data-[state=open]:border-[var(--border-focus)] data-[state=open]:[box-shadow:var(--ring-focus-sm)]",t),...o,children:[n,(0,i.jsx)(t4,{asChild:!0,children:(0,i.jsx)(rd.default,{name:"ChevronDown",size:16,className:"opacity-60",strokeWidth:1})})]})}function rg(e){let{className:t,children:r,position:n="popper",...o}=e;return(0,i.jsx)(re,{children:(0,i.jsxs)(rt,{"data-slot":"select-content",className:(0,rf.cn)("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 relative z-[10001] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md","popper"===n&&"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),position:n,...o,children:[(0,i.jsx)(rs,{className:"flex cursor-default items-center justify-center py-1",children:(0,i.jsx)(rd.default,{name:"ChevronUp",size:16})}),(0,i.jsx)(rr,{className:(0,rf.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,i.jsx)(ru,{className:"flex cursor-default items-center justify-center py-1",children:(0,i.jsx)(rd.default,{name:"ChevronDown",size:16,strokeWidth:1})})]})})}function ry(e){let{className:t,...r}=e;return(0,i.jsx)(ro,{"data-slot":"select-label",className:(0,rf.cn)("px-2 py-1.5 text-base font-semibold",t),...r})}function rw(e){let{className:t,children:r,...n}=e;return(0,i.jsxs)(rl,{"data-slot":"select-item",className:(0,rf.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-base outline-none hover:bg-[var(--ds-item-hover)] focus:bg-[var(--ds-item-hover)] focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[(0,i.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,i.jsx)(ra,{children:(0,i.jsx)(rd.default,{name:"Check",size:16})})}),(0,i.jsx)(ri,{children:r})]})}}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67489,29402,e=>{"use strict";e.s(["Select",()=>rp,"SelectContent",()=>rg,"SelectGroup",()=>rh,"SelectItem",()=>rw,"SelectLabel",()=>ry,"SelectTrigger",()=>rm,"SelectValue",()=>rv],67489);var t,r,n,o,l,i=e.i(18050);e.s(["Content",()=>rt,"Group",()=>rn,"Icon",()=>t4,"Item",()=>rl,"ItemIndicator",()=>ra,"ItemText",()=>ri,"Label",()=>ro,"Portal",()=>re,"Root",()=>t7,"ScrollDownButton",()=>ru,"ScrollUpButton",()=>rs,"Separator",()=>rc,"Trigger",()=>t8,"Value",()=>t3,"Viewport",()=>rr],29402);var a=e.i(71645),s=e.i(74080);function u(e,t){let[r,n]=t;return Math.min(n,Math.max(r,e))}function c(e,t){let{checkForDefaultPrevented:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function d(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function f(e,t){var r=d(e,t,"get");return r.get?r.get.call(e):r.value}function p(e,t,r){var n=d(e,t,"set");if(n.set)n.set.call(e,r);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=r}return r}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[],n=()=>{let t=r.map(e=>a.createContext(e));return function(r){let n=(null==r?void 0:r[e])||t;return a.useMemo(()=>({["__scope".concat(e)]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let o=a.createContext(n),l=r.length;r=[...r,n];let s=t=>{var r;let{scope:n,children:s,...u}=t,c=(null==n||null==(r=n[e])?void 0:r[l])||o,d=a.useMemo(()=>u,Object.values(u));return(0,i.jsx)(c.Provider,{value:d,children:s})};return s.displayName=t+"Provider",[s,function(r,i){var s;let u=(null==i||null==(s=i[e])?void 0:s[l])||o,c=a.useContext(u);if(c)return c;if(void 0!==n)return n;throw Error("`".concat(r,"` must be used within `").concat(t,"`"))}]},function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=t[0];if(1===t.length)return n;let o=()=>{let e=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){let r=e.reduce((e,r)=>{let{useScope:n,scopeName:o}=r,l=n(t)["__scope".concat(o)];return{...e,...l}},{});return a.useMemo(()=>({["__scope".concat(n.scopeName)]:r}),[r])}};return o.scopeName=n.scopeName,o}(n,...t)]}"undefined"!=typeof window&&window.document&&window.document.createElement;var v=e.i(20783);function m(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var o,l,i;let e,s,u=(s=(e=null==(l=Object.getOwnPropertyDescriptor((o=r).props,"ref"))?void 0:l.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=null==(i=Object.getOwnPropertyDescriptor(o,"ref"))?void 0:i.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref,c=function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=l(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(c.ref=t?(0,v.composeRefs)(t,u):u),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),s=l.find(y);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,i.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}var g=Symbol("radix.slottable");function y(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===g}var w=new WeakMap;function b(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=function(e,t){let r=e.length,n=x(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}(e,t);return -1===r?void 0:e[r]}function x(e){return e!=e||0===e?0:Math.trunc(e)}r=new WeakMap,class e extends Map{set(e,t){return w.get(this)&&(this.has(e)?f(this,r)[f(this,r).indexOf(e)]=e:f(this,r).push(e)),super.set(e,t),this}insert(e,t,n){let o,l=this.has(t),i=f(this,r).length,a=x(e),s=a>=0?a:i+a,u=s<0||s>=i?-1:s;if(u===this.size||l&&u===this.size-1||-1===u)return this.set(t,n),this;let c=this.size+ +!l;a<0&&s++;let d=[...f(this,r)],p=!1;for(let e=s;e<c;e++)if(s===e){let r=d[e];d[e]===t&&(r=d[e+1]),l&&this.delete(t),o=this.get(r),this.set(t,n)}else{p||d[e-1]!==t||(p=!0);let r=d[p?e:e-1],n=o;o=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,n){let o=new e(this);return o.insert(t,r,n),o}before(e){let t=f(this,r).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let o=f(this,r).indexOf(e);return -1===o?this:this.insert(o,t,n)}after(e){let t=f(this,r).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let o=f(this,r).indexOf(e);return -1===o?this:this.insert(o+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return p(this,r,[]),super.clear()}delete(e){let t=super.delete(e);return t&&f(this,r).splice(f(this,r).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=b(f(this,r),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=b(f(this,r),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return f(this,r).indexOf(e)}keyAt(e){return b(f(this,r),e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&n.push(e),o++;return new e(n)}map(t,r){let n=[],o=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(n)}reduce(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,l=0,i=null!=o?o:this.at(0);for(let e of this)i=0===l&&1===t.length?e:Reflect.apply(n,this,[i,e,l,this]),l++;return i}reduceRight(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,l=null!=o?o:this.at(-1);for(let e=this.size-1;e>=0;e--){let r=this.at(e);l=e===this.size-1&&1===t.length?r:Reflect.apply(n,this,[l,r,e,this])}return l}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=[...this.entries()];return o.splice(...r),new e(o)}slice(t,r){let n=new e,o=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}constructor(e){super(e),function(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}(this,r,{writable:!0,value:void 0}),p(this,r,[...super.keys()]),w.set(this,!0)}};var E=a.createContext(void 0),S=Symbol("radix.slottable");function C(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===S}var R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=function(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var o,l,i;let e,s,u=(s=(e=null==(l=Object.getOwnPropertyDescriptor((o=r).props,"ref"))?void 0:l.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=null==(i=Object.getOwnPropertyDescriptor(o,"ref"))?void 0:i.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref,c=function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=l(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(c.ref=t?(0,v.composeRefs)(t,u):u),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),s=l.find(C);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,i.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}("Primitive.".concat(t)),n=a.forwardRef((e,n)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(o?r:t,{...l,ref:n})});return n.displayName="Primitive.".concat(t),{...e,[t]:n}},{});function j(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>function(){for(var e,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return null==(e=t.current)?void 0:e.call(t,...n)},[])}var A="dismissableLayer.update",N=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),P=a.forwardRef((e,t)=>{var r,o;let{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,...h}=e,m=a.useContext(N),[g,y]=a.useState(null),w=null!=(o=null==g?void 0:g.ownerDocument)?o:null==(r=globalThis)?void 0:r.document,[,b]=a.useState({}),x=(0,v.useComposedRefs)(t,e=>y(e)),E=Array.from(m.layers),[S]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),C=E.indexOf(S),P=g?E.indexOf(g):-1,O=m.layersWithOutsidePointerEventsDisabled.size>0,M=P>=C,I=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=j(e),o=a.useRef(!1),l=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){k("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,r=[...m.branches].some(e=>e.contains(t));M&&!r&&(null==u||u(e),null==f||f(e),e.defaultPrevented||null==p||p())},w),L=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=j(e),o=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!o.current&&k("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;![...m.branches].some(e=>e.contains(t))&&(null==d||d(e),null==f||f(e),e.defaultPrevented||null==p||p())},w);return!function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=j(e);a.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e,{capture:!0}),()=>r.removeEventListener("keydown",e,{capture:!0})},[n,r])}(e=>{P===m.layers.size-1&&(null==s||s(e),!e.defaultPrevented&&p&&(e.preventDefault(),p()))},w),a.useEffect(()=>{if(g)return l&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(n=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),T(),()=>{l&&1===m.layersWithOutsidePointerEventsDisabled.size&&(w.body.style.pointerEvents=n)}},[g,w,l,m]),a.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),T())},[g,m]),a.useEffect(()=>{let e=()=>b({});return document.addEventListener(A,e),()=>document.removeEventListener(A,e)},[]),(0,i.jsx)(R.div,{...h,ref:x,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:c(e.onFocusCapture,L.onFocusCapture),onBlurCapture:c(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,I.onPointerDownCapture)})});function T(){let e=new CustomEvent(A);document.dispatchEvent(e)}function k(e,t,r,n){let{discrete:o}=n,l=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&l.addEventListener(e,t,{once:!0}),o)l&&s.flushSync(()=>l.dispatchEvent(i));else l.dispatchEvent(i)}P.displayName="DismissableLayer",a.forwardRef((e,t)=>{let r=a.useContext(N),n=a.useRef(null),o=(0,v.useComposedRefs)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,i.jsx)(R.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var O=0;function M(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var I="focusScope.autoFocusOnMount",L="focusScope.autoFocusOnUnmount",D={bubbles:!1,cancelable:!0},W=a.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...s}=e,[u,c]=a.useState(null),d=j(o),f=j(l),p=a.useRef(null),h=(0,v.useComposedRefs)(t,e=>c(e)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(n){let e=function(e){if(m.paused||!u)return;let t=e.target;u.contains(t)?p.current=t:B(p.current,{select:!0})},t=function(e){if(m.paused||!u)return;let t=e.relatedTarget;null!==t&&(u.contains(t)||B(p.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&B(u)});return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,u,m.paused]),a.useEffect(()=>{if(u){F.add(m);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(I,D);u.addEventListener(I,d),u.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(B(n,{select:t}),document.activeElement!==r)return}(_(u).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&B(u))}return()=>{u.removeEventListener(I,d),setTimeout(()=>{let t=new CustomEvent(L,D);u.addEventListener(L,f),u.dispatchEvent(t),t.defaultPrevented||B(null!=e?e:document.body,{select:!0}),u.removeEventListener(L,f),F.remove(m)},0)}}},[u,d,f,m]);let g=a.useCallback(e=>{if(!r&&!n||m.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,l]=function(e){let t=_(e);return[z(t,e),z(t.reverse(),e)]}(t);n&&l?e.shiftKey||o!==l?e.shiftKey&&o===n&&(e.preventDefault(),r&&B(l,{select:!0})):(e.preventDefault(),r&&B(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,m.paused]);return(0,i.jsx)(R.div,{tabIndex:-1,...s,ref:h,onKeyDown:g})});function _(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function z(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function B(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}W.displayName="FocusScope";var F=function(){let e=[];return{add(t){let r=e[0];t!==r&&(null==r||r.pause()),(e=H(e,t)).unshift(t)},remove(t){var r;null==(r=(e=H(e,t))[0])||r.resume()}}}();function H(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var V=(null==(o=globalThis)?void 0:o.document)?a.useLayoutEffect:()=>{},K=a[" useId ".trim().toString()]||(()=>void 0),U=0;function Y(e){let[t,r]=a.useState(K());return V(()=>{e||r(e=>null!=e?e:String(U++))},[e]),e||(t?"radix-".concat(t):"")}var X=e.i(58950),Z=e.i(53760),q=a.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...l}=e;return(0,i.jsx)(R.svg,{...l,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,i.jsx)("polygon",{points:"0,0 30,0 15,10"})})});q.displayName="Arrow";var G="Popper",[J,Q]=h(G),[$,ee]=J(G),et=e=>{let{__scopePopper:t,children:r}=e,[n,o]=a.useState(null);return(0,i.jsx)($,{scope:t,anchor:n,onAnchorChange:o,children:r})};et.displayName=G;var er="PopperAnchor",en=a.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,l=ee(er,r),s=a.useRef(null),u=(0,v.useComposedRefs)(t,s),c=a.useRef(null);return a.useEffect(()=>{let e=c.current;c.current=(null==n?void 0:n.current)||s.current,e!==c.current&&l.onAnchorChange(c.current)}),n?null:(0,i.jsx)(R.div,{...o,ref:u})});en.displayName=er;var eo="PopperContent",[el,ei]=J(eo),ea=a.forwardRef((e,t)=>{var r,n,o,l,s,u,c,d;let{__scopePopper:f,side:p="bottom",sideOffset:h=0,align:m="center",alignOffset:g=0,arrowPadding:y=0,avoidCollisions:w=!0,collisionBoundary:b=[],collisionPadding:x=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:C="optimized",onPlaced:A,...N}=e,P=ee(eo,f),[T,k]=a.useState(null),O=(0,v.useComposedRefs)(t,e=>k(e)),[M,I]=a.useState(null),L=function(e){let[t,r]=a.useState(void 0);return V(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let l=t[0];if("borderBoxSize"in l){let e=l.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(M),D=null!=(c=null==L?void 0:L.width)?c:0,W=null!=(d=null==L?void 0:L.height)?d:0,_="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},z=Array.isArray(b)?b:[b],B=z.length>0,F={padding:_,boundary:z.filter(ed),altBoundary:B},{refs:H,floatingStyles:K,placement:U,isPositioned:Y,middlewareData:q}=(0,X.useFloating)({strategy:"fixed",placement:p+("center"!==m?"-"+m:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,Z.autoUpdate)(...t,{animationFrame:"always"===C})},elements:{reference:P.anchor},middleware:[(0,X.offset)({mainAxis:h+W,alignmentAxis:g}),w&&(0,X.shift)({mainAxis:!0,crossAxis:!1,limiter:"partial"===E?(0,X.limitShift)():void 0,...F}),w&&(0,X.flip)({...F}),(0,X.size)({...F,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:l,height:i}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(l,"px")),a.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),M&&(0,X.arrow)({element:M,padding:y}),ef({arrowWidth:D,arrowHeight:W}),S&&(0,X.hide)({strategy:"referenceHidden",...F})]}),[G,J]=ep(U),Q=j(A);V(()=>{Y&&(null==Q||Q())},[Y,Q]);let $=null==(r=q.arrow)?void 0:r.x,et=null==(n=q.arrow)?void 0:n.y,er=(null==(o=q.arrow)?void 0:o.centerOffset)!==0,[en,ei]=a.useState();return V(()=>{T&&ei(window.getComputedStyle(T).zIndex)},[T]),(0,i.jsx)("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Y?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:en,"--radix-popper-transform-origin":[null==(l=q.transformOrigin)?void 0:l.x,null==(s=q.transformOrigin)?void 0:s.y].join(" "),...(null==(u=q.hide)?void 0:u.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,i.jsx)(el,{scope:f,placedSide:G,onArrowChange:I,arrowX:$,arrowY:et,shouldHideArrow:er,children:(0,i.jsx)(R.div,{"data-side":G,"data-align":J,...N,ref:O,style:{...N.style,animation:Y?void 0:"none"}})})})});ea.displayName=eo;var es="PopperArrow",eu={top:"bottom",right:"left",bottom:"top",left:"right"},ec=a.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=ei(es,r),l=eu[o.placedSide];return(0,i.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,i.jsx)(q,{...n,ref:t,style:{...n.style,display:"block"}})})});function ed(e){return null!==e}ec.displayName=es;var ef=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,l,i;let{placement:a,rects:s,middlewareData:u}=t,c=(null==(r=u.arrow)?void 0:r.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,h]=ep(a),v={start:"0%",center:"50%",end:"100%"}[h],m=(null!=(l=null==(n=u.arrow)?void 0:n.x)?l:0)+d/2,g=(null!=(i=null==(o=u.arrow)?void 0:o.y)?i:0)+f/2,y="",w="";return"bottom"===p?(y=c?v:"".concat(m,"px"),w="".concat(-f,"px")):"top"===p?(y=c?v:"".concat(m,"px"),w="".concat(s.floating.height+f,"px")):"right"===p?(y="".concat(-f,"px"),w=c?v:"".concat(g,"px")):"left"===p&&(y="".concat(s.floating.width+f,"px"),w=c?v:"".concat(g,"px")),{data:{x:y,y:w}}}});function ep(e){let[t,r="center"]=e.split("-");return[t,r]}var eh=a.forwardRef((e,t)=>{var r,n;let{container:o,...l}=e,[u,c]=a.useState(!1);V(()=>c(!0),[]);let d=o||u&&(null==(n=globalThis)||null==(r=n.document)?void 0:r.body);return d?s.default.createPortal((0,i.jsx)(R.div,{...l,ref:t}),d):null});eh.displayName="Portal";var ev=Symbol("radix.slottable");function em(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ev}a[" useEffectEvent ".trim().toString()],a[" useInsertionEffect ".trim().toString()];var eg=a[" useInsertionEffect ".trim().toString()]||V;function ey(e){let{prop:t,defaultProp:r,onChange:n=()=>{},caller:o}=e,[l,i,s]=function(e){let{defaultProp:t,onChange:r}=e,[n,o]=a.useState(t),l=a.useRef(n),i=a.useRef(r);return eg(()=>{i.current=r},[r]),a.useEffect(()=>{if(l.current!==n){var e;null==(e=i.current)||e.call(i,n),l.current=n}},[n,l]),[n,o,i]}({defaultProp:r,onChange:n}),u=void 0!==t,c=u?t:l;{let e=a.useRef(void 0!==t);a.useEffect(()=>{let t=e.current;if(t!==u){let e=u?"controlled":"uncontrolled";console.warn("".concat(o," is changing from ").concat(t?"controlled":"uncontrolled"," to ").concat(e,". Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component."))}e.current=u},[u,o])}return[c,a.useCallback(e=>{if(u){let n="function"==typeof e?e(t):e;if(n!==t){var r;null==(r=s.current)||r.call(s,n)}}else i(e)},[u,t,i,s])]}Symbol("RADIX:SYNC_STATE");var ew=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"});a.forwardRef((e,t)=>(0,i.jsx)(R.span,{...e,ref:t,style:{...ew,...e.style}})).displayName="VisuallyHidden";var eb=new WeakMap,ex=new WeakMap,eE={},eS=0,eC=function(e){return e&&(e.host||eC(e.parentNode))},eR=function(e,t,r,n){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=eC(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eE[r]||(eE[r]=new WeakMap);var l=eE[r],i=[],a=new Set,s=new Set(o),u=function(e){!e||a.has(e)||(a.add(e),u(e.parentNode))};o.forEach(u);var c=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(a.has(e))c(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,s=(eb.get(e)||0)+1,u=(l.get(e)||0)+1;eb.set(e,s),l.set(e,u),i.push(e),1===s&&o&&ex.set(e,!0),1===u&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),a.clear(),eS++,function(){i.forEach(function(e){var t=eb.get(e)-1,o=l.get(e)-1;eb.set(e,t),l.set(e,o),t||(ex.has(e)||e.removeAttribute(n),ex.delete(e)),o||e.removeAttribute(r)}),--eS||(eb=new WeakMap,eb=new WeakMap,ex=new WeakMap,eE={})}},ej=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),eR(n,o,r,"aria-hidden")):function(){return null}},eA=function(){return(eA=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function eN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}Object.create;Object.create;var eP=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),eT="width-before-scroll-bar";function ek(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var eO="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,eM=new WeakMap;function eI(e){return e}var eL=function(e){void 0===e&&(e={});var t,r,n,o=(void 0===t&&(t=eI),r=[],n=!1,{read:function(){if(n)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:null},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var l=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(l)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}});return o.options=eA({async:!0,ssr:!1},e),o}(),eD=function(){},eW=a.forwardRef(function(e,t){var r,n,o,l,i=a.useRef(null),s=a.useState({onScrollCapture:eD,onWheelCapture:eD,onTouchMoveCapture:eD}),u=s[0],c=s[1],d=e.forwardProps,f=e.children,p=e.className,h=e.removeScrollBar,v=e.enabled,m=e.shards,g=e.sideCar,y=e.noRelative,w=e.noIsolation,b=e.inert,x=e.allowPinchZoom,E=e.as,S=e.gapMode,C=eN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=(r=[i,t],n=function(e){return r.forEach(function(t){return ek(t,e)})},(o=(0,a.useState)(function(){return{value:null,callback:n,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=n,l=o.facade,eO(function(){var e=eM.get(l);if(e){var t=new Set(e),n=new Set(r),o=l.current;t.forEach(function(e){n.has(e)||ek(e,null)}),n.forEach(function(e){t.has(e)||ek(e,o)})}eM.set(l,r)},[r]),l),j=eA(eA({},C),u);return a.createElement(a.Fragment,null,v&&a.createElement(g,{sideCar:eL,removeScrollBar:h,shards:m,noRelative:y,noIsolation:w,inert:b,setCallbacks:c,allowPinchZoom:!!x,lockRef:i,gapMode:S}),d?a.cloneElement(a.Children.only(f),eA(eA({},j),{ref:R})):a.createElement(void 0===E?"div":E,eA({},j,{className:p,ref:R}),f))});eW.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eW.classNames={fullWidth:eT,zeroRight:eP};var e_=function(e){var t=e.sideCar,r=eN(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return a.createElement(n,eA({},r))};e_.isSideCarExport=!0;var ez=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=l||("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,o;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),o=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(o)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eB=function(){var e=ez();return function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},eF=function(){var e=eB();return function(t){return e(t.styles,t.dynamic),null}},eH={left:0,top:0,right:0,gap:0},eV=function(e){return parseInt(e||"",10)||0},eK=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[eV(r),eV(n),eV(o)]},eU=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return eH;var t=eK(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},eY=eF(),eX="data-scroll-locked",eZ=function(e,t,r,n){var o=e.left,l=e.top,i=e.right,a=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(a,"px ").concat(n,";\n }\n body[").concat(eX,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(l,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(eP," {\n right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(eT," {\n margin-right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(eP," .").concat(eP," {\n right: 0 ").concat(n,";\n }\n \n .").concat(eT," .").concat(eT," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(eX,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},eq=function(){var e=parseInt(document.body.getAttribute(eX)||"0",10);return isFinite(e)?e:0},eG=function(){a.useEffect(function(){return document.body.setAttribute(eX,(eq()+1).toString()),function(){var e=eq()-1;e<=0?document.body.removeAttribute(eX):document.body.setAttribute(eX,e.toString())}},[])},eJ=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;eG();var l=a.useMemo(function(){return eU(o)},[o]);return a.createElement(eY,{styles:eZ(l,!t,o,r?"":"!important")})},eQ=!1;if("undefined"!=typeof window)try{var e$=Object.defineProperty({},"passive",{get:function(){return eQ=!0,!0}});window.addEventListener("test",e$,e$),window.removeEventListener("test",e$,e$)}catch(e){eQ=!1}var e0=!!eQ&&{passive:!1},e1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},e2=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),e5(e,n)){var o=e9(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},e5=function(e,t){return"v"===e?e1(t,"overflowY"):e1(t,"overflowX")},e9=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},e6=function(e,t,r,n,o){var l,i=(l=window.getComputedStyle(t).direction,"h"===e&&"rtl"===l?-1:1),a=i*n,s=r.target,u=t.contains(s),c=!1,d=a>0,f=0,p=0;do{if(!s)break;var h=e9(e,s),v=h[0],m=h[1]-h[2]-i*v;(v||m)&&e5(e,s)&&(f+=m,p+=v);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!u&&s!==document.body||u&&(t.contains(s)||t===s))return d&&(o&&1>Math.abs(f)||!o&&a>f)?c=!0:!d&&(o&&1>Math.abs(p)||!o&&-a>p)&&(c=!0),c},e7=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e8=function(e){return[e.deltaX,e.deltaY]},e3=function(e){return e&&"current"in e?e.current:e},e4=0,te=[];let tt=(t=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(e4++)[0],l=a.useState(eF)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,o=0,l=t.length;o<l;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(e3),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,l=e7(e),a=r.current,s="deltaX"in e?e.deltaX:a[0]-l[0],u="deltaY"in e?e.deltaY:a[1]-l[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var h=e2(d,c);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=e2(d,c)),!h)return!1;if(!n.current&&"changedTouches"in e&&(s||u)&&(n.current=o),!o)return!0;var v=n.current||o;return e6(v,t,e,"h"===v?s:u,!0)},[]),u=a.useCallback(function(e){if(te.length&&te[te.length-1]===l){var r="deltaY"in e?e8(e):e7(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(i.current.shards||[]).map(e3).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?s(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=a.useCallback(function(e,r,n,o){var l={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(l),setTimeout(function(){t.current=t.current.filter(function(e){return e!==l})},1)},[]),d=a.useCallback(function(e){r.current=e7(e),n.current=void 0},[]),f=a.useCallback(function(t){c(t.type,e8(t),t.target,s(t,e.lockRef.current))},[]),p=a.useCallback(function(t){c(t.type,e7(t),t.target,s(t,e.lockRef.current))},[]);a.useEffect(function(){return te.push(l),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,e0),document.addEventListener("touchmove",u,e0),document.addEventListener("touchstart",d,e0),function(){te=te.filter(function(e){return e!==l}),document.removeEventListener("wheel",u,e0),document.removeEventListener("touchmove",u,e0),document.removeEventListener("touchstart",d,e0)}},[]);var h=e.removeScrollBar,v=e.inert;return a.createElement(a.Fragment,null,v?a.createElement(l,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,h?a.createElement(eJ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},eL.useMedium(t),e_);var tr=a.forwardRef(function(e,t){return a.createElement(eW,eA({},e,{ref:t,sideCar:tt}))});tr.classNames=eW.classNames;var tn=[" ","Enter","ArrowUp","ArrowDown"],to=[" ","Enter"],tl="Select",[ti,ta,ts]=function(e){let t=e+"CollectionProvider",[r,n]=h(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:r}=e,n=a.default.useRef(null),l=a.default.useRef(new Map).current;return(0,i.jsx)(o,{scope:t,itemMap:l,collectionRef:n,children:r})};s.displayName=t;let u=e+"CollectionSlot",c=m(u),d=a.default.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=l(u,r),a=(0,v.useComposedRefs)(t,o.collectionRef);return(0,i.jsx)(c,{ref:a,children:n})});d.displayName=u;let f=e+"CollectionItemSlot",p="data-radix-collection-item",g=m(f),y=a.default.forwardRef((e,t)=>{let{scope:r,children:n,...o}=e,s=a.default.useRef(null),u=(0,v.useComposedRefs)(t,s),c=l(f,r);return a.default.useEffect(()=>(c.itemMap.set(s,{ref:s,...o}),()=>void c.itemMap.delete(s))),(0,i.jsx)(g,{...{[p]:""},ref:u,children:n})});return y.displayName=f,[{Provider:s,Slot:d,ItemSlot:y},function(t){let r=l(e+"CollectionConsumer",t);return a.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(p,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(tl),[tu,tc]=h(tl,[ts,Q]),td=Q(),[tf,tp]=tu(tl),[th,tv]=tu(tl),tm=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:l,value:s,defaultValue:u,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:h,required:v,form:m}=e,g=td(t),[y,w]=a.useState(null),[b,x]=a.useState(null),[S,C]=a.useState(!1),R=function(e){let t=a.useContext(E);return e||t||"ltr"}(d),[j,A]=ey({prop:n,defaultProp:null!=o&&o,onChange:l,caller:tl}),[N,P]=ey({prop:s,defaultProp:u,onChange:c,caller:tl}),T=a.useRef(null),k=!y||m||!!y.closest("form"),[O,M]=a.useState(new Set),I=Array.from(O).map(e=>e.props.value).join(";");return(0,i.jsx)(et,{...g,children:(0,i.jsxs)(tf,{required:v,scope:t,trigger:y,onTriggerChange:w,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Y(),value:N,onValueChange:P,open:j,onOpenChange:A,dir:R,triggerPointerDownPosRef:T,disabled:h,children:[(0,i.jsx)(ti.Provider,{scope:t,children:(0,i.jsx)(th,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{M(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:r})}),k?(0,i.jsxs)(t2,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>P(e.target.value),disabled:h,form:m,children:[void 0===N?(0,i.jsx)("option",{value:""}):null,Array.from(O)]},I):null]})})};tm.displayName=tl;var tg="SelectTrigger",ty=a.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...o}=e,l=td(r),s=tp(tg,r),u=s.disabled||n,d=(0,v.useComposedRefs)(t,s.onTriggerChange),f=ta(r),p=a.useRef("touch"),[h,m,g]=t9(e=>{let t=f().filter(e=>!e.disabled),r=t.find(e=>e.value===s.value),n=t6(t,e,r);void 0!==n&&s.onValueChange(n.value)}),y=e=>{u||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,i.jsx)(en,{asChild:!0,...l,children:(0,i.jsx)(R.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":t5(s.value)?"":void 0,...o,ref:d,onClick:c(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&y(e)}),onPointerDown:c(o.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:c(o.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&tn.includes(e.key)&&(y(),e.preventDefault())})})})});ty.displayName=tg;var tw="SelectValue",tb=a.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,children:l,placeholder:a="",...s}=e,u=tp(tw,r),{onValueNodeHasChildrenChange:c}=u,d=void 0!==l,f=(0,v.useComposedRefs)(t,u.onValueNodeChange);return V(()=>{c(d)},[c,d]),(0,i.jsx)(R.span,{...s,ref:f,style:{pointerEvents:"none"},children:t5(u.value)?(0,i.jsx)(i.Fragment,{children:a}):l})});tb.displayName=tw;var tx=a.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...o}=e;return(0,i.jsx)(R.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});tx.displayName="SelectIcon";var tE=e=>(0,i.jsx)(eh,{asChild:!0,...e});tE.displayName="SelectPortal";var tS="SelectContent",tC=a.forwardRef((e,t)=>{let r=tp(tS,e.__scopeSelect),[n,o]=a.useState();return(V(()=>{o(new DocumentFragment)},[]),r.open)?(0,i.jsx)(tN,{...e,ref:t}):n?s.createPortal((0,i.jsx)(tR,{scope:e.__scopeSelect,children:(0,i.jsx)(ti.Slot,{scope:e.__scopeSelect,children:(0,i.jsx)("div",{children:e.children})})}),n):null});tC.displayName=tS;var[tR,tj]=tu(tS),tA=function(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var o,l,i;let e,s,u=(s=(e=null==(l=Object.getOwnPropertyDescriptor((o=r).props,"ref"))?void 0:l.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=null==(i=Object.getOwnPropertyDescriptor(o,"ref"))?void 0:i.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref,c=function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=l(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(c.ref=t?(0,v.composeRefs)(t,u):u),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),s=l.find(em);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,i.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}("SelectContent.RemoveScroll"),tN=a.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:s,side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:w,avoidCollisions:b,...x}=e,E=tp(tS,r),[S,C]=a.useState(null),[R,j]=a.useState(null),A=(0,v.useComposedRefs)(t,e=>C(e)),[N,T]=a.useState(null),[k,I]=a.useState(null),L=ta(r),[D,_]=a.useState(!1),z=a.useRef(!1);a.useEffect(()=>{if(S)return ej(S)},[S]),a.useEffect(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!=(e=r[0])?e:M()),document.body.insertAdjacentElement("beforeend",null!=(t=r[1])?t:M()),O++,()=>{1===O&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),O--}},[]);let B=a.useCallback(e=>{let[t,...r]=L().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(let r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&R&&(R.scrollTop=0),r===n&&R&&(R.scrollTop=R.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[L,R]),F=a.useCallback(()=>B([N,S]),[B,N,S]);a.useEffect(()=>{D&&F()},[D,F]);let{onOpenChange:H,triggerPointerDownPosRef:V}=E;a.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{var r,n,o,l;e={x:Math.abs(Math.round(t.pageX)-(null!=(o=null==(r=V.current)?void 0:r.x)?o:0)),y:Math.abs(Math.round(t.pageY)-(null!=(l=null==(n=V.current)?void 0:n.y)?l:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():S.contains(r.target)||H(!1),document.removeEventListener("pointermove",t),V.current=null};return null!==V.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[S,H,V]),a.useEffect(()=>{let e=()=>H(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[H]);let[K,U]=t9(e=>{let t=L().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=t6(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),Y=a.useCallback((e,t,r)=>{let n=!z.current&&!r;(void 0!==E.value&&E.value===t||n)&&(T(e),n&&(z.current=!0))},[E.value]),X=a.useCallback(()=>null==S?void 0:S.focus(),[S]),Z=a.useCallback((e,t,r)=>{let n=!z.current&&!r;(void 0!==E.value&&E.value===t||n)&&I(e)},[E.value]),q="popper"===n?tT:tP,G=q===tT?{side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:w,avoidCollisions:b}:{};return(0,i.jsx)(tR,{scope:r,content:S,viewport:R,onViewportChange:j,itemRefCallback:Y,selectedItem:N,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:F,selectedItemText:k,position:n,isPositioned:D,searchRef:K,children:(0,i.jsx)(tr,{as:tA,allowPinchZoom:!0,children:(0,i.jsx)(W,{asChild:!0,trapped:E.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:c(o,e=>{var t;null==(t=E.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,i.jsx)(P,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:(0,i.jsx)(q,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:e=>e.preventDefault(),...x,...G,onPlaced:()=>_(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:c(x.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>B(t)),e.preventDefault()}})})})})})})});tN.displayName="SelectContentImpl";var tP=a.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...o}=e,l=tp(tS,r),s=tj(tS,r),[c,d]=a.useState(null),[f,p]=a.useState(null),h=(0,v.useComposedRefs)(t,e=>p(e)),m=ta(r),g=a.useRef(!1),y=a.useRef(!0),{viewport:w,selectedItem:b,selectedItemText:x,focusSelectedItem:E}=s,S=a.useCallback(()=>{if(l.trigger&&l.valueNode&&c&&f&&w&&b&&x){let e=l.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),r=l.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==l.dir){let n=o.left-t.left,l=r.left-n,i=e.left-l,a=e.width+i,s=Math.max(a,t.width),d=u(l,[10,Math.max(10,window.innerWidth-10-s)]);c.style.minWidth=a+"px",c.style.left=d+"px"}else{let n=t.right-o.right,l=window.innerWidth-r.right-n,i=window.innerWidth-e.right-l,a=e.width+i,s=Math.max(a,t.width),d=u(l,[10,Math.max(10,window.innerWidth-10-s)]);c.style.minWidth=a+"px",c.style.right=d+"px"}let i=m(),a=window.innerHeight-20,s=w.scrollHeight,d=window.getComputedStyle(f),p=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),y=p+h+s+parseInt(d.paddingBottom,10)+v,E=Math.min(5*b.offsetHeight,y),S=window.getComputedStyle(w),C=parseInt(S.paddingTop,10),R=parseInt(S.paddingBottom,10),j=e.top+e.height/2-10,A=b.offsetHeight/2,N=p+h+(b.offsetTop+A);if(N<=j){let e=i.length>0&&b===i[i.length-1].ref.current;c.style.bottom="0px";let t=Math.max(a-j,A+(e?R:0)+(f.clientHeight-w.offsetTop-w.offsetHeight)+v);c.style.height=N+t+"px"}else{let e=i.length>0&&b===i[0].ref.current;c.style.top="0px";let t=Math.max(j,p+w.offsetTop+(e?C:0)+A);c.style.height=t+(y-N)+"px",w.scrollTop=N-j+w.offsetTop}c.style.margin="".concat(10,"px 0"),c.style.minHeight=E+"px",c.style.maxHeight=a+"px",null==n||n(),requestAnimationFrame(()=>g.current=!0)}},[m,l.trigger,l.valueNode,c,f,w,b,x,l.dir,n]);V(()=>S(),[S]);let[C,j]=a.useState();V(()=>{f&&j(window.getComputedStyle(f).zIndex)},[f]);let A=a.useCallback(e=>{e&&!0===y.current&&(S(),null==E||E(),y.current=!1)},[S,E]);return(0,i.jsx)(tk,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:A,children:(0,i.jsx)("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,i.jsx)(R.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});tP.displayName="SelectItemAlignedPosition";var tT=a.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=10,...l}=e,a=td(r);return(0,i.jsx)(ea,{...a,...l,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...l.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)"}})});tT.displayName="SelectPopperPosition";var[tk,tO]=tu(tS,{}),tM="SelectViewport",tI=a.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...o}=e,l=tj(tM,r),s=tO(tM,r),u=(0,v.useComposedRefs)(t,l.onViewportChange),d=a.useRef(0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.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:n}),(0,i.jsx)(ti.Slot,{scope:r,children:(0,i.jsx)(R.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:c(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=s;if((null==n?void 0:n.current)&&r){let e=Math.abs(d.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,o=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(o<n){let l=o+e,i=Math.min(n,l),a=l-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=a>0?a:0,r.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});tI.displayName=tM;var tL="SelectGroup",[tD,tW]=tu(tL),t_=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=Y();return(0,i.jsx)(tD,{scope:r,id:o,children:(0,i.jsx)(R.div,{role:"group","aria-labelledby":o,...n,ref:t})})});t_.displayName=tL;var tz="SelectLabel",tB=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=tW(tz,r);return(0,i.jsx)(R.div,{id:o.id,...n,ref:t})});tB.displayName=tz;var tF="SelectItem",[tH,tV]=tu(tF),tK=a.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:l,...s}=e,u=tp(tF,r),d=tj(tF,r),f=u.value===n,[p,h]=a.useState(null!=l?l:""),[m,g]=a.useState(!1),y=(0,v.useComposedRefs)(t,e=>{var t;return null==(t=d.itemRefCallback)?void 0:t.call(d,e,n,o)}),w=Y(),b=a.useRef("touch"),x=()=>{o||(u.onValueChange(n),u.onOpenChange(!1))};if(""===n)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,i.jsx)(tH,{scope:r,value:n,disabled:o,textId:w,isSelected:f,onItemTextChange:a.useCallback(e=>{h(t=>{var r;return t||(null!=(r=null==e?void 0:e.textContent)?r:"").trim()})},[]),children:(0,i.jsx)(ti.ItemSlot,{scope:r,value:n,disabled:o,textValue:p,children:(0,i.jsx)(R.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:y,onFocus:c(s.onFocus,()=>g(!0)),onBlur:c(s.onBlur,()=>g(!1)),onClick:c(s.onClick,()=>{"mouse"!==b.current&&x()}),onPointerUp:c(s.onPointerUp,()=>{"mouse"===b.current&&x()}),onPointerDown:c(s.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:c(s.onPointerMove,e=>{if(b.current=e.pointerType,o){var t;null==(t=d.onItemLeave)||t.call(d)}else"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:c(s.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null==(t=d.onItemLeave)||t.call(d)}}),onKeyDown:c(s.onKeyDown,e=>{var t;((null==(t=d.searchRef)?void 0:t.current)===""||" "!==e.key)&&(to.includes(e.key)&&x()," "===e.key&&e.preventDefault())})})})})});tK.displayName=tF;var tU="SelectItemText",tY=a.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,...l}=e,u=tp(tU,r),c=tj(tU,r),d=tV(tU,r),f=tv(tU,r),[p,h]=a.useState(null),m=(0,v.useComposedRefs)(t,e=>h(e),d.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,d.value,d.disabled)}),g=null==p?void 0:p.textContent,y=a.useMemo(()=>(0,i.jsx)("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:b}=f;return V(()=>(w(y),()=>b(y)),[w,b,y]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(R.span,{id:d.textId,...l,ref:m}),d.isSelected&&u.valueNode&&!u.valueNodeHasChildren?s.createPortal(l.children,u.valueNode):null]})});tY.displayName=tU;var tX="SelectItemIndicator",tZ=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return tV(tX,r).isSelected?(0,i.jsx)(R.span,{"aria-hidden":!0,...n,ref:t}):null});tZ.displayName=tX;var tq="SelectScrollUpButton",tG=a.forwardRef((e,t)=>{let r=tj(tq,e.__scopeSelect),n=tO(tq,e.__scopeSelect),[o,l]=a.useState(!1),s=(0,v.useComposedRefs)(t,n.onScrollButtonChange);return V(()=>{if(r.viewport&&r.isPositioned){let e=function(){l(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,i.jsx)(t$,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});tG.displayName=tq;var tJ="SelectScrollDownButton",tQ=a.forwardRef((e,t)=>{let r=tj(tJ,e.__scopeSelect),n=tO(tJ,e.__scopeSelect),[o,l]=a.useState(!1),s=(0,v.useComposedRefs)(t,n.onScrollButtonChange);return V(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)<e)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,i.jsx)(t$,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});tQ.displayName=tJ;var t$=a.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=e,l=tj("SelectScrollButton",r),s=a.useRef(null),u=ta(r),d=a.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),V(()=>{var e;let t=u().find(e=>e.ref.current===document.activeElement);null==t||null==(e=t.ref.current)||e.scrollIntoView({block:"nearest"})},[u]),(0,i.jsx)(R.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:c(o.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(n,50))}),onPointerMove:c(o.onPointerMove,()=>{var e;null==(e=l.onItemLeave)||e.call(l),null===s.current&&(s.current=window.setInterval(n,50))}),onPointerLeave:c(o.onPointerLeave,()=>{d()})})}),t0=a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,i.jsx)(R.div,{"aria-hidden":!0,...n,ref:t})});t0.displayName="SelectSeparator";var t1="SelectArrow";a.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=td(r),l=tp(t1,r),a=tj(t1,r);return l.open&&"popper"===a.position?(0,i.jsx)(ec,{...o,...n,ref:t}):null}).displayName=t1;var t2=a.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,...o}=e,l=a.useRef(null),s=(0,v.useComposedRefs)(t,l),u=function(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(n);return a.useEffect(()=>{let e=l.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(u!==n&&t){let r=new Event("change",{bubbles:!0});t.call(e,n),e.dispatchEvent(r)}},[u,n]),(0,i.jsx)(R.select,{...o,style:{...ew,...o.style},ref:s,defaultValue:n})});function t5(e){return""===e||void 0===e}function t9(e){let t=j(e),r=a.useRef(""),n=a.useRef(0),o=a.useCallback(e=>{let o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),l=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,l]}function t6(e,t,r){var n,o;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,a=(n=e,o=Math.max(i,0),n.map((e,t)=>n[(o+t)%n.length]));1===l.length&&(a=a.filter(e=>e!==r));let s=a.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return s!==r?s:void 0}t2.displayName="SelectBubbleInput";var t7=tm,t8=ty,t3=tb,t4=tx,re=tE,rt=tC,rr=tI,rn=t_,ro=tB,rl=tK,ri=tY,ra=tZ,rs=tG,ru=tQ,rc=t0,rd=e.i(72064),rf=e.i(75157);function rp(e){let{...t}=e;return(0,i.jsx)(t7,{"data-slot":"select",...t})}function rh(e){let{...t}=e;return(0,i.jsx)(rn,{"data-slot":"select-group",...t})}function rv(e){let{...t}=e;return(0,i.jsx)(t3,{"data-slot":"select-value",...t})}function rm(e){let{className:t,size:r="default",children:n,...o}=e;return(0,i.jsxs)(t8,{"data-slot":"select-trigger","data-size":r,className:(0,rf.cn)("flex h-9 w-fit min-w-24 items-center justify-between gap-2 whitespace-nowrap rounded-md border !border-solid border-[var(--ds-border,var(--input))] bg-transparent px-2.5 py-1 outline-none transition-[color,box-shadow,border-color] duration-150 ease-in-out placeholder:text-muted-foreground hover:border-[var(--border-hover)] focus-visible:border-[var(--border-focus)] focus-visible:[box-shadow:var(--ring-focus-sm)] disabled:cursor-not-allowed disabled:opacity-50 disabled:focus-visible:border-[var(--ds-border,var(--input))] disabled:focus-visible:[box-shadow:none] data-[size=default]:h-9 data-[size=sm]:h-7 data-[state=open]:border-[var(--border-focus)] data-[state=open]:[box-shadow:var(--ring-focus-sm)]",t),...o,children:[n,(0,i.jsx)(t4,{asChild:!0,children:(0,i.jsx)(rd.default,{name:"ChevronDown",size:16,className:"opacity-60",strokeWidth:1})})]})}function rg(e){let{className:t,children:r,position:n="popper",...o}=e;return(0,i.jsx)(re,{children:(0,i.jsxs)(rt,{"data-slot":"select-content",className:(0,rf.cn)("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 relative z-[10001] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md","popper"===n&&"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),position:n,...o,children:[(0,i.jsx)(rs,{className:"flex cursor-default items-center justify-center py-1",children:(0,i.jsx)(rd.default,{name:"ChevronUp",size:16})}),(0,i.jsx)(rr,{className:(0,rf.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,i.jsx)(ru,{className:"flex cursor-default items-center justify-center py-1",children:(0,i.jsx)(rd.default,{name:"ChevronDown",size:16,strokeWidth:1})})]})})}function ry(e){let{className:t,...r}=e;return(0,i.jsx)(ro,{"data-slot":"select-label",className:(0,rf.cn)("px-2 py-1.5 font-semibold",t),...r})}function rw(e){let{className:t,children:r,...n}=e;return(0,i.jsxs)(rl,{"data-slot":"select-item",className:(0,rf.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 outline-none hover:bg-[var(--ds-item-hover)] focus:bg-[var(--ds-item-hover)] focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[(0,i.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,i.jsx)(ra,{children:(0,i.jsx)(rd.default,{name:"Check",size:16})})}),(0,i.jsx)(ri,{children:r})]})}}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93479,e=>{"use strict";e.s(["Input",()=>l]);var t=e.i(18050),a=e.i(75157);function l(e){let{className:l,type:s="text",size:r="default",...i}=e;return(0,t.jsx)("input",{type:s,"data-slot":"input","data-size":r,className:(0,a.cn)("h-9 w-full appearance-none rounded-md border border-solid border-border bg-transparent px-3 outline-none transition-[color,box-shadow,border-color] duration-150 ease-in-out placeholder:text-muted-foreground hover:border-[var(--border-hover)] focus-visible:border-[var(--border-focus)] focus-visible:[box-shadow:var(--ring-focus-sm)] read-only:focus-visible:border-border read-only:focus-visible:[box-shadow:none] disabled:cursor-not-allowed disabled:opacity-50 disabled:focus-visible:border-border disabled:focus-visible:[box-shadow:none] data-[size=default]:h-9 data-[size=lg]:h-10 data-[size=sm]:h-7",l),...i})}},51239,e=>{e.v("/app/_next/static/media/data-loading.be8d921a.png")},2839,e=>{"use strict";e.s(["Loading",()=>i],2839);var t=e.i(18050),a=e.i(57688);let l={src:e.i(51239).default,width:951,height:482,blurWidth:8,blurHeight:4,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAYAAACzzX7wAAAAj0lEQVR42gGEAHv/AAAAAAANERAObXJwYaGko5N/gYBwDg8PCgAAAAAAAAAAAAMEBAJic2xp2+3m7fL8+P7l6ujjUlhWTAYGBgUAAAAAADM3NTG6x8LB7fr1/vD89/7f9+3+wNXNzycpKB4AAAAAAJ+qpozL2dO/0NvWx9Td2c6gzrzRpcq8u2FpZk8CAgIBCRI7kCfNfAcAAAAASUVORK5CYII="};var s=e.i(87968),r=e.i(75157);function i(e){let{text:i="加载中",className:n,showImage:o=!0,imageSrc:c=l,imageAlt:d="加载中",imageSize:u=180,imageClassName:m}=e,p="string"==typeof c?{width:u,height:u}:{width:c.width,height:c.height};return(0,t.jsxs)("div",{className:(0,r.cn)("flex min-h-[180px] w-full flex-col items-center justify-center gap-2 py-4 text-[var(--ds-muted)]",n),role:"status","aria-live":"polite",children:[o?(0,t.jsx)("span",{className:(0,r.cn)("block shrink-0",m),style:{width:u},children:(0,t.jsx)(a.default,{src:c,alt:d,width:p.width,height:p.height,unoptimized:!0,draggable:!1,sizes:"".concat(u,"px"),className:"h-auto w-full object-contain"})}):null,(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)(s.Spinner,{className:"mr-2"}),i]})]})}},92715,e=>{"use strict";e.s(["AppTable",()=>u],92715);var t=e.i(18050),a=e.i(85413),l=e.i(71645),s=e.i(75157);let r=l.forwardRef((e,a)=>{let{className:l,...r}=e;return(0,t.jsx)("div",{className:"relative w-full overflow-auto",children:(0,t.jsx)("table",{ref:a,className:(0,s.cn)("w-full caption-bottom border-collapse",l),...r})})});r.displayName="Table";let i=l.forwardRef((e,a)=>{let{className:l,...r}=e;return(0,t.jsx)("thead",{ref:a,className:(0,s.cn)("[&_tr]:table [&_tr]:w-full [&_tr]:table-fixed [&_tr]:border-b",l),...r})});i.displayName="TableHeader";let n=l.forwardRef((e,a)=>{let{className:r,viewportFit:i=!0,viewportReserveBottom:n=16,viewportPaginationReserve:o=0,style:c,...d}=e,u=l.useRef(null),m=l.useCallback(e=>{u.current=e,"function"==typeof a?a(e):a&&(a.current=e)},[a]),[p,f]=l.useState(void 0);return l.useLayoutEffect(()=>{var e,t;if(!i)return void f(void 0);let a=()=>{var e,t;let a=u.current;if(!a)return;let l=a.getBoundingClientRect().top;f(Math.max(80,Math.floor((null!=(t=null==(e=window.visualViewport)?void 0:e.height)?t:window.innerHeight)-l-(n+o))))};a();let l=new ResizeObserver(()=>{a()});try{l.observe(document.body)}catch(e){}return window.addEventListener("resize",a),null==(e=window.visualViewport)||e.addEventListener("resize",a),null==(t=window.visualViewport)||t.addEventListener("scroll",a),window.addEventListener("scroll",a,!0),()=>{var e,t;l.disconnect(),window.removeEventListener("resize",a),null==(e=window.visualViewport)||e.removeEventListener("resize",a),null==(t=window.visualViewport)||t.removeEventListener("scroll",a),window.removeEventListener("scroll",a,!0)}},[i,n,o]),(0,t.jsx)("tbody",{ref:m,className:(0,s.cn)("block overflow-y-auto [&_tr:last-child]:border-b-0 [&_tr:last-child_td]:border-b-0 [&_tr]:table [&_tr]:w-full [&_tr]:table-fixed",r),style:i&&void 0!==p?{...c,maxHeight:p}:c,...d})});n.displayName="TableBody";let o=l.forwardRef((e,a)=>{let{className:l,hoverable:r=!0,...i}=e;return(0,t.jsx)("tr",{ref:a,className:(0,s.cn)("border-b transition-colors [&>td]:transition-colors data-[state=selected]:[&>td]:!bg-[var(--ds-item-active)]",r&&"group/table-row",l),...i})});o.displayName="TableRow";let c=l.forwardRef((e,a)=>{let{className:l,...r}=e;return(0,t.jsx)("th",{ref:a,className:(0,s.cn)("h-10 border-b border-[var(--border-subtle)] bg-[var(--surface-2)] px-3 text-left align-middle text-[14px] font-medium !text-[var(--ds-text)] text-muted-foreground",l),...r})});c.displayName="TableHead";let d=l.forwardRef((e,a)=>{let{className:l,...r}=e;return(0,t.jsx)("td",{ref:a,className:(0,s.cn)("border-x-0 border-b border-t-0 border-solid border-[var(--border-subtle)] p-3 align-middle transition-colors group-has-[td:hover]/table-row:!bg-[var(--ds-item-hover)]",l),...r})});function u(e){let{rows:l,columns:u,getRowKey:m,className:p,rowClassName:f,headerRowClassName:x,emptyText:h,emptyNode:b,bodyProps:g}=e;return(0,t.jsx)("div",{className:(0,s.cn)("overflow-hidden border border-[var(--ds-border)]",p),children:(0,t.jsxs)(r,{children:[(0,t.jsx)(i,{children:(0,t.jsx)(o,{className:(0,s.cn)("bg-[var(--ds-main-tint)] hover:bg-[var(--ds-main-tint)]",x),children:u.map(e=>(0,t.jsx)(c,{className:e.headerClassName,children:e.title},e.key))})}),(0,t.jsx)(n,{...g,children:l.length?l.map(e=>(0,t.jsx)(o,{className:"function"==typeof f?f(e):f,children:u.map(a=>(0,t.jsx)(d,{className:a.cellClassName,children:a.render(e)},a.key))},m(e))):(0,t.jsx)(o,{hoverable:!1,children:(0,t.jsx)(d,{colSpan:u.length,className:"py-6",children:null!=b?b:(0,t.jsx)(a.Empty,{text:h})})})})]})})}d.displayName="TableCell"},62427,e=>{"use strict";e.s(["clearRuntimeMcpItemConfig",()=>w,"deleteRuntimeMcp",()=>m,"deleteRuntimeSkill",()=>j,"deleteRuntimeTool",()=>u,"exportRuntimeMcpUrl",()=>f,"exportRuntimeSkillUrl",()=>N,"exportRuntimeToolUrl",()=>p,"importRuntimeMcp",()=>h,"importRuntimeTool",()=>x,"installCloudSkill",()=>C,"listBaseSkills",()=>r,"listCloudSkillCatalog",()=>k,"listInstalledSkills",()=>i,"listInstalledTools",()=>s,"listMcpServers",()=>l,"listRuntimeMcpPackages",()=>d,"listRuntimeTools",()=>c,"loadBaseSkillMd",()=>n,"loadRemoteMcpJson",()=>b,"loadRuntimeMcpItemConfig",()=>v,"saveBaseSkillMd",()=>o,"saveRemoteMcpJson",()=>g,"saveRuntimeMcpItemConfig",()=>y]);var t=e.i(29250),a=e.i(36845);async function l(e,l,s){let r=await (0,t.get)((0,a.buildMcpServersListUrl)(e,l,s));return{servers:Array.isArray(r.servers)?r.servers:[]}}async function s(e,l,s){let r=await (0,t.get)((0,a.buildToolInstalledListUrl)(e,l,s));return{tools:Array.isArray(r.tools)?r.tools:[]}}async function r(e,l,s){let r=await (0,t.get)((0,a.buildSkillBaseListUrl)(e,l,s));return{skills:Array.isArray(r.skills)?r.skills:[]}}async function i(e,l,s){let r=await (0,t.get)((0,a.buildSkillInstalledListUrl)(e,l,s));return{skills:Array.isArray(r.skills)?r.skills:[]}}async function n(e,l,s,r){return(0,t.get)((0,a.buildBaseSkillMdUrl)(e,l,s,r))}async function o(e,l,s,r,i){await (0,t.put)((0,a.buildBaseSkillMdUrl)(e,l,s,r),{content:i})}async function c(e,l,s){let r=await (0,t.get)((0,a.buildToolsRuntimeFilesUrl)(e,l,s));return{runtimeToolsDir:"string"==typeof r.runtimeToolsDir?r.runtimeToolsDir:"",items:Array.isArray(r.items)?r.items.filter(e=>!!(e&&e.id)):[]}}async function d(e,l,s){let r=await (0,t.get)((0,a.buildMcpRuntimeFilesUrl)(e,l,s));return{mcpRuntimeDir:"string"==typeof r.mcpRuntimeDir?r.mcpRuntimeDir:"",items:Array.isArray(r.items)?r.items.filter(e=>!!(e&&e.id)):[]}}async function u(e,l,s,r){return(0,t.del)((0,a.buildToolsRuntimeDeleteUrl)(e,l,s,r))}async function m(e,l,s,r){return(0,t.del)((0,a.buildMcpRuntimeDeleteUrl)(e,l,s,r))}function p(e,t,l,s){return(0,a.buildToolsRuntimeExportUrl)(e,t,l,s)}function f(e,t,l,s){return(0,a.buildMcpRuntimeExportUrl)(e,t,l,s)}async function x(e,l,s,r){let i=new FormData;return i.append("file",r),(0,t.post)((0,a.buildToolsRuntimeImportUrl)(e,l,s),i,{type:"file"})}async function h(e,l,s,r){let i=new FormData;return i.append("file",r),(0,t.post)((0,a.buildMcpRuntimeImportUrl)(e,l,s),i,{type:"file"})}async function b(e,l,s){return(0,t.get)((0,a.buildRemoteMcpJsonUrl)(e,l,s))}async function g(e,l,s,r){await (0,t.post)((0,a.buildRemoteMcpJsonUrl)(e,l,s),{content:r})}async function v(e,l,s,r,i){return(0,t.get)((0,a.buildRuntimeMcpItemConfigUrl)(e,l,s,r,i))}async function y(e,l,s,r,i,n){await (0,t.put)((0,a.buildRuntimeMcpItemConfigUrl)(e,l,s,r,i),{server:n})}async function w(e,l,s,r,i){await (0,t.del)((0,a.buildRuntimeMcpItemConfigUrl)(e,l,s,r,i))}async function j(e,l,s,r){return(0,t.del)((0,a.buildSkillsRuntimeDeleteUrl)(e,l,s,r))}function N(e,t,l,s){return(0,a.buildSkillsRuntimeExportUrl)(e,t,l,s)}async function k(e,l,s,r,i,n){let o=await (0,t.get)((0,a.buildCloudSkillCatalogUrl)(e,l,s,r,i,n));return{items:Array.isArray(o.items)?o.items:[],totalPages:Number(o.totalPages||0)}}async function C(e,l,s,r){await (0,t.post)((0,a.buildCloudSkillInstallUrl)(e,l,s),{id:r})}},53925,e=>{"use strict";e.s(["ResourceImportDialog",()=>u],53925);var t=e.i(18050),a=e.i(71645),l=e.i(72064),s=e.i(75157),r=e.i(19455);function i(e){return e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB")}function n(e){let{uploadUrl:n,accept:o,disabled:c=!1,multiple:d=!1,maxFileSize:u=0x3200000,autoUpload:m=!1,method:p="POST",transport:f="xhr",fieldName:x="file",headers:h,extraFormData:b,autoRetryTimes:g=0,autoRetryDelayMs:v=800,selectionOnly:y=!1,className:w,emptyTitle:j="点击或拖拽文件到此处",emptyHint:N="支持上传文件",onFilesChange:k,onUploadSuccess:C,onUploadError:A,onValidationError:S}=e,R=a.useId(),T=a.useRef(null),U=a.useRef(new Map),z=a.useRef(new Map),M=a.useRef([]),[B,L]=a.useState(!1),[D,E]=a.useState([]),I=a.useMemo(()=>o?o.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean):[],[o]);a.useEffect(()=>{M.current=D,null==k||k(D)},[D,k]),a.useEffect(()=>()=>{for(let e of U.current.values())e.abort();for(let e of z.current.values())e.abort();for(let e of M.current)e.previewUrl&&URL.revokeObjectURL(e.previewUrl)},[]);let O=a.useCallback((e,t)=>{E(a=>a.map(a=>a.id===e?{...a,...t}:a))},[]),P=a.useCallback(async(e,t)=>{let a=M.current.find(t=>t.id===e);if(!a||c)return;O(e,{status:t>0?"retrying":"uploading",progress:0,error:"",retryCount:t});let l=new FormData;if(b)for(let[e,t]of Object.entries(b))l.append(e,t);l.append(x,a.file);try{let t="";if("fetch"===f){let a=new AbortController;z.current.set(e,a);let s=await fetch(n,{method:p,headers:h,body:l,signal:a.signal}),r=await s.text();try{t=r?JSON.parse(r):""}catch(e){t=r}if(!s.ok)throw Error("上传失败:".concat(s.status," ").concat(s.statusText))}else t=await new Promise((t,a)=>{let s=new XMLHttpRequest;if(U.current.set(e,s),s.open(p,n,!0),h)for(let[e,t]of Object.entries(h))s.setRequestHeader(e,t);s.upload.onprogress=t=>{if(!t.lengthComputable)return;let a=Math.min(100,Math.round(t.loaded/t.total*100));O(e,{progress:a})},s.onerror=()=>a(Error("网络异常,上传失败")),s.onabort=()=>a(Error("__ABORTED__")),s.onload=()=>{s.status>=200&&s.status<300?t(function(e){let t=e.responseText||"";try{return JSON.parse(t)}catch(e){return t}}(s)):a(Error("上传失败:".concat(s.status," ").concat(s.statusText)))},s.send(l)});O(e,{status:"success",progress:100,error:""});let a=M.current.find(t=>t.id===e);a&&(null==C||C(a,t))}catch(s){let a=s instanceof Error?s.message:String(s);if("__ABORTED__"===a)return void O(e,{status:"selected",progress:0,error:""});if(t<g){O(e,{status:"retrying",error:"重试中(".concat(t+1,"/").concat(g,")")}),await new Promise(e=>window.setTimeout(e,v)),await P(e,t+1);return}O(e,{status:"error",error:a});let l=M.current.find(t=>t.id===e);l&&(null==A||A(l,a))}finally{U.current.delete(e),z.current.delete(e)}},[v,g,c,b,x,h,p,A,C,f,O,n]),_=a.useCallback(e=>{P(e,0)},[P]),F=a.useCallback(e=>{var t,a;null==(t=U.current.get(e))||t.abort(),null==(a=z.current.get(e))||a.abort()},[]),H=a.useCallback(()=>{for(let e of M.current)("selected"===e.status||"error"===e.status)&&_(e.id)},[_]),K=a.useCallback(e=>{if(c||!e.length)return;let t=new Set(M.current.map(e=>"".concat(e.file.name,"::").concat(e.file.size))),a=[];for(let l of e){let e="".concat(l.name,"::").concat(l.size);if(!t.has(e)){if(!function(e,t){if(!t.length)return!0;let a=e.name.toLowerCase(),l=(e.type||"").toLowerCase();return t.some(e=>e.startsWith(".")?a.endsWith(e):e.endsWith("/*")?l.startsWith("".concat(e.slice(0,-1))):l===e)}(l,I)){null==S||S("文件类型不支持:".concat(l.name));continue}if(l.size>u){null==S||S("文件过大(最大 ".concat(i(u),"):").concat(l.name));continue}t.add(e),a.push({id:"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),file:l,status:"selected",progress:0,error:"",retryCount:0,previewUrl:l.type.startsWith("image/")?URL.createObjectURL(l):""})}}if(!a.length)return;let l=d?[...M.current,...a]:[a[a.length-1]];if(!d)for(let e of M.current)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);if(E(l),m&&!y)for(let e of a)_(e.id)},[I,m,c,u,d,S,y,_]),V=a.useCallback(e=>{let t=e.target.files;t&&(K(Array.from(t)),e.target.value="")},[K]),J=a.useCallback(e=>{var t;e.preventDefault(),e.stopPropagation(),L(!1),c||K(Array.from(null!=(t=e.dataTransfer.files)?t:[]))},[K,c]);return(0,t.jsxs)("div",{className:(0,s.cn)("flex min-h-0 w-full flex-col gap-3",w),children:[(0,t.jsx)("input",{ref:T,id:R,type:"file",hidden:!0,accept:o,multiple:d,disabled:c,onChange:V}),(0,t.jsxs)("label",{htmlFor:R,onDragOver:e=>{e.preventDefault(),c||L(!0)},onDragLeave:e=>{e.preventDefault(),L(!1)},onDrop:J,className:(0,s.cn)("flex min-h-[124px] cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-[var(--ds-border)] px-4 py-6 text-center transition-colors hover:border-[var(--ds-border-hover)] hover:bg-[var(--ds-main-tint)]",B&&"bg-[var(--ds-accent)]/5 border-[var(--ds-accent)]",c&&"cursor-not-allowed opacity-60"),children:[(0,t.jsx)(l.default,{name:"Upload",size:20,className:"text-[var(--ds-muted)]"}),(0,t.jsx)("div",{className:"text-[var(--ds-text)]",children:j}),(0,t.jsx)("div",{className:"text-[var(--ds-muted)]",children:N})]}),D.length?(0,t.jsx)("div",{className:"space-y-2",children:D.map(e=>(0,t.jsx)("div",{className:"rounded-md border border-[var(--ds-border)] p-2.5",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"truncate text-[var(--ds-text)]",children:e.file.name}),(0,t.jsx)("div",{className:"text-[var(--ds-muted)]",children:i(e.file.size)}),e.previewUrl?(0,t.jsx)("img",{src:e.previewUrl,alt:e.file.name,className:"mt-2 h-14 w-14 rounded object-cover"}):null,"uploading"===e.status||"retrying"===e.status?(0,t.jsx)("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded bg-[var(--ds-main-tint)]",children:(0,t.jsx)("div",{className:"h-full bg-[var(--ds-accent)] transition-all",style:{width:"".concat(e.progress,"%")}})}):null,"error"===e.status?(0,t.jsx)("div",{className:"mt-1 text-[var(--ds-danger)]",children:e.error||"上传失败"}):null]}),y?null:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:["success"===e.status?(0,t.jsx)(l.default,{name:"CheckCircle2",size:16,className:"text-[var(--ds-accent)]"}):null,"selected"===e.status||"error"===e.status?(0,t.jsxs)(r.Button,{type:"button",size:"sm",variant:"outline",disabled:c,onClick:()=>_(e.id),children:["error"===e.status?(0,t.jsx)(l.default,{name:"RefreshCw",size:14,className:"mr-1"}):null,"error"===e.status?"重试":"上传"]}):null,"uploading"===e.status||"retrying"===e.status?(0,t.jsxs)(r.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>F(e.id),children:[(0,t.jsx)(l.default,{name:"XCircle",size:14,className:"mr-1"}),"取消"]}):null]})]})},e.id))}):null,!y&&!m&&D.some(e=>"selected"===e.status||"error"===e.status)?(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(r.Button,{type:"button",size:"sm",onClick:H,disabled:c,children:"上传"})}):null]})}var o=e.i(76639),c=e.i(13354),d=e.i(29250);function u(e){let{open:l,onOpenChange:s,title:i,description:u,uploadUrl:m,resetKey:p}=e,[f,x]=(0,a.useState)(!1),[h,b]=(0,a.useState)(null),g=(0,a.useCallback)(()=>{s(!1),b(null)},[s]),v=(0,a.useCallback)(async()=>{if(!h)return void c.appToast.info("请先选择 zip 文件");let e=new FormData;e.append("file",h),x(!0);try{let t=await (0,d.bridgeFetch)(m,{method:"POST",body:e}),a=Number(t.imported||0),l=Number(t.overwritten||0),s=Array.isArray(t.rejected)?t.rejected.length:0;c.appToast.success("导入完成:导入 ".concat(a,",覆盖 ").concat(l)+(s>0?",拒绝 ".concat(s):"")),g()}catch(e){c.appToast.error("导入失败:".concat(e instanceof Error?e.message:String(e)))}finally{x(!1)}},[g,h,m]);return(0,t.jsx)(o.Dialog,{open:l,onOpenChange:e=>{s(e),e||b(null)},children:(0,t.jsxs)(o.DialogContent,{className:"flex min-h-[320px] max-w-[560px] flex-col",children:[(0,t.jsxs)(o.DialogHeader,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.DialogTitle,{children:i}),(0,t.jsx)(o.DialogDescription,{children:u})]}),(0,t.jsx)(o.DialogClose,{className:"sidebar-icon-btn","aria-label":"关闭",onClick:g,children:"✕"})]}),(0,t.jsxs)("div",{className:"m-3 flex flex-1 flex-col gap-3",children:[(0,t.jsx)(n,{uploadUrl:m,accept:".zip,application/zip",maxFileSize:0x3200000,multiple:!1,disabled:f,selectionOnly:!0,emptyTitle:"点击或拖拽 zip 文件到此处",emptyHint:"支持 .zip 格式,最大 50MB",onFilesChange:e=>{var t,a;b(null!=(a=null==(t=e[0])?void 0:t.file)?a:null)},onValidationError:e=>{c.appToast.info(e)}},"".concat(l?"open":"closed","-").concat(null!=p?p:m)),(0,t.jsxs)("div",{className:"mt-auto flex justify-end pt-2",children:[(0,t.jsx)(r.Button,{className:"mr-[12px]",type:"button",variant:"plain-outline",size:"lg",onClick:g,children:"取消"}),(0,t.jsx)(r.Button,{type:"button",size:"lg",variant:"default",disabled:f||null==h,onClick:()=>void v(),children:f?"导入中…":"确定"})]})]})]})})}},55242,e=>{"use strict";e.s(["AppDialog",()=>r]);var t=e.i(18050),a=e.i(71645),l=e.i(76639),s=e.i(75157);function r(e){let{open:r,onOpenChange:i,title:n,children:o,footer:c,width:d="max-w-3xl",minHeight:u}=e,m=(0,a.useId)();return(0,t.jsx)(l.Dialog,{open:r,onOpenChange:i,children:(0,t.jsxs)(l.DialogContent,{"aria-labelledby":m,className:(0,s.cn)(d,u?"!min-h-[--min-h]":""),style:u?{"--min-h":u}:void 0,children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{id:m,children:n}),(0,t.jsx)(l.DialogClose,{"aria-label":"关闭"})]}),(0,t.jsx)(l.DialogBody,{className:"!px-4 !py-3",children:o}),c?(0,t.jsx)("div",{className:"flex flex-shrink-0 justify-end gap-2 border-t border-[var(--ds-border)] bg-[var(--ds-sidebar)] px-4 py-3",children:c}):null]})})}},39721,e=>{"use strict";e.s(["SkillsManageView",()=>z],39721);var t=e.i(18050),a=e.i(71645),l=e.i(65934),s=e.i(87243),r=e.i(13354),i=e.i(50711),n=e.i(51419),o=e.i(92715),c=e.i(19455),d=e.i(94055),u=e.i(94197),m=e.i(72064),p=e.i(93479),f=e.i(75157);function x(e){let{className:a,...l}=e;return(0,t.jsx)("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:(0,f.cn)("flex w-full justify-end",a),...l})}let h=a.forwardRef((e,a)=>{let{className:l,...s}=e;return(0,t.jsx)("ul",{ref:a,"data-slot":"pagination-content",className:(0,f.cn)("flex flex-row flex-wrap items-center justify-end gap-1",l),...s})});h.displayName="PaginationContent";let b=a.forwardRef((e,a)=>{let{className:l,...s}=e;return(0,t.jsx)("li",{ref:a,"data-slot":"pagination-item",className:(0,f.cn)("",l),...s})});b.displayName="PaginationItem",a.forwardRef((e,a)=>{let{className:l,isActive:s,size:r="icon",...i}=e;return(0,t.jsx)("a",{ref:a,"aria-current":s?"page":void 0,"data-slot":"pagination-link","data-active":s?"true":void 0,className:(0,f.cn)((0,c.buttonVariants)({variant:s?"outline":"ghost",size:r}),l),...i})}).displayName="PaginationLink";var g=e.i(62427),v=e.i(2839);function y(e){let{active:l,wsUrl:s,apiBase:i,agent:n,onAfterInstall:d,className:u}=e,[f,y]=(0,a.useState)(""),[w,j]=(0,a.useState)(1),[N,k]=(0,a.useState)(0),[C,A]=(0,a.useState)([]),[S,R]=(0,a.useState)(!1),[T,U]=(0,a.useState)(""),[z,M]=(0,a.useState)({}),B=(0,a.useRef)(0),L=(0,a.useCallback)(async()=>{let e=++B.current;R(!0),U("");try{let t=await (0,g.listCloudSkillCatalog)(s,i,n,f,w,10);if(e!==B.current)return;let a=Array.isArray(t.items)?t.items:[],l=[];for(let e of a)e&&"object"==typeof e&&e.id&&l.push({id:String(e.id),title:String(e.title||""),skillName:String(e.skillName||""),description:"string"==typeof e.description?e.description:"",installed:!!e.installed});A(l),k(t.totalPages)}catch(t){if(e!==B.current)return;A([]),k(0),U(t instanceof Error?t.message:String(t))}finally{e===B.current&&R(!1)}},[s,i,n,f,w]);(0,a.useEffect)(()=>{if(!l){y(""),j(1),k(0),A([]),U(""),M({}),B.current+=1;return}L()},[l,L]);let D=(0,a.useMemo)(()=>{if(S)return"加载中…";if(T)return"加载失败:".concat(T);let e=C.reduce((e,t)=>e+ +!!t.installed,0);return"已安装 ".concat(e," 项")},[S,T,C]),E=(0,a.useCallback)(async(e,t)=>{M(t=>({...t,[e]:!0}));try{await (0,g.installCloudSkill)(s,i,n,e),r.appToast.success("云端技能已安装:".concat(t)),await L(),null==d||d()}catch(e){r.appToast.error("安装失败:".concat(e instanceof Error?e.message:String(e)))}finally{M(t=>{let a={...t};return delete a[e],a})}},[s,i,n,L,d]);if((0,a.useCallback)(e=>{j(1),y(e)},[]),!l)return null;let I=N>0?"第 ".concat(w,"/").concat(N," 页"):"第 0/0 页",O=S||w<=1,P=S||N<=0||w>=N,_=[{key:"name",title:"名称",headerClassName:"",cellClassName:" text-[var(--ds-text)]",render:e=>e.skillName?"".concat(e.skillName):e.id},{key:"description",title:"详情",headerClassName:"",cellClassName:" text-[var(--ds-text)]",render:e=>(0,t.jsxs)(t.Fragment,{children:[e.title,e.description?" — ".concat(e.description):""]})},{key:"status",title:"状态",headerClassName:"",cellClassName:"whitespace-nowrap text-[var(--ds-text)]",render:e=>e.installed?"已安装":"未安装"},{key:"actions",title:"操作",headerClassName:"w-[96px] text-right ",cellClassName:"w-[116px] text-right",render:e=>{let a=!!z[e.id],l=!!e.installed;return!a&&l?"-":(0,t.jsx)(c.Button,{type:"button",size:"sm",variant:"outline",disabled:a||l,onClick:()=>void E(e.id,e.title||e.skillName||e.id),children:a?"安装中…":l?"已安装":"安装"})}}];return(0,t.jsx)("div",{className:u,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"relative max-w-md",children:[(0,t.jsx)(p.Input,{type:"search",value:f,onChange:e=>y(e.target.value),placeholder:"搜索名称 / 详情",className:"h-8 pl-8","aria-label":"搜索已安装 Skill"}),(0,t.jsx)(m.default,{name:"Search",size:16,className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-[var(--ds-muted)]","aria-hidden":!0})]}),(0,t.jsx)("div",{className:"text-[var(--ds-muted)]",children:D}),(0,t.jsx)(o.AppTable,{rows:C,columns:_,getRowKey:e=>e.id,className:"min-h-0 flex-1 rounded-md",bodyProps:{viewportPaginationReserve:64},emptyNode:S?(0,t.jsx)(v.Loading,{text:"加载中…",className:"min-h-[200px]"}):void 0}),(0,t.jsx)(x,{className:"mx-0 w-full",children:(0,t.jsxs)(h,{className:"w-full flex-wrap justify-end gap-2",children:[(0,t.jsx)(b,{children:(0,t.jsxs)(c.Button,{type:"button",variant:"outline",size:"sm",disabled:O,className:"gap-1",onClick:()=>j(e=>Math.max(1,e-1)),"aria-label":"上一页",children:[(0,t.jsx)(m.default,{name:"ChevronLeft",size:16,className:"shrink-0"}),"上一页"]})}),(0,t.jsx)(b,{children:(0,t.jsx)("span",{className:"flex h-9 min-w-[6.5rem] items-center justify-center text-[var(--ds-muted)]",children:I})}),(0,t.jsx)(b,{children:(0,t.jsxs)(c.Button,{type:"button",variant:"outline",size:"sm",disabled:P,className:"gap-1",onClick:()=>j(e=>e+1),"aria-label":"下一页",children:["下一页",(0,t.jsx)(m.default,{name:"ChevronRight",size:16,className:"shrink-0",strokeWidth:1})]})})]})})]})})}var w=e.i(36845),j=e.i(53925);function N(e){let{open:a,onOpenChange:l,wsUrl:s,apiBase:r,agent:i}=e;return(0,t.jsx)(j.ResourceImportDialog,{open:a,onOpenChange:l,title:"导入 Skill zip",description:"选择一个 zip 文件并导入到 skills-runtime。",uploadUrl:(0,w.buildSkillsRuntimeImportUrl)(s,r,i),resetKey:i})}var k=e.i(55242);function C(e){let{open:l,onOpenChange:s,skillName:i,wsUrl:n,apiBase:o,agent:d,onSaved:u}=e,[m,p]=(0,a.useState)(""),[f,x]=(0,a.useState)(!1),[h,b]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!l||!i.trim())return;let e=!1;return x(!0),p(""),(0,g.loadBaseSkillMd)(n,o,d,i).then(t=>{e||p("string"==typeof t.content?t.content:"")}).catch(t=>{e||(r.appToast.error("加载 SKILL.md 失败:".concat(t instanceof Error?t.message:String(t))),s(!1))}).finally(()=>{e||x(!1)}),()=>{e=!0}},[l,i,n,o,d,s]);let v=(0,a.useCallback)(async()=>{if(i.trim()){b(!0);try{await (0,g.saveBaseSkillMd)(n,o,d,i,m),r.appToast.success("SKILL.md 已保存"),s(!1),null==u||u()}catch(e){r.appToast.error("保存失败:".concat(e instanceof Error?e.message:String(e)))}finally{b(!1)}}},[i,n,o,d,m,s,u]);return(0,t.jsx)(k.AppDialog,{open:l,onOpenChange:s,title:"编辑 SKILL.md · /".concat(i),width:"max-w-4xl",minHeight:"420px",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Button,{type:"button",variant:"plain-outline",size:"lg",disabled:f||h,onClick:()=>s(!1),children:"取消"}),(0,t.jsx)(c.Button,{type:"button",size:"lg",disabled:f||h,onClick:()=>void v(),children:"保存"})]}),children:f?(0,t.jsx)("p",{className:"py-6 text-center text-[var(--ds-muted)]",children:"加载中…"}):(0,t.jsx)("textarea",{className:"focus-visible:ring-[var(--ds-accent)]/30 min-h-[320px] w-full resize-y rounded-md border border-[var(--ds-border)] bg-[var(--ds-bg)] p-3 leading-6 text-[var(--ds-text)] outline-none focus-visible:ring-2",spellCheck:!1,value:m,placeholder:"Markdown 源码…",onChange:e=>p(e.target.value)})})}function A(e){let{items:l,saveBusy:s,onToggleEnabled:r,onExport:i,onRemove:n,className:c}=e,[f,x]=(0,a.useState)(""),h=(0,a.useMemo)(()=>l.filter(e=>(function(e,t){var a;let l=t.trim().toLowerCase();return!l||"".concat(e.name," ").concat(null!=(a=e.description)?a:"").toLowerCase().includes(l)})(e,f)),[l,f]),b=[{key:"name",title:"名称",headerClassName:"",cellClassName:"",render:e=>"/".concat(e.name)},{key:"description",title:"详情",headerClassName:"",cellClassName:"",render:e=>e.description||"-"},{key:"status",title:"状态",headerClassName:"w-[160px] ",cellClassName:"w-[160px] text-[var(--ds-text)]",render:()=>"已安装"},{key:"enabled",title:"启用/未启用",headerClassName:"w-[160px] text-right ",cellClassName:"w-[160px] py-2 text-right align-middle",render:e=>(0,t.jsx)("span",{className:"inline-flex items-center justify-end gap-2",children:(0,t.jsx)(d.AccentSwitch,{checked:e.enabled,disabled:s,onCheckedChange:t=>r(e.name,t),"aria-label":"".concat(e.enabled?"禁用":"启用"," ").concat(e.name)})})},{key:"actions",title:"操作",headerClassName:"w-[128px] ",cellClassName:"w-[128px]",render:e=>(0,t.jsxs)("div",{className:"inline-flex items-center justify-end gap-1",children:[(0,t.jsx)(u.IconTooltipButton,{icon:"Download",label:"导出",ariaLabel:"导出 ".concat(e.name),disabled:s,onClick:()=>i(e.name)}),(0,t.jsx)(u.IconTooltipButton,{icon:"Trash2",label:"删除",tone:"danger",ariaLabel:"删除 ".concat(e.name),disabled:s,onClick:()=>{n(e.name)}})]})}],g=f.trim();return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"relative max-w-md",children:[(0,t.jsx)(p.Input,{type:"search",value:f,onChange:e=>x(e.target.value),placeholder:"搜索名称 / 详情",className:"h-8 pl-8","aria-label":"搜索已安装 Skill"}),(0,t.jsx)(m.default,{name:"Search",size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--ds-muted)]"})]}),(0,t.jsx)(o.AppTable,{rows:h,columns:b,getRowKey:e=>"skills:".concat(e.name),className:c,emptyText:g?"无匹配的 Skill":void 0})]})}var S=e.i(68499),R=e.i(56708);function T(e,t){var a,l,s;let r=(s=null!=(l=null!=(a=e.description)?a:e.whenToUse)?l:"")?s.length>100?s.slice(0,100):s:"";return{...e,id:e.name,label:"/".concat(e.name),description:r,isRuntime:t,canManage:e.canManage}}let U=[{value:"installed",label:"已安装Skill"},{value:"cloud_catalog",label:"Skill商店"}];function z(){let e=(0,l.useAppStore)(e=>e.wsUrl),p=(0,l.useAppStore)(e=>e.apiBase),f=(0,l.useAppStore)(e=>e.agentConfig),x=(0,l.useAppStore)(e=>e.patchAgentConfig),{currentAgent:h,loadAgentConfig:b}=(0,s.useSession)(),w=(0,i.usePersistAgentConfigField)("skills"),j=f.skills,k=(0,a.useMemo)(()=>[...j].sort().join("\0"),[j]),[z,M]=(0,a.useState)([]),[B,L]=(0,a.useState)([]),[D,E]=(0,a.useState)([]),[I,O]=(0,a.useState)(!1),[P,_]=(0,a.useState)(!1),[F,H]=(0,a.useState)(!1),[K,V]=(0,a.useState)("basic"),[J,W]=(0,a.useState)(!1),[G,X]=(0,a.useState)(""),[Y,q]=(0,a.useState)(!1);(0,a.useEffect)(()=>{b()},[b]);let Q=(0,a.useCallback)(async(e,t)=>{H(!0);try{await w(e,{silent:t})}finally{H(!1)}},[w]),Z=(0,a.useCallback)(async()=>{M([]),O(!0);try{var t;let a=await (0,g.listBaseSkills)(e,p,h());M((null!=(t=a.skills)?t:[]).map(e=>T(e,!1)))}catch(e){M([]),r.appToast.error("加载失败:".concat(e instanceof Error?e.message:String(e)))}finally{O(!1)}},[e,p,h]),$=(0,a.useCallback)(async()=>{L([]),_(!0);try{var t;let a=await (0,g.listInstalledSkills)(e,p,h());L((null!=(t=a.skills)?t:[]).map(e=>T(e,!0)))}catch(e){L([]),r.appToast.error("加载失败:".concat(e instanceof Error?e.message:String(e)))}finally{_(!1)}},[e,p,h]),ee=(0,a.useCallback)(async()=>{await Promise.all([Z(),$()])},[Z,$]),et=(0,a.useCallback)(async t=>{if(await (0,S.confirmAlertDialog)({title:"确认删除 Skill 包?",description:"Skill:".concat(t),confirmText:"删除",cancelText:"取消"}))try{await (0,g.deleteRuntimeSkill)(e,p,h(),t);let a=j.filter(e=>e!==t);E(e=>e.filter(e=>e!==t)),x({skills:a}),await Q(a,!0),await ee()}catch(e){r.appToast.error("删除失败:".concat(e instanceof Error?e.message:String(e)))}},[e,p,h,j,x,Q,ee]);(0,a.useEffect)(()=>{"basic"===K&&Z(),"installed"===K&&$()},[K,Z,$]);let ea=(0,a.useCallback)(()=>{ee()},[ee]);(0,a.useEffect)(()=>{"basic"===K&&E([...j])},[K,j,k]);let el=(0,a.useCallback)(e=>{let t=[...new Set(e)].sort();x({skills:t}),Q(t,!0)},[x,Q]),es=(0,a.useMemo)(()=>B.slice().sort((e,t)=>e.label.localeCompare(t.label)).map(e=>({name:e.id,installed:!0,description:e.description||"",enabled:j.includes(e.id)})),[B,j]),er=(0,a.useCallback)((e,t)=>{let a=t?[...new Set([...j,e])].sort():j.filter(t=>t!==e);x({skills:a}),E(a),Q(a,!0)},[j,x,Q]),ei=(0,a.useCallback)(t=>{window.open((0,g.exportRuntimeSkillUrl)(e,p,h(),t),"_blank","noopener")},[e,p,h]),en=(0,a.useCallback)(e=>{X(e.id),q(!0)},[]),eo=[{key:"name",title:"名称",headerClassName:" text-[var(--ds-muted)]",cellClassName:" text-[var(--ds-text)]",render:e=>e.label},{key:"description",title:"详情",headerClassName:" text-[var(--ds-muted)]",cellClassName:" text-[var(--ds-text)]",render:e=>e.description||"-"},{key:"enabled",title:"启用/未启用",headerClassName:"w-[102px] text-right text-[var(--ds-muted)]",cellClassName:"w-[102px] py-2 text-right align-middle",render:e=>(0,t.jsx)("span",{className:"inline-flex justify-end",children:(0,t.jsx)(d.AccentSwitch,{checked:D.includes(e.id),disabled:F,onCheckedChange:t=>{let a=t?[...new Set([...D,e.id])]:D.filter(t=>t!==e.id);E(a),el(a)},"aria-label":"选择 ".concat(e.label)})})},{key:"actions",title:"操作",headerClassName:"w-[104px] text-right text-[var(--ds-muted)]",cellClassName:"w-[104px] py-2 text-right align-middle",render:e=>(0,t.jsxs)("span",{className:"inline-flex justify-end gap-1",children:[(0,t.jsx)(u.IconTooltipButton,{icon:"Edit",label:"编辑",disabled:F,ariaLabel:"编辑 ".concat(e.label),onClick:()=>en(e)}),(0,t.jsx)(u.IconTooltipButton,{icon:"Trash2",label:"系统技能不可删除",tone:"danger",disabled:!0,ariaLabel:"删除 ".concat(e.label)})]})}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.ManageChromeHeaderActions,{children:(0,t.jsxs)(c.Button,{id:"btnAgentImportSkill",type:"button",variant:"plain-outline",size:"lg",className:"inline-flex items-center justify-center gap-1.5",onClick:()=>W(!0),children:[(0,t.jsx)(m.default,{name:"Import",size:16,className:"align-middle"}),"导入Skill"]})}),(0,t.jsxs)(n.AppTabs,{tabs:U,value:K,listVariant:"line",onChange:e=>V(e),children:[(0,t.jsx)(n.AppTabsPanel,{value:"basic",children:(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:(0,t.jsx)("div",{className:"min-h-0",children:I?(0,t.jsx)(v.Loading,{text:"加载中…",className:"min-h-[200px]"}):(0,t.jsx)(o.AppTable,{rows:z,columns:eo,getRowKey:e=>e.id})})})}),(0,t.jsx)(n.AppTabsPanel,{value:"installed",children:P?(0,t.jsx)(v.Loading,{text:"加载中…",className:"min-h-[200px]"}):(0,t.jsx)(A,{items:es,saveBusy:F,onToggleEnabled:er,onExport:ei,onRemove:et})}),(0,t.jsx)(n.AppTabsPanel,{value:"cloud_catalog",className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsx)(y,{active:"cloud_catalog"===K,wsUrl:e,apiBase:p,agent:h(),onAfterInstall:ea,className:"min-h-0 flex-1"})})]}),(0,t.jsx)(N,{open:J,onOpenChange:e=>{W(e),e||ee()},wsUrl:e,apiBase:p,agent:h()}),(0,t.jsx)(C,{open:Y,onOpenChange:q,skillName:G,wsUrl:e,apiBase:p,agent:h(),onSaved:()=>void ee()})]})}}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92715,e=>{"use strict";e.s(["AppTable",()=>u],92715);var t=e.i(18050),r=e.i(85413),a=e.i(71645),l=e.i(75157);let s=a.forwardRef((e,r)=>{let{className:a,...s}=e;return(0,t.jsx)("div",{className:"relative w-full overflow-auto",children:(0,t.jsx)("table",{ref:r,className:(0,l.cn)("w-full caption-bottom border-collapse",a),...s})})});s.displayName="Table";let n=a.forwardRef((e,r)=>{let{className:a,...s}=e;return(0,t.jsx)("thead",{ref:r,className:(0,l.cn)("[&_tr]:table [&_tr]:w-full [&_tr]:table-fixed [&_tr]:border-b",a),...s})});n.displayName="TableHeader";let i=a.forwardRef((e,r)=>{let{className:s,viewportFit:n=!0,viewportReserveBottom:i=16,viewportPaginationReserve:o=0,style:c,...d}=e,u=a.useRef(null),p=a.useCallback(e=>{u.current=e,"function"==typeof r?r(e):r&&(r.current=e)},[r]),[m,f]=a.useState(void 0);return a.useLayoutEffect(()=>{var e,t;if(!n)return void f(void 0);let r=()=>{var e,t;let r=u.current;if(!r)return;let a=r.getBoundingClientRect().top;f(Math.max(80,Math.floor((null!=(t=null==(e=window.visualViewport)?void 0:e.height)?t:window.innerHeight)-a-(i+o))))};r();let a=new ResizeObserver(()=>{r()});try{a.observe(document.body)}catch(e){}return window.addEventListener("resize",r),null==(e=window.visualViewport)||e.addEventListener("resize",r),null==(t=window.visualViewport)||t.addEventListener("scroll",r),window.addEventListener("scroll",r,!0),()=>{var e,t;a.disconnect(),window.removeEventListener("resize",r),null==(e=window.visualViewport)||e.removeEventListener("resize",r),null==(t=window.visualViewport)||t.removeEventListener("scroll",r),window.removeEventListener("scroll",r,!0)}},[n,i,o]),(0,t.jsx)("tbody",{ref:p,className:(0,l.cn)("block overflow-y-auto [&_tr:last-child]:border-b-0 [&_tr:last-child_td]:border-b-0 [&_tr]:table [&_tr]:w-full [&_tr]:table-fixed",s),style:n&&void 0!==m?{...c,maxHeight:m}:c,...d})});i.displayName="TableBody";let o=a.forwardRef((e,r)=>{let{className:a,hoverable:s=!0,...n}=e;return(0,t.jsx)("tr",{ref:r,className:(0,l.cn)("border-b transition-colors [&>td]:transition-colors data-[state=selected]:[&>td]:!bg-[var(--ds-item-active)]",s&&"group/table-row",a),...n})});o.displayName="TableRow";let c=a.forwardRef((e,r)=>{let{className:a,...s}=e;return(0,t.jsx)("th",{ref:r,className:(0,l.cn)("h-10 border-b border-[var(--border-subtle)] bg-[var(--surface-2)] px-3 text-left align-middle text-[14px] font-medium !text-[var(--ds-text)] text-muted-foreground",a),...s})});c.displayName="TableHead";let d=a.forwardRef((e,r)=>{let{className:a,...s}=e;return(0,t.jsx)("td",{ref:r,className:(0,l.cn)("border-x-0 border-b border-t-0 border-solid border-[var(--border-subtle)] p-3 align-middle transition-colors group-has-[td:hover]/table-row:!bg-[var(--ds-item-hover)]",a),...s})});function u(e){let{rows:a,columns:u,getRowKey:p,className:m,rowClassName:f,headerRowClassName:b,emptyText:x,emptyNode:v,bodyProps:g}=e;return(0,t.jsx)("div",{className:(0,l.cn)("overflow-hidden border border-[var(--ds-border)]",m),children:(0,t.jsxs)(s,{children:[(0,t.jsx)(n,{children:(0,t.jsx)(o,{className:(0,l.cn)("bg-[var(--ds-main-tint)] hover:bg-[var(--ds-main-tint)]",b),children:u.map(e=>(0,t.jsx)(c,{className:e.headerClassName,children:e.title},e.key))})}),(0,t.jsx)(i,{...g,children:a.length?a.map(e=>(0,t.jsx)(o,{className:"function"==typeof f?f(e):f,children:u.map(r=>(0,t.jsx)(d,{className:r.cellClassName,children:r.render(e)},r.key))},p(e))):(0,t.jsx)(o,{hoverable:!1,children:(0,t.jsx)(d,{colSpan:u.length,className:"py-6",children:null!=v?v:(0,t.jsx)(r.Empty,{text:x})})})})]})})}d.displayName="TableCell"},62427,e=>{"use strict";e.s(["clearRuntimeMcpItemConfig",()=>w,"deleteRuntimeMcp",()=>p,"deleteRuntimeSkill",()=>C,"deleteRuntimeTool",()=>u,"exportRuntimeMcpUrl",()=>f,"exportRuntimeSkillUrl",()=>j,"exportRuntimeToolUrl",()=>m,"importRuntimeMcp",()=>x,"importRuntimeTool",()=>b,"installCloudSkill",()=>N,"listBaseSkills",()=>s,"listCloudSkillCatalog",()=>S,"listInstalledSkills",()=>n,"listInstalledTools",()=>l,"listMcpServers",()=>a,"listRuntimeMcpPackages",()=>d,"listRuntimeTools",()=>c,"loadBaseSkillMd",()=>i,"loadRemoteMcpJson",()=>v,"loadRuntimeMcpItemConfig",()=>h,"saveBaseSkillMd",()=>o,"saveRemoteMcpJson",()=>g,"saveRuntimeMcpItemConfig",()=>y]);var t=e.i(29250),r=e.i(36845);async function a(e,a,l){let s=await (0,t.get)((0,r.buildMcpServersListUrl)(e,a,l));return{servers:Array.isArray(s.servers)?s.servers:[]}}async function l(e,a,l){let s=await (0,t.get)((0,r.buildToolInstalledListUrl)(e,a,l));return{tools:Array.isArray(s.tools)?s.tools:[]}}async function s(e,a,l){let s=await (0,t.get)((0,r.buildSkillBaseListUrl)(e,a,l));return{skills:Array.isArray(s.skills)?s.skills:[]}}async function n(e,a,l){let s=await (0,t.get)((0,r.buildSkillInstalledListUrl)(e,a,l));return{skills:Array.isArray(s.skills)?s.skills:[]}}async function i(e,a,l,s){return(0,t.get)((0,r.buildBaseSkillMdUrl)(e,a,l,s))}async function o(e,a,l,s,n){await (0,t.put)((0,r.buildBaseSkillMdUrl)(e,a,l,s),{content:n})}async function c(e,a,l){let s=await (0,t.get)((0,r.buildToolsRuntimeFilesUrl)(e,a,l));return{runtimeToolsDir:"string"==typeof s.runtimeToolsDir?s.runtimeToolsDir:"",items:Array.isArray(s.items)?s.items.filter(e=>!!(e&&e.id)):[]}}async function d(e,a,l){let s=await (0,t.get)((0,r.buildMcpRuntimeFilesUrl)(e,a,l));return{mcpRuntimeDir:"string"==typeof s.mcpRuntimeDir?s.mcpRuntimeDir:"",items:Array.isArray(s.items)?s.items.filter(e=>!!(e&&e.id)):[]}}async function u(e,a,l,s){return(0,t.del)((0,r.buildToolsRuntimeDeleteUrl)(e,a,l,s))}async function p(e,a,l,s){return(0,t.del)((0,r.buildMcpRuntimeDeleteUrl)(e,a,l,s))}function m(e,t,a,l){return(0,r.buildToolsRuntimeExportUrl)(e,t,a,l)}function f(e,t,a,l){return(0,r.buildMcpRuntimeExportUrl)(e,t,a,l)}async function b(e,a,l,s){let n=new FormData;return n.append("file",s),(0,t.post)((0,r.buildToolsRuntimeImportUrl)(e,a,l),n,{type:"file"})}async function x(e,a,l,s){let n=new FormData;return n.append("file",s),(0,t.post)((0,r.buildMcpRuntimeImportUrl)(e,a,l),n,{type:"file"})}async function v(e,a,l){return(0,t.get)((0,r.buildRemoteMcpJsonUrl)(e,a,l))}async function g(e,a,l,s){await (0,t.post)((0,r.buildRemoteMcpJsonUrl)(e,a,l),{content:s})}async function h(e,a,l,s,n){return(0,t.get)((0,r.buildRuntimeMcpItemConfigUrl)(e,a,l,s,n))}async function y(e,a,l,s,n,i){await (0,t.put)((0,r.buildRuntimeMcpItemConfigUrl)(e,a,l,s,n),{server:i})}async function w(e,a,l,s,n){await (0,t.del)((0,r.buildRuntimeMcpItemConfigUrl)(e,a,l,s,n))}async function C(e,a,l,s){return(0,t.del)((0,r.buildSkillsRuntimeDeleteUrl)(e,a,l,s))}function j(e,t,a,l){return(0,r.buildSkillsRuntimeExportUrl)(e,t,a,l)}async function S(e,a,l,s,n,i){let o=await (0,t.get)((0,r.buildCloudSkillCatalogUrl)(e,a,l,s,n,i));return{items:Array.isArray(o.items)?o.items:[],totalPages:Number(o.totalPages||0)}}async function N(e,a,l,s){await (0,t.post)((0,r.buildCloudSkillInstallUrl)(e,a,l),{id:s})}},53925,e=>{"use strict";e.s(["ResourceImportDialog",()=>u],53925);var t=e.i(18050),r=e.i(71645),a=e.i(72064),l=e.i(75157),s=e.i(19455);function n(e){return e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB")}function i(e){let{uploadUrl:i,accept:o,disabled:c=!1,multiple:d=!1,maxFileSize:u=0x3200000,autoUpload:p=!1,method:m="POST",transport:f="xhr",fieldName:b="file",headers:x,extraFormData:v,autoRetryTimes:g=0,autoRetryDelayMs:h=800,selectionOnly:y=!1,className:w,emptyTitle:C="点击或拖拽文件到此处",emptyHint:j="支持上传文件",onFilesChange:S,onUploadSuccess:N,onUploadError:k,onValidationError:R}=e,M=r.useId(),T=r.useRef(null),A=r.useRef(new Map),U=r.useRef(new Map),D=r.useRef([]),[E,z]=r.useState(!1),[B,O]=r.useState([]),I=r.useMemo(()=>o?o.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean):[],[o]);r.useEffect(()=>{D.current=B,null==S||S(B)},[B,S]),r.useEffect(()=>()=>{for(let e of A.current.values())e.abort();for(let e of U.current.values())e.abort();for(let e of D.current)e.previewUrl&&URL.revokeObjectURL(e.previewUrl)},[]);let L=r.useCallback((e,t)=>{O(r=>r.map(r=>r.id===e?{...r,...t}:r))},[]),P=r.useCallback(async(e,t)=>{let r=D.current.find(t=>t.id===e);if(!r||c)return;L(e,{status:t>0?"retrying":"uploading",progress:0,error:"",retryCount:t});let a=new FormData;if(v)for(let[e,t]of Object.entries(v))a.append(e,t);a.append(b,r.file);try{let t="";if("fetch"===f){let r=new AbortController;U.current.set(e,r);let l=await fetch(i,{method:m,headers:x,body:a,signal:r.signal}),s=await l.text();try{t=s?JSON.parse(s):""}catch(e){t=s}if(!l.ok)throw Error("上传失败:".concat(l.status," ").concat(l.statusText))}else t=await new Promise((t,r)=>{let l=new XMLHttpRequest;if(A.current.set(e,l),l.open(m,i,!0),x)for(let[e,t]of Object.entries(x))l.setRequestHeader(e,t);l.upload.onprogress=t=>{if(!t.lengthComputable)return;let r=Math.min(100,Math.round(t.loaded/t.total*100));L(e,{progress:r})},l.onerror=()=>r(Error("网络异常,上传失败")),l.onabort=()=>r(Error("__ABORTED__")),l.onload=()=>{l.status>=200&&l.status<300?t(function(e){let t=e.responseText||"";try{return JSON.parse(t)}catch(e){return t}}(l)):r(Error("上传失败:".concat(l.status," ").concat(l.statusText)))},l.send(a)});L(e,{status:"success",progress:100,error:""});let r=D.current.find(t=>t.id===e);r&&(null==N||N(r,t))}catch(l){let r=l instanceof Error?l.message:String(l);if("__ABORTED__"===r)return void L(e,{status:"selected",progress:0,error:""});if(t<g){L(e,{status:"retrying",error:"重试中(".concat(t+1,"/").concat(g,")")}),await new Promise(e=>window.setTimeout(e,h)),await P(e,t+1);return}L(e,{status:"error",error:r});let a=D.current.find(t=>t.id===e);a&&(null==k||k(a,r))}finally{A.current.delete(e),U.current.delete(e)}},[h,g,c,v,b,x,m,k,N,f,L,i]),J=r.useCallback(e=>{P(e,0)},[P]),_=r.useCallback(e=>{var t,r;null==(t=A.current.get(e))||t.abort(),null==(r=U.current.get(e))||r.abort()},[]),F=r.useCallback(()=>{for(let e of D.current)("selected"===e.status||"error"===e.status)&&J(e.id)},[J]),H=r.useCallback(e=>{if(c||!e.length)return;let t=new Set(D.current.map(e=>"".concat(e.file.name,"::").concat(e.file.size))),r=[];for(let a of e){let e="".concat(a.name,"::").concat(a.size);if(!t.has(e)){if(!function(e,t){if(!t.length)return!0;let r=e.name.toLowerCase(),a=(e.type||"").toLowerCase();return t.some(e=>e.startsWith(".")?r.endsWith(e):e.endsWith("/*")?a.startsWith("".concat(e.slice(0,-1))):a===e)}(a,I)){null==R||R("文件类型不支持:".concat(a.name));continue}if(a.size>u){null==R||R("文件过大(最大 ".concat(n(u),"):").concat(a.name));continue}t.add(e),r.push({id:"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),file:a,status:"selected",progress:0,error:"",retryCount:0,previewUrl:a.type.startsWith("image/")?URL.createObjectURL(a):""})}}if(!r.length)return;let a=d?[...D.current,...r]:[r[r.length-1]];if(!d)for(let e of D.current)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);if(O(a),p&&!y)for(let e of r)J(e.id)},[I,p,c,u,d,R,y,J]),V=r.useCallback(e=>{let t=e.target.files;t&&(H(Array.from(t)),e.target.value="")},[H]),K=r.useCallback(e=>{var t;e.preventDefault(),e.stopPropagation(),z(!1),c||H(Array.from(null!=(t=e.dataTransfer.files)?t:[]))},[H,c]);return(0,t.jsxs)("div",{className:(0,l.cn)("flex min-h-0 w-full flex-col gap-3",w),children:[(0,t.jsx)("input",{ref:T,id:M,type:"file",hidden:!0,accept:o,multiple:d,disabled:c,onChange:V}),(0,t.jsxs)("label",{htmlFor:M,onDragOver:e=>{e.preventDefault(),c||z(!0)},onDragLeave:e=>{e.preventDefault(),z(!1)},onDrop:K,className:(0,l.cn)("flex min-h-[124px] cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-[var(--ds-border)] px-4 py-6 text-center transition-colors hover:border-[var(--ds-border-hover)] hover:bg-[var(--ds-main-tint)]",E&&"bg-[var(--ds-accent)]/5 border-[var(--ds-accent)]",c&&"cursor-not-allowed opacity-60"),children:[(0,t.jsx)(a.default,{name:"Upload",size:20,className:"text-[var(--ds-muted)]"}),(0,t.jsx)("div",{className:"text-[var(--ds-text)]",children:C}),(0,t.jsx)("div",{className:"text-[var(--ds-muted)]",children:j})]}),B.length?(0,t.jsx)("div",{className:"space-y-2",children:B.map(e=>(0,t.jsx)("div",{className:"rounded-md border border-[var(--ds-border)] p-2.5",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"truncate text-[var(--ds-text)]",children:e.file.name}),(0,t.jsx)("div",{className:"text-[var(--ds-muted)]",children:n(e.file.size)}),e.previewUrl?(0,t.jsx)("img",{src:e.previewUrl,alt:e.file.name,className:"mt-2 h-14 w-14 rounded object-cover"}):null,"uploading"===e.status||"retrying"===e.status?(0,t.jsx)("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded bg-[var(--ds-main-tint)]",children:(0,t.jsx)("div",{className:"h-full bg-[var(--ds-accent)] transition-all",style:{width:"".concat(e.progress,"%")}})}):null,"error"===e.status?(0,t.jsx)("div",{className:"mt-1 text-[var(--ds-danger)]",children:e.error||"上传失败"}):null]}),y?null:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:["success"===e.status?(0,t.jsx)(a.default,{name:"CheckCircle2",size:16,className:"text-[var(--ds-accent)]"}):null,"selected"===e.status||"error"===e.status?(0,t.jsxs)(s.Button,{type:"button",size:"sm",variant:"outline",disabled:c,onClick:()=>J(e.id),children:["error"===e.status?(0,t.jsx)(a.default,{name:"RefreshCw",size:14,className:"mr-1"}):null,"error"===e.status?"重试":"上传"]}):null,"uploading"===e.status||"retrying"===e.status?(0,t.jsxs)(s.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>_(e.id),children:[(0,t.jsx)(a.default,{name:"XCircle",size:14,className:"mr-1"}),"取消"]}):null]})]})},e.id))}):null,!y&&!p&&B.some(e=>"selected"===e.status||"error"===e.status)?(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(s.Button,{type:"button",size:"sm",onClick:F,disabled:c,children:"上传"})}):null]})}var o=e.i(76639),c=e.i(13354),d=e.i(29250);function u(e){let{open:a,onOpenChange:l,title:n,description:u,uploadUrl:p,resetKey:m}=e,[f,b]=(0,r.useState)(!1),[x,v]=(0,r.useState)(null),g=(0,r.useCallback)(()=>{l(!1),v(null)},[l]),h=(0,r.useCallback)(async()=>{if(!x)return void c.appToast.info("请先选择 zip 文件");let e=new FormData;e.append("file",x),b(!0);try{let t=await (0,d.bridgeFetch)(p,{method:"POST",body:e}),r=Number(t.imported||0),a=Number(t.overwritten||0),l=Array.isArray(t.rejected)?t.rejected.length:0;c.appToast.success("导入完成:导入 ".concat(r,",覆盖 ").concat(a)+(l>0?",拒绝 ".concat(l):"")),g()}catch(e){c.appToast.error("导入失败:".concat(e instanceof Error?e.message:String(e)))}finally{b(!1)}},[g,x,p]);return(0,t.jsx)(o.Dialog,{open:a,onOpenChange:e=>{l(e),e||v(null)},children:(0,t.jsxs)(o.DialogContent,{className:"flex min-h-[320px] max-w-[560px] flex-col",children:[(0,t.jsxs)(o.DialogHeader,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.DialogTitle,{children:n}),(0,t.jsx)(o.DialogDescription,{children:u})]}),(0,t.jsx)(o.DialogClose,{className:"sidebar-icon-btn","aria-label":"关闭",onClick:g,children:"✕"})]}),(0,t.jsxs)("div",{className:"m-3 flex flex-1 flex-col gap-3",children:[(0,t.jsx)(i,{uploadUrl:p,accept:".zip,application/zip",maxFileSize:0x3200000,multiple:!1,disabled:f,selectionOnly:!0,emptyTitle:"点击或拖拽 zip 文件到此处",emptyHint:"支持 .zip 格式,最大 50MB",onFilesChange:e=>{var t,r;v(null!=(r=null==(t=e[0])?void 0:t.file)?r:null)},onValidationError:e=>{c.appToast.info(e)}},"".concat(a?"open":"closed","-").concat(null!=m?m:p)),(0,t.jsxs)("div",{className:"mt-auto flex justify-end pt-2",children:[(0,t.jsx)(s.Button,{className:"mr-[12px]",type:"button",variant:"plain-outline",size:"lg",onClick:g,children:"取消"}),(0,t.jsx)(s.Button,{type:"button",size:"lg",variant:"default",disabled:f||null==x,onClick:()=>void h(),children:f?"导入中…":"确定"})]})]})]})})}},55242,e=>{"use strict";e.s(["AppDialog",()=>s]);var t=e.i(18050),r=e.i(71645),a=e.i(76639),l=e.i(75157);function s(e){let{open:s,onOpenChange:n,title:i,children:o,footer:c,width:d="max-w-3xl",minHeight:u}=e,p=(0,r.useId)();return(0,t.jsx)(a.Dialog,{open:s,onOpenChange:n,children:(0,t.jsxs)(a.DialogContent,{"aria-labelledby":p,className:(0,l.cn)(d,u?"!min-h-[--min-h]":""),style:u?{"--min-h":u}:void 0,children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{id:p,children:i}),(0,t.jsx)(a.DialogClose,{"aria-label":"关闭"})]}),(0,t.jsx)(a.DialogBody,{className:"!px-4 !py-3",children:o}),c?(0,t.jsx)("div",{className:"flex flex-shrink-0 justify-end gap-2 border-t border-[var(--ds-border)] bg-[var(--ds-sidebar)] px-4 py-3",children:c}):null]})})}},37991,e=>{"use strict";e.s(["McpManageView",()=>S],37991);var t=e.i(18050),r=e.i(71645),a=e.i(65934),l=e.i(87243),s=e.i(13354),n=e.i(50711),i=e.i(51419),o=e.i(55242),c=e.i(92715),d=e.i(19455),u=e.i(94055),p=e.i(94197);function m(e){let{items:r,saveBusy:a,onToggleStatus:l,onEdit:s,className:n}=e,i=[{key:"name",title:"名称",headerClassName:"",cellClassName:"",render:e=>e.label||e.name},{key:"description",title:"详情",headerClassName:"",cellClassName:"",render:e=>e.description||"-"},{key:"source",title:"来源",headerClassName:"",cellClassName:"",render:()=>"远程"},{key:"status",title:"状态",headerClassName:"",cellClassName:"whitespace-nowrap py-2 align-middle",render:e=>l?(0,t.jsx)("span",{className:"inline-flex items-center justify-end gap-2 text-[var(--ds-text)]",children:(0,t.jsx)(u.AccentSwitch,{checked:!e.disabled,disabled:a,onCheckedChange:t=>{l(e.name,t)},"aria-label":"".concat(e.disabled?"启用":"禁用"," ").concat(e.name)})}):(0,t.jsx)("span",{className:"text-[var(--ds-text)]",children:e.installed?"已安装":"未安装"})},...s?[{key:"actions",title:"操作",headerClassName:"w-[72px] ",cellClassName:"w-[72px]",render:e=>(0,t.jsx)("div",{className:"inline-flex justify-end",children:(0,t.jsx)(p.IconTooltipButton,{icon:"Edit",label:"编辑 MCP 配置",ariaLabel:"编辑 ".concat(e.name),disabled:a,onClick:()=>s(e.name)})})}]:[]];return(0,t.jsx)(c.AppTable,{rows:r,columns:i,getRowKey:e=>"mcp:".concat(e.name),className:n})}var f=e.i(36845),b=e.i(53925);function x(e){let{open:r,onOpenChange:a,wsUrl:l,apiBase:s,agent:n}=e;return(0,t.jsx)(b.ResourceImportDialog,{open:r,onOpenChange:a,title:"导入 MCP zip",description:"选择一个 zip 文件并导入到 mcp-runtime。",uploadUrl:(0,f.buildMcpRuntimeImportUrl)(l,s,n),resetKey:n})}var v=e.i(62427);function g(e){return(null!=e.packageId?String(e.packageId).trim():"")||e.id}function h(e){let{open:a,onOpenChange:l,itemId:n,source:i,wsUrl:c,apiBase:u,agent:p,onSaved:m}=e,[f,b]=(0,r.useState)(""),[x,g]=(0,r.useState)(!1),[h,y]=(0,r.useState)(!1),w="remote"===i?"remote":"runtime";(0,r.useEffect)(()=>{if(!a||!n.trim())return;let e=!1;return g(!0),b("加载中…"),(0,v.loadRuntimeMcpItemConfig)(c,u,p,n,w).then(t=>{if(e)return;let r=t.overlay;r&&"object"==typeof r&&!Array.isArray(r)?b(JSON.stringify(r,null,2)):b("{}")}).catch(t=>{e||(s.appToast.error("加载 MCP 配置失败:".concat(t instanceof Error?t.message:String(t))),l(!1))}).finally(()=>{e||g(!1)}),()=>{e=!0}},[a,n,c,u,p,w,l]);let C=(0,r.useCallback)(async()=>{let e;if(!n.trim())return;let t=f.trim();try{e=t?JSON.parse(t):{}}catch(e){s.appToast.error("JSON 解析失败:".concat(e instanceof Error?e.message:String(e)));return}if(!e||"object"!=typeof e||Array.isArray(e))return void s.appToast.error("配置必须是 JSON 对象");if("mcpServers"in e&&null!=e.mcpServers)return void s.appToast.error("请填写标准 server 配置(command/args/env),不要嵌套 mcpServers");let r=0===Object.keys(e).length;y(!0);try{r?await (0,v.clearRuntimeMcpItemConfig)(c,u,p,n,w):await (0,v.saveRuntimeMcpItemConfig)(c,u,p,n,w,e),s.appToast.success("MCP 配置已保存"),l(!1),null==m||m()}catch(e){s.appToast.error("保存失败:".concat(e instanceof Error?e.message:String(e)))}finally{y(!1)}},[n,f,c,u,p,w,l,m]);return(0,t.jsx)(o.AppDialog,{open:a,onOpenChange:l,title:"编辑 MCP 配置 · ".concat(n),width:"max-w-4xl",minHeight:"420px",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Button,{type:"button",variant:"plain-outline",size:"lg",disabled:h,onClick:()=>l(!1),children:"取消"}),(0,t.jsx)(d.Button,{type:"button",size:"lg",disabled:h||x,onClick:()=>void C(),children:"保存"})]}),children:(0,t.jsx)("textarea",{className:"focus-visible:ring-[var(--ds-accent)]/30 min-h-[320px] w-full resize-y rounded-md border border-[var(--ds-border)] bg-[var(--ds-bg)] p-3 font-mono leading-6 text-[var(--ds-text)] outline-none focus-visible:ring-2",spellCheck:!1,value:f,disabled:x,onChange:e=>b(e.target.value)})})}var y=e.i(68499),w=e.i(72064),C=e.i(56708);let j=[{value:"basic",label:"本地MCP"},{value:"installed",label:"远程MCP"}];function S(){let e=(0,a.useAppStore)(e=>e.wsUrl),f=(0,a.useAppStore)(e=>e.apiBase),b=(0,a.useAppStore)(e=>e.agentConfig),S=(0,a.useAppStore)(e=>e.setAgentConfig),{currentAgent:N,loadAgentConfig:k}=(0,l.useSession)(),R=(0,n.usePersistAgentConfigField)("mcpServers"),M=b.mcpServers,T=(0,r.useMemo)(()=>[...M].sort().join("\0"),[M]),[A,U]=(0,r.useState)([]),[D,E]=(0,r.useState)([]),[z,B]=(0,r.useState)(!1),[O,I]=(0,r.useState)(!1),[L,P]=(0,r.useState)("basic"),[J,_]=(0,r.useState)(!1),[F,H]=(0,r.useState)(!1),[V,K]=(0,r.useState)(""),[W,q]=(0,r.useState)(!1),[X,G]=(0,r.useState)(""),[Q,Y]=(0,r.useState)(),[Z,$]=(0,r.useState)(!1);(0,r.useEffect)(()=>{k()},[k]);let ee=(0,r.useCallback)(async(e,t)=>{I(!0);try{await R(e,{silent:t})}finally{I(!1)}},[R]),et=(0,r.useCallback)(e=>A.find(t=>t.id===e),[A]),er=(0,r.useCallback)(e=>{let t=et(e);G(e),Y(null==t?void 0:t.source),$(!0)},[et]),ea=(0,r.useCallback)(async()=>{U([]),B(!0);try{var t;let r=await (0,v.listMcpServers)(e,f,N());U((null!=(t=r.servers)?t:[]).map(e=>{var t,r,a;return{...e,id:e.name,label:e.name+(e.disabled?"(已禁用)":""),description:null!=(r=null!=(t=e.description)?t:e.source)?r:"",source:null!=(a=e.source)?a:"",installed:!!e.installed,packageId:e.packageId}}))}catch(e){U([]),s.appToast.error("加载失败:".concat(e instanceof Error?e.message:String(e)))}finally{B(!1)}},[e,f,N]),el=(0,r.useCallback)(async t=>{var r;let a=et(t),l=null!=(r=null==a?void 0:a.source)?r:"";if("runtime"!==l&&"remote"!==l)return void s.appToast.error("基础MCP不可删除");if(await (0,y.confirmAlertDialog)({title:"确认删除 MCP?",description:"服务器名:".concat(t),confirmText:"删除",cancelText:"取消"}))try{if("remote"===l){let r=await (0,v.loadRemoteMcpJson)(e,f,N()),a={};try{a=JSON.parse(String(r.content||"{}"))}catch(e){a={mcpServers:{}}}(!a.mcpServers||Array.isArray(a.mcpServers)||"object"!=typeof a.mcpServers)&&(a.mcpServers={}),delete a.mcpServers[t],await (0,v.saveRemoteMcpJson)(e,f,N(),JSON.stringify(a,null,2))}else{let r=a?g(a):t;await (0,v.deleteRuntimeMcp)(e,f,N(),r)}let r=M.filter(e=>e!==t);E(e=>e.filter(e=>e!==t)),S({...b,mcpServers:r}),await ee(r,!0),await ea()}catch(e){s.appToast.error("删除失败:".concat(e instanceof Error?e.message:String(e)))}},[et,e,f,N,M,b,S,ee,ea]);(0,r.useEffect)(()=>{("basic"===L||"installed"===L)&&ea()},[L,ea]),(0,r.useEffect)(()=>{("basic"===L||"installed"===L)&&E([...M])},[L,M,T]);let es=(0,r.useCallback)(async e=>{let t=[...new Set(e)].sort();S({...b,mcpServers:t}),await ee(t,!0)},[b,S,ee]),en=(0,r.useCallback)(async(e,t)=>{let r=t?[...new Set([...D,e])]:D.filter(t=>t!==e);E(r);try{await es(r)}catch(e){E(D),s.appToast.error("切换启用状态失败: ".concat(e))}},[D,es]),ei=(0,r.useMemo)(()=>A.filter(e=>"remote"!==e.source).slice().sort((e,t)=>e.id.localeCompare(t.id)),[A]),eo=(0,r.useMemo)(()=>A.filter(e=>"remote"===e.source).slice().sort((e,t)=>{let r=+!D.includes(e.id),a=+!D.includes(t.id);return r!==a?r-a:e.id.localeCompare(t.id)}).map(e=>({...e,name:e.id,label:e.label,description:e.description||"",installed:!0,source:e.source,disabled:!D.includes(e.id)})),[A,D]),ec=(0,r.useCallback)(t=>{window.open((0,v.exportRuntimeMcpUrl)(e,f,N(),g(t)),"_blank","noopener")},[e,f,N]),ed=(0,r.useCallback)(async(e,t)=>{let r=t?[...new Set([...D,e])]:D.filter(t=>t!==e);E(r);try{await es(r)}catch(e){E(D),s.appToast.error("切换启用状态失败: ".concat(e))}},[D,es]),eu=(0,r.useCallback)(()=>{H(!0),K(""),(0,v.loadRemoteMcpJson)(e,f,N()).then(e=>{K("string"==typeof e.content?e.content:'{\n "mcpServers": {}\n}\n')}).catch(e=>{s.appToast.error("加载 mcp.json 失败:".concat(e instanceof Error?e.message:String(e))),H(!1)})},[e,f,N]),ep=(0,r.useCallback)(async()=>{let t=function(e){let t,r=e.trim();if(!r)return"请输入 JSON 配置内容";try{t=JSON.parse(r)}catch(e){return"JSON 解析失败:".concat(e instanceof Error?e.message:String(e))}if(!t||"object"!=typeof t||Array.isArray(t))return"JSON 根节点必须是对象";let a=t.mcpServers;if(!a||"object"!=typeof a||Array.isArray(a))return"mcpServers 不能为空,且需包含至少一个 server";let l=Object.keys(a).filter(e=>e.trim());if(!l.length)return"mcpServers 不能为空,且需包含至少一个 server";let s=new Set;for(let e of l){let t=e.trim();!t||s.has(t)||s.add(t)}return s.size?null:"未解析到有效的 server 名称"}(V);if(t)return void s.appToast.error(t);q(!0);try{await (0,v.saveRemoteMcpJson)(e,f,N(),V.trim()),s.appToast.success("已保存全局 mcp.json。"),H(!1),await ea()}catch(e){s.appToast.error("保存 mcp.json 失败:".concat(e instanceof Error?e.message:String(e)))}finally{q(!1)}},[e,f,N,V,ea]),em=[{key:"name",title:"名称",headerClassName:" text-[var(--ds-muted)]",cellClassName:" text-[var(--ds-text)]",render:e=>e.label},{key:"description",title:"详情",headerClassName:" text-[var(--ds-muted)]",cellClassName:" text-[var(--ds-text)]",render:e=>e.description||"-"},{key:"enabled",title:"启用/未启用",headerClassName:"w-14 w-[112px] text-right text-[var(--ds-muted)]",cellClassName:"w-[112px] py-2 text-right align-middle",render:e=>(0,t.jsx)("span",{className:"inline-flex justify-end",children:(0,t.jsx)(u.AccentSwitch,{checked:D.includes(e.id),disabled:O,onCheckedChange:t=>{en(e.id,t)},"aria-label":"选择 ".concat(e.label)})})},{key:"actions",title:"操作",headerClassName:"w-[168px] text-[var(--ds-muted)]",cellClassName:"w-[168px]",render:e=>{var r;let a=null!=(r=e.source)?r:"",l="runtime"===a,s="runtime"===a||"remote"===a;return(0,t.jsxs)("div",{className:"inline-flex items-center justify-end gap-1",children:[(0,t.jsx)(p.IconTooltipButton,{icon:"Download",label:l?"导出":"仅 runtime MCP 支持导出",ariaLabel:"导出 ".concat(e.label),disabled:O||!l,onClick:()=>ec(e)}),(0,t.jsx)(p.IconTooltipButton,{icon:"Edit",label:"编辑 MCP 配置",ariaLabel:"编辑 ".concat(e.label),disabled:O,onClick:()=>er(e.id)}),(0,t.jsx)(p.IconTooltipButton,{icon:"Trash2",label:s?"删除":"基础MCP不可删除",tone:"danger",ariaLabel:"删除 ".concat(e.label),disabled:O||!s,onClick:()=>{el(e.id)},iconClassName:"text-red-500"})]})}}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.ManageChromeHeaderActions,{children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center",children:[(0,t.jsxs)(d.Button,{type:"button",variant:"plain-outline",size:"lg",onClick:eu,className:"mr-[12px]",children:[(0,t.jsx)(w.default,{name:"Edit",size:16,className:"align-middle"}),"编辑全局MCP"]}),(0,t.jsxs)(d.Button,{id:"btnAgentImportMcp",type:"button",variant:"plain-outline",size:"lg",className:"inline-flex items-center justify-center gap-1.5",onClick:()=>_(!0),children:[(0,t.jsx)(w.default,{name:"Import",size:16,className:"align-middle"}),"导入MCP"]})]})}),(0,t.jsxs)(i.AppTabs,{tabs:j,value:L,listVariant:"line",onChange:e=>P(e),children:[(0,t.jsx)(i.AppTabsPanel,{value:"basic",children:(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:(0,t.jsx)("div",{className:"min-h-0",children:z?(0,t.jsx)("p",{className:"px-3 py-6 text-center text-[var(--ds-muted)]",children:"加载中…"}):(0,t.jsx)(c.AppTable,{rows:ei,columns:em,getRowKey:e=>e.id})})})}),(0,t.jsx)(i.AppTabsPanel,{value:"installed",children:(0,t.jsx)(m,{items:eo,saveBusy:O,onToggleStatus:ed,onEdit:er})})]}),(0,t.jsx)(x,{open:J,onOpenChange:e=>{_(e),e||ea()},wsUrl:e,apiBase:f,agent:N()}),(0,t.jsx)(h,{open:Z,onOpenChange:$,itemId:X,source:Q,wsUrl:e,apiBase:f,agent:N(),onSaved:()=>{ea(),ee(b.mcpServers,!0)}}),(0,t.jsx)(o.AppDialog,{open:F,onOpenChange:H,title:"编辑全局MCP",width:"max-w-4xl",minHeight:"420px",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Button,{type:"button",variant:"plain-outline",size:"lg",disabled:W,onClick:()=>H(!1),children:"取消"}),(0,t.jsx)(d.Button,{type:"button",size:"lg",disabled:W,onClick:()=>void ep(),children:"保存"})]}),children:(0,t.jsx)("textarea",{className:"focus-visible:ring-[var(--ds-accent)]/30 min-h-[320px] w-full resize-y rounded-md border border-[var(--ds-border)] bg-[var(--ds-bg)] p-3 leading-6 text-[var(--ds-text)] outline-none focus-visible:ring-2",spellCheck:!1,value:V,onChange:e=>K(e.target.value)})})]})}}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93479,e=>{"use strict";e.s(["Input",()=>n]);var t=e.i(18050),r=e.i(75157);function n(e){let{className:n,type:o="text",size:i="default",...a}=e;return(0,t.jsx)("input",{type:o,"data-slot":"input","data-size":i,className:(0,r.cn)("h-9 w-full appearance-none rounded-md border border-solid border-border bg-transparent px-3 outline-none transition-[color,box-shadow,border-color] duration-150 ease-in-out placeholder:text-muted-foreground hover:border-[var(--border-hover)] focus-visible:border-[var(--border-focus)] focus-visible:[box-shadow:var(--ring-focus-sm)] read-only:focus-visible:border-border read-only:focus-visible:[box-shadow:none] disabled:cursor-not-allowed disabled:opacity-50 disabled:focus-visible:border-border disabled:focus-visible:[box-shadow:none] data-[size=default]:h-9 data-[size=lg]:h-10 data-[size=sm]:h-7",n),...a})}},20783,e=>{"use strict";e.s(["composeRefs",()=>n,"useComposedRefs",()=>o]);var t=e.i(71645);function r(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{let n=!1,o=t.map(t=>{let o=r(t,e);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let e=0;e<o.length;e++){let n=o[e];"function"==typeof n?n():r(t[e],null)}}}}function o(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.useCallback(n(...r),r)}},24687,e=>{"use strict";e.s(["Textarea",()=>n]);var t=e.i(18050),r=e.i(75157);function n(e){let{className:n,...o}=e;return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("flex min-h-20 w-full rounded-md border border-solid border-border bg-transparent px-3 py-2 outline-none transition-[color,box-shadow,border-color] duration-150 ease-in-out placeholder:text-muted-foreground hover:border-[var(--border-hover)] focus-visible:border-[var(--border-focus)] focus-visible:[box-shadow:var(--ring-focus-sm)] read-only:focus-visible:border-border read-only:focus-visible:[box-shadow:none] disabled:cursor-not-allowed disabled:opacity-50 disabled:focus-visible:border-border disabled:focus-visible:[box-shadow:none]",n),...o})}},51239,e=>{e.v("/app/_next/static/media/data-loading.be8d921a.png")},2839,e=>{"use strict";e.s(["Loading",()=>a],2839);var t=e.i(18050),r=e.i(57688);let n={src:e.i(51239).default,width:951,height:482,blurWidth:8,blurHeight:4,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAYAAACzzX7wAAAAj0lEQVR42gGEAHv/AAAAAAANERAObXJwYaGko5N/gYBwDg8PCgAAAAAAAAAAAAMEBAJic2xp2+3m7fL8+P7l6ujjUlhWTAYGBgUAAAAAADM3NTG6x8LB7fr1/vD89/7f9+3+wNXNzycpKB4AAAAAAJ+qpozL2dO/0NvWx9Td2c6gzrzRpcq8u2FpZk8CAgIBCRI7kCfNfAcAAAAASUVORK5CYII="};var o=e.i(87968),i=e.i(75157);function a(e){let{text:a="加载中",className:u,showImage:s=!0,imageSrc:l=n,imageAlt:c="加载中",imageSize:f=180,imageClassName:d}=e,p="string"==typeof l?{width:f,height:f}:{width:l.width,height:l.height};return(0,t.jsxs)("div",{className:(0,i.cn)("flex min-h-[180px] w-full flex-col items-center justify-center gap-2 py-4 text-[var(--ds-muted)]",u),role:"status","aria-live":"polite",children:[s?(0,t.jsx)("span",{className:(0,i.cn)("block shrink-0",d),style:{width:f},children:(0,t.jsx)(r.default,{src:l,alt:c,width:p.width,height:p.height,unoptimized:!0,draggable:!1,sizes:"".concat(f,"px"),className:"h-auto w-full object-contain"})}):null,(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)(o.Spinner,{className:"mr-2"}),a]})]})}},98183,(e,t,r)=>{"use strict";function n(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,o(e));else t.set(r,o(n));return t}function a(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{assign:function(){return a},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return i}})},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return a}});let n=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,i=e.protocol||"",a=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(n.urlQueryToSearchParams(s)));let c=e.search||s&&"?"+s||"";return i&&!i.endsWith(":")&&(i+=":"),e.slashes||(!i||o.test(i))&&!1!==l?(l="//"+(l||""),a&&"/"!==a[0]&&(a="/"+a)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),""+i+l+(a=a.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+u}let a=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{DecodeError:function(){return b},MiddlewareNotFoundError:function(){return m},MissingStaticPage:function(){return y},NormalizeError:function(){return g},PageNotFoundError:function(){return A},SP:function(){return p},ST:function(){return h},WEB_VITALS:function(){return n},execOnce:function(){return o},getDisplayName:function(){return l},getLocationOrigin:function(){return u},getURL:function(){return s},isAbsoluteUrl:function(){return a},isResSent:function(){return c},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return v}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return r||(r=!0,t=e(...o)),t}}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,a=e=>i.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function s(){let{href:e}=window.location,t=u();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function d(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await d(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&c(r))return n;if(!n)throw Object.defineProperty(Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let p="undefined"!=typeof performance,h=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class g extends Error{}class A extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class y extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class m extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function v(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),o=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{default:function(){return g},useLinkStatus:function(){return y}});let n=e.r(90809),o=e.r(18050),i=n._(e.r(71645)),a=e.r(95057),u=e.r(8372),s=e.r(18581),l=e.r(18967),c=e.r(84395);e.r(33525);let f=e.r(91949),d=e.r(73668),p=e.r(99781);e.r(84508);let h=e.r(65165);function b(e){return"string"==typeof e?e:(0,a.formatUrl)(e)}function g(e){var t;let r,n,a,[g,y]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),m=(0,i.useRef)(null),{href:v,as:x,children:P,prefetch:w=null,passHref:j,replace:E,shallow:N,scroll:O,onClick:C,onMouseEnter:T,onTouchStart:S,legacyBehavior:_=!1,onNavigate:R,ref:U,unstable_dynamicOnHover:L,...I}=e;r=P,_&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let k=i.default.useContext(u.AppRouterContext),M=!1!==w,z=!1!==w?null===(t=w)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:B,as:D}=i.default.useMemo(()=>{let e=b(v);return{href:e,as:x?b(x):e}},[v,x]);_&&(n=i.default.Children.only(r));let F=_?n&&"object"==typeof n&&n.ref:U,K=i.default.useCallback(e=>(null!==k&&(m.current=(0,f.mountLinkInstance)(e,B,k,z,M,y)),()=>{m.current&&((0,f.unmountLinkForCurrentNavigation)(m.current),m.current=null),(0,f.unmountPrefetchableInstance)(e)}),[M,B,k,z,y]),G={ref:(0,s.useMergedRef)(K,F),onClick(e){_||"function"!=typeof C||C(e),_&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),k&&(e.defaultPrevented||function(e,t,r,n,o,a,u){let{nodeName:s}=e.currentTarget;if(!("A"===s.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,d.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),u){let e=!1;if(u({preventDefault:()=>{e=!0}}),e)return}i.default.startTransition(()=>{(0,p.dispatchNavigateAction)(r||t,o?"replace":"push",null==a||a,n.current)})}}(e,B,D,m,E,O,R))},onMouseEnter(e){_||"function"!=typeof T||T(e),_&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),k&&M&&(0,f.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){_||"function"!=typeof S||S(e),_&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),k&&M&&(0,f.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,l.isAbsoluteUrl)(D)?G.href=D:_&&!j&&("a"!==n.type||"href"in n.props)||(G.href=(0,c.addBasePath)(D)),a=_?i.default.cloneElement(n,G):(0,o.jsx)("a",{...I,...G,children:r}),(0,o.jsx)(A.Provider,{value:g,children:a})}let A=(0,i.createContext)(f.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(A);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]);