@qredence/fleet 0.5.11 → 0.6.1

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 (132) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/web/client/assets/action-swap-roll-COzQ86wm.js +1 -0
  3. package/dist/web/client/assets/agent-activity-svETLf_5.js +1 -0
  4. package/dist/web/client/assets/agent-disclosure-DAMuuGcM.js +1 -0
  5. package/dist/web/client/assets/analytics-stub-B6zGMuSV.js +1 -0
  6. package/dist/web/client/assets/{artifacts-panel-CQmFEF_H.js → artifacts-panel-HVjqBMyx.js} +1 -1
  7. package/dist/web/client/assets/button-C5wFDY5_.js +1 -0
  8. package/dist/web/client/assets/card-DA3Vnqay.js +1 -0
  9. package/dist/web/client/assets/{chat-yh02zgA7.js → chat-BhYseKd6.js} +7 -7
  10. package/dist/web/client/assets/{chat-command-palette-CmHTS3rs.js → chat-command-palette-LILDO_vG.js} +1 -1
  11. package/dist/web/client/assets/{citations-C_tPOJE_.js → citations-BPv8HIpf.js} +2 -2
  12. package/dist/web/client/assets/command-PhicLCoO.js +1 -0
  13. package/dist/web/client/assets/dialog-pBGUjAQ7.js +1 -0
  14. package/dist/web/client/assets/fleet-message-queue-fbYYwMj0.js +1 -0
  15. package/dist/web/client/assets/{fleet-pi-tool-renderer-BEDIO3al.js → fleet-pi-tool-renderer-BRgNnmaJ.js} +28 -28
  16. package/dist/web/client/assets/fleet-reasoning-panel-CjA2dwUJ.js +1 -0
  17. package/dist/web/client/assets/{fork-picker-dialog-ByBOGVsa.js → fork-picker-dialog-B7NNpVmW.js} +1 -1
  18. package/dist/web/client/assets/globals-CuIiqOTg.css +2 -0
  19. package/dist/web/client/assets/horizontal-resize-Cp3iHMH7.js +1 -0
  20. package/dist/web/client/assets/index-CSGplyr_.js +12 -0
  21. package/dist/web/client/assets/{input-0wwjWjKq.js → input-PcdubeKn.js} +1 -1
  22. package/dist/web/client/assets/input-group-C2HJEZvl.js +1 -0
  23. package/dist/web/client/assets/ipython-tool-CyuMOxz1.js +3 -0
  24. package/dist/web/client/assets/{markdown-code-CuQcR3UO.js → markdown-code-xNyjdZ4g.js} +1 -1
  25. package/dist/web/client/assets/{markdown-DInPmRUG.js → markdown-lvexwooo.js} +2 -2
  26. package/dist/web/client/assets/{model-selector-list-DsKTuAgS.js → model-selector-list-CoXX358G.js} +1 -1
  27. package/dist/web/client/assets/{notify-DgMKgZZW.js → notify-DxL0VD7Z.js} +1 -1
  28. package/dist/web/client/assets/openui-renderer-TLNe5e_Q.js +378 -0
  29. package/dist/web/client/assets/pencil-DcUwsKLn.js +1 -0
  30. package/dist/web/client/assets/prompt-input-fwP8TsgQ.js +1 -0
  31. package/dist/web/client/assets/{prompt-suggestions-Cc--lSNR.js → prompt-suggestions-BlGXmWS7.js} +1 -1
  32. package/dist/web/client/assets/provider-catalog-DYMFdbKc.js +1 -0
  33. package/dist/web/client/assets/provider-label-B4q5mI65.js +1 -0
  34. package/dist/web/client/assets/{repl-panel-DsPX04Xr.js → repl-panel-C5om8MGU.js} +1 -1
  35. package/dist/web/client/assets/{right-panel-registry-DewpBWHM.js → right-panel-registry-BBlxLxnx.js} +2 -2
  36. package/dist/web/client/assets/routes-XGsAIqBJ.js +16 -0
  37. package/dist/web/client/assets/settings-dialog-BSBasR3o.js +2 -0
  38. package/dist/web/client/assets/{subagent-chat-panel-DkVUumrP.js → subagent-chat-panel-oeLDPDAK.js} +1 -1
  39. package/dist/web/client/assets/{subagent-transcript-D8wmQxXe.js → subagent-transcript-DaVHjNUH.js} +1 -1
  40. package/dist/web/client/assets/{subagents-panel-BMp2Ego0.js → subagents-panel-D_aVgSCi.js} +1 -1
  41. package/dist/web/client/assets/surfaces-BhAXz9So.js +1 -0
  42. package/dist/web/client/assets/{switch-9rTeg6J6.js → switch-WhXeJNNY.js} +1 -1
  43. package/dist/web/client/assets/{toast-Bt9p2OL4.js → toast-D3c9XeGe.js} +1 -1
  44. package/dist/web/client/assets/{tool-result-DfnPN0FQ.js → tool-result-Cki8WUNc.js} +3 -3
  45. package/dist/web/client/assets/virtualized-turn-list-CdMa-ydT.js +6 -0
  46. package/dist/web/client/assets/workspace-panel-77bDbprs.js +1 -0
  47. package/dist/web/client/bundle-budget.json +6 -6
  48. package/dist/web/launcher.mjs +10 -1
  49. package/dist/web/server/{_tanstack-start-manifest_v-po4woX6g-AUGCOEZ2.js → _tanstack-start-manifest_v-0L7fqnH4-KMVGUFE4.js} +25 -24
  50. package/dist/web/server/{agent-activity-CS2rbF_C-A3R26CYH.js → agent-activity-BuEE6iVw-CDZLK4D2.js} +4 -4
  51. package/dist/web/server/{artifacts-panel-8GGUCtOd-X5TNKTY2.js → artifacts-panel-D3ySO--V-XSL53CXL.js} +18 -18
  52. package/dist/web/server/{chat-command-palette-Dgl5tqWn-72LLEWUD.js → chat-command-palette-kAbXhWVg-TJWXH2WW.js} +9 -9
  53. package/dist/web/server/{chunk-O4OTWWPF.js → chunk-2DDWXTVG.js} +5 -5
  54. package/dist/web/server/{chunk-MIW4LJTV.js → chunk-2JHTYWD5.js} +15 -23
  55. package/dist/web/server/{chunk-7MDZVLIY.js → chunk-3TIMGWWI.js} +1 -2
  56. package/dist/web/server/{chunk-AGFRJQZ7.js → chunk-4WBFCB4O.js} +257 -257
  57. package/dist/web/server/{chunk-P6UMR32I.js → chunk-5UCAJBAH.js} +4 -4
  58. package/dist/web/server/{chunk-BXWAUTTH.js → chunk-D27LRYVT.js} +42 -42
  59. package/dist/web/server/{chunk-YXXRP3NS.js → chunk-DLUZFOG3.js} +5 -5
  60. package/dist/web/server/{chunk-K3BXQG3N.js → chunk-EBG3XFGQ.js} +60 -60
  61. package/dist/web/server/{chunk-2ATMSG7U.js → chunk-EJEPDVK6.js} +3 -3
  62. package/dist/web/server/{chunk-IJPCV6DH.js → chunk-FYDQK6UX.js} +1 -1
  63. package/dist/web/server/{chunk-WKV2Z4KO.js → chunk-HF7DG7PC.js} +74 -74
  64. package/dist/web/server/{chunk-WYL2DW5R.js → chunk-JTCCQZLN.js} +2 -2
  65. package/dist/web/server/{chunk-UAPNEWCA.js → chunk-KP2PNDGL.js} +6 -6
  66. package/dist/web/server/chunk-M5RSPNYN.js +22 -0
  67. package/dist/web/server/{chunk-7SR6WDM2.js → chunk-MNBGB2SP.js} +2 -2
  68. package/dist/web/server/{chunk-HSJMLO36.js → chunk-MNPHMZU7.js} +3 -3
  69. package/dist/web/server/{chunk-JQDLJ7KI.js → chunk-NGCQJ33Y.js} +1134 -1134
  70. package/dist/web/server/{chunk-7SD2ZSEA.js → chunk-NIDBN7BQ.js} +1 -1
  71. package/dist/web/server/{chunk-ZJFA4F5X.js → chunk-NIZBFVJF.js} +2 -2
  72. package/dist/web/server/{chunk-P7H2OPKF.js → chunk-NJ4QEZHK.js} +11 -4
  73. package/dist/web/server/{chunk-WM4PUT6M.js → chunk-NNKJTKOQ.js} +234 -234
  74. package/dist/web/server/{chunk-N6NOTURM.js → chunk-NWDI3OWB.js} +4 -4
  75. package/dist/web/server/{chunk-ABBWBBSS.js → chunk-O3HDELZ2.js} +74826 -74825
  76. package/dist/web/server/{chunk-GGT2ZKDB.js → chunk-PLYZ7P2Y.js} +11 -155
  77. package/dist/web/server/chunk-PTCKOR23.js +39 -0
  78. package/dist/web/server/{chunk-RNOJACWQ.js → chunk-QFRCJWQQ.js} +7 -7
  79. package/dist/web/server/{chunk-NXJ32VFR.js → chunk-QIULBRTU.js} +13 -13
  80. package/dist/web/server/{chunk-XKKXXG6N.js → chunk-RIP3PBWT.js} +3 -3
  81. package/dist/web/server/{chunk-YKVGQBZA.js → chunk-S5LFXXDY.js} +625 -622
  82. package/dist/web/server/{chunk-XLNCWZMZ.js → chunk-UCUFC553.js} +3 -1
  83. package/dist/web/server/{chunk-KOUEJ3NU.js → chunk-UL2725KQ.js} +3 -3
  84. package/dist/web/server/{chunk-HFQTI7AX.js → chunk-VPKX7QRU.js} +3 -3
  85. package/dist/web/server/{chunk-LZ4Q5KUJ.js → chunk-WNCAL4HN.js} +133 -133
  86. package/dist/web/server/{chunk-C5X6G26O.js → chunk-XIB6XNUX.js} +436 -436
  87. package/dist/web/server/{chunk-JUROEEWM.js → chunk-YGYOBX7G.js} +82 -4
  88. package/dist/web/server/{chunk-WILCIZYU.js → chunk-ZIFSJ3HQ.js} +626 -626
  89. package/dist/web/server/fleet-message-queue-D_w8lSeY-T3HB7HVQ.js +152 -0
  90. package/dist/web/server/{fleet-pi-tool-renderer-umKunT3K-O4GBH35V.js → fleet-pi-tool-renderer-qwc-qZFq-4U556N5Q.js} +12 -12
  91. package/dist/web/server/{fleet-reasoning-panel-BxC2COxi-GPLMQSTT.js → fleet-reasoning-panel-DG_vuvv0-NCZWEEIT.js} +26 -26
  92. package/dist/web/server/{fleet-subagent-list-CpSYzCIq-JDH2LHSS.js → fleet-subagent-list-BGb0PjhF-2X67FMUV.js} +1 -1
  93. package/dist/web/server/{fleet-tool-timeline-IB36_PB2-XJENTO6I.js → fleet-tool-timeline-D6yM4ZMz-ZSFVRRRI.js} +1 -1
  94. package/dist/web/server/{fork-picker-dialog-DlINz9UQ-UWIXFDJX.js → fork-picker-dialog-Ds6Tgtu3-DIBWN7MV.js} +5 -5
  95. package/dist/web/server/{model-selector-list-OYnzNbyu-HBGCNF2L.js → model-selector-list-DxeGZoD2-P6S6FSJH.js} +9 -9
  96. package/dist/web/server/{openui-renderer-Cj7kfqyL-EKJ6JTTQ.js → openui-renderer-MKFv6LlH-MDRSVFEY.js} +11 -11
  97. package/dist/web/server/{prompt-suggestions-D4AEEY7K-RZSP7PWV.js → prompt-suggestions-BOItmGnD-YQA7RHLG.js} +2 -2
  98. package/dist/web/server/{repl-panel-D5KsoJik-BQKO53JO.js → repl-panel-CuyF8wt5-CHDT2Q3N.js} +2 -2
  99. package/dist/web/server/{router-Ci1wxI7I-E2AYMNON.js → router-Dg72SESP-PCWKLFRG.js} +1239 -470
  100. package/dist/web/server/{routes-CRpm9-Sa-IYK6MUJO.js → routes-BGrVtPYF-SURPAJN6.js} +5781 -5588
  101. package/dist/web/server/server.js +2 -2
  102. package/dist/web/server/{settings-dialog-BvkgNflv-GPJ6COQO.js → settings-dialog-CK0FJlTg-HZRBAXDZ.js} +1577 -1264
  103. package/dist/web/server/{subagent-chat-panel-CMuvW9Sd-M5TEEGQW.js → subagent-chat-panel-gzamnTgK-PQ2TLLJF.js} +21 -21
  104. package/dist/web/server/{subagents-panel-DgfB6_Yy-4INEPE3Y.js → subagents-panel-Berjd7HJ-EI5ZKC6V.js} +20 -20
  105. package/dist/web/server/{workspace-panel-bpwj-Veu-Q2CEJMN4.js → workspace-panel-CBBa_3UO-B4PPFPMA.js} +46 -21
  106. package/package.json +1 -1
  107. package/dist/web/client/assets/action-swap-roll-BB8DFMuf.js +0 -1
  108. package/dist/web/client/assets/agent-activity-CwMDU7aP.js +0 -1
  109. package/dist/web/client/assets/agent-disclosure-B8SnhQXL.js +0 -1
  110. package/dist/web/client/assets/analytics-stub-Cas1He0w.js +0 -1
  111. package/dist/web/client/assets/button-BR2WWrFo.js +0 -1
  112. package/dist/web/client/assets/card-BKl76a3R.js +0 -1
  113. package/dist/web/client/assets/command-DPfiaYUL.js +0 -1
  114. package/dist/web/client/assets/dialog-BEZuZhzk.js +0 -1
  115. package/dist/web/client/assets/fleet-message-queue-DUz6Hfrf.js +0 -1
  116. package/dist/web/client/assets/fleet-reasoning-panel-CbkO7u-v.js +0 -1
  117. package/dist/web/client/assets/globals-B_I1Eq1u.css +0 -2
  118. package/dist/web/client/assets/horizontal-resize-qK6eRhIG.js +0 -1
  119. package/dist/web/client/assets/index-C1zOjrMK.js +0 -12
  120. package/dist/web/client/assets/input-group-BFDsCVS9.js +0 -1
  121. package/dist/web/client/assets/ipython-tool-ldJ9F1Cw.js +0 -3
  122. package/dist/web/client/assets/openui-renderer-J3dhPpL4.js +0 -378
  123. package/dist/web/client/assets/prompt-input-qPIXZ-Rb.js +0 -1
  124. package/dist/web/client/assets/provider-catalog-D8G66gwc.js +0 -1
  125. package/dist/web/client/assets/provider-label-Dpr7djG9.js +0 -1
  126. package/dist/web/client/assets/routes-vNkVToAF.js +0 -16
  127. package/dist/web/client/assets/settings-dialog-B-v4me3Y.js +0 -1
  128. package/dist/web/client/assets/surfaces-DI-U-_2a.js +0 -1
  129. package/dist/web/client/assets/virtualized-turn-list-DMJENRY0.js +0 -6
  130. package/dist/web/client/assets/workspace-panel-G6yMpKJ8.js +0 -1
  131. package/dist/web/server/chunk-QK4CHLVV.js +0 -17
  132. package/dist/web/server/fleet-message-queue-j0DCU5Xy-5HKBHMPV.js +0 -75
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DwxZHm0M.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{t as i}from"./utils-Eg7xtNmV.js";import{$ as a,G as o,H as s,J as c,Q as l,U as u,z as d}from"./layout-gyLzPvVv.js";import{c as f,d as p,h as m,l as h,m as g,p as _,r as v,s as y,u as b}from"./ease-u56MhKYS.js";import{n as x,t as S}from"./use-reduced-motion-eORd7fqW.js";import{t as C}from"./createLucideIcon-DwxZHm0M.js";import{o as w}from"./citations-BPv8HIpf.js";import{t as T}from"./check-JjHKAZas.js";import{t as E}from"./chevron-down-BEVGmnSb.js";import{t as D}from"./loader-circle-DjfHXUPB.js";import{t as ee}from"./plus-DXN1Bg_z.js";import{t as te}from"./square-Bhn8gjr0.js";import{t as O}from"./x-CsRC_tCI.js";import{i as k}from"./surfaces-BhAXz9So.js";function ne(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=c(i,a,o);return t?s(r):s}function A(e,t,n={}){let r=e.get(),i=null,s=r,c,l=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,u=()=>{i&&=(i.stop(),null),e.animation=void 0},f=()=>{let t=M(e.get()),r=M(s);if(t===r){u();return}let a=i?i.getGeneratorVelocity():e.getVelocity();u(),i=new o({keyframes:[t,r],velocity:a,type:`spring`,restDelta:.001,restSpeed:.01,...n,onUpdate:c})},p=()=>{f(),e.animation=i??void 0,e.events.animationStart?.notify(),i?.then(()=>{e.animation=void 0,e.events.animationComplete?.notify()})};if(e.attach((e,t)=>{s=e,c=e=>t(j(e,l)),a.postRender(p)},u),d(t)){let r=n.skipInitialAnimation===!0,i=t.on(`change`,t=>{r?(r=!1,e.jump(j(t,l),!1)):e.set(j(t,l))}),a=e.on(`destroy`,i);return()=>{i(),a()}}return u}function j(e,t){return t?e+t:e}function M(e){return typeof e==`number`?e:parseFloat(e)}var N=e(t(),1);function P(e){let t=m(()=>u(e)),{isStatic:n}=(0,N.useContext)(_);if(n){let[,n]=(0,N.useState)(e);(0,N.useEffect)(()=>t.on(`change`,n),[])}return t}function F(e,t){let n=P(t()),r=()=>n.set(t());return r(),g(()=>{let t=()=>a.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),l(r)}}),n}function I(e){s.current=[],e();let t=F(s.current,e);return s.current=void 0,t}function L(e,t,n,r){if(typeof e==`function`)return I(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return z(e,t,n,r);let i=typeof t==`function`?t:ne(t,n,r),a=Array.isArray(e)?R(e,i):R([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function R(e,t){let n=m(()=>[]);return F(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function z(e,t,n,r){let i=m(()=>Object.keys(n)),a=m(()=>({}));for(let o of i)a[o]=L(e,t,n[o],r);return a}function B(e,t={}){let{isStatic:n}=(0,N.useContext)(_),r=()=>d(e)?e.get():e;if(n)return L(r);let i=P(r());return(0,N.useInsertionEffect)(()=>A(i,e,t),[i,JSON.stringify(t)]),i}function V(e,t={}){return B(e,{type:`spring`,...t})}var re=C(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),H=r(),U={duration:0},W={type:`spring`,duration:.4,bounce:.3},G={hidden:{},show:{transition:{staggerChildren:.035,delayChildren:.05}}},ie={hidden:{opacity:0,y:-6,filter:`blur(3px)`},show:{opacity:1,y:0,filter:`blur(0px)`}},K=(0,N.createContext)(null);function q(e){let t=(0,N.useContext)(K);if(!t)throw Error(`${e} must be used within <AnimatedSelect>`);return t}function ae({value:e,defaultValue:t,onValueChange:n,disabled:r=!1,className:a,children:o}){let s=S()??!1,c=(0,N.useId)(),l=(0,N.useRef)(null),[u,d]=(0,N.useState)(!1),[f,p]=(0,N.useState)(t),[m,h]=(0,N.useState)(new Map),[g,_]=(0,N.useState)(`bottom`),v=e!==void 0,y=v?e:f,b=(0,N.useCallback)(e=>{v||p(e),n?.(e),d(!1)},[v,n]),x=(0,N.useCallback)((e,t)=>{h(n=>n.get(e)===t?n:new Map(n).set(e,t))},[]),C=(0,N.useCallback)(e=>{h(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]);(0,N.useEffect)(()=>{if(!u)return;let e=e=>e.key===`Escape`&&d(!1),t=e=>{l.current&&!l.current.contains(e.target)&&d(!1)};return window.addEventListener(`keydown`,e),window.addEventListener(`pointerdown`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,t)}},[u]);let w=(0,N.useMemo)(()=>({value:y,open:u,setOpen:d,select:b,register:x,unregister:C,labelFor:e=>e===void 0?void 0:m.get(e),reduce:s,triggerId:`${c}-trigger`,listId:`${c}-list`,disabled:r,placement:g,setPlacement:_}),[y,u,b,x,C,m,s,c,r,g]);return(0,H.jsx)(K.Provider,{value:w,children:(0,H.jsx)(`div`,{ref:l,className:i(`relative`,a),children:o})})}function oe({className:e,children:t}){let n=q(`AnimatedSelectTrigger`),r=n.placement===`top`,a=n.open?[0,0,12]:[12,0,12],o=n.reduce?{duration:0}:n.open?{duration:.6,times:[0,.4,1],ease:v}:{duration:.42,times:[0,.5,1],ease:v};return(0,H.jsxs)(p.button,{type:`button`,id:n.triggerId,disabled:n.disabled,"aria-haspopup":`listbox`,"aria-expanded":n.open,"aria-controls":n.listId,onClick:()=>n.setOpen(!n.open),initial:!1,animate:{borderTopLeftRadius:r?a:12,borderTopRightRadius:r?a:12,borderBottomLeftRadius:r?12:a,borderBottomRightRadius:r?12:a},transition:{borderTopLeftRadius:r?o:U,borderTopRightRadius:r?o:U,borderBottomLeftRadius:r?U:o,borderBottomRightRadius:r?U:o},className:i(`relative z-10 flex w-full items-center justify-between gap-2 rounded-xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors`,`hover:border-(--color-border-strong) focus-visible:ring-2 focus-visible:ring-foreground/20`,`disabled:pointer-events-none disabled:opacity-50`,e),children:[t,(0,H.jsx)(p.span,{"aria-hidden":!0,animate:{rotate:n.open?180:0},transition:n.reduce?{duration:0}:W,className:`text-muted-foreground`,children:(0,H.jsx)(E,{className:`size-4`})})]})}function se({className:e,children:t}){let n=q(`AnimatedSelectContent`),r=(0,N.useRef)(null),[a,o]=(0,N.useState)(0),s=n.open,{setPlacement:c}=n;(0,N.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>o(e.offsetHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()}),(0,N.useLayoutEffect)(()=>{if(!s)return;let e=document.getElementById(n.triggerId),t=r.current;if(!e||!t)return;let i=e.getBoundingClientRect(),a=t.offsetHeight,o=window.innerHeight-i.bottom,l=i.top;c(o<a+16&&l>o?`top`:`bottom`)},[s,n.triggerId,c]);let l=n.placement===`top`,u=s?8:0,d=s?12:0,f=s?{type:`spring`,duration:.6,bounce:.5,delay:.12}:{type:`spring`,duration:.3,bounce:.1},m=s?{duration:.3,ease:v,delay:.14}:{duration:.16,ease:v};return(0,H.jsx)(p.div,{id:n.listId,role:`listbox`,"aria-labelledby":n.triggerId,"aria-hidden":!s,inert:!s,initial:!1,animate:n.reduce?{opacity:+!!s,height:s?a:0}:{opacity:+!!s,height:s?a:0,marginTop:l?0:u,marginBottom:l?u:0,borderTopLeftRadius:l?12:d,borderTopRightRadius:l?12:d,borderBottomLeftRadius:l?d:12,borderBottomRightRadius:l?d:12},transition:n.reduce?{duration:.12}:{opacity:s?{duration:.18}:{duration:.16,delay:.12},height:s?{type:`spring`,duration:.42,bounce:.14}:{duration:.26,ease:v,delay:.14},marginTop:l?U:f,marginBottom:l?f:U,borderTopLeftRadius:l?U:m,borderTopRightRadius:l?U:m,borderBottomLeftRadius:l?m:U,borderBottomRightRadius:l?m:U},style:{transformOrigin:l?`bottom`:`top`,overflow:`hidden`,pointerEvents:s?`auto`:`none`},className:i(`absolute left-0 right-0 z-20 rounded-xl border border-border bg-background shadow-lg`,l?`bottom-full`:`top-full`,e),children:(0,H.jsx)(p.div,{ref:r,variants:n.reduce?void 0:G,initial:!1,animate:s?`show`:`hidden`,className:`p-1`,children:t})})}function ce({value:e,disabled:t=!1,className:n,children:r}){let a=q(`AnimatedSelectItem`),o=a.value===e,s=typeof r==`string`?r:e;return(0,N.useLayoutEffect)(()=>(a.register(e,s),()=>a.unregister(e)),[a.register,a.unregister,e,s]),(0,H.jsx)(p.li,{variants:a.reduce?void 0:ie,children:(0,H.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":o,disabled:t,onClick:()=>a.select(e),className:i(`flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm outline-none transition-colors`,o?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:bg-muted`,`disabled:pointer-events-none disabled:opacity-50`,n),children:[r,o?(0,H.jsx)(T,{className:`size-3.5 shrink-0`}):null]})})}var J={primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`border border-border bg-card text-foreground hover:border-border`,ghost:`text-muted-foreground hover:text-foreground hover:bg-primary/5`,outline:`border border-border bg-transparent text-foreground hover:bg-primary/5`},Y={sm:`h-8 px-3 text-xs gap-1.5 rounded-full`,md:`h-10 px-5 text-sm gap-2 rounded-full`,lg:`h-12 px-6 text-base gap-2 rounded-full`,icon:`h-8 w-8 rounded-lg`},X=(0,N.forwardRef)(function({variant:e=`primary`,size:t=`md`,pressScale:n=.93,ripple:r=!1,className:a,children:o,onPointerDown:s,...c},l){let u=S(),d=w(),[f,m]=(0,N.useState)([]),g=(0,N.useRef)(0),_=(0,N.useCallback)(e=>{if(r&&!u){let t=e.currentTarget.getBoundingClientRect(),n=Math.max(t.width,t.height)*2,r=g.current++;m(i=>[...i,{id:r,x:e.clientX-t.left,y:e.clientY-t.top,size:n}])}s?.(e)},[r,u,s]);return(0,H.jsxs)(p.button,{ref:l,type:`button`,whileTap:u?void 0:{scale:n},whileHover:u||!d?void 0:{scale:1.02},transition:h,onPointerDown:_,className:i(`inline-flex items-center justify-center font-medium select-none`,`transition-colors`,`disabled:pointer-events-none disabled:opacity-50`,r&&`relative overflow-hidden`,J[e],Y[t],a),...c,children:[(0,H.jsx)(`span`,{className:i(`pointer-events-none absolute inset-0 overflow-hidden rounded-[inherit]`,!r&&`hidden`),children:(0,H.jsx)(x,{children:r&&!u?f.map(e=>(0,H.jsx)(p.span,{className:`absolute rounded-full bg-current`,style:{left:e.x,top:e.y,width:e.size,height:e.size,x:`-50%`,y:`-50%`},initial:{scale:.05,opacity:.3},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:1.6,ease:v},onAnimationComplete:()=>m(t=>t.filter(t=>t.id!==e.id))},e.id)):null})}),o]})});(0,N.forwardRef)(function({variant:e=`primary`,size:t=`md`,pressScale:n=.93,className:r,children:a,...o},s){let c=S(),l=w();return(0,H.jsx)(p.a,{ref:s,whileTap:c?void 0:{scale:n},whileHover:c||!l?void 0:{scale:1.02},transition:h,className:i(`inline-flex items-center justify-center font-medium select-none`,`transition-colors`,J[e],Y[t],r),...o,children:a})});function le({children:e,strength:t=.35,className:n}){let r=(0,N.useRef)(null),a=S(),o=w(),s=!a&&o,c=P(0),l=P(0),u=V(c,y),d=V(l,y);return(0,H.jsx)(p.div,{ref:r,onMouseMove:e=>{let n=r.current;if(!n||!s)return;let i=n.getBoundingClientRect();c.set((e.clientX-i.left-i.width/2)*t),l.set((e.clientY-i.top-i.height/2)*t)},onMouseLeave:()=>{c.set(0),l.set(0)},style:{x:u,y:d},className:i(`inline-block`,n),children:e})}(0,N.forwardRef)(function({strength:e=.25,magneticClassName:t,children:n,...r},i){return(0,H.jsx)(le,{strength:e,className:t,children:(0,H.jsx)(X,{ref:i,...r,children:n})})});var ue=.025,Z=`blur(6px)`,de={initial:{opacity:0,y:`105%`,filter:Z},animate:(e=0)=>({opacity:1,y:`0%`,filter:`blur(0px)`,transition:{...b,delay:e}}),exit:(e=0)=>({opacity:0,y:`-105%`,filter:Z,transition:{duration:.16,ease:v,delay:e*.5}})},fe={initial:{opacity:0,width:0,scale:.7,filter:Z},animate:{opacity:1,width:`1.5rem`,scale:1,filter:`blur(0px)`,transition:b},exit:{opacity:0,width:0,scale:.7,filter:Z,transition:{duration:.16,ease:v}}};function Q({keyId:e,children:t}){let n=S();return(0,H.jsx)(p.span,{variants:fe,initial:n?{opacity:0}:`initial`,animate:n?{opacity:1}:`animate`,exit:n?{opacity:0}:`exit`,transition:n?{duration:.15}:void 0,className:`inline-grid shrink-0 place-items-center overflow-hidden`,children:t},e)}function pe({value:e,children:t}){let n=S(),r=(0,N.useRef)(null),[i,a]=(0,N.useState)(),o=typeof t==`string`?t:null,s=o!==null&&!n;return(0,N.useLayoutEffect)(()=>{let e=r.current?.offsetWidth;e&&a(t=>t===e?t:e)}),(0,H.jsxs)(p.span,{initial:!1,layout:`size`,style:{width:i},transition:n?{duration:0}:b,className:`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,children:[(0,H.jsx)(`span`,{ref:r,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:s?o.split(``).map((e,t)=>(0,H.jsx)(`span`,{className:`inline-block whitespace-pre`,children:e},t)):t}),s?(0,H.jsx)(`span`,{className:`sr-only`,children:o}):null,(0,H.jsx)(x,{initial:!1,children:s?(0,H.jsx)(p.span,{"aria-hidden":!0,initial:`initial`,animate:`animate`,exit:`exit`,className:`absolute left-0 top-0 inline-block whitespace-pre`,children:o.split(``).map((e,t)=>(0,H.jsx)(p.span,{custom:t*ue,variants:de,className:`inline-block whitespace-pre`,children:e},t))},`cascade-${e}`):(0,H.jsx)(p.span,{initial:n?{opacity:0}:{opacity:0,y:14,filter:Z},animate:n?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:n?{opacity:0}:{opacity:0,y:-14,filter:Z},transition:n?{duration:.15}:b,className:`absolute left-0 top-0 inline-block`,children:t},`text-${e}`)})]})}(0,N.forwardRef)(function({state:e=`idle`,children:t,loadingText:n=`Loading`,successText:r=`Done`,errorText:i=`Try again`,icon:a,disabled:o,...s},c){let l=e===`loading`,u=e===`loading`?n:e===`success`?r:e===`error`?i:t,d=typeof u==`string`?`${e}-${u}`:e;return(0,H.jsx)(X,{ref:c,disabled:o||l,"aria-busy":l,whileHover:void 0,...s,children:(0,H.jsxs)(`span`,{"aria-live":`polite`,className:`relative inline-flex items-center justify-center overflow-hidden`,children:[(0,H.jsxs)(x,{initial:!1,children:[e===`loading`?(0,H.jsx)(Q,{keyId:`loading-icon`,children:(0,H.jsx)(D,{className:`size-4 animate-spin`})}):null,e===`success`?(0,H.jsx)(Q,{keyId:`success-icon`,children:(0,H.jsx)(T,{className:`size-4`})}):null,e===`error`?(0,H.jsx)(Q,{keyId:`error-icon`,children:(0,H.jsx)(O,{className:`size-4`})}):null]}),(0,H.jsx)(pe,{value:d,children:u}),(0,H.jsx)(x,{initial:!1,children:e===`idle`&&a?(0,H.jsx)(Q,{keyId:`idle-icon`,children:a}):null})]})})});function me(e,t){return e?.trigger.left===t.trigger.left&&e.trigger.top===t.trigger.top&&e.trigger.width===t.trigger.width&&e.trigger.height===t.trigger.height&&e.content.width===t.content.width&&e.content.height===t.content.height}function he(e,t,n){let[r,i]=(0,N.useState)(null),a=(0,N.useCallback)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let a=n.getBoundingClientRect(),o={trigger:{left:a.left,top:a.top,width:a.width,height:a.height},content:{width:r.offsetWidth,height:r.offsetHeight}};i(e=>me(e,o)?e:o)},[t,e]);return(0,N.useLayoutEffect)(()=>{if(a(),!n)return;let r=e.current,i=t.current,o=new ResizeObserver(a);return r&&o.observe(r),i&&o.observe(i),window.addEventListener(`scroll`,a,!0),window.addEventListener(`resize`,a),()=>{o.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[n,t,e,a]),r}function ge(){return()=>{}}function _e(){return!0}function ve(){return!1}function ye(){return(0,N.useSyncExternalStore)(ge,_e,ve)}var be=e(n(),1),xe=(0,N.createContext)(null);function $(e){let t=(0,N.useContext)(xe);if(!t)throw Error(`${e} must be used within <MorphPopover>`);return t}function Se({children:e,open:t,defaultOpen:n=!1,onOpenChange:r,className:a}){let o=(0,N.useId)(),s=(0,N.useRef)(null),c=(0,N.useRef)(null),l=(0,N.useRef)(null),[u,d]=(0,N.useState)(n),f=t!==void 0,p=f?t:u,m=(0,N.useCallback)(e=>{f||d(e),r?.(e)},[f,r]),h=(0,N.useCallback)(()=>m(!p),[m,p]),g=(0,N.useEffectEvent)(m);(0,N.useEffect)(()=>{if(!p)return;let e=e=>e.key===`Escape`&&g(!1),t=e=>{let t=e.target;s.current&&!s.current.contains(t)&&!l.current?.contains(t)&&g(!1)};return window.addEventListener(`keydown`,e),window.addEventListener(`pointerdown`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,t)}},[p]);let _=(0,N.useMemo)(()=>({open:p,setOpen:m,toggle:h,triggerId:`${o}-trigger`,contentId:`${o}-content`,triggerRef:c,contentRef:l}),[p,m,h,o]);return(0,H.jsx)(xe.Provider,{value:_,children:(0,H.jsx)(`div`,{ref:s,className:i(`relative inline-flex`,a),children:e})})}function Ce(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n&&typeof n==`object`&&(n.current=t)}}function we({children:e}){let t=$(`MorphPopoverTrigger`);if(!(0,N.isValidElement)(e))return e;let n=e,r=n.props.onClick,i=n.props.ref;return(0,N.cloneElement)(n,{id:t.triggerId,ref:Ce(i,e=>{t.triggerRef.current=e}),onClick:e=>{r?.(e),t.toggle()},"aria-haspopup":`dialog`,"aria-expanded":t.open,"aria-controls":t.open?t.contentId:void 0})}var Te=(e,t)=>`${e===`bottom`?`top`:`bottom`} ${t===`end`?`right`:`left`}`;function Ee(e,t,n){return`inset(${e===`bottom`?`0%`:`92%`} ${t===`end`?`0%`:`92%`} ${e===`bottom`?`92%`:`0%`} ${t===`end`?`92%`:`0%`} round ${n}px)`}var De=e=>`inset(0% 0% 0% 0% round ${e}px)`,Oe={duration:.32,ease:v};function ke({children:e,side:t=`bottom`,align:n=`end`,sideOffset:r=8,radius:a=16,className:o}){let s=$(`MorphPopoverContent`),c=S()??!1,l=ye(),u=he(s.triggerRef,s.contentRef,l&&s.open),d=u?n===`end`?u.trigger.left+u.trigger.width-u.content.width:u.trigger.left:0,m=u?t===`bottom`?u.trigger.top+u.trigger.height+r:u.trigger.top-u.content.height-r:0,h=c?void 0:{hidden:{opacity:0,scale:.96,transition:f},show:{opacity:1,scale:1,transition:f}},g=c?void 0:{hidden:{clipPath:Ee(t,n,a),transition:Oe},show:{clipPath:De(a),transition:Oe}};return l?(0,be.createPortal)((0,H.jsx)(x,{children:s.open?(0,H.jsx)(p.div,{"data-morph-popover-portal":``,variants:h,initial:c?{opacity:0}:`hidden`,animate:c?{opacity:1}:`show`,exit:c?{opacity:0}:`hidden`,transition:c?{duration:.12}:void 0,style:{left:d,top:m,visibility:u?`visible`:`hidden`,transformOrigin:Te(t,n)},className:`fixed z-[9999] [filter:drop-shadow(0_10px_18px_rgba(0,0,0,0.14))]`,children:(0,H.jsx)(p.div,{ref:s.contentRef,id:s.contentId,role:`dialog`,"aria-labelledby":s.triggerId,variants:g,style:{borderRadius:a},className:i(`overflow-hidden`,k,o),children:e})}):null}),document.body):null}function Ae({value:e,defaultValue:t=``,onValueChange:n,models:r=[],model:a,defaultModel:o,onModelChange:s,actions:c=[],onAction:l,onSubmit:u,loading:d=!1,submitWhileLoading:f=!1,onStop:m,minRows:h=2,maxRows:g=8,leadingAction:_,className:v,disabled:y,placeholder:C=`Ask the agent to do something…`,"aria-label":w=`Prompt`,onKeyDown:T,...E}){let D=S()??!1,O=(0,N.useRef)(null),k=(0,N.useRef)(null),[ne,A]=(0,N.useState)(t),[j,M]=(0,N.useState)(o??r[0]?.value),[P,F]=(0,N.useState)(!1),I=e??ne,L=a??j,R=r.find(e=>e.value===L),z=!!I.trim()&&!y&&(!d||f),B=(0,N.useCallback)(()=>{let e=O.current,t=k.current;if(!e||!t||e.value!==I)return;let n=`${Math.min(Math.max(t.scrollHeight,h*24),g*24)}px`;e.style.height!==n&&(e.style.height=n)},[I,g,h]);(0,N.useLayoutEffect)(()=>{B()},[B]);let V=(0,N.useRef)(B);(0,N.useEffect)(()=>{V.current=B}),(0,N.useEffect)(()=>{let e=O.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>V.current());return t.observe(e),()=>t.disconnect()},[]);let U=t=>{e===void 0&&A(t),n?.(t)},W=e=>{a===void 0&&M(e),s?.(e)},G=t=>{t?.preventDefault();let n=I.trim();!n||y||d&&!f||(u?.(n,L),e===void 0&&A(``),O.current?.focus({preventScroll:!0}))},ie=e=>{T?.(e),!(e.defaultPrevented||e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing)&&(e.preventDefault(),G())};return(0,H.jsxs)(`form`,{onSubmit:G,className:i(`relative w-full rounded-[24px] border border-border/70 bg-sidebar p-2 text-[color:var(--foreground)] shadow-sm transition-[border-color,box-shadow] focus-within:border-foreground/25 focus-within:ring-1 focus-within:ring-ring/20`,y&&`opacity-60`,v),children:[(0,H.jsx)(`div`,{ref:k,"aria-hidden":`true`,className:`pointer-events-none invisible absolute inset-x-2 top-0 whitespace-pre-wrap px-2 text-sm leading-6 [overflow-wrap:break-word]`,children:`${I}\u200b`}),(0,H.jsx)(`textarea`,{ref:O,value:I,disabled:y,placeholder:C,"aria-label":w,rows:h,...E,onChange:e=>U(e.target.value),onKeyDown:ie,className:`scrollbar-hide block w-full resize-none overflow-y-auto bg-transparent px-2 pt-1.5 text-sm leading-6 text-foreground outline-none placeholder:text-foreground/55`}),(0,H.jsxs)(`div`,{className:`mt-1 flex min-h-8 items-center gap-1`,children:[c.length?(0,H.jsxs)(Se,{open:P,onOpenChange:F,children:[(0,H.jsx)(we,{children:(0,H.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,disabled:y||d,"aria-label":`Add to prompt`,className:`size-8 rounded-full text-foreground/70 hover:text-foreground`,children:(0,H.jsx)(p.span,{"aria-hidden":`true`,animate:{rotate:P?45:0},transition:D?{duration:0}:b,children:(0,H.jsx)(ee,{className:`size-4`})})})}),(0,H.jsx)(ke,{side:`top`,align:`start`,sideOffset:8,radius:12,className:`w-56 p-1.5`,children:c.map(e=>(0,H.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>{l?.(e.value),F(!1)},className:`flex w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-50`,children:[e.icon?(0,H.jsx)(`span`,{className:`mt-0.5 grid size-5 shrink-0 place-items-center text-foreground/70 [&_svg]:size-4`,children:e.icon}):null,(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsx)(`span`,{className:`block text-sm text-foreground`,children:e.label}),e.description?(0,H.jsx)(`span`,{className:`mt-0.5 block text-xs leading-4 text-foreground/60`,children:e.description}):null]})]},e.value))})]}):null,_,r.length?(0,H.jsxs)(ae,{value:L,onValueChange:W,disabled:y||d,className:`min-w-0`,children:[(0,H.jsx)(oe,{className:`h-8 w-auto max-w-52 rounded-xl border-0 bg-transparent px-2 py-0 text-xs hover:bg-muted focus-visible:ring-2`,children:(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[R?.icon?(0,H.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-foreground/70 [&_svg]:size-3.5`,children:R.icon}):null,(0,H.jsx)(`span`,{className:`truncate text-foreground/70`,children:R?.label??`Choose model`})]})}),(0,H.jsx)(se,{className:`right-auto w-52 shadow-none`,children:r.map(e=>(0,H.jsx)(ce,{value:e.value,disabled:e.disabled,className:`py-2`,children:(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.icon?(0,H.jsx)(`span`,{className:`grid size-5 shrink-0 place-items-center text-muted-foreground [&_svg]:size-4`,children:e.icon}):null,(0,H.jsx)(`span`,{className:`min-w-0 truncate text-sm text-foreground`,children:e.label})]})},e.value))})]}):null,d&&m?(0,H.jsx)(X,{type:`button`,size:`icon`,"aria-label":`Stop generating`,onClick:m,className:`ml-auto size-8 rounded-full`,children:(0,H.jsx)(te,{className:`size-3 fill-current`})}):null,!d||z?(0,H.jsx)(X,{type:`submit`,size:`icon`,disabled:!z,"aria-label":d?`Steer current run`:`Send prompt`,className:i(`size-8 rounded-full`,!d&&`ml-auto`),children:(0,H.jsx)(x,{initial:!1,mode:`popLayout`,children:(0,H.jsx)(p.span,{initial:D?{opacity:1}:{opacity:0,y:3,scale:.8},animate:{opacity:1,y:0,scale:1},exit:D?{opacity:0}:{opacity:0,y:-3,scale:.8},transition:D?{duration:0}:b,className:`grid place-items-center`,children:(0,H.jsx)(re,{className:`size-4`})},`send`)})}):null]})]})}export{ye as a,re as c,we as i,Se as n,he as o,ke as r,X as s,Ae as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-Eg7xtNmV.js";import{s as n}from"./surfaces-DI-U-_2a.js";var r=e();function i({suggestions:e,selectedSuggestion:i,cycle:a,onSuggestion:o,variant:s=`pills`,className:c,...l}){let u=s===`list`;return(0,r.jsx)(`div`,{"data-slot":`suggestions`,className:t(u?`flex w-full max-w-sm flex-col gap-2`:`flex w-full max-w-xl flex-wrap justify-center gap-1`,c),...l,children:e.map((e,a)=>(0,r.jsx)(`button`,{type:`button`,"aria-pressed":i===e,onClick:()=>o(e),className:t(n,`fade-in slide-in-from-bottom-2 animate-in fill-mode-both flex cursor-pointer items-center text-[0.8125rem] text-foreground/80 transition-[color,transform] duration-300 hover:-translate-y-px hover:text-foreground focus-visible:text-foreground active:scale-[0.96] motion-reduce:animate-none`,u?`w-full rounded-2xl px-4 py-2.5 text-start`:`rounded-full px-4 py-2`,i===e&&`!bg-foreground !text-background hover:!text-background focus-visible:!text-background`),style:{animationDelay:`${a*70}ms`},children:e},e))},a)}export{i as PromptSuggestions};
1
+ import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-Eg7xtNmV.js";import{c as n}from"./surfaces-BhAXz9So.js";var r=e();function i({suggestions:e,selectedSuggestion:i,cycle:a,onSuggestion:o,variant:s=`pills`,className:c,...l}){let u=s===`list`;return(0,r.jsx)(`div`,{"data-slot":`suggestions`,className:t(u?`flex w-full max-w-sm flex-col gap-2`:`flex w-full max-w-xl flex-wrap justify-center gap-1`,c),...l,children:e.map((e,a)=>(0,r.jsx)(`button`,{type:`button`,"aria-pressed":i===e,onClick:()=>o(e),className:t(n,`fade-in slide-in-from-bottom-2 animate-in fill-mode-both flex cursor-pointer items-center text-[0.8125rem] text-foreground/80 transition-[color,transform] duration-300 hover:-translate-y-px hover:text-foreground focus-visible:text-foreground active:scale-[0.96] motion-reduce:animate-none`,u?`w-full rounded-2xl px-4 py-2.5 text-start`:`rounded-full px-4 py-2`,i===e&&`!bg-foreground !text-background hover:!text-background focus-visible:!text-background`),style:{animationDelay:`${a*70}ms`},children:e},e))},a)}export{i as PromptSuggestions};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{$ as i,A as a,B as o,D as s,E as c,G as l,H as u,I as d,J as f,L as p,O as m,T as h,U as g,V as _,W as v,X as y,et as b,g as x,h as S,j as C,k as w,l as T,nt as E,p as D,q as O,r as k,rt as A,u as j,z as M}from"./button-C5wFDY5_.js";import{t as N}from"./utils-Eg7xtNmV.js";import{$ as P,B as F,C as I,D as ee,F as L,G as R,H as z,I as B,K as V,L as H,N as te,O as U,P as W,Q as G,R as ne,S as K,U as q,V as re,W as ie,Y as ae,Z as oe,_ as se,et as J,f as ce,g as le,it as ue,j as de,k as fe,l as pe,n as me,nt as he,o as ge,ot as _e,q as ve,rt as Y,st as ye,t as be,u as xe,v as Se,z as X}from"./createBaseUIEventDetails-DV0dQrBX.js";import{D as Ce,I as we,L as Te,M as Ee,O as De,S as Oe,X as ke,Y as Ae,Z as je,_ as Me,at as Ne,g as Pe,h as Fe,it as Ie,j as Le,k as Re,nt as ze,ot as Be,rt as Ve,st as He,tt as Ue}from"./dialog-pBGUjAQ7.js";import{n as We,r as Ge}from"./useBaseUiId-CHqXB2UQ.js";import{t as Ke}from"./check-JjHKAZas.js";import{t as qe}from"./chevron-down-BEVGmnSb.js";import{t as Je}from"./useControlled-CJJ9BOQB.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,s as et}from"./input-PcdubeKn.js";var Z=e(t(),1),Q=r(),tt=[`top`,`right`,`bottom`,`left`],nt=Math.min,rt=Math.max,it=Math.round,at=Math.floor,ot=e=>({x:e,y:e}),st={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ct(e,t,n){return rt(e,nt(t,n))}function lt(e,t){return typeof e==`function`?e(t):e}function ut(e){return e.split(`-`)[0]}function dt(e){return e.split(`-`)[1]}function ft(e){return e===`x`?`y`:`x`}function pt(e){return e===`y`?`height`:`width`}function mt(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ht(e){return ft(mt(e))}function gt(e,t,n){n===void 0&&(n=!1);let r=dt(e),i=ht(e),a=pt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Tt(o)),[o,Tt(o)]}function _t(e){let t=Tt(e);return[vt(e),t,vt(t)]}function vt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var yt=[`left`,`right`],bt=[`right`,`left`],xt=[`top`,`bottom`],St=[`bottom`,`top`];function Ct(e,t,n){switch(e){case`top`:case`bottom`:return n?t?bt:yt:t?yt:bt;case`left`:case`right`:return t?xt:St;default:return[]}}function wt(e,t,n,r){let i=dt(e),a=Ct(ut(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vt)))),a}function Tt(e){let t=ut(e);return st[t]+e.slice(t.length)}function Et(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Dt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Et(e)}function Ot(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function kt(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function At(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=le}=t,u=`rootStore`in e?e.rootStore:e,d=u.context.dataRef,f=Z.useRef(void 0),m=te(),h=i(),g=Z.useMemo(()=>{function e(e,t,n,r){let i=be(l,t,n);e&&r===`touch`&&c>0?h.start(c,()=>{u.setOpen(!0,i)}):u.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,i=u.select(`domReferenceElement`)!==t;return e&&i||!e||!a?!0:r&&s?!n(r.type):!1}return{onPointerDown(e){f.current=Ie(e.pointerType,!0)&&Be(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=f.current,a=n.nativeEvent,s=u.select(`open`);if(n.button!==0||r===`click`||Ie(i,!0)&&o)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),l=_(a);if(p(l)){e(c,a,l,i);return}let d=n.currentTarget;m.request(()=>{e(c,a,d,i)})},onClick(n){if(r===`mousedown-only`)return;let i=f.current;if(r===`mousedown`&&i){f.current=void 0;return}Ie(i,!0)&&o||e(t(u.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){f.current=void 0}}},[d,r,o,l,u,s,a,m,h,c]);return Z.useMemo(()=>n?{reference:g}:ye,[n,g])}function jt(e,t,n){let{reference:r,floating:i}=e,a=mt(t),o=ht(t),s=pt(o),c=ut(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=dt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Mt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=lt(t,e),p=Dt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ot(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Nt=50,Pt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Mt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=jt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Nt&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=jt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ft=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=lt(e,t)||{};if(l==null)return{};let d=Dt(u),f={x:n,y:r},p=ht(i),m=pt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=nt(d[_],T),D=nt(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=ct(E,k,O),j=!c.arrow&&dt(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),It=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=lt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ut(r),_=mt(o),v=ut(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Tt(o)]:_t(o)),x=p!==`none`;!d&&x&&b.push(...wt(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=gt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===mt(t)||T.every(e=>mt(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=mt(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Lt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rt(e){return tt.some(t=>e[t]>=0)}var zt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=lt(e,t);switch(i){case`referenceHidden`:{let e=Lt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Rt(e)}}}case`escaped`:{let e=Lt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Rt(e)}}}default:return{}}}}},Bt=new Set([`left`,`top`]);async function Vt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ut(n),s=dt(n),c=mt(n)===`y`,l=Bt.has(o)?-1:1,u=a&&c?-1:1,d=lt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ht=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Vt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ut=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=lt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=mt(i),p=ft(f),m=u[p],h=u[f],g=(e,t)=>ct(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Wt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=lt(e,t),u={x:n,y:r},d=mt(i),f=ft(d),p=u[f],m=u[d],h=lt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Bt.has(ut(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Gt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=lt(e,t),c=await i.detectOverflow(t,s),l=ut(n),u=dt(n),d=mt(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=nt(p-c[m],g),y=nt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*rt(c.left,c.right):S=p-2*rt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Kt(e){let t=L(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=V(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=it(n)!==a||it(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function qt(e){return R(e)?e:e.contextElement}function Jt(e){let t=qt(e);if(!V(t))return ot(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Kt(t),o=(a?it(n.width):n.width)/r,s=(a?it(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Yt=ot(0);function Xt(e){let t=q(e);return!P()||!t.visualViewport?Yt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===q(e)}function Qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=qt(e),o=ot(1);t&&(r?R(r)&&(o=Jt(r)):o=Jt(e));let s=Zt(a,n,r)?Xt(a):ot(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=q(a),t=R(r)?q(r):r,n=e,i=ne(n);for(;i&&t!==n;){let e=Jt(i),t=i.getBoundingClientRect(),r=L(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=q(i),i=ne(n)}}return Ot({width:u,height:d,x:c,y:l})}function $t(e,t){let n=F(e).scrollLeft;return t?t.left+n:Qt(H(e)).left+n}function en(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$t(e,n),y:n.top+t.scrollTop}}function tn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?G(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ot(1),u=ot(0),d=V(r);if((d||!a)&&((X(r)!==`body`||ae(o))&&(c=F(r)),d)){let e=Qt(r);l=Jt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?en(o,c):ot(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function nn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function rn(e){let t=F(e),n=e.ownerDocument.body,r=rt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=rt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+$t(e),o=-t.scrollTop;return L(n).direction===`rtl`&&(a+=rt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var an=25;function on(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=q(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!P()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if($t(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=an&&(s-=o)}return{width:s,height:c,x:l,y:u}}function sn(e,t){let n=Qt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Jt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=on(e,n,t);else if(t===`document`)r=rn(H(e));else if(R(t))r=sn(t,n);else{let n=Xt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ot(r)}function ln(e,t){let n=t.get(e);if(n)return n;let r=re(e,[],!1).filter(e=>R(e)&&X(e)!==`body`),i=null,a=L(e).position===`fixed`,o=a?z(e):e;for(;R(o)&&!ve(o);){let e=L(o),t=ie(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=z(o)}return t.set(e,r),r}function un(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?G(t)?[]:ln(t,this._c):[].concat(n),r],o=cn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=cn(t,a[e],i);s=rt(n.top,s),c=nt(n.right,c),l=nt(n.bottom,l),u=rt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function dn(e){let{width:t,height:n}=Kt(e);return{width:t,height:n}}function fn(e,t,n){let r=V(t),i=H(t),a=n===`fixed`,o=Qt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ot(0);if((r||!a)&&((X(t)!==`body`||ae(i))&&(s=F(t)),r)){let e=Qt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=$t(i));let l=i&&!r&&!a?en(i,s):ot(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function pn(e){return L(e).position===`static`}function mn(e,t){if(!V(e)||L(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function hn(e,t){let n=q(e);if(G(e))return n;if(!V(e)){let t=z(e);for(;t&&!ve(t);){if(R(t)&&!pn(t))return t;t=z(t)}return n}let r=mn(e,t);for(;r&&oe(r)&&pn(r);)r=mn(r,t);return r&&ve(r)&&pn(r)&&!ie(r)?n:r||B(e)||n}var gn=async function(e){let t=this.getOffsetParent||hn,n=this.getDimensions,r=await n(e.floating);return{reference:fn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _n(e){return L(e).direction===`rtl`}var vn={convertOffsetParentRelativeRectToViewportRelativeRect:tn,getDocumentElement:H,getClippingRect:un,getOffsetParent:hn,getElementRects:gn,getClientRects:nn,getDimensions:dn,getScale:Jt,isElement:R,isRTL:_n};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bn(e,t,n){let r=null,i,a=H(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=at(d),h=at(a.clientWidth-(u+f)),g=at(a.clientHeight-(d+p)),_=at(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:rt(0,nt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!yn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=q(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=qt(e),u=i||a?[...l?re(l):[],...t?re(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Qt(e):null;c&&g();function g(){let t=Qt(e);h&&!yn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Sn=Ht,Cn=Ut,wn=It,Tn=Gt,En=zt,Dn=Ft,On=Wt,kn=(e,t,n)=>{let r=new Map,i=n??{},a={...vn,...i.platform,_c:r};return Pt(e,t,{...i,platform:a})},An=e(n(),1),jn=typeof document<`u`?Z.useLayoutEffect:function(){};function Mn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Mn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Nn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pn(e,t){let n=Nn(e);return Math.round(t*n)/n}function Fn(e){let t=Z.useRef(e);return jn(()=>{t.current=e}),t}function In(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Z.useState(r);Mn(f,r)||p(r);let[m,h]=Z.useState(null),[g,_]=Z.useState(null),v=Z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Z.useRef(null),C=Z.useRef(null),w=Z.useRef(u),T=c!=null,E=Fn(c),D=Fn(i),O=Fn(l),k=Z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),kn(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Mn(w.current,t)&&(w.current=t,An.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);jn(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Z.useRef(!1);jn(()=>(A.current=!0,()=>{A.current=!1}),[]),jn(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=Z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Pn(M.floating,u.x),r=Pn(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Nn(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ln=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Dn({element:r.current,padding:i}).fn(n):r?Dn({element:r,padding:i}).fn(n):{}}}},Rn=(e,t)=>{let n=Sn(e);return{name:n.name,fn:n.fn,options:[e,t]}},zn=(e,t)=>{let n=Cn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bn=(e,t)=>({fn:On(e).fn,options:[e,t]}),Vn=(e,t)=>{let n=wn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hn=(e,t)=>{let n=Tn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Un=(e,t)=>{let n=En(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wn=(e,t)=>{let n=Ln(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Gn(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=K(),a=Ue()!=null,o=ue(()=>new Ae({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new we,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=R(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function Kn(e){return qn(e,e.rootContext)}function qn(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=Z.useState(null),[d,f]=Z.useState(void 0),[p,m]=Z.useState(void 0),h=Z.useRef(null),g=ze(r),_=Z.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=In({...e,elements:{..._,...l&&{reference:l}}}),y=R(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=Z.useCallback(e=>{let t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=Z.useCallback(e=>{(R(e)||e===null)&&(h.current=e,f(e)),(R(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!R(e))&&v.refs.setReference(e)},[v.refs,f]),C=Z.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=Z.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=Z.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=Z.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),Z.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var Jn=`Escape`;function Yn(e){return f&&e.movementX===0&&e.movementY===0}function Xn(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Zn(e,t){return Xn(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Qn(e,t,n){return Xn(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function $n(e,t,n){return Xn(t,n?e===g:e===v,e===u)}function er(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Jn:Xn(t,n?e===v:e===g,e===l)}function tr(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:u=!1,loopFocus:f=!1,nested:p=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:v=`auto`,focusItemOnHover:y=!0,openOnArrowKeyDown:x=!0,disabledIndices:S=void 0,orientation:T=`vertical`,parentOrientation:E,id:D,resetOnPointerLeave:O=!0,externalTree:k,grid:A}=t,j=A!=null,N=`rootStore`in e?e.rootStore:e,P=N.useState(`open`),F=N.useState(`floatingElement`),I=N.useState(`domReferenceElement`),ee=N.context.dataRef,L=C(F),R=d(I),z=Ge(L),B=Ue(),H=ze(k),U=Z.useRef(v),W=Z.useRef(l??-1),G=Z.useRef(null),ne=Z.useRef(!0),K=J(e=>{i(W.current===-1?null:W.current,e)}),q=Z.useRef(!!F),re=Z.useRef(P),ie=Z.useRef(!1),ae=Z.useRef(!1),oe=Z.useRef(null),se=Ge(S),ce=Ge(P),le=Ge(l),ue=Ge(O),de=te(),fe=te(),pe=J(()=>{function e(e){g?H?.events.emit(`virtualfocus`,e):oe.current=Ve(e,{sync:ie.current,preventScroll:!0})}let t=n.current[W.current],r=ae.current;t&&e(t),(ie.current?e=>e():e=>de.request(e))(()=>{let i=n.current[W.current]||t;i&&(t||e(i),Se&&(r||!ne.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{ee.current.orientation=T},[ee,T]),Y(()=>{a&&(P&&F?(W.current=l??-1,U.current&&l!=null&&(ae.current=!0,K())):q.current&&(W.current=-1,K()))},[a,P,F,l,K]),Y(()=>{if(a){if(!P){ie.current=!1;return}if(F){if(r==null){if(ie.current=!1,le.current!=null)return;if(q.current&&(W.current=-1,pe()),(!re.current||!q.current)&&U.current&&(G.current!=null||U.current===!0&&G.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>fe.request(e):queueMicrotask)(t),e+=1):(W.current=G.current==null||Qn(G.current,T,m)||p?s(n):c(n),G.current=null,K())};t()}}else w(n.current,r)||(W.current=r,pe(),ae.current=!1)}}},[a,P,F,r,le,p,n,T,m,K,pe,fe]),Y(()=>{if(!a||F||!H||g||!q.current)return;let e=H.nodesRef.current,t=e.find(e=>e.id===B)?.context?.elements.floating,n=M(b(I??t??null)),r=e.some(e=>e.context&&o(e.context.elements.floating,n));t&&!r&&ne.current&&t.focus({preventScroll:!0})},[a,F,I,H,B,g]),Y(()=>{re.current=P,q.current=!!F}),Y(()=>{P||(G.current=null,U.current=v)},[P,v]);let me=r!=null,he=J(e=>{if(!ce.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(W.current!==t||r!==t)&&(W.current=t,K(e))}),_e=J(()=>E??H?.nodesRef.current.find(e=>e.id===B)?.context?.dataRef?.current.orientation),ve=J(()=>s(n,se.current)),ye=J(e=>{if(ne.current=!1,ie.current=!0,e.which===229||!ce.current&&e.currentTarget===z.current)return;if(p&&er(e.key,T,m,j)){Zn(e.key,_e())||He(e),N.setOpen(!1,be(xe,e.nativeEvent)),V(I)&&(g?H?.events.emit(`virtualfocus`,I):I.focus());return}let t=W.current,r=s(n,S),i=c(n,S);if(R||(e.key===`Home`&&(He(e),W.current=r,K(e)),e.key===`End`&&(He(e),W.current=i,K(e))),A!=null){let t=A(e,W.current,n,T,f,m,S,r,i);if(t!=null&&(W.current=t,K(e)),T===`both`)return}if(Zn(e.key,T)){if(He(e),P&&!g&&M(e.currentTarget.ownerDocument)===e.currentTarget){W.current=Qn(e.key,T,m)?r:i,K(e);return}Qn(e.key,T,m)?f?t>=i?u&&t!==n.current.length?W.current=-1:(ie.current=!1,W.current=r):W.current=h(n.current,{startingIndex:t,disabledIndices:S}):W.current=Math.min(i,h(n.current,{startingIndex:t,disabledIndices:S})):f?t<=r?u&&t!==-1?W.current=n.current.length:(ie.current=!1,W.current=i):W.current=h(n.current,{startingIndex:t,decrement:!0,disabledIndices:S}):W.current=Math.max(r,h(n.current,{startingIndex:t,decrement:!0,disabledIndices:S})),w(n.current,W.current)&&(W.current=-1),K(e)}}),Se=Z.useMemo(()=>({onFocus(e){ie.current=!0,he(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Yn(e)||(ie.current=!0,ae.current=!1,y&&he(e))},onPointerLeave(e){if(!ce.current||!ne.current||e.pointerType===`touch`)return;ie.current=!0;let t=e.relatedTarget;if(!(!y||n.current.includes(t))&&ue.current&&(oe.current?.(),oe.current=null,W.current=-1,K(e),!g)){let e=z.current,t=M(b(e));e&&o(e,t)&&e.focus({preventScroll:!0})}}}),[he,ce,z,y,n,K,ue,g]),X=Z.useMemo(()=>g&&P&&me&&{"aria-activedescendant":`${D}-${r}`},[g,P,me,D,r]),Ce=Z.useMemo(()=>({"aria-orientation":T===`both`?void 0:T,...R?{}:X,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&P&&!g){let t=_(e.nativeEvent);if(t&&!o(z.current,t))return;He(e),N.setOpen(!1,be(ge,e.nativeEvent)),V(I)&&I.focus();return}ye(e)},onPointerMove(e){Yn(e)||(ne.current=!0)}}),[X,ye,z,T,R,N,P,g,I]),we=Z.useMemo(()=>{function e(e){N.setOpen(!0,be(xe,e.nativeEvent,e.currentTarget))}function t(e){v===`auto`&&Ne(e.nativeEvent)&&(U.current=!g)}function n(e){U.current=v,v===`auto`&&Be(e.nativeEvent)&&(U.current=!0)}return{onKeyDown(t){let n=N.select(`open`);ne.current=!1;let r=t.key.startsWith(`Arrow`),i=$n(t.key,_e(),m),a=Zn(t.key,T),o=(p?i:a)||t.key===`Enter`||t.key.trim()===``;if(g&&n)return ye(t);if(!(!n&&!x&&r)){if(o){let e=Zn(t.key,_e());G.current=p&&e?null:t.key}if(p){i&&(He(t),n?(W.current=ve(),K(t)):e(t));return}a&&(le.current!=null&&(W.current=le.current),He(t),!n&&x?e(t):ye(t),n&&K(t))}},onFocus(e){N.select(`open`)&&!g&&(W.current=-1,K(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ye,v,ve,p,K,N,x,T,_e,m,le,g]),Te=Z.useMemo(()=>({...X,...we}),[X,we]);return Z.useMemo(()=>a?{reference:Te,floating:Ce,item:Se,trigger:we}:{},[a,Te,Ce,we,Se])}function nr(e,t){let{listRef:n,elementsRef:r,activeIndex:s,onMatch:c,disabledIndices:l,onTyping:u,enabled:d=!0,resetMs:f=750,selectedIndex:p=null}=t,h=`rootStore`in e?e.rootStore:e,g=h.useState(`open`),_=i(),v=Z.useRef(``),y=Z.useRef(p??s??-1),b=Z.useRef(null),x=J(e=>{function t(e){return r?.current[e]}function i(e){let n=t(e);return n&&!m(n)||n?.matches(`:disabled`)?!1:l==null||!a(_e,e,l)}function o(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,a=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(a)||!i(n)))return n}return-1}let d=n.current;if(v.current.length>0&&e.key===` `&&(He(e),u?.(!0)),v.current.length>0&&v.current[0]!==` `&&o(d,v.current)===-1&&e.key!==` `&&u?.(!1),d==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;g&&e.key!==` `&&(He(e),u?.(!0));let h=v.current===``;h&&(y.current=p??s??-1),d.every((e,t)=>e&&i(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&v.current===e.key&&(v.current=``,y.current=b.current),v.current+=e.key,_.start(f,()=>{v.current=``,y.current=b.current,u?.(!1)});let x=((h?p??s??-1:y.current)??0)+1,S=o(d,v.current,x);S===-1?e.key!==` `&&(v.current=``,u?.(!1)):(c?.(S),b.current=S)}),S=J(e=>{let t=e.relatedTarget,n=h.select(`domReferenceElement`),r=h.select(`floatingElement`);o(n,t)||o(r,t)||(_.clear(),v.current=``,y.current=b.current,u?.(!1))});Y(()=>{!g&&p!==null||(_.clear(),b.current=null,v.current!==``&&(v.current=``))},[g,p,_]);let C=Z.useMemo(()=>({onKeyDown:x,onBlur:S}),[x,S]);return Z.useMemo(()=>d?{reference:C,floating:C}:{},[d,C])}var rr=Z.createContext(void 0);function ir(){return Z.useContext(rr)?.direction??`ltr`}var ar=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=lt(e,t)||{};if(l==null)return{};let f=Dt(u),p={x:n,y:r},m=ht(i),h=pt(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=ct(k,j,A),N=!c.arrow&&dt(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),or=(e,t)=>({...ar(e),options:[e,t]}),sr={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},cr={sideX:`left`,sideY:`top`},lr=`--available-width`,ur=`--available-height`;function dr(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function fr(e,t,n){let{rects:r,placement:i}=e;return{side:dr(t,ut(i),n),align:dt(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function pr(e){return mr(e,Kn)}function mr(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=Z.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=J(j),N=j?M:n,P=Ge(n),F=Ge(g),I=ir()===`rtl`,ee=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],L=o===`center`?ee:`${ee}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let z=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),te={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},U=Z.useRef(null),W=Ge(a),G=Ge(s),ne=typeof a==`function`?0:a,K=typeof s==`function`?0:s,re=[];p&&re.push(p),re.push(Rn(e=>{let t=fr(e,i,I),n=typeof W.current==`function`?W.current(t):W.current,r=typeof G.current==`function`?G.current(t):G.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ne,K,I,i]));let ie=D===`none`&&E!==`shift`,ae=!ie&&(u||k||E===`shift`),oe=E===`none`?null:Vn({...te,padding:{top:R.top+1+z,right:R.right+1+H,bottom:R.bottom+1+B,left:R.left+1+V},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),se=ie?null:zn({...te,rootBoundary:A,mainAxis:D!==`none`,crossAxis:ae,limiter:u||k?void 0:Bn(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=mt(ut(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[te,u,k,A,R,D]);E===`shift`||D===`shift`||o===`center`?re.push(se,oe):re.push(oe,se),re.push(Hn({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(lr,`${t}px`),i.setProperty(ur,`${n}px`);let a=q(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),or(e=>({element:U.current||b(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=ut(r),l=mt(c),u=U.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(fr(e,i,I)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ae&&l===`y`&&b?S:x),{}}},sr,x),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ce=Z.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:le,elements:ue,x:de,y:fe,middlewareData:pe,update:me,placement:he,context:ge,isPositioned:_e,floatingStyles:ve}=t({rootContext:h,open:m?g:void 0,placement:L,middleware:re,strategy:r,whileElementsMounted:m?void 0:(...e)=>xn(...e,ce),nodeId:y,externalTree:C}),{sideX:ye,sideY:be}=pe.adaptiveOrigin||cr,xe=_e?r:`fixed`,Se=Z.useMemo(()=>{let e;return e=_e?x?{position:xe,[ye]:de,[be]:fe}:{...ve,position:xe}:{position:xe,top:0,left:0},e[lr]=`100vw`,e[ur]=`100vh`,_e||(e.opacity=0),e},[x,xe,ye,de,be,fe,ve,_e]),X=Z.useRef(null);Y(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(hr(t)?t.current:t)||null;n!==X.current&&(le.setPositionReference(n),X.current=n)},[g,le,N,P]),Z.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&hr(e)&&e.current!==X.current&&(le.setPositionReference(e.current),X.current=e.current)},[g,le,N,P]),Z.useEffect(()=>{if(m&&g&&ue.reference&&ue.floating)return xn(ue.reference,ue.floating,me,ce)},[m,g,ue,me,ce]);let Ce=ut(he),we=dr(i,Ce,I),Te=dt(he)||`center`,Ee=!!pe.hide?.referenceHidden;Y(()=>{S&&g&&_e&&Ce!==ee&&T(Ce)},[S,g,_e,Ce,ee]);let De=Z.useMemo(()=>({position:`absolute`,top:pe.arrow?.y,left:pe.arrow?.x}),[pe.arrow]),Oe=pe.arrow?.centerOffset!==0;return Z.useMemo(()=>({positionerStyles:Se,arrowStyles:De,arrowRef:U,arrowUncentered:Oe,side:we,align:Te,physicalSide:Ce,anchorHidden:Ee,refs:le,context:ge,isPositioned:_e,update:me}),[Se,De,U,Oe,we,Te,Ce,Ee,le,ge,_e,me])}function hr(e){return e!=null&&`current`in e}function gr(e){return e===`starting`?T:ye}function _r(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),U(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},gr(r),i],stateAttributesMapping:Re})}function vr(e){let t=Z.useRef(!0);t.current&&(t.current=!1,e())}function yr(e){let[t,n]=Z.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function br(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var xr=Z.createContext(null);function Sr(){let e=Z.useContext(xr);if(e===null)throw Error(he(60));return e}var Cr=(e,t)=>Object.is(e,t);function wr(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Tr(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&wr(e,t,n))}function Er(e,t,n){return e.filter(e=>!wr(t,e,n))}function Dr(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Or(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function kr(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Or(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Ar(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Dr(e)}function jr(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Dr(e.value):Dr(e)}function Mr(e,t,n){function r(){return Ar(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=Or(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Nr(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Q.jsx)(Z.Fragment,{children:Mr(r,t,n)},i)),e),[])}var $={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:jr(t,r)!==``},hasNullItemLabel:(e,t)=>t?kr(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>wr(t,e,n)):wr(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Pr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Fr(e,t){let n=Z.useRef(e),r=J(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ir(e){let t=Z.useRef(``),n=Z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Lr(e,t){let{onClick:n,onPointerDown:r}=Ir(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(y?`touch`:``))}));return Z.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Rr(e){let[t,n]=Z.useState(null),r=Lr(e,n);return Fr(e,t=>{t&&!e&&n(null)}),Z.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function zr(e,t){return Math.max(0,e-t)}function Br(e,t){if(t<=0)return 0;let n=kt(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function Vr(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:C,isItemEqualToValue:w=Cr,highlightItemOnHover:T=!0,children:D}=e,{clearErrors:O}=Ze(),{setDirty:k,setTouched:j,setFocused:M,validityData:N,setFilled:P,name:F,disabled:ee,validation:L,validationMode:R}=Qe(),z=$e({id:t}),B=ee||d,V=F??c,[H,te]=Je({controlled:n,default:y?r??_e:r,name:`Select`,state:`value`}),[U,W]=Je({controlled:a,default:o,name:`Select`,state:`open`}),G=Z.useRef([]),ne=Z.useRef([]),K=Z.useRef(null),q=Z.useRef(null),re=Z.useRef(0),ie=Z.useRef(null),ae=Z.useRef([]),oe=Z.useRef(!1),se=Z.useRef(null),le=Z.useRef(null),pe=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),me=Z.useRef(!1),{mounted:he,setMounted:ge,transitionStatus:ve}=We(U),{openMethod:xe,triggerProps:Se}=Rr(U),X=ue(()=>new E({id:z,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:C,isItemEqualToValue:w,value:H,open:U,mounted:he,transitionStatus:ve,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ce=A(X,$.activeIndex),we=A(X,$.selectedIndex),Ee=A(X,$.triggerElement),De=A(X,$.positionerElement),Oe=yr(xe),Ae=xe??Oe,je=Z.useMemo(()=>y?``:jr(H,C),[y,H,C]),Me=Z.useMemo(()=>y&&Array.isArray(H)?H.map(e=>jr(e,C)):jr(H,C),[y,H,C]),Ne=Ge(Ee),Pe=J(()=>Me);Ye(Ne,z,H,Pe,!B,c);let Fe=Z.useRef(H),Ie=y?Array.isArray(H)&&H.length>0:H!=null&&je!==``;Y(()=>{P(Ie)},[Ie,P]),Y(function(){let e=H,t=!1;if(y){let n=Array.isArray(H)?H:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:Tr(ae.current,e,w),r=n===-1?null:n;r===null&&(le.current=null),!U&&X.set(`selectedIndex`,r)},[y,U,H,w,X]);function Le(e){let t=N.initialValue;return Array.isArray(e)&&Array.isArray(t)?!Pr(e,t,(e,t)=>wr(e,t,w)):e!==t}Fr(H,()=>{O(V),k(Le(H)),L.change(H)});let Re=J((e,t)=>{s?.(e,t),!t.isCanceled&&(W(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(j(!0),M(!1),R===`onBlur`&&L.commit(H)))}),ze=J(()=>{ge(!1),X.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});I({enabled:!h,open:U,ref:K,onComplete(){U||ze()}}),Z.useImperativeHandle(h,()=>({unmount:ze}),[ze]);let Be=J((e,t)=>{i?.(e,t),!t.isCanceled&&te(e)}),Ve=J(e=>{let t=zr(e.scrollHeight,e.clientHeight),n=Br(e.scrollTop,t),r=n>0,i=n<t;X.set(`scrollUpArrowVisible`,r),X.set(`scrollDownArrowVisible`,i)}),He=Gn({open:U,onOpenChange:Re,elements:{reference:Ee,floating:De}}),Ue=At(He,{enabled:!f&&!B,event:`mousedown`}),Ke=ke(He),qe=tr(He,{enabled:!f&&!B,listRef:G,activeIndex:Ce,selectedIndex:we,disabledIndices:_e,onNavigate(e){e===null&&!U||X.set(`activeIndex`,e)},focusItemOnHover:T}),Xe=nr(He,{enabled:!f&&!B&&(U||!y),listRef:ne,activeIndex:Ce,selectedIndex:we,disabledIndices:e=>br(G.current[e]),onMatch(e){U?X.set(`activeIndex`,e):Be(ae.current[e],be(ce))},onTyping(e){oe.current=e}}),et=Z.useMemo(()=>fe(Xe.reference,qe.reference,Ke.reference,Ue.reference,Se),[Ue.reference,Xe.reference,qe.reference,Ke.reference,Se]),tt=Z.useMemo(()=>fe(Te,Xe.floating,qe.floating,Ke.floating),[Xe.floating,qe.floating,Ke.floating]),nt=qe.item??ye;vr(()=>{X.update({popupProps:tt,triggerProps:et})}),X.useSyncedValues({id:z,modal:m,multiple:y,value:H,open:U,mounted:he,transitionStatus:ve,popupProps:tt,triggerProps:et,items:v,itemToStringLabel:b,itemToStringValue:C,isItemEqualToValue:w,openMethod:Ae});let rt=Z.useMemo(()=>({store:X,floatingContext:He,required:p,disabled:B,readOnly:f,multiple:y,highlightItemOnHover:T,setValue:Be,setOpen:Re,listRef:G,popupRef:K,scrollHandlerRef:q,handleScrollArrowVisibility:Ve,scrollArrowsMountedCountRef:re,itemProps:nt,valueRef:ie,valuesRef:ae,labelsRef:ne,typingRef:oe,selectionRef:pe,firstItemTextRef:se,selectedItemTextRef:le,validation:L,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:me,initialValueRef:Fe}),[X,He,p,B,f,y,T,Be,Re,nt,L,_,Ve]),it=de(g,L.inputRef),at=y?void 0:V,ot=Z.useMemo(()=>!y||!Array.isArray(H)||!V?null:H.map(e=>{let t=jr(e,C);return(0,Q.jsx)(`input`,{type:`hidden`,form:l,name:V,value:t,disabled:B},t)}),[y,H,l,V,C,B]);return(0,Q.jsxs)(xr.Provider,{value:rt,children:[D,(0,Q.jsx)(`input`,{...L.getValidationProps(B,{onFocus(){X.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||B||f)return;let t=e.currentTarget.value,n=be(ce,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ae.current.findIndex(t=>jr(t,C).toLowerCase()===e||Ar(t,b).toLowerCase()===e);r===-1&&(r=ae.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=ae.current[r];i!=null&&Be(i,n)}X.set(`forceMount`,!0),queueMicrotask(r)}}),id:z&&at==null?`${z}-hidden-input`:void 0,form:l,name:at,autoComplete:u,value:je,disabled:B,required:p&&!(y&&Ie),readOnly:f,ref:it,style:V?x:S,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ot]})}function Hr(e,t){return e??t}var Ur=5;function Wr(e,t){let n=Gr(t);return e.clientX>=n.left-Ur&&e.clientX<=n.right+Ur&&e.clientY>=n.top-Ur&&e.clientY<=n.bottom+Ur}function Gr(e){let t=e.getBoundingClientRect(),n=q(e);if(O)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var Kr=400,qr={...Le,...et,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Jr=Z.forwardRef(function(e,t){let{render:n,className:r,id:a,disabled:s=!1,nativeButton:c=!0,style:l,...u}=e,{setTouched:d,setFocused:f,validationMode:p,state:m,disabled:h}=Qe(),{labelId:g}=Xe(),{store:_,setOpen:v,selectionRef:y,validation:x,readOnly:S,required:w,alignItemWithTriggerActiveRef:T,disabled:E}=Sr(),D=h||E||s,O=A(_,$.open),k=A(_,$.mounted),j=A(_,$.value),M=A(_,$.triggerProps),N=A(_,$.positionerElement),P=A(_,$.listElement),F=A(_,$.popupSide),I=A(_,$.id),ee=A(_,$.labelId),L=A(_,$.hasSelectedValue),R=k&&N?F:null,z=a??I,B=Hr(g,ee);$e({id:z});let V=Ge(N),H=Z.useRef(null),{getButtonProps:te,buttonRef:W}=Se({disabled:D,native:c}),G=_.useStateSetter(`triggerElement`),ne=i(),K=i(),q=i();Z.useEffect(()=>{if(O)return q.start(Kr,()=>{y.current.allowUnselectedMouseUp=!0,y.current.allowSelectedMouseUp=!0}),()=>{q.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[O,y,K,q]);let re=fe(M,{id:z,role:`combobox`,"aria-expanded":O,"aria-haspopup":`listbox`,"aria-controls":O?P?.id??C(N)?.id:void 0,"aria-labelledby":B,"aria-readonly":S||void 0,"aria-required":w||void 0,tabIndex:D?-1:0,onFocus(e){f(!0),O&&T.current&&v(!1,be(ce,e.nativeEvent)),ne.start(0,()=>{_.set(`forceMount`,!0)})},onBlur(e){o(N,e.relatedTarget)||(d(!0),f(!1),p===`onBlur`&&x.commit(j))},onMouseDown(e){if(O)return;let t=b(e.currentTarget);function n(e){if(!H.current)return;let t=e.target;o(H.current,t)||o(V.current,t)||Wr(e,H.current)||v(!1,be(me,e))}K.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},u,te),ie=x.getValidationProps(D,re);ie.role=`combobox`;let ae={...m,open:O,disabled:D,value:j,readOnly:S,popupSide:R,placeholder:!L};return U(`button`,e,{ref:[t,H,W,G],state:ae,stateAttributesMapping:qr,props:ie})}),Yr={value:()=>null},Xr=Z.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Sr(),u=A(c,$.value),d=A(c,$.items),f=A(c,$.itemToStringLabel),p=A(c,$.hasSelectedValue),m=!p&&a!=null&&i==null,h=A(c,$.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?Nr(u,d,f):Mr(u,d,f)),U(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Yr})}),Zr=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Sr(),s={open:A(o,$.open)};return U(`span`,e,{state:s,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Ee})}),Qr=Z.forwardRef(function(e,t){let{store:n}=Sr(),r=A(n,$.mounted),i=A(n,$.forceMount);return r||i?(0,Q.jsx)(k,{ref:t,...e}):null}),$r=Z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ei(){return Z.useContext($r)}function ti(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=Z.useState(!1),s=ue(ri).current,c=ue(ni).current,l=Z.useRef(0),u=Z.useRef(!0),d=Z.useRef([]),f=Z.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>!e))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!oi(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&si(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=ai(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=J(()=>{let[e,t]=ii(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});Y(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=J(e=>(s.add(e),()=>{s.delete(e)})),b=Z.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Q.jsx)($r.Provider,{value:b,children:t})}function ni(){return new Map}function ri(){return new Set}function ii(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>si(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function ai(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function oi(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function si(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var ci=Z.createContext(void 0);function li(){let e=Z.useContext(ci);if(!e)throw Error(he(59));return e}function ui(e,t){e&&Object.assign(e.style,t)}var di={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},fi=20;function pi(e,t,n,r){let[i,a]=Z.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=b(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-fi)},[e,t,n]),Ce(e&&(!t||i),r)}var mi={position:`fixed`},hi=Z.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=j,style:_,...v}=e,{store:y,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:O,floatingContext:k}=Sr(),M=A(y,$.open),N=A(y,$.mounted),P=A(y,$.modal),F=A(y,$.value),I=A(y,$.openMethod),ee=A(y,$.positionerElement),L=A(y,$.triggerElement),R=A(y,$.isItemEqualToValue),z=A(y,$.transitionStatus),B=Z.useRef(null),V=Z.useRef(null),[H,te]=Z.useState(h),U=N&&H&&I!==`touch`;!N&&H!==h&&te(h),Z.useImperativeHandle(S,()=>U),pi((U||P)&&M,I===`touch`,ee,L);let W=pr({anchor:n,floatingRootContext:k,positionMethod:a,mounted:N,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??U,collisionAvoidance:g,keepMounted:!0}),G=U?`none`:W.side,ne=U?mi:W.positionerStyles,K={open:M,side:G,align:W.align,anchorHidden:W.anchorHidden};Y(()=>{y.set(`popupSide`,W.side)},[y,W.side]);let q=_r(e,K,{styles:ne,transitionStatus:z,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!N,inert:!M}),re=Z.useRef(0),ie=J(e=>{if(w.current.length===0)return;let t=re.current;if(re.current=e.size,e.size===t)return;let n=be(ce);if(t!==0&&!y.state.multiple&&F!==null&&Tr(w.current,F,R)===-1){let e=T.current,t=e!=null&&Tr(w.current,e,R)!==-1?e:null;O(t,n),t===null&&(y.set(`selectedIndex`,null),C.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(F)){let e=F.filter(e=>Tr(w.current,e,R)!==-1);e.length!==F.length&&(O(e,n),e.length===0&&(y.set(`selectedIndex`,null),C.current=null))}if(M&&U){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};ui(ee,e),ui(E.current,e)}}),ae=Z.useMemo(()=>({...W,side:G,alignItemWithTriggerActive:U,setControlledAlignItemWithTrigger:te,scrollUpArrowRef:B,scrollDownArrowRef:V}),[W,G,U,te]);return(0,Q.jsx)(ti,{elementsRef:b,labelsRef:x,onMapChange:ie,children:(0,Q.jsxs)(ci.Provider,{value:ae,children:[N&&P&&(0,Q.jsx)(De,{inert:D(!M),cutout:L}),q]})})}),gi=`base-ui-disable-scrollbar`,_i={className:gi,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:gi,precedence:`base-ui:low`,children:`.${gi}{scrollbar-width:none}.${gi}::-webkit-scrollbar{display:none}`})}},vi=Z.createContext(void 0);function yi(e){let t=Z.useContext(vi);if(t===void 0&&!e)throw Error(he(69));return t}var bi=Z.createContext(void 0),xi={disableStyleElements:!1};function Si(){return Z.useContext(bi)??xi}var Ci={...Re,...ee},wi=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:p,selectedItemTextRef:m,multiple:h,handleScrollArrowVisibility:g,scrollHandlerRef:_,listRef:v,highlightItemOnHover:y,floatingContext:x}=Sr(),{side:S,align:C,alignItemWithTriggerActive:w,isPositioned:T,setControlledAlignItemWithTrigger:E}=li(),D=yi(!0)!=null,O=ir(),{nonce:k,disableStyleElements:j}=Si(),M=A(s,$.id),N=A(s,$.open),P=A(s,$.openMethod),F=A(s,$.mounted),ee=A(s,$.popupProps),L=A(s,$.transitionStatus),R=A(s,$.triggerElement),z=A(s,$.positionerElement),B=A(s,$.listElement),V=Z.useRef(!1),H=Z.useRef(!1),G=Z.useRef({}),ne=te(),K=J(e=>{if(!z||!c.current||!H.current)return;let t=z.style.top===`0px`,n=z.style.bottom===`0px`;if(V.current||!w||!t&&!n){g(e);return}let r=Di(z),i=Oi(z.getBoundingClientRect().height,`y`,r),a=b(z),o=q(z),s=o.getComputedStyle(z),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Ti(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=Ei(e),h=null,_=e=>{z.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=kt(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(V.current=!0),g(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let x=Math.ceil(y);if(x!==0&&_(x),h!=null){let t=kt(h,0,Ei(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}x>=f-1&&(V.current=!0),g(e)});Z.useImperativeHandle(_,()=>K,[K]),I({open:N,ref:c,onComplete(){N&&l?.(!0)}});let re={open:N,transitionStatus:L,side:S,align:C};Y(()=>{!z||!c.current||Object.keys(G.current).length||(G.current={top:z.style.top||`0`,left:z.style.left||`0`,right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[c,z]),Y(()=>{N||w||(H.current=!1,V.current=!1,ui(z,G.current))},[N,w,z,c]),Y(()=>{let e=c.current;if(!N||!R||!z||!e||w&&!T||s.state.transitionStatus===`ending`)return;if(H.current=!0,e.style.removeProperty(`--transform-origin`),!w){ne.request(()=>g(B||e));return}let t=ji(e);try{let t=m.current;t?.isConnected||(t=!$.hasSelectedValue(s.state)&&p.current?.isConnected?p.current:null);let n=d.current,r=q(z),i=r.getComputedStyle(z),a=r.getComputedStyle(e),o=b(R),c=Di(R),l=ki(R.getBoundingClientRect(),c),u=ki(z.getBoundingClientRect(),c),h=l.height,_=B||e,x=_.scrollHeight,S=parseFloat(a.borderBottomWidth),C=parseFloat(i.marginTop)||10,w=parseFloat(i.marginBottom)||10,T=parseFloat(i.minHeight)||100,D=Ti(a),k=o.documentElement.clientHeight-C-w,A=o.documentElement.clientWidth,j=k-l.bottom+h,M,N=O===`rtl`?l.right-u.width:l.left,P=0;if(t&&n){let e=ki(n.getBoundingClientRect(),c);M=ki(t.getBoundingClientRect(),c),N=u.left+(O===`rtl`?e.right-M.right:e.left-M.left);let r=e.top-l.top+e.height/2;P=M.top-u.top+M.height/2-r}let F=j+P+w+S,I=Math.min(k,F),ee=k-C-w,L=F-I,H=A-5;z.style.left=`${kt(N,5,H-u.width)}px`,z.style.height=`${I}px`,z.style.maxHeight=`none`,z.style.marginTop=`${C}px`,z.style.marginBottom=`${w}px`,e.style.height=`100%`;let te=Ei(_),U=L>=te-1;U&&(I=Math.min(k,u.height)-(L-te));let W=l.top<20||l.bottom>k-20||Math.ceil(I)+1<Math.min(x,T),ne=(r.visualViewport?.scale??1)!==1&&f;if(W||ne){ui(z,G.current),E(!1);return}let K=Math.max(T,I);if(U){let e=Math.max(0,k-F);z.style.top=u.height>=ee?`0`:`${e}px`,z.style.height=`${I}px`,_.scrollTop=Ei(_)}else z.style.bottom=`0`,_.scrollTop=L;if(M){let t=u.top,n=u.height,r=M.top+M.height/2,i=kt(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(K===k||I>=D)&&(V.current=!0),g(_),y&&s.state.selectedIndex===null&&s.state.activeIndex===null&&v.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,N,z,R,d,p,m,c,g,w,E,ne,B,v,y,O,T]),Z.useEffect(()=>{if(!w||!z||!N)return;let e=q(z);function t(e){u(!1,be(se,e))}return W(e,`resize`,t)},[u,w,z,N]);let ie={...B?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":h||void 0,id:`${M}-list`},onKeyDown(e){D&&Oe.has(e.key)&&e.stopPropagation()},onScroll(e){B||K(e.currentTarget)},...w&&{style:B?{height:`100%`}:di},className:!B&&w?_i.className:void 0},ae=U(`div`,e,{ref:[t,c],state:re,stateAttributesMapping:Ci,props:[ee,ie,gr(L),o]});return(0,Q.jsxs)(Z.Fragment,{children:[!j&&_i.getElement(k),(0,Q.jsx)(je,{context:x,modal:!1,disabled:!F,openInteractionType:P,returnFocus:a,restoreFocus:!0,children:ae})]})});function Ti(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Ei(e){return zr(e.scrollHeight,e.clientHeight)}function Di(e){return vn.getScale(e)}function Oi(e,t,n){return e/n[t]}function ki(e,t){return Ot({x:Oi(e.x,`x`,t),y:Oi(e.y,`y`,t),width:Oi(e.width,`x`,t),height:Oi(e.height,`y`,t)})}var Ai=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function ji(e){let{style:t}=e,n={};for(let[e,r]of Ai)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ai){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Mi=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s,multiple:c}=Sr(),{alignItemWithTriggerActive:l}=li(),u=A(o,$.hasScrollArrows),d=A(o,$.openMethod),f={id:`${A(o,$.id)}-list`,role:`listbox`,"aria-multiselectable":c||void 0,onScroll(e){s.current?.(e.currentTarget)},...l&&{style:di},className:u&&d!==`touch`?_i.className:void 0},p=o.useStateSetter(`listElement`);return U(`div`,e,{ref:[t,p],props:[f,a]})});function Ni(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=ei(),u=Z.useRef(-1),[d,f]=Z.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=Z.useRef(null),h=Z.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Pi=Z.createContext(void 0);function Fi(){let e=Z.useContext(Pi);if(!e)throw Error(he(57));return e}var Ii=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Z.useRef(null),d=Ni({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:y,selectedItemTextRef:b,disabled:x,readOnly:S}=Sr(),C=x||s,w=A(f,$.isActive,d.index),T=A(f,$.open),E=A(f,$.isSelected,a),D=A(f,$.isSelectedByFocus,d.index),O=A(f,$.isItemEqualToValue),k=d.index,j=Z.useRef(null);Y(()=>{let e=v.current;return e[k]=a,()=>{delete e[k]}},[k,a,v]),Y(()=>{let e=f.state.value,t=e;y&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&wr(a,t,O)&&(f.set(`selectedIndex`,k),u.current&&(b.current=u.current))},[k,y,O,f,a,b]);let M=Z.useRef(`mouse`),N=Z.useRef(!1),{getButtonProps:P,buttonRef:F}=Se({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),I={disabled:C,selected:E,highlighted:w};function ee(e){if(x||S)return;let t=f.state.value;if(y){let n=Array.isArray(t)?t:[],r=E?Er(n,a,O):[...n,a];h(r,be(pe,e))}else h(a,be(pe,e)),m(!1,be(pe,e))}function L(){g.current.dragY=0}let R={role:`option`,"aria-selected":E,tabIndex:T&&w?0:-1,onKeyDown(e){f.set(`activeIndex`,k),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=M.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Ne(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!N.current;N.current=!1,!(C||i)&&ee(e.nativeEvent)},onPointerEnter(e){M.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){M.current=e.pointerType,N.current=!0,L()},onMouseUp(){if(L(),C||M.current===`touch`||N.current)return;let e=!g.current.allowSelectedMouseUp&&E,t=!g.current.allowUnselectedMouseUp&&!E;e||t||(N.current=!0,j.current?.click(),N.current=!1)}},z=U(`div`,e,{ref:[F,t,d.ref,j],state:I,props:[p,R,l,P]}),B=Z.useMemo(()=>({selected:E,index:k,textRef:u,selectedByFocus:D}),[E,k,u,D]);return(0,Q.jsx)(Pi.Provider,{value:B,children:z})})),Li=Z.forwardRef(function(e,t){let{selected:n}=Fi();return e.keepMounted||n?(0,Q.jsx)(Ri,{...e,ref:t}):null}),Ri=Z.memo(Z.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=Fi(),c=Z.useRef(null),{transitionStatus:l,setMounted:u}=We(s),d=U(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:ee});return I({open:s,ref:c,onComplete(){s||u(!1)}}),d})),zi=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=Fi(),{firstItemTextRef:a,selectedItemTextRef:o}=Sr(),{render:s,className:c,style:l,...u}=e,d=Z.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]);return U(`div`,e,{ref:[d,t,r],props:u})})),Bi=2;function Vi({className:e,onValueChange:t,options:n,placeholder:r,triggerId:i,value:a,...o}){let s=n.find(e=>e.value===a),c=s?.icon,l=Pe(),u=Math.min(l+Bi,8);return(0,Q.jsxs)(Vr,{"data-slot":`select`,items:n,onValueChange:e=>{e!==null&&t(e)},value:a,...o,children:[(0,Q.jsxs)(Jr,{id:i,"aria-label":o[`aria-label`],className:N(`group flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 data-placeholder:text-muted-foreground dark:bg-input/30 dark:disabled:bg-input/80`,e),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[c?(0,Q.jsx)(c,{className:`size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground`}):null,(0,Q.jsx)(Xr,{placeholder:r,children:(0,Q.jsx)(`span`,{className:`truncate`,children:s?.label??r??a??``})})]}),(0,Q.jsx)(Zr,{className:`shrink-0 text-muted-foreground`,children:(0,Q.jsx)(qe,{className:`size-4`})})]}),(0,Q.jsx)(Qr,{children:(0,Q.jsx)(hi,{className:`z-[70]`,sideOffset:4,children:(0,Q.jsx)(wi,{className:N(`max-h-72 min-w-(--anchor-width) overflow-y-auto rounded-lg p-1 text-sm text-popover-foreground outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,Me(u,3)),children:(0,Q.jsx)(Fe,{value:u,children:(0,Q.jsx)(Mi,{children:n.map(e=>{let t=e.icon;return(0,Q.jsxs)(Ii,{className:`relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-7 text-sm outline-none select-none data-highlighted:bg-muted data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50`,disabled:e.disabled,value:e.value,children:[(0,Q.jsx)(Li,{className:`absolute left-2 flex items-center justify-center`,children:(0,Q.jsx)(Ke,{className:`size-3.5`})}),t?(0,Q.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground`}):null,(0,Q.jsx)(zi,{children:e.label})]},e.value)})})})})})})]})}function Hi(e){return U(e.defaultTagName??`div`,e,e)}var Ui=[{id:`amazon-bedrock`,name:`Amazon Bedrock`,envVarName:`AWS_ACCESS_KEY_ID`},{id:`openai`,name:`OpenAI`,envVarName:`OPENAI_API_KEY`},{id:`openai-chat-completions`,name:`OpenAI Chat Completions`,envVarName:`OPENAI_CHAT_COMPLETIONS_API_KEY`},{id:`openai-chat-completions-base-url`,name:`OpenAI Chat Completions Base URL`,envVarName:`OPENAI_CHAT_COMPLETIONS_BASE_URL`},{id:`openai-chat-completions-model`,name:`OpenAI Chat Completions Model`,envVarName:`OPENAI_CHAT_COMPLETIONS_MODEL`},{id:`anthropic`,name:`Anthropic`,envVarName:`ANTHROPIC_API_KEY`},{id:`google-vertex`,name:`Google Vertex`,envVarName:`GOOGLE_APPLICATION_CREDENTIALS`},{id:`google`,name:`Google Gemini`,envVarName:`GEMINI_API_KEY`},{id:`mistral`,name:`Mistral`,envVarName:`MISTRAL_API_KEY`},{id:`groq`,name:`Groq`,envVarName:`GROQ_API_KEY`},{id:`openrouter`,name:`OpenRouter`,envVarName:`OPENROUTER_API_KEY`},{id:`vercel-ai-gateway`,name:`Vercel AI Gateway`,envVarName:`AI_GATEWAY_API_KEY`},{id:`github-copilot`,name:`GitHub Copilot`,envVarName:`GITHUB_COPILOT_TOKEN`,authType:`oauth`},{id:`ollama`,name:`Ollama`,envVarName:`OLLAMA_BASE_URL`},{id:`daytona`,name:`Daytona`,envVarName:`DAYTONA_API_KEY`},{id:`daytona-target`,name:`Daytona Target`,envVarName:`DAYTONA_TARGET`}],Wi=[`daytona`,`daytona-target`,`openai-chat-completions-base-url`,`openai-chat-completions-model`],Gi=`openai-chat-completions`,Ki=`${Gi}+`,qi=`custom+`;function Ji(e){return e.startsWith(qi)}function Yi(e){return e===`openai-chat-completions`||e.startsWith(Ki)}function Xi(e){return e.startsWith(Ki)}var Zi=Ui.map(({id:e,name:t,envVarName:n,authType:r})=>({id:e,name:t,envVarName:n,authType:r})),Qi=Zi.flatMap(e=>Wi.includes(e.id)?[]:[e.id]);Zi.filter(e=>!Wi.includes(e.id)&&e.authType!==`oauth`),Array.from(new Set([...Zi.flatMap(e=>Qi.includes(e.id)||e.id===`openai-chat-completions-base-url`||e.id===`openai-chat-completions-model`?[e.envVarName]:[]),`HF_TOKEN`,`ANT_LING_API_KEY`,`AZURE_OPENAI_API_KEY`,`NVIDIA_API_KEY`,`DEEPSEEK_API_KEY`,`GOOGLE_CLOUD_API_KEY`,`CEREBRAS_API_KEY`,`XAI_API_KEY`,`RADIUS_API_KEY`,`ZAI_API_KEY`,`ZAI_CODING_CN_API_KEY`,`MINIMAX_API_KEY`,`MINIMAX_CN_API_KEY`,`MOONSHOT_API_KEY`,`FIREWORKS_API_KEY`,`TOGETHER_API_KEY`,`OPENCODE_API_KEY`,`KIMI_API_KEY`,`CLOUDFLARE_API_KEY`,`CLOUDFLARE_ACCOUNT_ID`,`CLOUDFLARE_GATEWAY_ID`,`XIAOMI_API_KEY`,`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`ANTHROPIC_OAUTH_TOKEN`,`ANTHROPIC_OAUTH_KEY`,`COPILOT_GITHUB_TOKEN`,`GITHUB_COPILOT_TOKEN`,`AWS_SECRET_ACCESS_KEY`,`AWS_BEARER_TOKEN_BEDROCK`,`AWS_PROFILE`,`AWS_ACCESS_KEY_ID`,`DAYTONA_API_KEY`,`ORG_DAYTONA_API_KEY`,`DAYTONA_TARGET`]));export{xn as A,Vn as C,zn as D,Rn as E,kt as M,Hn as O,Wn as S,Bn as T,br as _,Yi as a,pr as b,Ni as c,_i as d,pi as f,Fr as g,Lr as h,Xi as i,At as j,In as k,Si as l,Br as m,Gi as n,Hi as o,ti as p,Ji as r,Vi as s,Zi as t,yi as u,_r as v,Un as w,ir as x,gr as y};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{$ as i,B as a,F as o,N as s,Q as c,V as l,et as u,n as d,st as f,t as p,tt as m}from"./button-C5wFDY5_.js";import{t as h}from"./utils-Eg7xtNmV.js";import{G as g,P as _,at as v,ct as y,et as b,h as x,it as S,rt as C,t as w}from"./createBaseUIEventDetails-DV0dQrBX.js";import{_ as T,c as E,ct as D,d as O,f as k,g as A,h as j,it as M,l as N,m as P,nt as F,p as I,tt as ee,u as te}from"./dialog-pBGUjAQ7.js";import{a as L,r as R,t as z}from"./provider-catalog-DYMFdbKc.js";import{r as B}from"./useBaseUiId-CHqXB2UQ.js";import{t as V}from"./createLucideIcon-DwxZHm0M.js";import{t as H}from"./bot-Bs7QWJ2q.js";import{t as ne}from"./loader-circle-DjfHXUPB.js";import{n as re,r as ie,t as ae}from"./shield-check-CkA2viVW.js";import{t as oe}from"./plug-Dt6VN0zF.js";import{t as U}from"./sparkles-DuclzqlE.js";var W=e(t(),1),se=f();function ce(e,t){return t!=null&&!M(t)?0:typeof e==`function`?e():e}function G(e,t,n){let r=ce(e,n);return typeof r==`number`?r:r?.[t]}function le(e){return typeof e==`function`?e():e}function ue(e,t){return t||e===`click`||e===`mousedown`}function de(e){return e?.includes(`mouse`)&&e!==`mousedown`}function fe(e){let t=W.useCallback(t=>e===void 0?y:e.subscribeStore(t),[e]),n=W.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,se.useSyncExternalStore)(t,n,()=>e?.serverStore)}var pe=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new c,this.restTimeout=new c,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},K=new WeakMap;function q(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&K.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),K.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function me(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=K.get(n);a&&a!==e&&q(a),q(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,K.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function he(e){let t=e.context.dataRef.current,n=S(()=>t.hoverInteractionState??pe.create()).current;return t.hoverInteractionState||=n,v(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ge(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:c}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=d.useState(`floatingElement`),h=d.useState(`domReferenceElement`),{dataRef:v}=d.context,y=F(),S=ee(),T=he(d),E=i(),O=b(()=>ue(v.current.openEvent?.type,T.interactedInside)),k=b(()=>de(v.current.openEvent?.type)),A=b(()=>{q(T)});C(()=>{f||(T.pointerType=void 0,T.restTimeoutPending=!1,T.interactedInside=!1,A())},[f,T,A]),W.useEffect(()=>A,[A]),C(()=>{if(n&&f&&T.handleCloseOptions?.blockPointerEvents&&k()&&g(h)&&p){let e=h,t=p,n=u(p),r=y?.nodesRef.current.find(e=>e.id===S)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=T.pointerEventsScopeElement===t?null:T.pointerEventsScopeElement,a=r===t?null:r,o=T.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return me(T,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{A()}}},[n,f,h,p,T,k,y,S,A]),W.useEffect(()=>{if(!n)return;function e(){return!!(y&&S&&D(y.nodesRef.current,S).length>0)}function t(e){let t=G(r,`close`,T.pointerType),n=()=>{d.setOpen(!1,w(x,e)),y?.events.emit(`floating.closed`,e)};t?T.openChangeTimeout.start(t,n):(T.openChangeTimeout.clear(),n())}function i(e){let t=l(e);if(!s(t)){T.interactedInside=!1;return}T.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function u(){T.openChangeTimeout.clear(),E.clear(),y?.events.off(`floating.closed`,h),A()}function f(n){if(e()&&y){y.events.on(`floating.closed`,h);return}if(o(n.relatedTarget,d.context.triggerElements))return;let r=v.current.floatingContext?.nodeId??c,i=n.relatedTarget;if(!(y&&r&&g(i)&&D(y.nodesRef.current,r,!1).some(e=>a(e.context?.elements.floating,i)))){if(T.handler){T.handler(n);return}A(),k()&&!O()&&t(n)}}function h(t){!y||!S||e()||E.start(0,()=>{y.events.off(`floating.closed`,h),d.setOpen(!1,w(x,t)),y.events.emit(`floating.closed`,t)})}let b=p;return m(b&&_(b,`mouseenter`,u),b&&_(b,`mouseleave`,f),b&&_(b,`pointerdown`,i,!0),()=>{y?.events.off(`floating.closed`,h)})},[n,p,d,v,r,c,k,O,A,T,y,S,E])}var _e=e(n(),1),ve={current:null};function ye(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:c=0,move:d=!0,triggerElementRef:f=ve,externalTree:p,isActiveTrigger:h=!0,getHandleCloseContext:v,isClosing:y,shouldOpen:S,guardStaleOpen:C=!1}=t,T=`rootStore`in e?e.rootStore:e,{dataRef:E,events:D}=T.context,O=F(p),k=he(T),A=W.useRef(!1),j=B(i),N=B(r),P=B(c),I=B(n),ee=B(S),te=B(y),L=b(()=>ue(E.current.openEvent?.type,k.interactedInside)),R=b(()=>ee.current?.()!==!1),z=b((e,t,n)=>{let r=T.context.triggerElements;if(r.hasElement(t))return!e||!a(e,t);if(!g(n))return!1;let i=n;return r.hasMatchingElement(e=>a(e,i))&&(!e||!a(e,i))}),V=b(()=>{k.handler&&=(u(T.select(`domReferenceElement`)).removeEventListener(`mousemove`,k.handler),void 0)}),H=b(()=>{q(k)});return h&&(k.handleCloseOptions=j.current?.__options),W.useEffect(()=>V,[V]),W.useEffect(()=>{if(!n)return;function e(e){e.open?A.current=!1:(A.current=e.reason===x,V(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return D.on(`openchange`,e),()=>{D.off(`openchange`,e)}},[n,D,k,V]),W.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=G(N.current,`close`,k.pointerType);n?k.openChangeTimeout.start(n,()=>{T.setOpen(!1,w(x,e)),O?.events.emit(`floating.closed`,e)}):t&&(k.openChangeTimeout.clear(),T.setOpen(!1,w(x,e)),O?.events.emit(`floating.closed`,e))}let t=f.current??(h?T.select(`domReferenceElement`):null);if(!g(t))return;function r(e){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,s&&!M(k.pointerType))return;let t=le(P.current),n=G(N.current,`open`,k.pointerType),r=l(e),i=e.currentTarget??null,o=T.select(`domReferenceElement`),c=i;if(g(r)&&!T.context.triggerElements.hasElement(r)){for(let e of T.context.triggerElements.elements())if(a(e,r)){c=e;break}}g(i)&&g(o)&&!T.context.triggerElements.hasElement(i)&&a(i,o)&&(c=o);let u=c!=null&&z(o,c,r),d=T.select(`open`),f=te.current?.()??T.select(`transitionStatus`)===`ending`,p=!d&&f&&A.current,m=!u&&g(c)&&g(o)&&a(o,c)&&p,h=t>0&&!n,_=u&&(d||p)||m,v=!d||u;if(_){R()&&T.setOpen(!0,w(x,e,c));return}h||(n?k.openChangeTimeout.start(n,()=>{v&&R()&&T.setOpen(!0,w(x,e,c))}):v&&R()&&T.setOpen(!0,w(x,e,c)))}function i(t){if(L()){H();return}V();let n=T.select(`domReferenceElement`),r=u(n);k.restTimeout.clear(),k.restTimeoutPending=!1;let i=E.current.floatingContext??v?.();if(!o(t.relatedTarget,T.context.triggerElements)){if(j.current&&i){T.select(`open`)||k.openChangeTimeout.clear();let n=f.current;k.handler=j.current({...i,tree:O,x:t.clientX,y:t.clientY,onClose(){H(),V(),I.current&&!L()&&n===T.select(`domReferenceElement`)&&e(t,!0)}}),r.addEventListener(`mousemove`,k.handler),k.handler(t);return}(k.pointerType!==`touch`||!a(T.select(`floatingElement`),t.relatedTarget))&&e(t)}}function c(e){a(t,e.relatedTarget)||(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1)}let p=C?_(t,`mouseout`,c):void 0;return d?m(_(t,`mousemove`,r,{once:!0}),_(t,`mouseenter`,r),_(t,`mouseleave`,i),p):m(_(t,`mouseenter`,r),_(t,`mouseleave`,i),p)},[V,H,E,N,T,n,j,k,h,z,L,s,d,P,f,O,I,v,te,R,C]),W.useMemo(()=>{if(!n)return;function e(e){k.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=T.select(`domReferenceElement`),i=T.select(`open`),a=z(r,n,e.target);if(s&&!M(k.pointerType))return;if(i&&a&&k.handleCloseOptions?.blockPointerEvents){let e=T.select(`floatingElement`);if(e){let t=k.handleCloseOptions?.getScope?.()??n.ownerDocument.body;me(k,{scopeElement:t,referenceElement:n,floatingElement:e})}}let o=le(P.current);if(i&&!a||o===0||!a&&k.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;k.restTimeout.clear();function c(){if(k.restTimeoutPending=!1,L())return;let e=T.select(`open`);!k.blockMouseMove&&(!e||a)&&R()&&T.setOpen(!0,w(x,t,n))}k.pointerType===`touch`?_e.flushSync(()=>{c()}):a&&i?c():(k.restTimeoutPending=!0,k.restTimeout.start(o,c))}}},[n,k,L,z,s,T,P,R])}var be=.1,xe=be*be,J=.5;function Y(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function X(e,t,n,r,i,a,o,s,c,l){let u=!1;return Y(e,t,n,r,i,a)&&(u=!u),Y(e,t,i,a,o,s)&&(u=!u),Y(e,t,o,s,c,l)&&(u=!u),Y(e,t,c,l,n,r)&&(u=!u),u}function Se(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Z(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Ce(e={}){let{blockPointerEvents:t=!1}=e,n=new c,r=({x:e,y:t,placement:r,elements:i,onClose:o,nodeId:s,tree:c})=>{let u=r?.split(`-`)[0],d=!1,f=null,p=null,m=typeof performance<`u`?performance.now():0;function h(e,t){let n=performance.now(),r=n-m;if(f===null||p===null||r===0)return f=e,p=t,m=n,!1;let i=e-f,a=t-p,o=i*i+a*a,s=r*r*xe;return f=e,p=t,m=n,o<s}function _(){n.clear(),o()}return function(r){n.clear();let o=i.domReference,f=i.floating;if(!o||!f||u==null||e==null||t==null)return;let{clientX:p,clientY:m}=r,v=l(r),y=r.type===`mouseleave`,b=a(f,v),x=a(o,v);if(b&&(d=!0,!y))return;if(x&&(d=!1,!y)){d=!0;return}if(y&&g(r.relatedTarget)&&a(f,r.relatedTarget))return;function S(){return!!(c&&D(c.nodesRef.current,s).length>0)}function C(){S()||_()}if(S())return;let w=o.getBoundingClientRect(),T=f.getBoundingClientRect(),E=e>T.right-T.width/2,O=t>T.bottom-T.height/2,k=T.width>w.width,A=T.height>w.height,j=(k?w:T).left,M=(k?w:T).right,N=(A?w:T).top,P=(A?w:T).bottom;if(u===`top`&&t>=w.bottom-1||u===`bottom`&&t<=w.top+1||u===`left`&&e>=w.right-1||u===`right`&&e<=w.left+1){C();return}let F=!1;switch(u){case`top`:F=Z(p,m,j,w.top+1,M,T.bottom-1);break;case`bottom`:F=Z(p,m,j,T.top+1,M,w.bottom-1);break;case`left`:F=Z(p,m,T.right-1,P,w.left+1,N);break;case`right`:F=Z(p,m,w.right-1,P,T.left+1,N)}if(F)return;if(d&&!Se(p,m,w)){C();return}if(!y&&h(p,m)){C();return}let I=!1;switch(u){case`top`:{let n=k?J/2:J*4,r=k||E?e+n:e-n,i=k?e-n:E?e+n:e-n,a=t+J+1,o=E||k?T.bottom-J:T.top,s=E?k?T.bottom-J:T.top:T.bottom-J;I=X(p,m,r,a,i,a,T.left,o,T.right,s);break}case`bottom`:{let n=k?J/2:J*4,r=k||E?e+n:e-n,i=k?e-n:E?e+n:e-n,a=t-J,o=E||k?T.top+J:T.bottom,s=E?k?T.top+J:T.bottom:T.top+J;I=X(p,m,r,a,i,a,T.left,o,T.right,s);break}case`left`:{let n=A?J/2:J*4,r=A||O?t+n:t-n,i=A?t-n:O?t+n:t-n,a=e+J+1,o=O||A?T.right-J:T.left,s=O?A?T.right-J:T.left:T.right-J;I=X(p,m,o,T.top,s,T.bottom,a,r,a,i);break}case`right`:{let n=A?J/2:J*4,r=A||O?t+n:t-n,i=A?t-n:O?t+n:t-n,a=e-J,o=O||A?T.left+J:T.right,s=O?A?T.left+J:T.right:T.left+J;I=X(p,m,a,r,a,i,o,T.top,s,T.bottom);break}}I?d||n.start(40,C):C()}};return r.__options={...e,blockPointerEvents:t},r}var we=V(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Te=V(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ee=V(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),De=V(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Oe=V(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ke=V(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ae=V(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),je=V(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),Me=`h-8 shrink-0 cursor-pointer rounded-full border-border/45 bg-background/65 px-3 text-[0.6875rem] font-semibold text-foreground/75 shadow-sm transition-[background-color,border-color,box-shadow,opacity,transform] duration-150 hover:bg-foreground/5 active:scale-[0.96] disabled:opacity-50`,Ne=`relative after:absolute after:top-1/2 after:left-1/2 after:size-10 after:-translate-x-1/2 after:-translate-y-1/2`,Pe=`relative after:absolute after:inset-x-0 after:-top-1.5 after:-bottom-1.5`,Fe=`relative inline-flex h-9 items-center gap-1.5 rounded-[10px] border border-border/70 px-3 text-label font-medium whitespace-nowrap shadow-sm backdrop-blur transition-colors`,Ie=`bg-sidebar text-foreground/55 hover:bg-background hover:text-foreground/75`,Le=`bg-background text-foreground/75`;`${Ie}`,`${Le}`;var Re=`relative z-10 overflow-visible`,ze=`h-full min-h-0 w-[min(360px,calc(100vw-1.5rem))] overflow-hidden rounded-md border border-border/70 bg-background/95 shadow-lg backdrop-blur`,Be=d(`flex min-w-0 rounded-[4px] border`,{variants:{tone:{default:`border-border/30 bg-background/30`,muted:`border-border/20 bg-foreground/1.5`,inset:`border-border/60 bg-foreground/2`,dashed:`border-dashed border-border/25 bg-background/10`},padding:{sm:`p-2`,md:`px-2.5 py-2`,lg:`p-2.5`},interactive:{true:`transition-[border-color,background-color,box-shadow] duration-200 hover:border-border/45 hover:bg-foreground/2 hover:shadow-sm`,lift:`transition-[border-color,background-color,box-shadow,transform] duration-200 hover:-translate-y-px hover:border-border/45 hover:bg-foreground/3.5 hover:shadow-sm`,false:``}},defaultVariants:{tone:`default`,padding:`sm`,interactive:!1}});function Ve(e){return P(`alert-dialog`,e)}var Q=r(),He=4;function Ue({...e}){return(0,Q.jsx)(Ve,{"data-slot":`alert-dialog`,...e})}function We({...e}){return(0,Q.jsx)(N,{"data-slot":`alert-dialog-portal`,...e})}function Ge({className:e,...t}){return(0,Q.jsx)(I,{"data-slot":`alert-dialog-backdrop`,className:h(`fixed inset-0 isolate z-[60] bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Ke({className:e,children:t,...n}){let r=A(),i=Math.min(r+He,8);return(0,Q.jsxs)(We,{children:[(0,Q.jsx)(Ge,{}),(0,Q.jsx)(te,{"data-slot":`alert-dialog-content`,className:h(`fixed top-1/2 left-1/2 z-[60] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-6 text-sm text-popover-foreground outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,T(i),e),...n,children:(0,Q.jsx)(j,{value:i,children:t})})]})}function qe({className:e,...t}){return(0,Q.jsx)(E,{"data-slot":`alert-dialog-title`,className:h(`font-heading text-base leading-none font-medium`,e),...t})}function Je({className:e,...t}){return(0,Q.jsx)(O,{"data-slot":`alert-dialog-description`,className:h(`text-sm text-pretty text-muted-foreground`,e),...t})}function Ye({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:h(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Xe({...e}){return(0,Q.jsx)(k,{"data-slot":`alert-dialog-cancel`,render:(0,Q.jsx)(p,{variant:`outline`}),...e})}function Ze({...e}){return(0,Q.jsx)(k,{"data-slot":`alert-dialog-action`,render:(0,Q.jsx)(p,{variant:`destructive`}),...e})}function Qe({className:e,...t}){return(0,Q.jsx)(ne,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:h(`size-4 animate-spin`,e),...t})}var $e={"amazon-bedrock":{icon:De,placeholder:`AKIA... (AWS access key id)`,help:`Amazon Bedrock uses standard AWS credentials (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY) plus AWS_REGION. This field sets AWS_ACCESS_KEY_ID in .env.local.`},openai:{icon:U,placeholder:`sk-proj-...`,help:`Stored securely in your root .env.local file. Overrides the active OPENAI_API_KEY environment variable.`},"openai-chat-completions":{icon:U,placeholder:`sk-... or nvapi-...`,help:`OpenAI-compatible Chat Completions root (e.g. https://opencode.ai/zen/v1). Paste …/chat/completions if you want — it is normalized. Requires API key, base URL, and model name.`},"openai-chat-completions-model":{icon:U,placeholder:`meta/llama-3.1-70b-instruct`,help:`Gateway model name registered when /models is empty or incomplete.`},anthropic:{icon:H,placeholder:`sk-ant-...`,help:`Stored securely in your root .env.local file. Overrides the active ANTHROPIC_API_KEY environment variable.`},"google-vertex":{icon:ae,placeholder:`Path to service account JSON, or credentials text...`,help:`Stored securely in your root .env.local file. Overrides the active GOOGLE_APPLICATION_CREDENTIALS environment variable.`},google:{icon:Te,placeholder:`AIzaSy...`,help:`Stored securely in your root .env.local file. Overrides the active GEMINI_API_KEY environment variable.`},mistral:{icon:Ae,placeholder:`Your Mistral API key...`,help:`Stored securely in your root .env.local file. Overrides the active MISTRAL_API_KEY environment variable.`},groq:{icon:je,placeholder:`gsk_...`,help:`Stored securely in your root .env.local file. Overrides the active GROQ_API_KEY environment variable.`},openrouter:{icon:re,placeholder:`sk-or-...`,help:`Stored securely in your root .env.local file. Overrides the active OPENROUTER_API_KEY environment variable.`},"vercel-ai-gateway":{icon:ie,placeholder:`Your AI Gateway API key...`,help:`Stored securely in your root .env.local file. Overrides the active AI_GATEWAY_API_KEY environment variable.`},"github-copilot":{icon:H,placeholder:`OAuth subscription`,help:`GitHub Copilot uses device-code OAuth. Sign in from Settings; credentials are stored in auth.json.`},"openai-codex":{icon:U,placeholder:`OAuth subscription`,help:`OpenAI Codex uses ChatGPT OAuth. Sign in from Settings; credentials are stored in auth.json.`},ollama:{icon:Ee,placeholder:`http://localhost:11434 (default)`,help:`Configure local Ollama execution endpoints. Overrides the active OLLAMA_BASE_URL environment variable.`},custom:{icon:oe,placeholder:`sk-... / provider key`,help:`Register any OpenAI-, Anthropic-, or Google-compatible endpoint through Pi's native custom-provider mechanism. Requires a name, API key, https base URL, API family, and at least one model id. Deployed accounts only.`}},$=`size-4`;function et({className:e}){return(0,Q.jsx)(`svg`,{viewBox:`0 0 24 24`,className:h($,e),fill:`currentColor`,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.368v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.814 3.354-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.079.079 0 0 0-.041-.067zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zM8.306 12.683l-2.02-1.163a.08.08 0 0 1-.038-.057V6.074a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.392.681zm1.098-2.016l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z`})})}function tt({className:e}){return(0,Q.jsx)(`svg`,{viewBox:`0 0 24 24`,className:h($,e),fill:`currentColor`,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`M17.305 14.256h-3.778l-2.28-7.23h-.005l-2.32 7.23H5.145L9.93 3h4.14l4.235 11.256zm-8.48 2.37h6.37l1.16 3.374h3.465L14.18 3h-4.36L4.15 20h3.465l1.21-3.374z`})})}function nt({className:e}){return(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:h($,e),fill:`currentColor`,"aria-hidden":!0,children:[(0,Q.jsx)(`path`,{d:`M21.6 12.23c0-.71-.06-1.4-.18-2.05H12v3.87h5.38a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.89-1.74 2.98-4.3 2.98-7.34z`}),(0,Q.jsx)(`path`,{d:`M12 22c2.7 0 4.96-.89 6.61-2.42l-3.24-2.5c-.9.6-2.04.96-3.37.96-2.59 0-4.78-1.75-5.56-4.1H3.1v2.58A9.99 9.99 0 0 0 12 22z`}),(0,Q.jsx)(`path`,{d:`M6.44 13.94A5.99 5.99 0 0 1 6.12 12c0-.67.12-1.33.32-1.94V7.48H3.1A9.99 9.99 0 0 0 2 12c0 1.61.39 3.14 1.1 4.52l3.34-2.58z`}),(0,Q.jsx)(`path`,{d:`M12 5.96c1.47 0 2.79.5 3.82 1.5l2.87-2.87C16.95 2.99 14.7 2 12 2A9.99 9.99 0 0 0 3.1 7.48l3.34 2.58C7.22 7.71 9.41 5.96 12 5.96z`})]})}function rt({className:e}){return(0,Q.jsx)(`svg`,{viewBox:`0 0 24 24`,className:h($,e),fill:`currentColor`,"aria-hidden":!0,children:(0,Q.jsx)(`path`,{d:`M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2.2c-3.3.7-4-1.4-4-1.4-.5-1.4-1.3-1.8-1.3-1.8-1.1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.7.2 2.9.1 3.2.8.8 1.2 1.9 1.2 3.2 0 4.6-2.9 5.6-5.5 5.9.4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3z`})})}function it({provider:e,api:t,className:n}){let r=e.toLowerCase();if(R(r)||r===`custom`)return t===`anthropic-messages`?(0,Q.jsx)(tt,{className:n}):t===`google-genai`?(0,Q.jsx)(nt,{className:n}):(0,Q.jsx)(et,{className:n});if(r===`openai`||r===`openai-codex`||L(r))return(0,Q.jsx)(et,{className:n});if(r===`anthropic`)return(0,Q.jsx)(tt,{className:n});if(r===`google`||r===`google-vertex`)return(0,Q.jsx)(nt,{className:n});if(r===`github-copilot`||r===`github`)return(0,Q.jsx)(rt,{className:n});let i=e in $e?$e[e].icon:Ee;return(0,Q.jsx)(i,{className:h($,n),"aria-hidden":!0})}function at(e){return z.find(t=>t.id===e)?.name??e}export{G as A,Ee as C,ge as D,ye as E,he as O,Oe as S,Ce as T,Ne as _,Ue as a,Be as b,Ke as c,qe as d,Re as f,Me as g,Ie as h,Qe as i,fe as k,Je as l,Fe as m,it as n,Ze as o,Le as p,$e as r,Xe as s,at as t,Ye as u,Pe as v,we as w,ke as x,ze as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{o as r,t as i}from"./ipython-tool-ldJ9F1Cw.js";import{t as a}from"./square-terminal-BYTN_I86.js";import{t as o}from"./triangle-alert-CU-gd7ui.js";var s=e(t(),1),c=n(),l={running:{toolState:`input-streaming`,label:`Running`},error:{toolState:`output-error`,label:`Failed`},cancelled:{toolState:`aborted`,label:`Cancelled`},success:{toolState:`output-available`,label:`Completed`}};function u(e){return l[e].toolState}function d(e){return{type:`tool-IPython`,toolCallId:e.sourceToolCallId??e.id,state:u(e.status),input:e.input,output:e.output,backgroundOutput:e.backgroundOutput}}function f(e){return l[e].label}function p({artifact:e,index:t,selected:n}){let a=(0,s.useRef)(null);return(0,s.useEffect)(()=>{n&&requestAnimationFrame(()=>{a.current?.focus({preventScroll:!0}),a.current?.scrollIntoView({block:`nearest`})})},[e.id,n]),(0,c.jsxs)(`article`,{ref:a,tabIndex:-1,className:`overflow-hidden rounded-md border border-border/60 bg-background outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-repl-run-id":e.id,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 border-b border-border/50 px-2.5 py-1.5`,children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,c.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[0.6875rem] font-medium text-foreground/70`,children:[`Cell `,t+1]}),(0,c.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:f(e.status)})]}),(0,c.jsx)(`div`,{className:`p-2`,children:(0,c.jsx)(i,{part:d(e)})})]})}function m({artifactRuns:e=[],selectedArtifactId:t,kernelDiagnostics:n}){let r=e.flatMap(e=>e.artifacts).filter(e=>e.kind===`ipython`);return(0,c.jsxs)(`section`,{"aria-label":`REPL runs`,className:`space-y-2 pb-1`,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,c.jsx)(a,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`IPython cells`}),(0,c.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:r.length>0?r.length:`none yet`})]}),n?(0,c.jsxs)(`details`,{className:`overflow-hidden rounded-md border border-border/60 bg-background`,children:[(0,c.jsxs)(`summary`,{className:`flex min-w-0 cursor-pointer items-center gap-2 px-2.5 py-1.5`,children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.6875rem] font-medium text-foreground/70`,children:`Kernel diagnostics`}),(0,c.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:n.truncated?`tail`:`stderr`})]}),(0,c.jsx)(`pre`,{className:`max-h-48 overflow-auto border-t border-border/50 px-2.5 py-1.5 font-mono text-[0.6875rem] leading-4 whitespace-pre-wrap text-foreground/70`,children:n.tail})]}):null,r.length===0?(0,c.jsx)(`p`,{className:`px-2 text-[0.6875rem] leading-4 text-foreground/45`,children:`Executed IPython cells and their output will appear here.`}):(0,c.jsx)(`div`,{className:`space-y-2`,"data-testid":`repl-run-list`,children:r.map((e,n)=>(0,c.jsx)(p,{artifact:e,index:n,selected:e.id===t},e.id))})]})}export{m as ReplPanelContent};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{o as r,t as i}from"./ipython-tool-CyuMOxz1.js";import{t as a}from"./square-terminal-BYTN_I86.js";import{t as o}from"./triangle-alert-CU-gd7ui.js";var s=e(t(),1),c=n(),l={running:{toolState:`input-streaming`,label:`Running`},error:{toolState:`output-error`,label:`Failed`},cancelled:{toolState:`aborted`,label:`Cancelled`},success:{toolState:`output-available`,label:`Completed`}};function u(e){return l[e].toolState}function d(e){return{type:`tool-IPython`,toolCallId:e.sourceToolCallId??e.id,state:u(e.status),input:e.input,output:e.output,backgroundOutput:e.backgroundOutput}}function f(e){return l[e].label}function p({artifact:e,index:t,selected:n}){let a=(0,s.useRef)(null);return(0,s.useEffect)(()=>{n&&requestAnimationFrame(()=>{a.current?.focus({preventScroll:!0}),a.current?.scrollIntoView({block:`nearest`})})},[e.id,n]),(0,c.jsxs)(`article`,{ref:a,tabIndex:-1,className:`overflow-hidden rounded-md border border-border/60 bg-background outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-repl-run-id":e.id,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 border-b border-border/50 px-2.5 py-1.5`,children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,c.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[0.6875rem] font-medium text-foreground/70`,children:[`Cell `,t+1]}),(0,c.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:f(e.status)})]}),(0,c.jsx)(`div`,{className:`p-2`,children:(0,c.jsx)(i,{part:d(e)})})]})}function m({artifactRuns:e=[],selectedArtifactId:t,kernelDiagnostics:n}){let r=e.flatMap(e=>e.artifacts).filter(e=>e.kind===`ipython`);return(0,c.jsxs)(`section`,{"aria-label":`REPL runs`,className:`space-y-2 pb-1`,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5`,children:[(0,c.jsx)(a,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label font-medium text-foreground/70`,children:`IPython cells`}),(0,c.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:r.length>0?r.length:`none yet`})]}),n?(0,c.jsxs)(`details`,{className:`overflow-hidden rounded-md border border-border/60 bg-background`,children:[(0,c.jsxs)(`summary`,{className:`flex min-w-0 cursor-pointer items-center gap-2 px-2.5 py-1.5`,children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0 text-foreground/45`}),(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.6875rem] font-medium text-foreground/70`,children:`Kernel diagnostics`}),(0,c.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-foreground/40`,children:n.truncated?`tail`:`stderr`})]}),(0,c.jsx)(`pre`,{className:`max-h-48 overflow-auto border-t border-border/50 px-2.5 py-1.5 font-mono text-[0.6875rem] leading-4 whitespace-pre-wrap text-foreground/70`,children:n.tail})]}):null,r.length===0?(0,c.jsx)(`p`,{className:`px-2 text-[0.6875rem] leading-4 text-foreground/45`,children:`Executed IPython cells and their output will appear here.`}):(0,c.jsx)(`div`,{className:`space-y-2`,"data-testid":`repl-run-list`,children:r.map((e,n)=>(0,c.jsx)(p,{artifact:e,index:n,selected:e.id===t},e.id))})]})}export{m as ReplPanelContent};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/artifacts-panel-CQmFEF_H.js","assets/rolldown-runtime-hePW80VL.js","assets/bundle-mjs-DKHVkVWu.js","assets/jsx-runtime-NZYk81nU.js","assets/button-BR2WWrFo.js","assets/react-dom-Bwxum3ti.js","assets/createBaseUIEventDetails-DV0dQrBX.js","assets/utils-Eg7xtNmV.js","assets/createLucideIcon-DwxZHm0M.js","assets/tool-result-DfnPN0FQ.js","assets/ease-u56MhKYS.js","assets/layout-gyLzPvVv.js","assets/use-reduced-motion-eORd7fqW.js","assets/check-JjHKAZas.js","assets/chevron-down-BEVGmnSb.js","assets/loader-circle-DjfHXUPB.js","assets/circle-x-CkKCB__4.js","assets/action-swap-roll-BB8DFMuf.js","assets/rotate-ccw-WNFNkKQD.js","assets/square-terminal-BYTN_I86.js","assets/wrench-BJNNe07k.js","assets/preload-helper-Czpn1I53.js","assets/agent-disclosure-B8SnhQXL.js","assets/chevron-right-DrJxToLs.js","assets/package-CdcJFPf2.js","assets/openui-renderer-J3dhPpL4.js","assets/dialog-BEZuZhzk.js","assets/useBaseUiId-CHqXB2UQ.js","assets/x-CsRC_tCI.js","assets/provider-catalog-D8G66gwc.js","assets/useControlled-CJJ9BOQB.js","assets/input-0wwjWjKq.js","assets/chevron-up-CnSvySGH.js","assets/card-BKl76a3R.js","assets/chunk-YOKDWASO-BAf618wr.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js","assets/openui-utils-DawGoQNp.js","assets/safe-external-url-D3PJJIcM.js","assets/chat-yh02zgA7.js","assets/switch-9rTeg6J6.js","assets/markdown-DInPmRUG.js","assets/cn-C8c0S2mI.js","assets/dist-BPaFisIZ.js","assets/collapsible-BoXtZZWN.js","assets/prime-agent-artifacts-C-g1VPiW.js","assets/artifacts-utils-N_kUFbz2.js","assets/resources-panel-D867-goy.js","assets/resource-helpers-Q2T0YCMO.js","assets/file-text-T-NcAlZs.js","assets/plug-Dt6VN0zF.js","assets/circle-alert-CONlFReH.js","assets/skeleton-loaders-C9vHwAYV.js","assets/skeleton-CkR2VmWc.js","assets/session-insights-panel-YnaXvTpi.js","assets/repl-panel-DsPX04Xr.js","assets/ipython-tool-ldJ9F1Cw.js","assets/triangle-alert-CU-gd7ui.js","assets/subagents-panel-BMp2Ego0.js","assets/bot-Bs7QWJ2q.js","assets/subagent-utils-DDH5qm9Z.js","assets/subagent-transcript-D8wmQxXe.js","assets/citations-C_tPOJE_.js","assets/earth-DGZXAN5r.js","assets/shield-check-CkA2viVW.js","assets/virtualized-turn-list-DMJENRY0.js","assets/image-BbPmlw-n.js","assets/notify-DgMKgZZW.js","assets/toast-Bt9p2OL4.js","assets/fleet-pi-tool-renderer-BEDIO3al.js","assets/eye-B0DFz5hL.js","assets/search-eWVnAJsb.js","assets/sparkles-DuclzqlE.js","assets/terminal-DOS1s1gm.js","assets/dist-CZDnnosQ.js","assets/workspace-path-nav-C0AQNZyy.js","assets/surfaces-DI-U-_2a.js","assets/range-BWOHiLNe.js","assets/fleet-tool-timeline-C8heL7ae.js","assets/refresh-cw-IThTJ3j-.js","assets/fleet-subagent-list-iKUtLJKZ.js","assets/workspace-panel-G6yMpKJ8.js","assets/horizontal-resize-qK6eRhIG.js","assets/safe-storage-s25GrfpH.js","assets/folder-BC5p7qK7.js","assets/hard-drive-CHqgr7VQ.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-DwxZHm0M.js";import{t as i}from"./bot-Bs7QWJ2q.js";import{t as a}from"./folder-BC5p7qK7.js";import{t as o}from"./package-CdcJFPf2.js";import{t as s}from"./square-terminal-BYTN_I86.js";import{t as c}from"./preload-helper-Czpn1I53.js";import{i as l,n as u}from"./right-panel-context-DHlNWJsF.js";import{t as d}from"./skeleton-CkR2VmWc.js";var f=r(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),p=r(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),m=e(t(),1),h=n(),g=(0,m.lazy)(()=>c(async()=>{let{ArtifactsPanelContent:e}=await import(`./artifacts-panel-CQmFEF_H.js`);return{ArtifactsPanelContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])).then(({ArtifactsPanelContent:e})=>({default:e}))),_=(0,m.lazy)(()=>c(async()=>{let{ResourcesPanelContent:e}=await import(`./resources-panel-D867-goy.js`);return{ResourcesPanelContent:e}},__vite__mapDeps([47,3,1,48,8,2,49,24,50,51,52,53,7])).then(({ResourcesPanelContent:e})=>({default:e}))),v=(0,m.lazy)(()=>c(async()=>{let{SessionInsightsPanel:e}=await import(`./session-insights-panel-YnaXvTpi.js`);return{SessionInsightsPanel:e}},__vite__mapDeps([54,3,1])).then(({SessionInsightsPanel:e})=>({default:e}))),y=(0,m.lazy)(()=>c(async()=>{let{ReplPanelContent:e}=await import(`./repl-panel-DsPX04Xr.js`);return{ReplPanelContent:e}},__vite__mapDeps([55,1,2,3,56,7,8,42,19,57])).then(({ReplPanelContent:e})=>({default:e}))),b=(0,m.lazy)(()=>c(async()=>{let{SubagentsPanelContent:e}=await import(`./subagents-panel-BMp2Ego0.js`);return{SubagentsPanelContent:e}},__vite__mapDeps([58,1,2,3,4,5,6,7,59,8,23,60,51,15,16,61,62,10,11,12,14,63,64,21,22,38,65,13,17,49,66,28,42,67,68,57,37,69,9,18,19,20,32,56,70,71,72,73,74,35,36,75,44,27,30,76,77,78,79,80,45])).then(({SubagentsPanelContent:e})=>({default:e}))),x=(0,m.lazy)(()=>c(async()=>{let{WorkspacePanelContent:e}=await import(`./workspace-panel-G6yMpKJ8.js`);return{WorkspacePanelContent:e}},__vite__mapDeps([81,1,2,3,10,11,12,7,48,8,49,24,50,23,51,82,83,84,85,75,41,21,34,5,35,42,52,53])).then(({WorkspacePanelContent:e})=>({default:e})));function S(){return(0,h.jsxs)(`div`,{className:`flex min-h-32 flex-col gap-3 p-4`,"aria-label":`Loading panel`,children:[(0,h.jsx)(d,{className:`h-5 w-32`}),(0,h.jsx)(d,{className:`h-20 w-full`})]})}function C(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(v,{activityLabel:e.activityLabel,artifactRuns:e.artifactRuns,chatMode:e.chatMode,messages:e.messages,planLabel:e.planLabel,presentation:e.presentation,queue:e.queue,selectedModelKey:e.selectedModelKey,sessionId:e.sessionId,status:e.status,thinkingLevel:e.thinkingLevel})})}function w(){let e=u(),t=l();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(_,{error:e.resourcesError,loading:e.resourcesLoading,resources:e.resources,workspace:t.workspaceTree})})}function T(){let e=l();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(x,{error:e.workspaceError,loadWorkspaceFile:e.loadWorkspaceFile,loading:e.workspaceLoading,onSelectedPathChange:e.setSelectedWorkspacePath,selectedPath:e.selectedWorkspacePath,workspace:e.workspaceTree})})}function E(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(g,{artifactRuns:e.artifactRuns,messages:e.messages,onOpenUIAction:e.onOpenUIAction,selectedArtifactId:e.selectedArtifactId,status:e.status})})}function D(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(y,{artifactRuns:e.artifactRuns,selectedArtifactId:e.selectedArtifactId,kernelDiagnostics:e.presentation.kernelDiagnostics})})}function O(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(b,{agents:e.presentation.rlmChildren,loadSession:e.loadSubagentSession,onOpenTab:e.onOpenSubagentTab,parentSessionId:e.sessionId,tree:e.presentation.rlmTree})})}var k={resources:{id:`resources`,order:0,title:`Resources`,ariaLabel:`Resources`,commandLabel:`Open Resources`,commandKeywords:[`resources`,`skills`,`panels`],icon:p,dataTestid:`pi-resources-canvas`,mobileDataTestid:`pi-resources-mobile-panel`,showInLauncher:!0,badgeSource:`resources`,loadingSource:`resources`,refreshSource:`resources`,component:w},workspace:{id:`workspace`,order:1,title:`Workspace`,ariaLabel:`Workspace`,commandLabel:`Open Workspace`,commandKeywords:[`workspace`,`files`,`panels`],icon:a,dataTestid:`pi-workspace-canvas`,mobileDataTestid:`pi-workspace-mobile-panel`,showInLauncher:!0,badgeSource:void 0,loadingSource:`workspace`,refreshSource:`workspace`,component:T},artifacts:{id:`artifacts`,order:2,title:`Artifacts`,ariaLabel:`Artifacts`,commandLabel:`Open Artifacts`,commandKeywords:[`artifacts`,`reports`,`datasets`,`panels`],icon:o,dataTestid:`pi-artifacts-canvas`,mobileDataTestid:`pi-artifacts-mobile-panel`,showInLauncher:!0,badgeSource:`artifacts`,loadingSource:void 0,refreshSource:void 0,component:E},repl:{id:`repl`,order:3,title:`REPL`,ariaLabel:`REPL runs`,commandLabel:`Open REPL`,commandKeywords:[`repl`,`ipython`,`python`,`cells`,`panels`],icon:s,dataTestid:`pi-repl-canvas`,mobileDataTestid:`pi-repl-mobile-panel`,showInLauncher:!0,badgeSource:`repl`,loadingSource:void 0,refreshSource:void 0,component:D},subagents:{id:`subagents`,order:4,title:`Subagents`,ariaLabel:`Subagents`,commandLabel:`Open Subagents`,commandKeywords:[`subagents`,`agents`,`threads`,`delegation`,`panels`],icon:i,dataTestid:`pi-subagents-canvas`,mobileDataTestid:`pi-subagents-mobile-panel`,showInLauncher:!1,badgeSource:void 0,loadingSource:void 0,refreshSource:void 0,component:O},"session-insights":{id:`session-insights`,order:5,title:`Session insights`,ariaLabel:`Session insights`,commandLabel:`Open Session Insights`,commandKeywords:[`session`,`insights`,`activity`,`panels`],icon:f,dataTestid:`pi-session-insights-canvas`,mobileDataTestid:`pi-session-insights-mobile-panel`,showInLauncher:!0,badgeSource:void 0,loadingSource:void 0,refreshSource:void 0,component:C}},A=Object.values(k).sort((e,t)=>e.order-t.order).filter(e=>e.showInLauncher!==!1);function j(e){return k[e]}export{j as n,p as r,A as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/artifacts-panel-HVjqBMyx.js","assets/rolldown-runtime-hePW80VL.js","assets/bundle-mjs-DKHVkVWu.js","assets/jsx-runtime-NZYk81nU.js","assets/button-C5wFDY5_.js","assets/react-dom-Bwxum3ti.js","assets/utils-Eg7xtNmV.js","assets/createBaseUIEventDetails-DV0dQrBX.js","assets/createLucideIcon-DwxZHm0M.js","assets/tool-result-Cki8WUNc.js","assets/ease-u56MhKYS.js","assets/layout-gyLzPvVv.js","assets/use-reduced-motion-eORd7fqW.js","assets/check-JjHKAZas.js","assets/chevron-down-BEVGmnSb.js","assets/loader-circle-DjfHXUPB.js","assets/circle-x-CkKCB__4.js","assets/action-swap-roll-COzQ86wm.js","assets/rotate-ccw-WNFNkKQD.js","assets/square-terminal-BYTN_I86.js","assets/wrench-BJNNe07k.js","assets/preload-helper-Czpn1I53.js","assets/agent-disclosure-DAMuuGcM.js","assets/chevron-right-DrJxToLs.js","assets/package-CdcJFPf2.js","assets/openui-renderer-TLNe5e_Q.js","assets/card-DA3Vnqay.js","assets/dialog-pBGUjAQ7.js","assets/useBaseUiId-CHqXB2UQ.js","assets/x-CsRC_tCI.js","assets/provider-catalog-DYMFdbKc.js","assets/useControlled-CJJ9BOQB.js","assets/input-PcdubeKn.js","assets/chevron-up-CnSvySGH.js","assets/chunk-YOKDWASO-BAf618wr.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js","assets/safe-external-url-D3PJJIcM.js","assets/openui-utils-DawGoQNp.js","assets/chat-BhYseKd6.js","assets/switch-WhXeJNNY.js","assets/markdown-lvexwooo.js","assets/cn-C8c0S2mI.js","assets/dist-BPaFisIZ.js","assets/collapsible-BoXtZZWN.js","assets/prime-agent-artifacts-C-g1VPiW.js","assets/artifacts-utils-N_kUFbz2.js","assets/resources-panel-D867-goy.js","assets/resource-helpers-Q2T0YCMO.js","assets/file-text-T-NcAlZs.js","assets/plug-Dt6VN0zF.js","assets/circle-alert-CONlFReH.js","assets/skeleton-loaders-C9vHwAYV.js","assets/skeleton-CkR2VmWc.js","assets/session-insights-panel-YnaXvTpi.js","assets/repl-panel-C5om8MGU.js","assets/ipython-tool-CyuMOxz1.js","assets/triangle-alert-CU-gd7ui.js","assets/subagents-panel-D_aVgSCi.js","assets/bot-Bs7QWJ2q.js","assets/subagent-utils-DDH5qm9Z.js","assets/subagent-transcript-DaVHjNUH.js","assets/citations-BPv8HIpf.js","assets/earth-DGZXAN5r.js","assets/shield-check-CkA2viVW.js","assets/virtualized-turn-list-CdMa-ydT.js","assets/image-BbPmlw-n.js","assets/notify-DxL0VD7Z.js","assets/toast-D3c9XeGe.js","assets/fleet-pi-tool-renderer-BRgNnmaJ.js","assets/eye-B0DFz5hL.js","assets/search-eWVnAJsb.js","assets/sparkles-DuclzqlE.js","assets/terminal-DOS1s1gm.js","assets/dist-CZDnnosQ.js","assets/surfaces-BhAXz9So.js","assets/workspace-path-nav-C0AQNZyy.js","assets/range-BWOHiLNe.js","assets/fleet-tool-timeline-C8heL7ae.js","assets/refresh-cw-IThTJ3j-.js","assets/fleet-subagent-list-iKUtLJKZ.js","assets/workspace-panel-77bDbprs.js","assets/horizontal-resize-Cp3iHMH7.js","assets/safe-storage-s25GrfpH.js","assets/folder-BC5p7qK7.js","assets/hard-drive-CHqgr7VQ.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-DwxZHm0M.js";import{t as i}from"./bot-Bs7QWJ2q.js";import{t as a}from"./folder-BC5p7qK7.js";import{t as o}from"./package-CdcJFPf2.js";import{t as s}from"./square-terminal-BYTN_I86.js";import{t as c}from"./preload-helper-Czpn1I53.js";import{i as l,n as u}from"./right-panel-context-DHlNWJsF.js";import{t as d}from"./skeleton-CkR2VmWc.js";var f=r(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),p=r(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),m=e(t(),1),h=n(),g=(0,m.lazy)(()=>c(async()=>{let{ArtifactsPanelContent:e}=await import(`./artifacts-panel-HVjqBMyx.js`);return{ArtifactsPanelContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])).then(({ArtifactsPanelContent:e})=>({default:e}))),_=(0,m.lazy)(()=>c(async()=>{let{ResourcesPanelContent:e}=await import(`./resources-panel-D867-goy.js`);return{ResourcesPanelContent:e}},__vite__mapDeps([47,3,1,48,8,2,49,24,50,51,52,53,6])).then(({ResourcesPanelContent:e})=>({default:e}))),v=(0,m.lazy)(()=>c(async()=>{let{SessionInsightsPanel:e}=await import(`./session-insights-panel-YnaXvTpi.js`);return{SessionInsightsPanel:e}},__vite__mapDeps([54,3,1])).then(({SessionInsightsPanel:e})=>({default:e}))),y=(0,m.lazy)(()=>c(async()=>{let{ReplPanelContent:e}=await import(`./repl-panel-C5om8MGU.js`);return{ReplPanelContent:e}},__vite__mapDeps([55,1,2,3,56,6,8,42,19,57])).then(({ReplPanelContent:e})=>({default:e}))),b=(0,m.lazy)(()=>c(async()=>{let{SubagentsPanelContent:e}=await import(`./subagents-panel-D_aVgSCi.js`);return{SubagentsPanelContent:e}},__vite__mapDeps([58,1,2,3,4,5,6,7,59,8,23,60,51,15,16,61,62,10,11,12,14,63,64,21,22,37,65,13,17,49,66,29,42,67,68,57,38,69,9,18,19,20,33,56,70,71,72,73,74,35,36,75,44,28,31,76,77,78,79,80,45])).then(({SubagentsPanelContent:e})=>({default:e}))),x=(0,m.lazy)(()=>c(async()=>{let{WorkspacePanelContent:e}=await import(`./workspace-panel-77bDbprs.js`);return{WorkspacePanelContent:e}},__vite__mapDeps([81,1,2,3,6,10,11,12,48,8,49,24,50,23,51,82,83,84,85,76,41,21,34,5,35,42,52,53])).then(({WorkspacePanelContent:e})=>({default:e})));function S(){return(0,h.jsxs)(`div`,{className:`flex min-h-32 flex-col gap-3 p-4`,"aria-label":`Loading panel`,children:[(0,h.jsx)(d,{className:`h-5 w-32`}),(0,h.jsx)(d,{className:`h-20 w-full`})]})}function C(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(v,{activityLabel:e.activityLabel,artifactRuns:e.artifactRuns,chatMode:e.chatMode,messages:e.messages,planLabel:e.planLabel,presentation:e.presentation,queue:e.queue,selectedModelKey:e.selectedModelKey,sessionId:e.sessionId,status:e.status,thinkingLevel:e.thinkingLevel})})}function w(){let e=u(),t=l();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(_,{error:e.resourcesError,loading:e.resourcesLoading,resources:e.resources,workspace:t.workspaceTree})})}function T(){let e=l();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(x,{error:e.workspaceError,loadWorkspaceFile:e.loadWorkspaceFile,loading:e.workspaceLoading,onSelectedPathChange:e.setSelectedWorkspacePath,selectedPath:e.selectedWorkspacePath,workspace:e.workspaceTree})})}function E(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(g,{artifactRuns:e.artifactRuns,messages:e.messages,onOpenUIAction:e.onOpenUIAction,selectedArtifactId:e.selectedArtifactId,status:e.status})})}function D(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(y,{artifactRuns:e.artifactRuns,selectedArtifactId:e.selectedArtifactId,kernelDiagnostics:e.presentation.kernelDiagnostics})})}function O(){let e=u();return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(S,{}),children:(0,h.jsx)(b,{agents:e.presentation.rlmChildren,loadSession:e.loadSubagentSession,onOpenTab:e.onOpenSubagentTab,parentSessionId:e.sessionId,tree:e.presentation.rlmTree})})}var k={resources:{id:`resources`,order:0,title:`Resources`,ariaLabel:`Resources`,commandLabel:`Open Resources`,commandKeywords:[`resources`,`skills`,`panels`],icon:p,dataTestid:`pi-resources-canvas`,mobileDataTestid:`pi-resources-mobile-panel`,showInLauncher:!0,badgeSource:`resources`,loadingSource:`resources`,refreshSource:`resources`,component:w},workspace:{id:`workspace`,order:1,title:`Workspace`,ariaLabel:`Workspace`,commandLabel:`Open Workspace`,commandKeywords:[`workspace`,`files`,`panels`],icon:a,dataTestid:`pi-workspace-canvas`,mobileDataTestid:`pi-workspace-mobile-panel`,showInLauncher:!0,badgeSource:void 0,loadingSource:`workspace`,refreshSource:`workspace`,component:T},artifacts:{id:`artifacts`,order:2,title:`Artifacts`,ariaLabel:`Artifacts`,commandLabel:`Open Artifacts`,commandKeywords:[`artifacts`,`reports`,`datasets`,`panels`],icon:o,dataTestid:`pi-artifacts-canvas`,mobileDataTestid:`pi-artifacts-mobile-panel`,showInLauncher:!0,badgeSource:`artifacts`,loadingSource:void 0,refreshSource:void 0,component:E},repl:{id:`repl`,order:3,title:`REPL`,ariaLabel:`REPL runs`,commandLabel:`Open REPL`,commandKeywords:[`repl`,`ipython`,`python`,`cells`,`panels`],icon:s,dataTestid:`pi-repl-canvas`,mobileDataTestid:`pi-repl-mobile-panel`,showInLauncher:!0,badgeSource:`repl`,loadingSource:void 0,refreshSource:void 0,component:D},subagents:{id:`subagents`,order:4,title:`Subagents`,ariaLabel:`Subagents`,commandLabel:`Open Subagents`,commandKeywords:[`subagents`,`agents`,`threads`,`delegation`,`panels`],icon:i,dataTestid:`pi-subagents-canvas`,mobileDataTestid:`pi-subagents-mobile-panel`,showInLauncher:!1,badgeSource:void 0,loadingSource:void 0,refreshSource:void 0,component:O},"session-insights":{id:`session-insights`,order:5,title:`Session insights`,ariaLabel:`Session insights`,commandLabel:`Open Session Insights`,commandKeywords:[`session`,`insights`,`activity`,`panels`],icon:f,dataTestid:`pi-session-insights-canvas`,mobileDataTestid:`pi-session-insights-mobile-panel`,showInLauncher:!0,badgeSource:void 0,loadingSource:void 0,refreshSource:void 0,component:C}},A=Object.values(k).sort((e,t)=>e.order-t.order).filter(e=>e.showInLauncher!==!1);function j(e){return k[e]}export{j as n,p as r,A as t};