@questdb/web-console 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_LICENSES.txt +717 -303
- package/dist/assets/index-B0NErtb0.js +1059 -0
- package/dist/assets/index-DLj61pTx.js +7008 -0
- package/dist/assets/{tiktoken-CTBgcTlC.js → tiktoken-D_XIXzTZ.js} +1 -1
- package/dist/assets/{vendor-DsPrTxrp.js → vendor-BHoUroWS.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +5 -3
- package/dist/assets/index-Cg4NZQY-.js +0 -7079
- package/dist/assets/index-DH6Mra5W.js +0 -1055
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
import{p as te,Q as _t,s as Me,u as Fe,a as pt,j as r,A as gt,K as en,c as h,B as he,b as ft,t as ve,C as je,e as Ze,d as tn,f as D,g as Ea,h as It,i as nn,k as _a,l as Ia,m as an,n as Za,o as me,q as Zt,r as rn,v as Va,T as Na,w as sn,x as on,y as ln,z as Vt,D as Pe,E as ne,F as De,G as Nt,H as Sa,I as Qe,J as La,L as He,M as St,N as Fa,O as cn,P as Ke,R as qe,S as Da,U as qa,V as Ta,W as Ra,X as za,Y as Ue,Z as Oa,_ as le,$ as dn,a0 as Lt,a1 as $a,a2 as Ba,a3 as Ce,a4 as Ft,a5 as Wa,a6 as Pa,a7 as Dt,a8 as Te,a9 as Qa,aa as un,ab as Ka,ac as Ua,ad as Ga,ae as Ya,af as Xa,ag as Ja,ah as er,ai as tr,aj as nr,ak as hn,al as ar,am as rr,an as pe,ao as ir,ap as sr,aq as or,ar as mn,as as Re,at as lr,au as cr,av as dr,aw as Ge,ax as Ye,ay as Xe,az as Je,aA as et,aB as ur,aC as hr,aD as mr,aE as pr,aF as gr,aG as xt,aH as pn,aI as fr,aJ as xr,aK as yr,aL as br}from"./index-DLj61pTx.js";import{b as n,E as Ee,H as g,Z as qt,R as yt,C as re,U as Cr,D as gn}from"./vendor-BHoUroWS.js";const wr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),n.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),kr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),n.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),Ar=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M88,128a16,16,0,1,1,16,16A16,16,0,0,1,88,128Zm64,16a16,16,0,1,0-16-16A16,16,0,0,0,152,144Zm84-80V192a20,20,0,0,1-20,20H84.47L53,239.17l-.12.11A19.91,19.91,0,0,1,40.05,244a20.14,20.14,0,0,1-8.49-1.9A19.82,19.82,0,0,1,20,224V64A20,20,0,0,1,40,44H216A20,20,0,0,1,236,64Zm-24,4H44V215.23l28.16-24.32A11.93,11.93,0,0,1,80,188H212Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),n.createElement("path",{d:"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM84,140a12,12,0,1,1,12-12A12,12,0,0,1,84,140Zm44,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm44,0a12,12,0,1,1,12-12A12,12,0,0,1,172,140Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM84,118a10,10,0,1,0,10,10A10,10,0,0,0,84,118Zm88,0a10,10,0,1,0,10,10A10,10,0,0,0,172,118Zm58-54V192a14,14,0,0,1-14,14H82.23L49.07,234.64l-.06.05A13.87,13.87,0,0,1,40,238a14.11,14.11,0,0,1-5.95-1.33A13.88,13.88,0,0,1,26,224V64A14,14,0,0,1,40,50H216A14,14,0,0,1,230,64Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V224a2,2,0,0,0,3.26,1.55l34.82-30.08A6,6,0,0,1,80,194H216a2,2,0,0,0,2-2Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-52-8a8,8,0,1,0,8,8A8,8,0,0,0,84,120Zm88,0a8,8,0,1,0,8,8A8,8,0,0,0,172,120Zm56-56V192a12,12,0,0,1-12,12H81.49L47.76,233.13l0,0A11.89,11.89,0,0,1,40,236a12.17,12.17,0,0,1-5.1-1.14A11.89,11.89,0,0,1,28,224V64A12,12,0,0,1,40,52H216A12,12,0,0,1,228,64Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V224a4,4,0,0,0,6.56,3.08L77.38,197A4,4,0,0,1,80,196H216a4,4,0,0,0,4-4Z"}))]]),Mr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),vr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),n.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),jr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M236,137A108.13,108.13,0,1,1,119,20,12,12,0,0,1,121,44,84.12,84.12,0,1,0,212,135,12,12,0,1,1,236,137ZM116,76v52a12,12,0,0,0,12,12h52a12,12,0,0,0,0-24H140V76a12,12,0,0,0-24,0Zm92,20a16,16,0,1,0-16-16A16,16,0,0,0,208,96ZM176,64a16,16,0,1,0-16-16A16,16,0,0,0,176,64Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,96a12,12,0,1,1,12,12A12,12,0,0,1,208,96ZM196,72a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm28.66,56a8,8,0,0,0-8.63,7.31A88.12,88.12,0,1,1,120.66,40,8,8,0,0,0,119.34,24,104.12,104.12,0,1,0,232,136.66,8,8,0,0,0,224.66,128ZM128,56a72,72,0,1,1-72,72A72.08,72.08,0,0,1,128,56Zm-8,72a8,8,0,0,0,8,8h48a8,8,0,0,0,0-16H136V80a8,8,0,0,0-16,0Zm40-80a12,12,0,1,0-12-12A12,12,0,0,0,160,48Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M230,136.49A102.12,102.12,0,1,1,119.51,26a6,6,0,0,1,1,12A90.13,90.13,0,1,0,218,135.51a6,6,0,1,1,12,1ZM122,72v56a6,6,0,0,0,6,6h56a6,6,0,0,0,0-12H134V72a6,6,0,0,0-12,0Zm38-26a10,10,0,1,0-10-10A10,10,0,0,0,160,46Zm36,24a10,10,0,1,0-10-10A10,10,0,0,0,196,70Zm24,36a10,10,0,1,0-10-10A10,10,0,0,0,220,106Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228,136.33A100.13,100.13,0,1,1,119.67,28a4,4,0,1,1,.66,8A92.13,92.13,0,1,0,220,135.67a4,4,0,1,1,8,.66ZM128,132h56a4,4,0,0,0,0-8H132V72a4,4,0,0,0-8,0v56A4,4,0,0,0,128,132Zm32-88a8,8,0,1,0-8-8A8,8,0,0,0,160,44Zm36,24a8,8,0,1,0-8-8A8,8,0,0,0,196,68Zm24,36a8,8,0,1,0-8-8A8,8,0,0,0,220,104Z"}))]]),Hr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),n.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]),Er=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M51.51,104.49l-32-32a12,12,0,0,1,0-17l32-32a12,12,0,1,1,17,17L45,64,68.49,87.51a12,12,0,0,1-17,17Zm48,0a12,12,0,0,0,17,0l32-32a12,12,0,0,0,0-17l-32-32a12,12,0,1,0-17,17L123,64,99.51,87.51A12,12,0,0,0,99.51,104.49ZM200,36H180a12,12,0,0,0,0,24h16V196H60V140a12,12,0,0,0-24,0v60a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M152,32V96a16,16,0,0,1-16,16H32A16,16,0,0,1,16,96V32A16,16,0,0,1,32,16H136A16,16,0,0,1,152,32Z",opacity:"0.2"}),n.createElement("path",{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M200,40H168a16,16,0,0,0-16-16H32A16,16,0,0,0,16,40v80a16,16,0,0,0,16,16h8v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM106.34,61.66a8,8,0,0,1,11.32-11.32l24,24a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L124.69,80Zm-64,24a8,8,0,0,1,0-11.32l24-24A8,8,0,0,1,77.66,61.66L59.31,80,77.66,98.34a8,8,0,0,1-11.32,11.32ZM200,200H56V136h96a16,16,0,0,0,16-16V56h32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M59.76,100.24l-32-32a6,6,0,0,1,0-8.48l32-32a6,6,0,1,1,8.48,8.48L40.49,64,68.24,91.76a6,6,0,1,1-8.48,8.48Zm40,0a6,6,0,0,0,8.48,0l32-32a6,6,0,0,0,0-8.48l-32-32a6,6,0,1,0-8.48,8.48L127.51,64,99.76,91.76A6,6,0,0,0,99.76,100.24ZM200,42H176a6,6,0,0,0,0,12h24a2,2,0,0,1,2,2V200a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V136a6,6,0,0,0-12,0v64a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M61.17,98.83l-32-32a4,4,0,0,1,0-5.66l32-32a4,4,0,0,1,5.66,5.66L37.66,64,66.83,93.17a4,4,0,0,1-5.66,5.66Zm40,0a4,4,0,0,0,5.66,0l32-32a4,4,0,0,0,0-5.66l-32-32a4,4,0,0,0-5.66,5.66L130.34,64,101.17,93.17A4,4,0,0,0,101.17,98.83ZM200,44H176a4,4,0,0,0,0,8h24a4,4,0,0,1,4,4V200a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V136a4,4,0,0,0-8,0v64a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Z"}))]]),_r=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M209.88,69.83A115.19,115.19,0,0,0,128,36h-.41C63.85,36.22,12,88.76,12,153.13V176a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V152A115.25,115.25,0,0,0,209.88,69.83ZM220,172H127.32l46.44-65A12,12,0,1,0,154.24,93L97.82,172H36V153.13c0-1.72,0-3.43.14-5.13H56a12,12,0,0,0,0-24H40.62c10.91-33.39,40-58.52,75.38-63.21V80a12,12,0,0,0,24,0V60.8A92,92,0,0,1,215.66,124H200a12,12,0,0,0,0,24h19.9c.06,1.33.1,2.66.1,4Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232,152v24a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V153.13C24,95.65,70.15,48.2,127.63,48A104,104,0,0,1,232,152Z",opacity:"0.2"}),n.createElement("path",{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M240,152v24a16,16,0,0,1-16,16H115.93a4,4,0,0,1-3.24-6.35L174.27,101a8.21,8.21,0,0,0-1.37-11.3,8,8,0,0,0-11.37,1.61l-72,99.06A4,4,0,0,1,86.25,192H32a16,16,0,0,1-16-16V153.13c0-1.79,0-3.57.13-5.33a4,4,0,0,1,4-3.8H48a8,8,0,0,0,8-8.53A8.17,8.17,0,0,0,47.73,128H23.92a4,4,0,0,1-3.87-5c12-43.84,49.66-77.13,95.52-82.28a4,4,0,0,1,4.43,4V72a8,8,0,0,0,8.53,8A8.17,8.17,0,0,0,136,71.73V44.67a4,4,0,0,1,4.43-4A112.18,112.18,0,0,1,236.23,123a4,4,0,0,1-3.88,5H208.27a8.17,8.17,0,0,0-8.25,7.47,8,8,0,0,0,8,8.53h27.92a4,4,0,0,1,4,3.86C240,149.23,240,150.61,240,152Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M205.65,74.08A109.26,109.26,0,0,0,128,42h-.39C67.17,42.21,18,92.06,18,153.13V176a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V152A109.3,109.3,0,0,0,205.65,74.08ZM226,176a2,2,0,0,1-2,2H115.78l57.07-78.47a6,6,0,0,0-9.7-7.06L100.94,178H32a2,2,0,0,1-2-2V153.13A102.36,102.36,0,0,1,30.62,142H56a6,6,0,0,0,0-12H32.71C42.6,88.4,78.53,56.86,122,54.19V80a6,6,0,0,0,12,0V54.19A98.05,98.05,0,0,1,223.53,130H200a6,6,0,0,0,0,12h25.5c.33,3.3.5,6.64.5,10Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M204.23,75.5A107.37,107.37,0,0,0,127.62,44C68.28,44.21,20,93.16,20,153.13V176a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V152A107.25,107.25,0,0,0,204.23,75.5ZM228,176a4,4,0,0,1-4,4H111.85l59.38-81.65a4,4,0,1,0-6.46-4.7L102,180H32a4,4,0,0,1-4-4V153.13A103.42,103.42,0,0,1,28.84,140H56a4,4,0,0,0,0-8H30.21C39.59,87.66,77.84,53.93,124,52.09V80a4,4,0,0,0,8,0V52.08A100.08,100.08,0,0,1,226,132H200a4,4,0,0,0,0,8h27.29a101.6,101.6,0,0,1,.71,12Z"}))]]),Ir=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M71.51,144.49a12,12,0,0,1,0-17l24-24a12,12,0,0,1,17,17L109,124h55V104a12,12,0,0,1,24,0v32a12,12,0,0,1-12,12H109l3.52,3.51a12,12,0,0,1-17,17ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),n.createElement("path",{d:"M184,104v32a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Zm48-48V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-32,96a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M182,104v32a6,6,0,0,1-6,6H94.48l13.76,13.76a6,6,0,1,1-8.48,8.48l-24-24a6,6,0,0,1,0-8.48l24-24a6,6,0,0,1,8.48,8.48L94.48,130H170V104a6,6,0,0,1,12,0Zm48-48V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M184,104v32a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Zm48-48V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M180,104v32a4,4,0,0,1-4,4H89.66l17.17,17.17a4,4,0,0,1-5.66,5.66l-24-24a4,4,0,0,1,0-5.66l24-24a4,4,0,0,1,5.66,5.66L89.66,132H172V104a4,4,0,0,1,8,0Zm48-48V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),Zr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),n.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Vr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),n.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),Nr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),n.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),fn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:wr}));fn.displayName="ArrowCounterClockwiseIcon";const xn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:kr}));xn.displayName="ArrowUpIcon";const yn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Ar}));yn.displayName="ChatDotsIcon";const bn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Mr}));bn.displayName="ChatTextIcon";const Cn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:vr}));Cn.displayName="CheckIcon";const wn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:jr}));wn.displayName="ClockCountdownIcon";const kn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Hr}));kn.displayName="ClockCounterClockwiseIcon";const An=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Er}));An.displayName="CodeBlockIcon";const Mn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:_r}));Mn.displayName="GaugeIcon";const vn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Ir}));vn.displayName="KeyReturnIcon";const jn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Zr}));jn.displayName="MagnifyingGlassIcon";const Hn=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Vr}));Hn.displayName="PencilSimpleLineIcon";const En=n.forwardRef((e,t)=>n.createElement(te,{ref:t,...e,weights:Nr}));En.displayName="TrashSimpleIcon";const Sr=g(D).attrs({alignItems:"center",gap:"0"}).withConfig({displayName:"ExplainQueryButton__KeyBinding"})([`
|
|
2
|
+
color: `,`;
|
|
3
|
+
`],({theme:e})=>e.color.pinkPrimary),Lr=ft.isMacintosh||ft.isIOS?"\u2318":"Ctrl",Fr=ft.isMacintosh||ft.isIOS?"Cmd+E":"Ctrl+E",Dr=g(he).withConfig({displayName:"ExplainQueryButton__ExplainButton"})([`
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
`]),qr=({conversationId:e,queryText:t})=>{const{quest:a}=n.useContext(_t),i=Ee(Me.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:u,aiAssistantSettings:p}=Fe(),{addMessage:f,updateMessage:c,updateConversationName:y,persistMessages:b,setIsStreaming:x}=pt(),w=()=>{ve(je.AI_EXPLAIN_QUERY),Ze(tn({conversationId:e,queryText:t,settings:{model:d,apiKey:u},aiAssistantSettings:p,questClient:a,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:f,updateMessage:c,setStatus:l,setIsStreaming:x,persistMessages:b,updateConversationName:y})};return r.jsxs(Dr,{skin:"gradient",gradientWeight:"thin",onClick:w,title:`Explain query with AI Assistant (${Fr})`,"data-hook":"button-explain-query",children:[r.jsx(gt,{size:12,variant:"hollow"}),"Explain query",r.jsxs(Sr,{children:[r.jsx(en,{keyString:Lr,color:h("pinkPrimary"),hoverColor:h("pinkPrimary")}),r.jsx(en,{keyString:"E",color:h("pinkPrimary"),hoverColor:h("pinkPrimary")})]})]})},_n=(e,t,a,i)=>{if(!(a!=null&&a.current)||!i.current)return null;const l=i.current.getModel();if(!l)return null;const o=a.current[t.toString()];if(!o)return null;const s=o[e];if(!s||!s.error)return null;const d=s.selection?s.selection.startOffset:s.startOffset,u=s.selection?s.selection.endOffset:s.endOffset,p=l.getPositionAt(d),f=l.getPositionAt(d+s.error.position),c=l.getWordAtPosition(f),y=l.getPositionAt(u),b=s.selection?l.getValueInRange({startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:y.lineNumber,endColumn:y.column}):Ea(e).queryText;return{errorMessage:s.error.error||"Query execution failed",word:c?c.word:null,fixStart:d,fixEnd:u,queryText:b}},Tr=g(he).withConfig({displayName:"FixQueryButton__FixButton"})([`
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
`]),Rr=()=>{const{quest:e}=n.useContext(_t),{editorRef:t,executionRefs:a}=It(),i=Ee(Me.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:u,aiAssistantSettings:p}=Fe(),{chatWindowState:f,getConversationMeta:c,addMessage:y,updateMessage:b,updateConversationName:x,persistMessages:w,setIsStreaming:A}=pt(),j=()=>{ve(je.AI_FIX_QUERY);const C=f.activeConversationId,M=c(C),v=_n(M.queryKey,M.bufferId,a,t),{errorMessage:E,queryText:z,word:Z}=v;Ze(nn({conversationId:C,queryText:z,errorMessage:E,errorWord:Z??void 0,settings:{model:d,apiKey:u},aiAssistantSettings:p,questClient:e,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:y,updateMessage:b,setStatus:l,setIsStreaming:A,persistMessages:w,updateConversationName:x})};return r.jsxs(Tr,{skin:"gradient",gradientWeight:"thin",onClick:j,title:"Fix query with AI Assistant","data-hook":"button-fix-query",children:[r.jsx(gt,{size:12,variant:"hollow"}),"Fix query"]})},Tt=e=>{if(!e||typeof e!="string")return`
|
|
8
|
+
`;let t=e.trim();return t.endsWith(";")&&(t=t.slice(0,-1).trim()),t+`
|
|
9
|
+
`},In=g.div.withConfig({displayName:"AssistantModesCompact__Container"})([`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 0.4rem;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
width: 100%;
|
|
15
|
+
overflow-y: auto;
|
|
16
|
+
overflow-x: hidden;
|
|
17
|
+
min-height: 0;
|
|
18
|
+
`]),Zn=g.div.withConfig({displayName:"AssistantModesCompact__ModeHeader"})([`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-shrink: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
|
|
23
|
+
`,`
|
|
24
|
+
`,`
|
|
25
|
+
gap: 0.8rem;
|
|
26
|
+
`],({$expanded:e})=>e?re([`
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
`]):re([`
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
padding: 0.4rem;
|
|
33
|
+
`]),({$abort:e})=>e&&re([`
|
|
34
|
+
opacity: 0.7;
|
|
35
|
+
`])),Rt=g.div.withConfig({displayName:"AssistantModesCompact__ModeChevron"})([`
|
|
36
|
+
width: 1.4rem;
|
|
37
|
+
height: 1.4rem;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
color: `,`;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
transition:
|
|
45
|
+
color 0.2s,
|
|
46
|
+
transform 0.2s;
|
|
47
|
+
transform: rotate(`,`);
|
|
48
|
+
`],h("gray2"),({$expanded:e})=>e?"90deg":"0deg"),zt=g.div.withConfig({displayName:"AssistantModesCompact__ModeTitle"})([`
|
|
49
|
+
font-weight: 500;
|
|
50
|
+
font-size: 1.4rem;
|
|
51
|
+
color: `,`;
|
|
52
|
+
text-align: center;
|
|
53
|
+
margin-right: auto;
|
|
54
|
+
transition: color 0.2s;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
|
|
57
|
+
`,`
|
|
58
|
+
`,`
|
|
59
|
+
`],h("gray2"),({$isActive:e})=>e&&ln,({$isTopLevel:e})=>e&&re([`
|
|
60
|
+
color: `,`;
|
|
61
|
+
`],h("foreground"))),Vn=g.div.withConfig({displayName:"AssistantModesCompact__ModeHeaderTop"})([`
|
|
62
|
+
display: flex;
|
|
63
|
+
gap: 0.8rem;
|
|
64
|
+
align-items: center;
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
`,`
|
|
67
|
+
`,`
|
|
68
|
+
`,`
|
|
69
|
+
`],({$expanded:e})=>e&&re([`
|
|
70
|
+
padding: 0.4rem;
|
|
71
|
+
`]),({$expanded:e})=>!e&&re([`
|
|
72
|
+
min-height: 0;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
`]),({$isExpandable:e})=>e&&re([`
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
user-select: none;
|
|
77
|
+
&:hover `,", &:hover ",` {
|
|
78
|
+
color: `,`;
|
|
79
|
+
}
|
|
80
|
+
`],zt,Rt,h("foreground"))),Ot=g.div.withConfig({displayName:"AssistantModesCompact__ExpandableWrapper"})([`
|
|
81
|
+
display: grid;
|
|
82
|
+
grid-template-rows: `,`;
|
|
83
|
+
transition:
|
|
84
|
+
grid-template-rows 0.1s ease-out,
|
|
85
|
+
opacity 0.3s ease-out;
|
|
86
|
+
width: 100%;
|
|
87
|
+
|
|
88
|
+
`,`
|
|
89
|
+
`],({$expanded:e})=>e?"1fr":"0fr",({$expanded:e})=>!e&&re([`
|
|
90
|
+
height: 0;
|
|
91
|
+
opacity: 0;
|
|
92
|
+
`])),$t=g.div.withConfig({displayName:"AssistantModesCompact__ExpandableContent"})([`
|
|
93
|
+
min-height: 0;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
`]),zr=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningThread"})([`
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 0.8rem;
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
padding: 0 2.8rem;
|
|
101
|
+
`]),bt=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningItem"})([`
|
|
102
|
+
display: flex;
|
|
103
|
+
gap: 0.5rem;
|
|
104
|
+
align-items: center;
|
|
105
|
+
padding: 0.4rem;
|
|
106
|
+
padding-left: 0;
|
|
107
|
+
`]),tt=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningIcon"})([`
|
|
108
|
+
width: 1.4rem;
|
|
109
|
+
height: 1.4rem;
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
color: `,`;
|
|
115
|
+
`],h("foreground")),Ct=g.div.withConfig({displayName:"AssistantModesCompact__ReasoningText"})([`
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-wrap: wrap;
|
|
118
|
+
gap: 0.4rem;
|
|
119
|
+
align-items: center;
|
|
120
|
+
min-height: 0;
|
|
121
|
+
min-width: 0;
|
|
122
|
+
`]),ie=g.span.withConfig({displayName:"AssistantModesCompact__ReasoningTextPart"})([`
|
|
123
|
+
font-weight: 400;
|
|
124
|
+
font-size: 1.4rem;
|
|
125
|
+
color: `,`;
|
|
126
|
+
`],h("gray2")),Ve=g.div.withConfig({displayName:"AssistantModesCompact__CodeBadge"})([`
|
|
127
|
+
background: `,`;
|
|
128
|
+
border: 1px solid `,`;
|
|
129
|
+
border-radius: 0.4rem;
|
|
130
|
+
padding: 0 0.4rem;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
transform: translateY(1px);
|
|
135
|
+
`],h("background"),h("selection")),Ne=g.span.withConfig({displayName:"AssistantModesCompact__CodeBadgeText"})([`
|
|
136
|
+
font-family: `,`;
|
|
137
|
+
font-size: 1.2rem;
|
|
138
|
+
color: `,`;
|
|
139
|
+
`],({theme:e})=>e.fontMonospace,h("purple")),Nn=g(Cn).withConfig({displayName:"AssistantModesCompact__CheckIcon"})([`
|
|
140
|
+
width: 1.6rem;
|
|
141
|
+
height: 1.6rem;
|
|
142
|
+
color: `,`;
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
`],h("pink")),Or=g(on).withConfig({displayName:"AssistantModesCompact__CloseCircleIcon"})([`
|
|
145
|
+
color: `,`;
|
|
146
|
+
flex-shrink: 0;
|
|
147
|
+
`],h("red")),$r=g.div.withConfig({displayName:"AssistantModesCompact__CollapsedSectionsWrapper"})([`
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
gap: 0.8rem;
|
|
151
|
+
padding-left: 2.8rem;
|
|
152
|
+
`]),Br=g.span.withConfig({displayName:"AssistantModesCompact__DurationText"})([`
|
|
153
|
+
font-size: 1.2rem;
|
|
154
|
+
color: `,`;
|
|
155
|
+
font-family: `,`;
|
|
156
|
+
font-weight: 400;
|
|
157
|
+
flex-shrink: 0;
|
|
158
|
+
transform: translateY(1px);
|
|
159
|
+
`],h("graphLegend"),({theme:e})=>e.fontMonospace),Wr=(e,t)=>{if(e===me.Processing&&t&&"type"in t)switch(t.type){case"fix":return"Processing fix request";case"explain":return"Processing explain request";default:return e}return e},Pr=g.div.withConfig({displayName:"AssistantModesCompact__ThinkingContent"})([`
|
|
160
|
+
font-size: 1.3rem;
|
|
161
|
+
color: `,`;
|
|
162
|
+
padding: 0 2.8rem;
|
|
163
|
+
white-space: pre-wrap;
|
|
164
|
+
word-break: break-word;
|
|
165
|
+
opacity: 0.7;
|
|
166
|
+
`],h("gray2")),Sn=({operationHistory:e,status:t,isLive:a=!1,onScrollNeeded:i,collapsed:l=!1,endTimestamp:o})=>{const s=qt(),[d,u]=n.useState({}),[p,f]=n.useState(!1),c=n.useRef(0),y=n.useRef(null),b=n.useMemo(()=>_a(e,t,a),[e,t,a]),x=n.useRef(a);n.useEffect(()=>{if(x.current&&!a){const C={};b.forEach(M=>{C[M.id]=!0}),u(C)}else if(a&&b.length>c.current){const C={};b.forEach((M,v)=>{v<b.length-1&&(C[M.id]=!0)}),u(C),i==null||i()}c.current=b.length,x.current=a},[b,a,i]);const w=C=>{u(M=>{const v=b.find(T=>T.id===C),E=v?an(v):!1,z=b.findIndex(T=>T.id===C)===b.length-1,Z=l?!1:a?z:!0;return M[C]===void 0?{...M,[C]:Z&&E}:{...M,[C]:!M[C]}})},A=n.useMemo(()=>{var v,E;if(e.length===0)return null;const C=(v=e[0])==null?void 0:v.timestamp,M=o??((E=e[e.length-1])==null?void 0:E.timestamp);return!C||!M||C===M?null:Ia(M-C)},[e,o]);if(e.length===0)return null;const j=b.map((C,M)=>{var N;const v=an(C),E=M===b.length-1,z=l?!1:a?E:!0,Z=d[C.id]===void 0?z&&v:!d[C.id]&&v,T=b[M+1],S=Za(C,T,T?void 0:o),m=C.type===me.Thinking?((N=C.operations[0])==null?void 0:N.content)??"":"";return r.jsxs(Zn,{$expanded:Z,$abort:C.abort,children:[r.jsxs(Vn,{$expanded:Z,$isExpandable:v,"data-hook":`assistant-mode-${C.type.toLowerCase().replace(/\s+/g,"-")}`,role:v?"button":"presentation",tabIndex:v?0:void 0,"aria-expanded":v?Z:void 0,onClick:v?()=>w(C.id):void 0,onKeyDown:v?H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),w(C.id))}:void 0,children:[r.jsx(tt,{children:C.active?r.jsx(Zt,{size:14}):C.abort?r.jsx(Or,{size:14}):r.jsx(Nn,{})}),r.jsxs(D,{gap:"0.3rem",children:[r.jsx(zt,{$isActive:C.active,children:C.type}),S&&r.jsxs(Br,{children:["(",S,")"]}),v&&r.jsx(Rt,{$expanded:Z,children:r.jsx(rn,{size:14})})]})]}),v&&C.type===me.Thinking&&r.jsx(Ot,{$expanded:Z,children:r.jsx($t,{children:m?r.jsx(Pr,{children:m}):null})}),v&&C.type!==me.Thinking&&r.jsx(Ot,{$expanded:Z,children:r.jsx($t,{children:r.jsx(zr,{children:C.operations.map((H,ce)=>{const Q=`${C.id}-${ce}-${JSON.stringify(H.args)}`;if(H.type===me.Processing){const R=Wr(H.type,H.args);return r.jsxs(bt,{children:[r.jsx(tt,{children:r.jsx(Va,{style:{width:"14px",height:"14px"}})}),r.jsx(Ct,{children:r.jsx(ie,{children:R})})]},Q)}if(H.type===me.InvestigatingTable){const R=H.args&&"name"in H.args?H.args.name:"table",U=H.args&&"tableOpType"in H.args?H.args.tableOpType:"details";return r.jsxs(bt,{children:[r.jsx(tt,{children:r.jsx(Na,{size:14,color:s.color.gray2})}),r.jsxs(Ct,{children:[r.jsx(ie,{children:"Investigating"}),r.jsx(Ve,{children:r.jsx(Ne,{children:R})}),r.jsx(ie,{children:U})]})]},Q)}if(H.type===me.InvestigatingDocs){const R=H.args&&"items"in H.args&&Array.isArray(H.args.items)?H.args.items:null;if(R&&R.length>0)return r.jsx(yt.Fragment,{children:R.map((X,_e)=>{const fe=`${Q}-item-${_e}`;return r.jsxs(bt,{children:[r.jsx(tt,{children:r.jsx(sn,{size:14,color:s.color.gray2})}),r.jsx(Ct,{children:X.section?r.jsxs(r.Fragment,{children:[r.jsx(ie,{children:"Investigating"}),r.jsx(Ve,{children:r.jsx(Ne,{children:X.section})}),r.jsx(ie,{children:"in"}),r.jsx(Ve,{children:r.jsx(Ne,{children:X.name})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ie,{children:"Investigating"}),r.jsx(Ve,{children:r.jsx(Ne,{children:X.name})})]})})]},fe)})},Q);const U=H.args&&"name"in H.args?H.args.name:null,ae=H.args&&"section"in H.args?H.args.section:null;return r.jsxs(bt,{children:[r.jsx(tt,{children:r.jsx(sn,{size:14})}),r.jsx(Ct,{children:U&&ae?r.jsxs(r.Fragment,{children:[r.jsx(ie,{children:"Investigating"}),r.jsx(Ve,{children:r.jsx(Ne,{children:ae})}),r.jsx(ie,{children:"in"}),r.jsx(Ve,{children:r.jsx(Ne,{children:U})}),r.jsx(ie,{children:"documentation"})]}):U?r.jsxs(r.Fragment,{children:[r.jsx(ie,{children:"Investigating"}),r.jsx(Ve,{children:r.jsx(Ne,{children:U})}),r.jsx(ie,{children:"documentation"})]}):r.jsx(ie,{children:"Investigating documentation"})})]},Q)}return null})})})})]},C.id)});return l?r.jsx(In,{ref:y,"data-hook":"assistant-modes-container",children:r.jsxs(Zn,{$expanded:p,$abort:!1,children:[r.jsxs(Vn,{$expanded:p,$isExpandable:!0,onClick:()=>f(C=>!C),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f(M=>!M))},"data-hook":"assistant-mode-processing-collapsed",role:"button",tabIndex:0,"aria-expanded":p,children:[r.jsx(Nn,{}),r.jsx(zt,{$isActive:!1,children:A?`Thought for ${A}`:"Thought"}),r.jsx(Rt,{$expanded:p,children:r.jsx(rn,{size:14})})]}),r.jsx(Ot,{$expanded:p,children:r.jsx($t,{children:r.jsx($r,{children:j})})})]})}):r.jsx(In,{ref:y,"data-hook":"assistant-modes-container",children:j})},Qr={tokenize:Jr,partial:!0},Ln={tokenize:ei,partial:!0},Fn={tokenize:ti,partial:!0},Dn={tokenize:ni,partial:!0},Kr={tokenize:ai,partial:!0},qn={tokenize:Yr,previous:Rn},Tn={tokenize:Xr,previous:zn},we={tokenize:Gr,previous:On},ge={},Ur={text:ge};let Se=48;for(;Se<123;)ge[Se]=we,Se++,Se===58?Se=65:Se===91&&(Se=97);ge[43]=we,ge[45]=we,ge[46]=we,ge[95]=we,ge[72]=[we,Tn],ge[104]=[we,Tn],ge[87]=[we,qn],ge[119]=[we,qn];function Gr(e,t,a){const i=this;let l,o;return s;function s(c){return!Bt(c)||!On.call(i,i.previous)||Wt(i.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(c))}function d(c){return Bt(c)?(e.consume(c),d):c===64?(e.consume(c),u):a(c)}function u(c){return c===46?e.check(Kr,f,p)(c):c===45||c===95||Vt(c)?(o=!0,e.consume(c),u):f(c)}function p(c){return e.consume(c),l=!0,u}function f(c){return o&&l&&Pe(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):a(c)}}function Yr(e,t,a){const i=this;return l;function l(s){return s!==87&&s!==119||!Rn.call(i,i.previous)||Wt(i.events)?a(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Qr,e.attempt(Ln,e.attempt(Fn,o),a),a)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Xr(e,t,a){const i=this;let l="",o=!1;return s;function s(c){return(c===72||c===104)&&zn.call(i,i.previous)&&!Wt(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),d):a(c)}function d(c){if(Pe(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),d;if(c===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(c),u}return a(c)}function u(c){return c===47?(e.consume(c),o?p:(o=!0,u)):a(c)}function p(c){return c===null||Sa(c)||ne(c)||De(c)||Nt(c)?a(c):e.attempt(Ln,e.attempt(Fn,f),a)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Jr(e,t,a){let i=0;return l;function l(s){return(s===87||s===119)&&i<3?(i++,e.consume(s),l):s===46&&i===3?(e.consume(s),o):a(s)}function o(s){return s===null?a(s):t(s)}}function ei(e,t,a){let i,l,o;return s;function s(p){return p===46||p===95?e.check(Dn,u,d)(p):p===null||ne(p)||De(p)||p!==45&&Nt(p)?u(p):(o=!0,e.consume(p),s)}function d(p){return p===95?i=!0:(l=i,i=void 0),e.consume(p),s}function u(p){return l||i||!o?a(p):t(p)}}function ti(e,t){let a=0,i=0;return l;function l(s){return s===40?(a++,e.consume(s),l):s===41&&i<a?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Dn,t,o)(s):s===null||ne(s)||De(s)?t(s):(e.consume(s),l)}function o(s){return s===41&&i++,e.consume(s),l}}function ni(e,t,a){return i;function i(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),i):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||ne(d)||De(d)?t(d):a(d)}function l(d){return d===null||d===40||d===91||ne(d)||De(d)?t(d):i(d)}function o(d){return Pe(d)?s(d):a(d)}function s(d){return d===59?(e.consume(d),i):Pe(d)?(e.consume(d),s):a(d)}}function ai(e,t,a){return i;function i(o){return e.consume(o),l}function l(o){return Vt(o)?a(o):t(o)}}function Rn(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ne(e)}function zn(e){return!Pe(e)}function On(e){return!(e===47||Bt(e))}function Bt(e){return e===43||e===45||e===46||e===95||Vt(e)}function Wt(e){let t=e.length,a=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const ri={tokenize:hi,partial:!0};function ii(){return{document:{91:{tokenize:ci,continuation:{tokenize:di},exit:ui}},text:{91:{tokenize:li},93:{add:"after",tokenize:si,resolveTo:oi}}}}function si(e,t,a){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;l--;){const u=i.events[l][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return d;function d(u){if(!s||!s._balanced)return a(u);const p=Qe(i.sliceSerialize({start:s.end,end:i.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?a(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function oi(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[a+1],e[a+2],["enter",i,t],e[a+3],e[a+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(a,e.length-a+1,...d),e}function li(e,t,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,s;return d;function d(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?a(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(c){if(o>999||c===93&&!s||c===null||c===91||ne(c))return a(c);if(c===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(Qe(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(c)}return ne(c)||(s=!0),o++,e.consume(c),c===92?f:p}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,p):p(c)}}function ci(e,t,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0,d;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):a(x)}function f(x){if(s>999||x===93&&!d||x===null||x===91||ne(x))return a(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=Qe(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return ne(x)||(d=!0),s++,e.consume(x),x===92?c:f}function c(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}function y(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),l.includes(o)||l.push(o),He(e,b,"gfmFootnoteDefinitionWhitespace")):a(x)}function b(x){return t(x)}}function di(e,t,a){return e.check(La,t,e.attempt(ri,t,a))}function ui(e){e.exit("gfmFootnoteDefinition")}function hi(e,t,a){const i=this;return He(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):a(o)}}function mi(e){let t=(e||{}).singleTilde;const a={tokenize:l,resolveAll:i};return t==null&&(t=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function i(o,s){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let u=d;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[d][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[d][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[d][1].start)},c=[["enter",p,s],["enter",o[u][1],s],["exit",o[u][1],s],["enter",f,s]],y=s.parser.constructs.insideSpan.null;y&&St(c,c.length,0,Fa(y,o.slice(u+1,d),s)),St(c,c.length,0,[["exit",f,s],["enter",o[d][1],s],["exit",o[d][1],s],["exit",p,s]]),St(o,u-1,d-u+3,c),d=u+c.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,s,d){const u=this.previous,p=this.events;let f=0;return c;function c(b){return u===126&&p[p.length-1][1].type!=="characterEscape"?d(b):(o.enter("strikethroughSequenceTemporary"),y(b))}function y(b){const x=cn(u);if(b===126)return f>1?d(b):(o.consume(b),f++,y);if(f<2&&!t)return d(b);const w=o.exit("strikethroughSequenceTemporary"),A=cn(b);return w._open=!A||A===2&&!!x,w._close=!x||x===2&&!!A,s(b)}}}class pi{constructor(){this.map=[]}add(t,a,i){gi(this,t,a,i)}consume(t){if(this.map.sort((o,s)=>o[0]-s[0]),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(t.slice(this.map[a][0]+this.map[a][1])),i.push(this.map[a][2]),t.length=this.map[a][0];i.push([...t]),t.length=0;let l=i.pop();for(;l;)t.push(...l),l=i.pop();this.map.length=0}}function gi(e,t,a,i){let l=0;if(!(a===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=a,e.map[l][2].push(...i);return}l+=1}e.map.push([t,a,i])}}function fi(e,t){let a=!1;const i=[];for(;t<e.length;){const l=e[t];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return i}const xi={flow:{null:{tokenize:yi,resolveAll:bi}}};function yi(e,t,a){const i=this;let l=0,o=0,s;return d;function d(m){let N=i.events.length-1;for(;N>-1;){const Q=i.events[N][1].type;if(Q==="lineEnding"||Q==="linePrefix")N--;else break}const H=N>-1?i.events[N][1].type:null,ce=H==="tableHead"||H==="tableRow"?z:u;return ce===z&&i.parser.lazy[i.now().line]?a(m):ce(m)}function u(m){return e.enter("tableHead"),e.enter("tableRow"),p(m)}function p(m){return m===124||(s=!0,o+=1),f(m)}function f(m){return m===null?a(m):Ke(m)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),b):a(m):qe(m)?He(e,f,"whitespace")(m):(o+=1,s&&(s=!1,l+=1),m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(m)))}function c(m){return m===null||m===124||ne(m)?(e.exit("data"),f(m)):(e.consume(m),m===92?y:c)}function y(m){return m===92||m===124?(e.consume(m),c):c(m)}function b(m){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(m):(e.enter("tableDelimiterRow"),s=!1,qe(m)?He(e,x,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):x(m))}function x(m){return m===45||m===58?A(m):m===124?(s=!0,e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),w):E(m)}function w(m){return qe(m)?He(e,A,"whitespace")(m):A(m)}function A(m){return m===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),j):m===45?(o+=1,j(m)):m===null||Ke(m)?v(m):E(m)}function j(m){return m===45?(e.enter("tableDelimiterFiller"),C(m)):E(m)}function C(m){return m===45?(e.consume(m),C):m===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(m))}function M(m){return qe(m)?He(e,v,"whitespace")(m):v(m)}function v(m){return m===124?x(m):m===null||Ke(m)?!s||l!==o?E(m):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(m)):E(m)}function E(m){return a(m)}function z(m){return e.enter("tableRow"),Z(m)}function Z(m){return m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),Z):m===null||Ke(m)?(e.exit("tableRow"),t(m)):qe(m)?He(e,Z,"whitespace")(m):(e.enter("data"),T(m))}function T(m){return m===null||m===124||ne(m)?(e.exit("data"),Z(m)):(e.consume(m),m===92?S:T)}function S(m){return m===92||m===124?(e.consume(m),T):T(m)}}function bi(e,t){let a=-1,i=!0,l=0,o=[0,0,0,0],s=[0,0,0,0],d=!1,u=0,p,f,c;const y=new pi;for(;++a<e.length;){const b=e[a],x=b[1];b[0]==="enter"?x.type==="tableHead"?(d=!1,u!==0&&($n(y,t,u,p,f),f=void 0,u=0),p={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},y.add(a,0,[["enter",p,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(i=!0,c=void 0,o=[0,0,0,0],s=[0,a+1,0,0],d&&(d=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},y.add(a,0,[["enter",f,t]])),l=x.type==="tableDelimiterRow"?2:f?3:1):l&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=wt(y,t,o,l,void 0,c),o=[0,0,0,0]),s[2]=a)):x.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(s[0]=s[1],c=wt(y,t,o,l,void 0,c)),o=s,s=[o[1],a,0,0])):x.type==="tableHead"?(d=!0,u=a):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=a,o[1]!==0?(s[0]=s[1],c=wt(y,t,o,l,a,c)):s[1]!==0&&(c=wt(y,t,s,l,a,c)),l=0):l&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=a)}for(u!==0&&$n(y,t,u,p,f),y.consume(t.events),a=-1;++a<t.events.length;){const b=t.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=fi(t.events,a))}return e}function wt(e,t,a,i,l,o){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(o.end=Object.assign({},ze(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));const u=ze(t.events,a[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){const p=ze(t.events,a[2]),f=ze(t.events,a[3]),c={type:d,start:Object.assign({},p),end:Object.assign({},f)};if(e.add(a[2],0,[["enter",c,t]]),i!==2){const y=t.events[a[2]],b=t.events[a[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const x=a[2]+1,w=a[3]-a[2]-1;e.add(x,w,[])}}e.add(a[3]+1,0,[["exit",c,t]])}return l!==void 0&&(o.end=Object.assign({},ze(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function $n(e,t,a,i,l){const o=[],s=ze(t.events,a);l&&(l.end=Object.assign({},s),o.push(["exit",l,t])),i.end=Object.assign({},s),o.push(["exit",i,t]),e.add(a+1,0,o)}function ze(e,t){const a=e[t],i=a[0]==="enter"?"start":"end";return a[1][i]}const Ci={tokenize:ki},wi={text:{91:Ci}};function ki(e,t,a){const i=this;return l;function l(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return ne(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):a(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(u)}function d(u){return Ke(u)?t(u):qe(u)?e.check({tokenize:Ai},t,a)(u):a(u)}}function Ai(e,t,a){return He(e,i,"whitespace");function i(l){return l===null?a(l):t(l)}}function Mi(e){return Da([Ur,ii(),mi(e),xi,wi])}function Bn(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,l=a.indexOf(t);for(;l!==-1;)i++,l=a.indexOf(t,l+t.length);return i}function vi(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ji={}.hasOwnProperty,Hi=(function(e,t,a,i){let l,o;typeof t=="string"||t instanceof RegExp?(o=[[t,a]],l=i):(o=t,l=a),l||(l={});const s=qa(l.ignore||[]),d=Ei(o);let u=-1;for(;++u<d.length;)Ta(e,"text",p);return e;function p(c,y){let b=-1,x;for(;++b<y.length;){const w=y[b];if(s(w,x?x.children.indexOf(w):void 0,x))return;x=w}if(x)return f(c,y)}function f(c,y){const b=y[y.length-1],x=d[u][0],w=d[u][1];let A=0;const j=b.children.indexOf(c);let C=!1,M=[];x.lastIndex=0;let v=x.exec(c.value);for(;v;){const E=v.index,z={index:v.index,input:v.input,stack:[...y,c]};let Z=w(...v,z);if(typeof Z=="string"&&(Z=Z.length>0?{type:"text",value:Z}:void 0),Z!==!1&&(A!==E&&M.push({type:"text",value:c.value.slice(A,E)}),Array.isArray(Z)?M.push(...Z):Z&&M.push(Z),A=E+v[0].length,C=!0),!x.global)break;v=x.exec(c.value)}return C?(A<c.value.length&&M.push({type:"text",value:c.value.slice(A)}),b.children.splice(j,1,...M)):M=[c],j+M.length}});function Ei(e){const t=[];if(typeof e!="object")throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let a=-1;for(;++a<e.length;)t.push([Wn(e[a][0]),Pn(e[a][1])])}else{let a;for(a in e)ji.call(e,a)&&t.push([Wn(a),Pn(e[a])])}return t}function Wn(e){return typeof e=="string"?new RegExp(vi(e),"g"):e}function Pn(e){return typeof e=="function"?e:()=>e}const Pt="phrasing",Qt=["autolink","link","image","label"],_i={transforms:[Fi],enter:{literalAutolink:Zi,literalAutolinkEmail:Kt,literalAutolinkHttp:Kt,literalAutolinkWww:Kt},exit:{literalAutolink:Li,literalAutolinkEmail:Si,literalAutolinkHttp:Vi,literalAutolinkWww:Ni}},Ii={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Pt,notInConstruct:Qt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Pt,notInConstruct:Qt},{character:":",before:"[ps]",after:"\\/",inConstruct:Pt,notInConstruct:Qt}]};function Zi(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kt(e){this.config.enter.autolinkProtocol.call(this,e)}function Vi(e){this.config.exit.autolinkProtocol.call(this,e)}function Ni(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function Si(e){this.config.exit.autolinkEmail.call(this,e)}function Li(e){this.exit(e)}function Fi(e){Hi(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Di],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,qi]],{ignore:["link","linkReference"]})}function Di(e,t,a,i,l){let o="";if(!Qn(l)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!Ti(a)))return!1;const s=Ri(a+i);if(!s[0])return!1;const d={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[d,{type:"text",value:s[1]}]:d}function qi(e,t,a,i){return!Qn(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function Ti(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ri(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],i=a.indexOf(")");const l=Bn(e,"(");let o=Bn(e,")");for(;i!==-1&&l>o;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[e,a]}function Qn(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||De(a)||Nt(a))&&(!t||a!==47)}function Kn(e){return e.label||!e.identifier?e.label||"":Ra(e.identifier)}function zi(e,t,a){const i=t.indexStack,l=e.children||[],o=t.createTracker(a),s=[];let d=-1;for(i.push(-1);++d<l.length;){const u=l[d];i[i.length-1]=d,s.push(o.move(t.handle(u,e,t,{before:`
|
|
167
|
+
`,after:`
|
|
168
|
+
`,...o.current()}))),u.type!=="list"&&(t.bulletLastUsed=void 0),d<l.length-1&&s.push(o.move(Oi(u,l[d+1],e,t)))}return i.pop(),s.join("")}function Oi(e,t,a,i){let l=i.join.length;for(;l--;){const o=i.join[l](e,t,a,i);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
169
|
+
`.repeat(1+o);if(o===!1)return`
|
|
170
|
+
|
|
171
|
+
<!---->
|
|
172
|
+
|
|
173
|
+
`}return`
|
|
174
|
+
|
|
175
|
+
`}const $i=/\r?\n|\r/g;function Bi(e,t){const a=[];let i=0,l=0,o;for(;o=$i.exec(e);)s(e.slice(i,o.index)),a.push(o[0]),i=o.index+o[0].length,l++;return s(e.slice(i)),a.join("");function s(d){a.push(t(d,l,!d))}}function Un(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Wi(e,t){return Gn(e,t.inConstruct,!0)&&!Gn(e,t.notInConstruct,!1)}function Gn(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Yn(e,t,a){const i=(a.before||"")+(t||"")+(a.after||""),l=[],o=[],s={};let d=-1;for(;++d<e.unsafe.length;){const f=e.unsafe[d];if(!Wi(e.stack,f))continue;const c=Un(f);let y;for(;y=c.exec(i);){const b="before"in f||!!f.atBreak,x="after"in f,w=y.index+(b?y[1].length:0);l.includes(w)?(s[w].before&&!b&&(s[w].before=!1),s[w].after&&!x&&(s[w].after=!1)):(l.push(w),s[w]={before:b,after:x})}}l.sort(Pi);let u=a.before?a.before.length:0;const p=i.length-(a.after?a.after.length:0);for(d=-1;++d<l.length;){const f=l[d];f<u||f>=p||f+1<p&&l[d+1]===f+1&&s[f].after&&!s[f+1].before&&!s[f+1].after||l[d-1]===f-1&&s[f].before&&!s[f-1].before&&!s[f-1].after||(u!==f&&o.push(Xn(i.slice(u,f),"\\")),u=f,/[!-/:-@[-`{-~]/.test(i.charAt(f))&&(!a.encode||!a.encode.includes(i.charAt(f)))?o.push("\\"):(o.push("&#x"+i.charCodeAt(f).toString(16).toUpperCase()+";"),u++))}return o.push(Xn(i.slice(u,p),a.after)),o.join("")}function Pi(e,t){return e-t}function Xn(e,t){const a=/\\(?=[!-/:-@[-`{-~])/g,i=[],l=[],o=e+t;let s=-1,d=0,u;for(;u=a.exec(o);)i.push(u.index);for(;++s<i.length;)d!==i[s]&&l.push(e.slice(d,i[s])),l.push("\\"),d=i[s];return l.push(e.slice(d)),l.join("")}function kt(e){const t=e||{},a=t.now||{};let i=t.lineShift||0,l=a.line||1,o=a.column||1;return{move:u,current:s,shift:d};function s(){return{now:{line:l,column:o},lineShift:i}}function d(p){i+=p}function u(p){const f=p||"",c=f.split(/\r?\n|\r/g),y=c[c.length-1];return l+=c.length-1,o=c.length===1?o+y.length:1+y.length+i,f}}Jn.peek=as;function Qi(){return{enter:{gfmFootnoteDefinition:Ui,gfmFootnoteDefinitionLabelString:Gi,gfmFootnoteCall:Ji,gfmFootnoteCallString:es},exit:{gfmFootnoteDefinition:Xi,gfmFootnoteDefinitionLabelString:Yi,gfmFootnoteCall:ns,gfmFootnoteCallString:ts}}}function Ki(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:rs,footnoteReference:Jn}}}function Ui(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Gi(){this.buffer()}function Yi(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.label=t,a.identifier=Qe(this.sliceSerialize(e)).toLowerCase()}function Xi(e){this.exit(e)}function Ji(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function es(){this.buffer()}function ts(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.label=t,a.identifier=Qe(this.sliceSerialize(e)).toLowerCase()}function ns(e){this.exit(e)}function Jn(e,t,a,i){const l=kt(i);let o=l.move("[^");const s=a.enter("footnoteReference"),d=a.enter("reference");return o+=l.move(Yn(a,Kn(e),{...l.current(),before:o,after:"]"})),d(),s(),o+=l.move("]"),o}function as(){return"["}function rs(e,t,a,i){const l=kt(i);let o=l.move("[^");const s=a.enter("footnoteDefinition"),d=a.enter("label");return o+=l.move(Yn(a,Kn(e),{...l.current(),before:o,after:"]"})),d(),o+=l.move("]:"+(e.children&&e.children.length>0?" ":"")),l.shift(4),o+=l.move(Bi(zi(e,a,l.current()),is)),s(),o}function is(e,t,a){return t===0?e:(a?"":" ")+e}function ea(e,t,a){const i=t.indexStack,l=e.children||[],o=[];let s=-1,d=a.before;i.push(-1);let u=t.createTracker(a);for(;++s<l.length;){const p=l[s];let f;if(i[i.length-1]=s,s+1<l.length){let c=t.handle.handlers[l[s+1].type];c&&c.peek&&(c=c.peek),f=c?c(l[s+1],e,t,{before:"",after:"",...u.current()}).charAt(0):""}else f=a.after;o.length>0&&(d==="\r"||d===`
|
|
176
|
+
`)&&p.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),d=" ",u=t.createTracker(a),u.move(o.join(""))),o.push(u.move(t.handle(p,e,t,{...u.current(),before:d,after:f}))),d=o[o.length-1].slice(-1)}return i.pop(),o.join("")}const ss=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ta.peek=us;const os={canContainEols:["delete"],enter:{strikethrough:cs},exit:{strikethrough:ds}},ls={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ss}],handlers:{delete:ta}};function cs(e){this.enter({type:"delete",children:[]},e)}function ds(e){this.exit(e)}function ta(e,t,a,i){const l=kt(i),o=a.enter("strikethrough");let s=l.move("~~");return s+=ea(e,a,{...l.current(),before:s,after:"~"}),s+=l.move("~~"),o(),s}function us(){return"~"}na.peek=hs;function na(e,t,a){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const s=a.unsafe[o],d=Un(s);let u;if(s.atBreak)for(;u=d.exec(i);){let p=u.index;i.charCodeAt(p)===10&&i.charCodeAt(p-1)===13&&p--,i=i.slice(0,p)+" "+i.slice(u.index+1)}}return l+i+l}function hs(){return"`"}function ms(e){return e.length}function ps(e,t){const a=t||{},i=(a.align||[]).concat(),l=a.stringLength||ms,o=[],s=[],d=[],u=[];let p=0,f=-1;for(;++f<e.length;){const w=[],A=[];let j=-1;for(e[f].length>p&&(p=e[f].length);++j<e[f].length;){const C=gs(e[f][j]);if(a.alignDelimiters!==!1){const M=l(C);A[j]=M,(u[j]===void 0||M>u[j])&&(u[j]=M)}w.push(C)}s[f]=w,d[f]=A}let c=-1;if(typeof i=="object"&&"length"in i)for(;++c<p;)o[c]=aa(i[c]);else{const w=aa(i);for(;++c<p;)o[c]=w}c=-1;const y=[],b=[];for(;++c<p;){const w=o[c];let A="",j="";w===99?(A=":",j=":"):w===108?A=":":w===114&&(j=":");let C=a.alignDelimiters===!1?1:Math.max(1,u[c]-A.length-j.length);const M=A+"-".repeat(C)+j;a.alignDelimiters!==!1&&(C=A.length+C+j.length,C>u[c]&&(u[c]=C),b[c]=C),y[c]=M}s.splice(1,0,y),d.splice(1,0,b),f=-1;const x=[];for(;++f<s.length;){const w=s[f],A=d[f];c=-1;const j=[];for(;++c<p;){const C=w[c]||"";let M="",v="";if(a.alignDelimiters!==!1){const E=u[c]-(A[c]||0),z=o[c];z===114?M=" ".repeat(E):z===99?E%2?(M=" ".repeat(E/2+.5),v=" ".repeat(E/2-.5)):(M=" ".repeat(E/2),v=M):v=" ".repeat(E)}a.delimiterStart!==!1&&!c&&j.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&C==="")&&(a.delimiterStart!==!1||c)&&j.push(" "),a.alignDelimiters!==!1&&j.push(M),j.push(C),a.alignDelimiters!==!1&&j.push(v),a.padding!==!1&&j.push(" "),(a.delimiterEnd!==!1||c!==p-1)&&j.push("|")}x.push(a.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return x.join(`
|
|
177
|
+
`)}function gs(e){return e==null?"":String(e)}function aa(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const fs={enter:{table:xs,tableData:ra,tableHeader:ra,tableRow:bs},exit:{codeText:Cs,table:ys,tableData:Ut,tableHeader:Ut,tableRow:Ut}};function xs(e){const t=e._align;this.enter({type:"table",align:t.map(a=>a==="none"?null:a),children:[]},e),this.setData("inTable",!0)}function ys(e){this.exit(e),this.setData("inTable")}function bs(e){this.enter({type:"tableRow",children:[]},e)}function Ut(e){this.exit(e)}function ra(e){this.enter({type:"tableCell",children:[]},e)}function Cs(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,ws));const a=this.stack[this.stack.length-1];a.value=t,this.exit(e)}function ws(e,t){return t==="|"?t:e}function ks(e){const t=e||{},a=t.tableCellPadding,i=t.tablePipeAlign,l=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
178
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:s,tableRow:d,tableCell:u,inlineCode:y}};function s(b,x,w,A){return p(f(b,w,A),b.align)}function d(b,x,w,A){const j=c(b,w,A),C=p([j]);return C.slice(0,C.indexOf(`
|
|
179
|
+
`))}function u(b,x,w,A){const j=w.enter("tableCell"),C=w.enter("phrasing"),M=ea(b,w,{...A,before:o,after:o});return C(),j(),M}function p(b,x){return ps(b,{align:x,alignDelimiters:i,padding:a,stringLength:l})}function f(b,x,w){const A=b.children;let j=-1;const C=[],M=x.enter("table");for(;++j<A.length;)C[j]=c(A[j],x,w);return M(),C}function c(b,x,w){const A=b.children;let j=-1;const C=[],M=x.enter("tableRow");for(;++j<A.length;)C[j]=u(A[j],b,x,w);return M(),C}function y(b,x,w){let A=na(b,x,w);return w.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function As(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Ms(e){const t=e.options.listItemIndent||"tab";if(t===1||t==="1")return"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vs(e,t,a,i){const l=Ms(a);let o=a.bulletCurrent||As(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const d=a.createTracker(i);d.move(o+" ".repeat(s-o.length)),d.shift(s);const u=a.enter("listItem"),p=a.indentLines(a.containerFlow(e,d.current()),f);return u(),p;function f(c,y,b){return y?(b?"":" ".repeat(s))+c:(b?o:o+" ".repeat(s-o.length))+c}}const js={exit:{taskListCheckValueChecked:ia,taskListCheckValueUnchecked:ia,paragraph:Es}},Hs={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_s}};function ia(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function Es(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1],i=a.children[0];if(i&&i.type==="text"){const l=t.children;let o=-1,s;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){s=d;break}}s===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function _s(e,t,a,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",d=kt(i);o&&d.move(s);let u=vs(e,t,a,{...i,...d.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),u;function p(f){return f+s}}function Is(){return[_i,Qi(),os,fs,js]}function Zs(e){return{extensions:[Ii,Ki(),ls,ks(e),Hs]}}function Vs(e={}){const t=this.data();a("micromarkExtensions",Mi(e)),a("fromMarkdownExtensions",Is()),a("toMarkdownExtensions",Zs(e));function a(i,l){(t[i]?t[i]:t[i]=[]).push(l)}}const Ns=g.div.withConfig({displayName:"AssistantMarkdown__CodeBlockWrapper"})([`
|
|
180
|
+
margin: 1rem 0;
|
|
181
|
+
width: 100%;
|
|
182
|
+
`]),Ss=g.div.withConfig({displayName:"AssistantMarkdown__MarkdownContent"})([`
|
|
183
|
+
margin: 0;
|
|
184
|
+
width: 100%;
|
|
185
|
+
font-family: `,`;
|
|
186
|
+
font-size: 1.4rem;
|
|
187
|
+
line-height: 2.1rem;
|
|
188
|
+
color: `,`;
|
|
189
|
+
word-break: break-word;
|
|
190
|
+
|
|
191
|
+
p {
|
|
192
|
+
margin: 0 0 1rem 0;
|
|
193
|
+
&:last-child {
|
|
194
|
+
margin-bottom: 0;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
code {
|
|
199
|
+
background: `,`;
|
|
200
|
+
border: 1px solid `,`;
|
|
201
|
+
border-radius: 0.4rem;
|
|
202
|
+
padding: 0.1rem 0.4rem;
|
|
203
|
+
font-family: `,`;
|
|
204
|
+
font-size: 1.3rem;
|
|
205
|
+
color: `,`;
|
|
206
|
+
white-space: pre-wrap;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
strong {
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
color: `,`;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
em {
|
|
215
|
+
font-style: italic;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
ul,
|
|
219
|
+
ol {
|
|
220
|
+
margin: 0.5rem 0;
|
|
221
|
+
padding-left: 2rem;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
li {
|
|
225
|
+
margin-bottom: 0.3rem;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
a {
|
|
229
|
+
color: `,`;
|
|
230
|
+
text-decoration: none;
|
|
231
|
+
&:hover {
|
|
232
|
+
text-decoration: underline;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
h1,
|
|
237
|
+
h2,
|
|
238
|
+
h3,
|
|
239
|
+
h4 {
|
|
240
|
+
margin: 1rem 0 0.5rem 0;
|
|
241
|
+
font-weight: 600;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
h1 {
|
|
245
|
+
font-size: 1.8rem;
|
|
246
|
+
}
|
|
247
|
+
h2 {
|
|
248
|
+
font-size: 1.6rem;
|
|
249
|
+
}
|
|
250
|
+
h3 {
|
|
251
|
+
font-size: 1.5rem;
|
|
252
|
+
}
|
|
253
|
+
h4 {
|
|
254
|
+
font-size: 1.4rem;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
blockquote {
|
|
258
|
+
border-left: 3px solid `,`;
|
|
259
|
+
margin: 1rem 0;
|
|
260
|
+
padding-left: 1rem;
|
|
261
|
+
color: `,`;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.table-wrapper {
|
|
265
|
+
overflow-x: auto;
|
|
266
|
+
margin: 1rem 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
table {
|
|
270
|
+
border-collapse: collapse;
|
|
271
|
+
min-width: max-content;
|
|
272
|
+
border-radius: 0.8rem;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
th,
|
|
276
|
+
td {
|
|
277
|
+
padding: 0.6rem 0.8rem;
|
|
278
|
+
border: 1px solid `,`;
|
|
279
|
+
text-align: left;
|
|
280
|
+
white-space: nowrap;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
th {
|
|
284
|
+
background: `,`;
|
|
285
|
+
font-weight: 600;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
td:last-child {
|
|
289
|
+
white-space: normal;
|
|
290
|
+
min-width: 200px;
|
|
291
|
+
}
|
|
292
|
+
`],({theme:e})=>e.font,h("foreground"),h("background"),h("selection"),({theme:e})=>e.fontMonospace,h("purple"),h("foreground"),({theme:e})=>e.color.cyan,h("selection"),h("gray2"),h("selection"),h("backgroundDarker")),Ls=e=>({a:({children:t,href:a,...i})=>r.jsx("a",{...typeof a=="string"&&a.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},href:a,...i,children:t}),table:({children:t,...a})=>r.jsx("div",{className:"table-wrapper",children:r.jsx("table",{...a,children:t})}),pre:({children:t})=>r.jsx(r.Fragment,{children:t}),code:n.memo(({children:t,className:a})=>{if(typeof a=="string"&&a.includes("language-")){const i=(Array.isArray(t)?t.join(""):typeof t=="string"?t:"").replace(/\n$/,"");return r.jsx(Ns,{"data-hook":"chat-message-code-block",children:r.jsx(Ue,{value:i,maxHeight:216,onOpenInEditor:()=>{var l;(l=e.current)==null||l.call(e,{type:"code",value:i})}})})}return r.jsx("code",{children:t})},(t,a)=>t.children===a.children&&t.className===a.className)}),sa=n.memo(({content:e,messageId:t,onOpenInEditor:a})=>{const i=n.useRef(a);n.useEffect(()=>{i.current=a},[a]);const l=n.useMemo(()=>Ls(i),[]);return r.jsx(Ss,{children:r.jsx(za,{remarkPlugins:[Vs],components:l,children:e})},t)},(e,t)=>e.content===t.content);function oa(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}const la=g.div.withConfig({displayName:"AssistantMessageContent__Divider"})([`
|
|
293
|
+
width: 100%;
|
|
294
|
+
height: 1px;
|
|
295
|
+
background: linear-gradient(
|
|
296
|
+
90deg,
|
|
297
|
+
`,` 0%,
|
|
298
|
+
rgba(54, 14, 26, 0) 100%
|
|
299
|
+
);
|
|
300
|
+
margin-bottom: 1rem;
|
|
301
|
+
`],h("dividerAccent")),ca=g.div.withConfig({displayName:"AssistantMessageContent__OperationHistoryContainer"})([`
|
|
302
|
+
width: 100%;
|
|
303
|
+
`]),Fs=g(D).attrs({alignItems:"center",gap:"1rem"}).withConfig({displayName:"AssistantMessageContent__AssistantHeader"})([`
|
|
304
|
+
width: 100%;
|
|
305
|
+
padding: 1.2rem 0.4rem;
|
|
306
|
+
flex: 1 0 auto;
|
|
307
|
+
`]),Ds=g(le).attrs({className:"assistant-label"}).withConfig({displayName:"AssistantMessageContent__AssistantLabel"})([`
|
|
308
|
+
font-size: 1.4rem;
|
|
309
|
+
color: `,`;
|
|
310
|
+
`],h("foreground")),qs=g(D).attrs({className:"token-display"}).withConfig({displayName:"AssistantMessageContent__TokenDisplay"})([`
|
|
311
|
+
align-items: center;
|
|
312
|
+
gap: 0.9rem;
|
|
313
|
+
margin: 0 0 0 auto;
|
|
314
|
+
`]),da=g(D).withConfig({displayName:"AssistantMessageContent__ExplanationContent"})([`
|
|
315
|
+
display: flex;
|
|
316
|
+
flex-direction: column;
|
|
317
|
+
border-radius: 0.6rem;
|
|
318
|
+
padding: 0 0.8rem;
|
|
319
|
+
flex-shrink: 0;
|
|
320
|
+
width: 100%;
|
|
321
|
+
`]),Ts=Cr([`
|
|
322
|
+
0%, 50% { opacity: 1; }
|
|
323
|
+
51%, 100% { opacity: 0; }
|
|
324
|
+
`]),ua=g.span.withConfig({displayName:"AssistantMessageContent__StreamingCursor"})([`
|
|
325
|
+
display: inline-block;
|
|
326
|
+
width: 2px;
|
|
327
|
+
height: 1.4em;
|
|
328
|
+
background: `,`;
|
|
329
|
+
margin-left: 2px;
|
|
330
|
+
margin-right: auto;
|
|
331
|
+
vertical-align: text-bottom;
|
|
332
|
+
animation: `,` 1s infinite;
|
|
333
|
+
`],h("foreground"),Ts),Rs=n.memo(({turnMessages:e,anchorMessage:t,status:a,isLiveOperation:i,isMessageStreaming:l,onScrollNeeded:o,onOpenInEditor:s})=>{const d=qt(),{operationHistory:u,endTimestamp:p,timeline:f}=n.useMemo(()=>{const w=t.operationHistory??[],A=w.filter(M=>M.type!==me.Aborted),j=w.length>0?Math.max(...w.map(M=>M.timestamp)):void 0,C=A.some(M=>{var v;return M.type===me.GeneratingResponse&&!!((v=M.content)!=null&&v.trim())});return{operationHistory:A.filter(M=>M.type!==me.GeneratingResponse),endTimestamp:j,timeline:C?Oa(A):null}},[t.operationHistory]),c=n.useMemo(()=>e.filter(w=>w.role==="assistant"&&typeof w.content=="string"&&!!w.content).map(w=>w.content).join(`
|
|
334
|
+
|
|
335
|
+
`),[e]),y=!!c,b=n.useMemo(()=>{const w=t.tokenUsage;return!w||typeof w.inputTokens!="number"||typeof w.outputTokens!="number"?null:r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{fontWeight:600},children:oa(w.inputTokens)})," ","input /"," ",r.jsx("span",{style:{fontWeight:600},children:oa(w.outputTokens)})," ","output tokens"]})},[t.tokenUsage]),x=r.jsxs(Fs,{"data-hook":"assistant-header",children:[r.jsx(gt,{size:20,variant:"filled"}),r.jsx(Ds,{children:t.model||"Assistant"}),b&&r.jsxs(qs,{className:"token-display",children:[r.jsx(Mn,{size:"16px",color:d.color.gray2}),r.jsx(le,{size:"sm",color:"gray2",children:b})]})]});if(f&&f.length>0){let w=!1;return r.jsxs(r.Fragment,{children:[f.map((A,j)=>{const C=j===f.length-1;if(A.type==="operations")return r.jsxs(yt.Fragment,{children:[j===0&&r.jsx(la,{}),r.jsx(ca,{children:r.jsx(Sn,{operationHistory:A.operations,status:a,isLive:i&&C,onScrollNeeded:o,collapsed:!C,endTimestamp:A.endTimestamp})})]},`ops-${A.timestamp}`);const M=!w;return w=!0,r.jsxs(yt.Fragment,{children:[M&&x,r.jsx(da,{children:r.jsx(sa,{content:A.content,messageId:t.id,onOpenInEditor:s})})]},`content-${A.timestamp}`)}),l&&r.jsx(ua,{"data-hook":"streaming-cursor"})]})}return r.jsxs(r.Fragment,{children:[u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(la,{}),r.jsx(ca,{children:r.jsx(Sn,{operationHistory:u,status:a,isLive:i,onScrollNeeded:o,collapsed:y||!!t.error,endTimestamp:p})})]}),y&&r.jsxs(r.Fragment,{children:[x,r.jsxs(da,{children:[r.jsx(sa,{content:c,messageId:t.id,onOpenInEditor:s}),l&&r.jsx(ua,{"data-hook":"streaming-cursor"})]})]})]})},(e,t)=>{const a=e.turnMessages[e.turnMessages.length-1],i=t.turnMessages[t.turnMessages.length-1];return a===i&&e.anchorMessage===t.anchorMessage&&e.status===t.status&&e.isLiveOperation===t.isLiveOperation&&e.isMessageStreaming===t.isMessageStreaming}),zs=g(D).withConfig({displayName:"ChatMessages__MessagesContainer"})([`
|
|
336
|
+
display: flex;
|
|
337
|
+
flex-direction: column;
|
|
338
|
+
gap: 1.5rem;
|
|
339
|
+
padding: 2rem 1rem;
|
|
340
|
+
overflow-y: auto;
|
|
341
|
+
flex: 1 1 auto;
|
|
342
|
+
min-height: 0;
|
|
343
|
+
width: 100%;
|
|
344
|
+
`,`
|
|
345
|
+
`],({$scrolled:e})=>!e&&re([`
|
|
346
|
+
opacity: 0;
|
|
347
|
+
`])),Os=g(D).attrs({align:"flex-start"}).withConfig({displayName:"ChatMessages__MessageBubble"})([`
|
|
348
|
+
display: flex;
|
|
349
|
+
flex-direction: column;
|
|
350
|
+
gap: 0.5rem;
|
|
351
|
+
padding: 0.8rem;
|
|
352
|
+
border-radius: 0.8rem;
|
|
353
|
+
width: 100%;
|
|
354
|
+
align-self: flex-end;
|
|
355
|
+
background: `,`;
|
|
356
|
+
border: 1px solid `,`;
|
|
357
|
+
flex-shrink: 0;
|
|
358
|
+
`],h("loginBackground"),h("black32")),ha=g(D).withConfig({displayName:"ChatMessages__UserRequestBox"})([`
|
|
359
|
+
display: flex;
|
|
360
|
+
flex-direction: column;
|
|
361
|
+
gap: 0.5rem;
|
|
362
|
+
padding: 0.8rem;
|
|
363
|
+
width: 100%;
|
|
364
|
+
align-self: flex-end;
|
|
365
|
+
background: `,`;
|
|
366
|
+
border: 1px solid `,`;
|
|
367
|
+
border-radius: 0.6rem;
|
|
368
|
+
flex-shrink: 0;
|
|
369
|
+
`],h("loginBackground"),h("black32")),$s=g(D).attrs({alignItems:"center",gap:"0.8rem"}).withConfig({displayName:"ChatMessages__UserRequestHeader"})([`
|
|
370
|
+
width: 100%;
|
|
371
|
+
padding: 0.4rem;
|
|
372
|
+
flex: 1 0 auto;
|
|
373
|
+
`]),At=g(D).withConfig({displayName:"ChatMessages__UserRequestContent"})([`
|
|
374
|
+
display: flex;
|
|
375
|
+
flex-direction: column;
|
|
376
|
+
border-radius: 0.6rem;
|
|
377
|
+
overflow: hidden;
|
|
378
|
+
flex-shrink: 0;
|
|
379
|
+
width: 100%;
|
|
380
|
+
align-items: flex-start;
|
|
381
|
+
`]),ma=g.div.withConfig({displayName:"ChatMessages__InlineSQLEditor"})([`
|
|
382
|
+
width: 100%;
|
|
383
|
+
`]),Bs=g(D).attrs({gap:"1rem",alignItems:"center"}).withConfig({displayName:"ChatMessages__OperationBadge"})([`
|
|
384
|
+
width: 100%;
|
|
385
|
+
padding: 0 0.4rem;
|
|
386
|
+
`]),Ws=g(D).attrs({align:"center",justifyContent:"center"}).withConfig({displayName:"ChatMessages__BadgeIconContainer"})([`
|
|
387
|
+
background: `,`;
|
|
388
|
+
border: 1px solid `,`;
|
|
389
|
+
border-radius: 0.4rem;
|
|
390
|
+
padding: 0.8rem;
|
|
391
|
+
width: 4.8rem;
|
|
392
|
+
height: 4rem;
|
|
393
|
+
flex-shrink: 0;
|
|
394
|
+
`],h("aiBadgeIconBg"),h("aiBadgeIconBorder")),Ps=g.div.withConfig({displayName:"ChatMessages__BadgeIconWrapper"})([`
|
|
395
|
+
width: 2.4rem;
|
|
396
|
+
height: 2.4rem;
|
|
397
|
+
display: flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: center;
|
|
400
|
+
color: `,`;
|
|
401
|
+
|
|
402
|
+
svg {
|
|
403
|
+
width: 100%;
|
|
404
|
+
height: 100%;
|
|
405
|
+
}
|
|
406
|
+
`],({theme:e})=>e.color.pink),Qs=g(le).withConfig({displayName:"ChatMessages__BadgeTitle"})([`
|
|
407
|
+
font-weight: 500;
|
|
408
|
+
font-size: 1.6rem;
|
|
409
|
+
line-height: 1.6rem;
|
|
410
|
+
color: `,`;
|
|
411
|
+
`],h("foreground")),Ks=g(D).withConfig({displayName:"ChatMessages__BadgeDescriptionContainer"})([`
|
|
412
|
+
align-items: flex-start;
|
|
413
|
+
flex-direction: column;
|
|
414
|
+
padding: 0.8rem;
|
|
415
|
+
width: 100%;
|
|
416
|
+
`]),Us=g(le).withConfig({displayName:"ChatMessages__BadgeDescriptionText"})([`
|
|
417
|
+
font-size: 1.4rem;
|
|
418
|
+
line-height: 2.1rem;
|
|
419
|
+
color: `,`;
|
|
420
|
+
`],h("foreground")),Gs=g(le).withConfig({displayName:"ChatMessages__BadgeDescriptionIssueText"})([`
|
|
421
|
+
font-size: 1.4rem;
|
|
422
|
+
line-height: 2.1rem;
|
|
423
|
+
font-weight: 600;
|
|
424
|
+
`]),Ys=g(D).withConfig({displayName:"ChatMessages__IssueMessageRow"})([`
|
|
425
|
+
display: flex;
|
|
426
|
+
align-items: center;
|
|
427
|
+
gap: 0.5rem;
|
|
428
|
+
`]),pa=g(he).withConfig({displayName:"ChatMessages__SchemaNameDisplay"})([`
|
|
429
|
+
margin-left: 0.4rem;
|
|
430
|
+
padding: 0.5rem 1rem;
|
|
431
|
+
align-items: center;
|
|
432
|
+
gap: 1rem;
|
|
433
|
+
border-radius: 0.6rem;
|
|
434
|
+
border: 1px solid `,`;
|
|
435
|
+
background: `,`;
|
|
436
|
+
|
|
437
|
+
&:hover,
|
|
438
|
+
&:active {
|
|
439
|
+
background: `,` !important;
|
|
440
|
+
border-color: `,` !important;
|
|
441
|
+
}
|
|
442
|
+
`],h("selection"),h("backgroundDarker"),h("backgroundLighter"),h("cyan")),ga=g(le).withConfig({displayName:"ChatMessages__SchemaName"})([`
|
|
443
|
+
font-size: 1.4rem;
|
|
444
|
+
color: `,`;
|
|
445
|
+
`],h("foreground")),fa=g(le).withConfig({displayName:"ChatMessages__MessageContent"})([`
|
|
446
|
+
font-size: 1.4rem;
|
|
447
|
+
line-height: 1.8rem;
|
|
448
|
+
color: `,`;
|
|
449
|
+
white-space: pre-wrap;
|
|
450
|
+
word-wrap: break-word;
|
|
451
|
+
`],h("foreground")),Xs=g(D).withConfig({displayName:"ChatMessages__ExplanationBox"})([`
|
|
452
|
+
display: flex;
|
|
453
|
+
flex-direction: column;
|
|
454
|
+
gap: 0.8rem;
|
|
455
|
+
width: 100%;
|
|
456
|
+
align-self: flex-start;
|
|
457
|
+
text-align: left;
|
|
458
|
+
background: transparent;
|
|
459
|
+
padding: 0.4rem;
|
|
460
|
+
border-radius: 0.6rem;
|
|
461
|
+
flex-shrink: 0;
|
|
462
|
+
|
|
463
|
+
`,`
|
|
464
|
+
|
|
465
|
+
.assistant-label,
|
|
466
|
+
.token-display {
|
|
467
|
+
transition: opacity 0.2s;
|
|
468
|
+
opacity: 0;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
&:hover,
|
|
472
|
+
&:focus-within {
|
|
473
|
+
.assistant-label,
|
|
474
|
+
.token-display {
|
|
475
|
+
opacity: 1;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
`],({$hasOperationHistory:e})=>e&&re([`
|
|
479
|
+
padding-top: 0;
|
|
480
|
+
`])),Js=g.div.withConfig({displayName:"ChatMessages__ErrorContainer"})([`
|
|
481
|
+
display: flex;
|
|
482
|
+
align-items: center;
|
|
483
|
+
flex-shrink: 0;
|
|
484
|
+
gap: 0.5rem;
|
|
485
|
+
padding: 0.4rem 0.4rem 0.4rem 0.8rem;
|
|
486
|
+
border: 1px solid `,`;
|
|
487
|
+
border-radius: 0.6rem;
|
|
488
|
+
color: `,`;
|
|
489
|
+
font-size: 1.4rem;
|
|
490
|
+
line-height: 2rem;
|
|
491
|
+
width: 100%;
|
|
492
|
+
`],h("red"),h("foreground")),eo=g(he).withConfig({displayName:"ChatMessages__RetryButton"})([`
|
|
493
|
+
margin-left: auto;
|
|
494
|
+
flex-shrink: 0;
|
|
495
|
+
padding: 0.5rem 0.8rem;
|
|
496
|
+
height: auto;
|
|
497
|
+
`]),to=g.div.withConfig({displayName:"ChatMessages__MessagesEnd"})([`
|
|
498
|
+
min-height: 1px;
|
|
499
|
+
width: 100%;
|
|
500
|
+
background: transparent;
|
|
501
|
+
`]),no=g(D).withConfig({displayName:"ChatMessages__DiffContainer"})([`
|
|
502
|
+
display: flex;
|
|
503
|
+
flex-direction: column;
|
|
504
|
+
gap: 1rem;
|
|
505
|
+
margin-top: 1rem;
|
|
506
|
+
padding: 0.8rem 1.2rem;
|
|
507
|
+
border: 1px solid `,`;
|
|
508
|
+
border-radius: 0.8rem;
|
|
509
|
+
background: `,`;
|
|
510
|
+
width: 100%;
|
|
511
|
+
`],h("selection"),h("backgroundDarker")),ao=g(D).withConfig({displayName:"ChatMessages__DiffHeader"})([`
|
|
512
|
+
display: flex;
|
|
513
|
+
align-items: center;
|
|
514
|
+
justify-content: space-between;
|
|
515
|
+
padding-bottom: 0.8rem;
|
|
516
|
+
border-bottom: 1px solid `,`;
|
|
517
|
+
width: 100%;
|
|
518
|
+
`,`
|
|
519
|
+
`],h("selectionDarker"),({$isExpanded:e})=>!e&&re([`
|
|
520
|
+
border-bottom: 0;
|
|
521
|
+
padding-bottom: 0;
|
|
522
|
+
`])),ro=g(D).withConfig({displayName:"ChatMessages__DiffHeaderLeft"})([`
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: center;
|
|
525
|
+
gap: 1rem;
|
|
526
|
+
padding: 0.4rem 0;
|
|
527
|
+
`]),io=g.span.withConfig({displayName:"ChatMessages__DiffHeaderLabel"})([`
|
|
528
|
+
font-size: 1.4rem;
|
|
529
|
+
color: `,`;
|
|
530
|
+
`],h("offWhite")),so=g(D).withConfig({displayName:"ChatMessages__DiffHeaderRight"})([`
|
|
531
|
+
display: flex;
|
|
532
|
+
align-items: center;
|
|
533
|
+
gap: 1.8rem;
|
|
534
|
+
margin-left: auto;
|
|
535
|
+
`]),xa=g(D).withConfig({displayName:"ChatMessages__DiffHeaderStatus"})([`
|
|
536
|
+
display: flex;
|
|
537
|
+
align-items: center;
|
|
538
|
+
gap: 0.8rem;
|
|
539
|
+
color: `,`;
|
|
540
|
+
font-size: 1.3rem;
|
|
541
|
+
`],({$isAccepted:e,$isRejected:t,$isRejectedWithFollowUp:a})=>t?h("red"):a?h("cyan"):e?h("greenDarker"):h("gray2")),ya=g.span.withConfig({displayName:"ChatMessages__StatusIcon"})([`
|
|
542
|
+
display: flex;
|
|
543
|
+
align-items: center;
|
|
544
|
+
color: `,`;
|
|
545
|
+
`],({$isAccepted:e,$isRejected:t,$isRejectedWithFollowUp:a})=>t?h("red"):a?h("cyan"):e?h("greenDarker"):h("gray2")),Gt=g.button.withConfig({displayName:"ChatMessages__IconButton"})([`
|
|
546
|
+
display: flex;
|
|
547
|
+
align-items: center;
|
|
548
|
+
justify-content: center;
|
|
549
|
+
padding: 0;
|
|
550
|
+
background: transparent;
|
|
551
|
+
border: none;
|
|
552
|
+
cursor: pointer;
|
|
553
|
+
height: 2.2rem;
|
|
554
|
+
width: 2.2rem;
|
|
555
|
+
color: `,`;
|
|
556
|
+
|
|
557
|
+
&:hover:not(:disabled) {
|
|
558
|
+
svg {
|
|
559
|
+
filter: brightness(1.3);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
&:disabled {
|
|
564
|
+
opacity: 0.4;
|
|
565
|
+
cursor: not-allowed;
|
|
566
|
+
}
|
|
567
|
+
`],h("gray2")),oo=g(Gt).withConfig({displayName:"ChatMessages__ExpandButton"})([`
|
|
568
|
+
width: 1.6rem;
|
|
569
|
+
height: 1.6rem;
|
|
570
|
+
`]),lo=g.div.withConfig({displayName:"ChatMessages__DiffEditorWrapper"})([`
|
|
571
|
+
position: relative;
|
|
572
|
+
width: 100%;
|
|
573
|
+
`]),co=g(D).withConfig({displayName:"ChatMessages__ButtonBar"})([`
|
|
574
|
+
padding: 0.5rem;
|
|
575
|
+
gap: 1rem;
|
|
576
|
+
justify-content: center;
|
|
577
|
+
flex-shrink: 0;
|
|
578
|
+
width: fit-content;
|
|
579
|
+
margin: 0 auto;
|
|
580
|
+
background: `,`;
|
|
581
|
+
border: 1px solid `,`;
|
|
582
|
+
border-radius: 0.4rem;
|
|
583
|
+
`],h("backgroundDarker"),h("selection")),uo=g(he).withConfig({displayName:"ChatMessages__AcceptButton"})([`
|
|
584
|
+
background: `,`;
|
|
585
|
+
color: `,`;
|
|
586
|
+
border: 0.1rem solid `,`;
|
|
587
|
+
width: 10rem;
|
|
588
|
+
|
|
589
|
+
&:hover:not(:disabled) {
|
|
590
|
+
background: `,`;
|
|
591
|
+
border-color: `,`;
|
|
592
|
+
filter: brightness(1.2);
|
|
593
|
+
}
|
|
594
|
+
`],({theme:e})=>e.color.pinkDarker,h("foreground"),({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker),ho=g(he).withConfig({displayName:"ChatMessages__RejectButton"})([`
|
|
595
|
+
background: `,`;
|
|
596
|
+
color: `,`;
|
|
597
|
+
border: 1px solid transparent;
|
|
598
|
+
width: 10rem;
|
|
599
|
+
|
|
600
|
+
&:hover:not(:disabled) {
|
|
601
|
+
background: `,`;
|
|
602
|
+
border-color: transparent;
|
|
603
|
+
}
|
|
604
|
+
`],h("background"),h("foreground"),h("selection")),mo=e=>{switch(e){case"fix_request":return{icon:r.jsx(Ja,{size:24}),title:"Fix Query",description:"Help me debug and fix the error with the attached SQL query"};case"explain_request":return{icon:r.jsx(Xa,{size:24}),title:"Explain Query",description:"Explain this query in detail"};case"schema_explain_request":return{icon:r.jsx(Ya,{size:24}),title:"Explain Schema",description:"Provide an overview, detailed column descriptions and storage details."};case"health_issue_request":return{icon:r.jsx(Ga,{size:24}),title:"Health Issue Analysis",description:"Analyze table health issue and provide steps for resolution:"};default:return null}},po=(e,t)=>{switch(e){case"loading":return r.jsx(hn,{size:24,color:t.color.red});case"success":return r.jsx(nr,{});case"error":return r.jsx(tr,{});default:return r.jsx(er,{})}},go=({messages:e,onAcceptChange:t,onRejectChange:a,onRunQuery:i,onOpenInEditor:l,onApplyToEditor:o,onRetry:s,onCancelQuery:d,runningQueryKey:u,queryNotifications:p,isOperationInProgress:f,editorSQL:c,isStreaming:y,isLoadingMessages:b,scrollToMessageId:x,onScrollToMessageComplete:w})=>{const A=qt(),j=gn(),C=Ee(Me.query.getTables),M=n.useRef(null),v=n.useRef(null),E=n.useRef(new Map),{status:z}=Fe(),[Z,T]=n.useState(!1),S=n.useRef(!1),m=n.useCallback(()=>{if(Z&&S.current||x)return;const L=Z?"smooth":"instant";setTimeout(()=>{var _;(_=M.current)==null||_.scrollIntoView({behavior:L}),T(!0)})},[Z,x]),N=n.useCallback(L=>{const _=C.find(J=>J.table_name===L.tableName&&dn(J)===L.kind);_&&j(Lt.console.pushSidebarHistory({type:"tableDetails",payload:{tableName:_.table_name,isMatView:_.table_type==="M",isView:_.table_type==="V"}}))},[C]);n.useEffect(()=>{const L=v.current;if(!L)return;const _=()=>{S.current=!0};return L.addEventListener("wheel",_),()=>L.removeEventListener("wheel",_)},[]),n.useEffect(()=>{S.current=!1},[e.length]);const H=n.useMemo(()=>{for(let L=e.length-1;L>=0;L--){const _=e[L];if(_.role==="assistant"&&_.sql)return L}return-1},[e]),ce=n.useRef(H>=0?H:-1),[Q,R]=n.useState(H>=0?new Set([H]):new Set);n.useEffect(()=>{H>=0&&H!==ce.current&&(R(L=>new Set([...L,H])),ce.current=H)},[H]);const{visibleEntries:U,lastAssistantAnchorIndex:ae,lastVisibleUserIndex:X}=n.useMemo(()=>$a(e),[e]),_e=n.useMemo(()=>Ba(y,e),[y,e]);n.useEffect(()=>{m()},[_e,m]),n.useLayoutEffect(()=>{if(!x||b)return;const L=E.current.get(x);if(L){const _=setTimeout(()=>{L.scrollIntoView({behavior:"smooth",block:"start"}),T(!0),w()},100);return()=>clearTimeout(_)}},[x,b,w]),n.useEffect(()=>()=>{w()},[]);const fe=U[U.length-1],Oe=U.length>0?fe.type==="user"?fe.index:fe.anchorIndex:-1,$e=ae;return r.jsxs(zs,{ref:v,$scrolled:Z,role:"log","data-hook":"chat-messages-container",children:[U.map(L=>{var it,st,ot;if(L.type==="user"){const{message:V}=L,Y=`${V.id}`,ye=(it=V.displayHealthIssueData)==null?void 0:it.severity,lt=Ce(V.sql||"")===Ce(c||""),se=V.displayType,Ae=V.sql;if(se&&se!=="ask_request"){const $=mo(se);let be=null;if(se==="schema_explain_request"&&V.displaySchemaData){const ee=V.displaySchemaData;be=r.jsx(At,{children:r.jsxs(pa,{onClick:()=>N(ee),children:[r.jsx(Ft,{kind:ee.kind,partitionBy:ee.partitionBy,walEnabled:ee.walEnabled,designatedTimestamp:ee.designatedTimestamp}),r.jsx(ga,{children:ee.tableName})]})})}else if(se==="health_issue_request"&&V.displayHealthIssueData){const ee=V.displayHealthIssueData;be=r.jsx(At,{children:r.jsxs(pa,{children:[r.jsx(Ft,{kind:"table"}),r.jsx(ga,{children:ee.tableName})]})})}else Ae&&(be=r.jsx(At,{children:r.jsx(ma,{"data-hook":"user-request-sql-editor",children:r.jsx(Ue,{value:Ae,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:Ae},lt)})})}));return r.jsxs(ha,{"data-hook":"chat-message-user",ref:ee=>{ee&&E.current.set(V.id,ee)},children:[r.jsxs(Bs,{children:[r.jsx(Ws,{children:r.jsx(Ps,{children:$==null?void 0:$.icon})}),r.jsx(Qs,{children:$==null?void 0:$.title})]}),($==null?void 0:$.description)&&r.jsxs(Ks,{children:[r.jsx(Us,{children:$.description}),se==="health_issue_request"&&((st=V.displayHealthIssueData)==null?void 0:st.issueMessage)&&r.jsxs(Ys,{children:[ye==="critical"?r.jsx(Wa,{size:14,weight:"fill",color:A.color.red}):r.jsx(Pa,{size:14,weight:"fill",color:A.color.orange}),r.jsx(Gs,{color:ye==="critical"?"red":"orange",children:V.displayHealthIssueData.issueMessage})]})]}),be]},Y)}if(se==="ask_request"&&Ae){const $=V.displayUserMessage||V.content||"";return r.jsxs(ha,{"data-hook":"chat-message-user",ref:be=>{be&&E.current.set(V.id,be)},children:[r.jsx($s,{children:r.jsx(fa,{children:$})}),r.jsx(At,{children:r.jsx(ma,{"data-hook":"user-request-sql-editor",children:r.jsx(Ue,{value:Ae,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:Ae},lt)})})})]},Y)}return r.jsx(Os,{"data-hook":"chat-message-user",ref:$=>{$&&E.current.set(V.id,$)},children:r.jsx(fa,{children:V.content})},Y)}const{anchorMessage:_,anchorIndex:J,turnMessages:Be}=L,k=`${_.id}`,Ie=Ce(_.sql||"")===Ce(c||""),Le=!!_.sql,xe=Le&&_.previousSQL!==void 0&&Ce(_.sql||"")===Ce(_.previousSQL||""),ke=Q.has(J),B=_.isAccepted===!0,q=_.isRejected===!0,de=Le&&!B&&!q&&J<X,W=J===Oe,nt=y&&W,at=Le&&!xe&&!B&&!q&&!de&&W;let P="neutral";if(_.sql){const V=Ce(_.sql),Y=Dt(V);if(u&&Y===u)P="loading";else if(p){const ye=(ot=p[Y])==null?void 0:ot.latest;ye&&(ye.type===Te.ERROR?P="error":(ye.type===Te.SUCCESS||ye.type===Te.INFO)&&(P="success"))}}const rt=Tt(_.previousSQL),We=Tt(_.sql),G=!!_.error,Mt=G&&!y&&!f&&W,vt=J===$e&&f===!0,jt=!!_.operationHistory&&_.operationHistory.length>0;return r.jsxs(Xs,{$hasOperationHistory:jt,"data-hook":"chat-message-assistant",ref:V=>{V&&E.current.set(_.id,V)},children:[r.jsx(Rs,{turnMessages:Be,anchorMessage:_,status:z,isLiveOperation:vt,isMessageStreaming:nt,onScrollNeeded:m,onOpenInEditor:l}),Le&&!nt&&r.jsxs(no,{"data-hook":"inline-diff-container",children:[r.jsxs(ao,{$isExpanded:ke,children:[r.jsxs(ro,{children:[r.jsx(Qa,{size:22,color:A.color.offWhite}),r.jsx(io,{children:"Suggested change"})]}),xe&&r.jsxs(xa,{"data-hook":"diff-status-unchanged",children:[r.jsx(ya,{children:r.jsx(un,{size:"14px"})}),"Already accepted"]}),!xe&&(B||q||de)&&r.jsxs(xa,{$isAccepted:B,$isRejected:q,$isRejectedWithFollowUp:de,"data-hook":q?"diff-status-rejected":de?"diff-status-followed-up":"diff-status-accepted",children:[r.jsx(ya,{$isAccepted:B,$isRejected:q,$isRejectedWithFollowUp:de,children:q?r.jsx(Ka,{size:"14px"}):de?r.jsx(yn,{size:"14px"}):r.jsx(un,{size:"14px"})}),q?"Rejected":de?"Followed up":"Accepted"]}),r.jsxs(so,{children:[r.jsx(Gt,{onClick:V=>{V.stopPropagation(),P==="loading"&&_.sql?d==null||d(Dt(Ce(_.sql))):_.sql&&i&&i(_.sql)},title:P==="loading"?"Cancel query":"Run this query","aria-label":P==="loading"?"Cancel query":"Run this query","data-hook":"message-action-run-sql",children:po(P,A)}),!at&&o&&!(J===H&&B)&&!Ie&&r.jsx(Gt,{onClick:V=>{V.stopPropagation(),_.id&&_.sql&&!f&&(ve(je.AI_EDITOR_SUGGESTION_APPLY),o(_.id,_.sql))},title:"Apply to editor","aria-label":"Apply to editor",disabled:f,"data-hook":"message-action-apply",children:r.jsx(vn,{size:22,color:A.color.offWhite})}),r.jsx(oo,{title:"Expand diff view","aria-label":ke?"Collapse diff view":"Expand diff view","aria-expanded":ke,"data-hook":"diff-expand-button",onClick:()=>{R(V=>{const Y=new Set(V);return Y.has(J)?Y.delete(J):Y.add(J),Y})},children:r.jsx(Ua,{})})]})]}),ke&&r.jsxs(r.Fragment,{children:[r.jsx(lo,{children:r.jsx(Ue,{diffEditor:!0,original:rt,modified:We,maxHeight:300,onOpenInEditor:()=>l({type:"diff",original:rt??"",modified:We??""}),handleScrollNeeded:m})}),at&&r.jsxs(co,{align:"center",justifyContent:"center",children:[a&&_.id&&r.jsx(ho,{onClick:()=>a(_.id),"data-hook":"message-action-reject",children:"Reject"}),t&&_.id&&r.jsx(uo,{onClick:()=>t(_.id),"data-hook":"message-action-accept",children:"Accept"})]})]})]}),G&&r.jsxs(Js,{role:"alert","data-hook":"chat-message-error",children:[r.jsx(on,{size:16,color:A.color.red,style:{flexShrink:0}}),_.error,Mt&&s&&r.jsx(eo,{size:"sm",skin:"secondary",prefixIcon:r.jsx(fn,{size:12}),onClick:()=>{const V=e.slice(0,J).findLastIndex(Y=>Y.role==="user");V>=0&&s(e[V].id)},"data-hook":"retry-button",children:"Retry"})]})]},k)}),r.jsx(to,{ref:M,"data-hook":"messages-end"})]})},fo=g(D).withConfig({displayName:"ChatInput__InputContainer"})([`
|
|
605
|
+
display: flex;
|
|
606
|
+
flex-direction: column;
|
|
607
|
+
align-items: stretch;
|
|
608
|
+
gap: 0.8rem;
|
|
609
|
+
padding: 1rem 1.2rem;
|
|
610
|
+
flex-shrink: 0;
|
|
611
|
+
width: 100%;
|
|
612
|
+
margin-top: auto;
|
|
613
|
+
border-top: 1px solid `,`;
|
|
614
|
+
`],h("selection")),xo=g(D).withConfig({displayName:"ChatInput__InputWrapper"})([`
|
|
615
|
+
display: flex;
|
|
616
|
+
position: relative;
|
|
617
|
+
width: 100%;
|
|
618
|
+
overflow: hidden;
|
|
619
|
+
`]),yo=g.textarea.withConfig({displayName:"ChatInput__StyledTextArea"})([`
|
|
620
|
+
flex: 1;
|
|
621
|
+
min-height: 8rem;
|
|
622
|
+
max-height: 30rem;
|
|
623
|
+
line-height: 1.3;
|
|
624
|
+
padding: `,`;
|
|
625
|
+
background: `,`;
|
|
626
|
+
border: 1px solid `,`;
|
|
627
|
+
border-radius: 0.6rem;
|
|
628
|
+
color: `,`;
|
|
629
|
+
font-size: 1.4rem;
|
|
630
|
+
font-family: `,`;
|
|
631
|
+
resize: none;
|
|
632
|
+
outline: none;
|
|
633
|
+
|
|
634
|
+
&:focus {
|
|
635
|
+
border-color: `,`;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
&::placeholder {
|
|
639
|
+
color: `,`;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
&:disabled {
|
|
643
|
+
opacity: 0.5;
|
|
644
|
+
}
|
|
645
|
+
`],({$hasContext:e})=>e?"4.4rem 4.5rem 1.2rem 1.2rem":"1.2rem 4.5rem 1.2rem 1.2rem",h("backgroundDarker"),h("selection"),h("foreground"),({theme:e})=>e.font,h("pinkDarker"),h("gray2")),bo=g.button.withConfig({displayName:"ChatInput__ActionButton"})([`
|
|
646
|
+
position: absolute;
|
|
647
|
+
right: 0.8rem;
|
|
648
|
+
bottom: 0.8rem;
|
|
649
|
+
padding: 0.6rem;
|
|
650
|
+
border: none;
|
|
651
|
+
display: flex;
|
|
652
|
+
align-items: center;
|
|
653
|
+
justify-content: center;
|
|
654
|
+
border-radius: 0.4rem;
|
|
655
|
+
cursor: pointer;
|
|
656
|
+
`]),Co=g.div.withConfig({displayName:"ChatInput__ContextBadgeContainer"})([`
|
|
657
|
+
position: absolute;
|
|
658
|
+
padding: 0.8rem;
|
|
659
|
+
top: 2px;
|
|
660
|
+
border-radius: 0.6rem;
|
|
661
|
+
left: 1px;
|
|
662
|
+
width: calc(100% - 0.2rem);
|
|
663
|
+
display: inline-flex;
|
|
664
|
+
background: `,`;
|
|
665
|
+
`],h("backgroundDarker")),wo=g.button.withConfig({displayName:"ChatInput__ContextBadge"})([`
|
|
666
|
+
display: flex;
|
|
667
|
+
padding: 0.3rem 0.6rem;
|
|
668
|
+
align-items: center;
|
|
669
|
+
gap: 0.4rem;
|
|
670
|
+
line-height: 1.4;
|
|
671
|
+
border-radius: 0.6rem;
|
|
672
|
+
border: 1px solid `,`;
|
|
673
|
+
background: `,`;
|
|
674
|
+
color: `,`;
|
|
675
|
+
font-size: 1.3rem;
|
|
676
|
+
user-select: none;
|
|
677
|
+
cursor: pointer;
|
|
678
|
+
font-family: inherit;
|
|
679
|
+
|
|
680
|
+
&:hover {
|
|
681
|
+
border: 1px solid `,`;
|
|
682
|
+
color: `,`;
|
|
683
|
+
}
|
|
684
|
+
`],h("selection"),h("chatBackground"),h("gray2"),h("offWhite"),h("offWhite")),ko=g.div.withConfig({displayName:"ChatInput__ContextBadgeIcon"})([`
|
|
685
|
+
display: flex;
|
|
686
|
+
align-items: center;
|
|
687
|
+
color: `,`;
|
|
688
|
+
flex-shrink: 0;
|
|
689
|
+
|
|
690
|
+
svg {
|
|
691
|
+
color: `,`;
|
|
692
|
+
}
|
|
693
|
+
`],h("gray2"),h("gray2")),Ao=g(bo).withConfig({displayName:"ChatInput__SendButton"})([`
|
|
694
|
+
background: `,`;
|
|
695
|
+
color: `,`;
|
|
696
|
+
|
|
697
|
+
&:hover:not(:disabled) {
|
|
698
|
+
background: `,`;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
&:disabled {
|
|
702
|
+
opacity: 0.5;
|
|
703
|
+
cursor: not-allowed;
|
|
704
|
+
}
|
|
705
|
+
`],h("pinkDarker"),h("foreground"),h("pink")),Mo=g.div.withConfig({displayName:"ChatInput__ThoughtStream"})([`
|
|
706
|
+
display: flex;
|
|
707
|
+
position: relative;
|
|
708
|
+
width: 100%;
|
|
709
|
+
background: `,`;
|
|
710
|
+
border: 1px solid transparent;
|
|
711
|
+
background:
|
|
712
|
+
linear-gradient(`,", ",`)
|
|
713
|
+
padding-box,
|
|
714
|
+
`,` border-box;
|
|
715
|
+
border-radius: 0.6rem;
|
|
716
|
+
height: 4rem;
|
|
717
|
+
`],h("backgroundDarker"),h("backgroundDarker"),h("backgroundDarker"),rr),vo=g.div.withConfig({displayName:"ChatInput__ThoughtStreamContent"})([`
|
|
718
|
+
display: flex;
|
|
719
|
+
align-items: center;
|
|
720
|
+
background: `,`;
|
|
721
|
+
gap: 0.8rem;
|
|
722
|
+
width: 100%;
|
|
723
|
+
height: 100%;
|
|
724
|
+
border-radius: 0.6rem;
|
|
725
|
+
padding: 0 1.2rem;
|
|
726
|
+
padding-right: 4.5rem;
|
|
727
|
+
`],h("backgroundDarker")),jo=g.div.withConfig({displayName:"ChatInput__ThoughtText"})([`
|
|
728
|
+
font-weight: 500;
|
|
729
|
+
font-size: 1.4rem;
|
|
730
|
+
color: `,`;
|
|
731
|
+
`,`
|
|
732
|
+
`],h("gray2"),ln),Ho=g.div.withConfig({displayName:"ChatInput__StopButtonWrapper"})([`
|
|
733
|
+
position: absolute;
|
|
734
|
+
right: 0.8rem;
|
|
735
|
+
top: 50%;
|
|
736
|
+
transform: translateY(-50%);
|
|
737
|
+
`]),ba=(e,t=30)=>{if(!e)return"";const a=e.trim().replace(/\s+/g," ");return a.length<=t?a:a.slice(0,t)+"..."},Eo=n.forwardRef(({onSend:e,disabled:t=!1,placeholder:a="Ask a question or request a refinement...",contextSQL:i,contextTableId:l,onContextClick:o},s)=>{const[d,u]=n.useState(""),p=n.useRef(null),f=Ee(Me.query.getTables),c=n.useMemo(()=>l==null?null:f.find(E=>E.id===l)??null,[l,f]),y=c!=null&&c.table_name?ba(c.table_name):i?ba(i):null,b=!!y;n.useImperativeHandle(s,()=>({focus:()=>{var E;(E=p.current)==null||E.focus()}}));const{status:x,abortOperation:w}=Fe(),A=pe(x);n.useEffect(()=>{p.current&&(p.current.style.height="auto",p.current.style.height=`${p.current.scrollHeight}px`)},[d]);const j=()=>{const E=d.trim();E&&!t&&!A&&(e(E),u(""),p.current&&(p.current.style.height="auto"))},C=E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),j())},M=()=>{w()},v=A;return r.jsxs(fo,{children:[v?r.jsxs(Mo,{"data-hook":"chat-assistant-modes",children:[r.jsxs(vo,{children:[r.jsx(Zt,{size:20}),r.jsx(jo,{role:"status","aria-live":"polite",children:x})]}),r.jsx(Ho,{children:r.jsx(ar,{size:"md",onClick:M,title:"Stop generation",ariaLabel:"Stop AI generation",dataHook:"chat-stop-button"})})]}):r.jsxs(xo,{children:[b&&r.jsx(Co,{children:r.jsxs(wo,{type:"button",onClick:o,"aria-label":`Change context: ${y}`,"data-hook":"chat-context-badge",children:[r.jsx(ko,{children:c?r.jsx(Ft,{kind:dn(c),partitionBy:c.partitionBy,walEnabled:c.walEnabled,designatedTimestamp:c.designatedTimestamp}):r.jsx(An,{size:14,weight:"regular"})}),y]})}),r.jsx(yo,{ref:p,value:d,onChange:E=>u(E.target.value),onKeyDown:C,placeholder:a,"aria-label":"Chat with AI assistant","aria-keyshortcuts":"Enter",disabled:t,rows:1,$hasContext:b,"data-hook":"chat-input-textarea"}),r.jsx(Ao,{onClick:j,disabled:!d.trim()||t,title:"Send (Enter) \u2022 New line (Shift+Enter)","aria-label":"Send message","data-hook":"chat-send-button",children:r.jsx(xn,{size:20,weight:"bold"})})]}),r.jsx(le,{color:"gray2",size:"sm",align:"center",children:"Chats are connected to a single query to improve responses."})]})}),Yt=g.div.withConfig({displayName:"ChatHistoryItem__Container"})([`
|
|
738
|
+
display: flex;
|
|
739
|
+
align-items: center;
|
|
740
|
+
gap: 0.6rem;
|
|
741
|
+
padding: 0.4rem 0.8rem;
|
|
742
|
+
border-radius: 4px;
|
|
743
|
+
cursor: `,`;
|
|
744
|
+
background: `,`;
|
|
745
|
+
opacity: `,`;
|
|
746
|
+
border: 0;
|
|
747
|
+
width: 100%;
|
|
748
|
+
text-align: left;
|
|
749
|
+
|
|
750
|
+
&:hover,
|
|
751
|
+
&:focus-visible {
|
|
752
|
+
background: `,`;
|
|
753
|
+
|
|
754
|
+
.chat-title {
|
|
755
|
+
color: `,`;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
&:focus-visible {
|
|
760
|
+
outline: 2px solid `,`;
|
|
761
|
+
outline-offset: -2px;
|
|
762
|
+
}
|
|
763
|
+
`],({$disabled:e})=>e?"not-allowed":"pointer",h("transparent"),({$disabled:e})=>e?.5:1,({$disabled:e})=>e?"transparent":h("selection"),({$disabled:e})=>e?h("offWhite"):h("foreground"),h("pink")),_o=g.div.withConfig({displayName:"ChatHistoryItem__IconWrapper"})([`
|
|
764
|
+
display: flex;
|
|
765
|
+
align-items: center;
|
|
766
|
+
justify-content: center;
|
|
767
|
+
flex-shrink: 0;
|
|
768
|
+
color: `,`;
|
|
769
|
+
`],h("gray2")),Io=g.div.withConfig({displayName:"ChatHistoryItem__Content"})([`
|
|
770
|
+
display: flex;
|
|
771
|
+
flex-direction: column;
|
|
772
|
+
flex: 1;
|
|
773
|
+
min-width: 0;
|
|
774
|
+
padding-left: 0.4rem;
|
|
775
|
+
`]),Zo=g.div.attrs({className:"chat-title"}).withConfig({displayName:"ChatHistoryItem__Title"})([`
|
|
776
|
+
padding: 0.2rem 0.4rem;
|
|
777
|
+
border: 1px solid transparent;
|
|
778
|
+
color: `,`;
|
|
779
|
+
white-space: nowrap;
|
|
780
|
+
overflow: hidden;
|
|
781
|
+
text-overflow: ellipsis;
|
|
782
|
+
transform: translateX(-0.4rem);
|
|
783
|
+
`],h("offWhite")),Vo=g.input.withConfig({displayName:"ChatHistoryItem__TitleInput"})([`
|
|
784
|
+
color: `,`;
|
|
785
|
+
background: transparent;
|
|
786
|
+
border: 1px solid `,`;
|
|
787
|
+
border-radius: 6px;
|
|
788
|
+
outline: none;
|
|
789
|
+
padding: 0.2rem 0.4rem;
|
|
790
|
+
font-family: inherit;
|
|
791
|
+
transform: translateX(-0.4rem);
|
|
792
|
+
|
|
793
|
+
&:focus {
|
|
794
|
+
outline: none;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
&::selection {
|
|
798
|
+
background: `,`;
|
|
799
|
+
}
|
|
800
|
+
&::-moz-selection {
|
|
801
|
+
background: `,`;
|
|
802
|
+
}
|
|
803
|
+
&::-webkit-selection {
|
|
804
|
+
background: `,`;
|
|
805
|
+
}
|
|
806
|
+
`],h("foreground"),h("pinkDarker"),h("pinkPrimary"),h("pinkPrimary"),h("pinkPrimary")),No=g.div.withConfig({displayName:"ChatHistoryItem__Subtitle"})([`
|
|
807
|
+
font-size: 1.2rem;
|
|
808
|
+
line-height: 1.5;
|
|
809
|
+
color: `,`;
|
|
810
|
+
white-space: nowrap;
|
|
811
|
+
overflow: hidden;
|
|
812
|
+
text-overflow: ellipsis;
|
|
813
|
+
`],h("gray2")),So=g.div.withConfig({displayName:"ChatHistoryItem__ActionsContainer"})([`
|
|
814
|
+
display: flex;
|
|
815
|
+
align-items: center;
|
|
816
|
+
gap: 0.4rem;
|
|
817
|
+
flex-shrink: 0;
|
|
818
|
+
`]),Ca=g.button.withConfig({displayName:"ChatHistoryItem__ActionButton"})([`
|
|
819
|
+
display: flex;
|
|
820
|
+
align-items: center;
|
|
821
|
+
justify-content: center;
|
|
822
|
+
padding: 0.4rem;
|
|
823
|
+
background: transparent;
|
|
824
|
+
border: none;
|
|
825
|
+
border-radius: 4px;
|
|
826
|
+
cursor: pointer;
|
|
827
|
+
color: `,`;
|
|
828
|
+
opacity: 0;
|
|
829
|
+
|
|
830
|
+
`,`:hover &,
|
|
831
|
+
`,`:focus-within & {
|
|
832
|
+
opacity: 1;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
&:focus-visible {
|
|
836
|
+
opacity: 1;
|
|
837
|
+
outline: 2px solid `,`;
|
|
838
|
+
outline-offset: -2px;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
&:hover {
|
|
842
|
+
background: `,`;
|
|
843
|
+
}
|
|
844
|
+
`],h("foreground"),Yt,Yt,h("pink"),h("backgroundDarker")),Lo=g.span.withConfig({displayName:"ChatHistoryItem__CurrentIndicator"})([`
|
|
845
|
+
font-size: 1.2rem;
|
|
846
|
+
line-height: 1.5rem;
|
|
847
|
+
color: `,`;
|
|
848
|
+
white-space: nowrap;
|
|
849
|
+
`],h("mutedLabel")),Fo=({conversation:e,subtitle:t,isCurrent:a,hasOngoingProcess:i,disabled:l,onSelect:o,onRename:s,onDelete:d})=>{const[u,p]=n.useState(!1),[f,c]=n.useState(e.conversationName),y=n.useRef(null);n.useEffect(()=>{u&&y.current&&(y.current.focus(),y.current.select())},[u]);const b=v=>{v.stopPropagation(),c(e.conversationName),p(!0)},x=v=>{v.stopPropagation(),d(e.id)},w=async()=>{const v=f.trim();v&&v!==e.conversationName&&(ve(je.AI_CHAT_RENAME),await s(e.id,v)),p(!1)},A=async v=>{v.key==="Enter"?await w():v.key==="Escape"&&(c(e.conversationName),p(!1))},j=async()=>{await w()},C=async()=>{!u&&!l&&await o(e.id)},M=async v=>{u||l||v.target===v.currentTarget&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),await o(e.id))};return r.jsxs(Yt,{role:"button",tabIndex:l?-1:0,"aria-disabled":l||void 0,onClick:C,onKeyDown:M,$disabled:l,"data-hook":"chat-history-item",children:[r.jsx(_o,{children:r.jsx(bn,{size:18})}),r.jsxs(Io,{children:[u?r.jsx(Vo,{ref:y,value:f,onChange:v=>c(v.target.value),onKeyDown:A,onBlur:j,onClick:v=>v.stopPropagation(),"data-hook":"chat-history-rename"}):r.jsx(Zo,{"data-hook":"chat-history-title",children:e.conversationName}),t&&r.jsx(No,{children:t})]}),r.jsxs(So,{children:[!u&&r.jsxs(r.Fragment,{children:[r.jsx(Ca,{onClick:b,title:"Edit title","data-hook":"chat-history-edit",children:r.jsx(Hn,{size:18})}),!i&&r.jsx(Ca,{onClick:x,title:"Delete","data-hook":"chat-history-delete",children:r.jsx(En,{size:18})})]}),a&&r.jsx(Lo,{children:"Current"})]})]})},Do=g.div.withConfig({displayName:"DateSeparator__Container"})([`
|
|
850
|
+
display: flex;
|
|
851
|
+
align-items: center;
|
|
852
|
+
gap: 1rem;
|
|
853
|
+
padding: 0.4rem 0;
|
|
854
|
+
width: 100%;
|
|
855
|
+
`]),wa=g.div.withConfig({displayName:"DateSeparator__Line"})([`
|
|
856
|
+
flex: 1;
|
|
857
|
+
height: 1px;
|
|
858
|
+
background: `,`;
|
|
859
|
+
`],h("selection")),qo=g.div.withConfig({displayName:"DateSeparator__LabelContainer"})([`
|
|
860
|
+
display: flex;
|
|
861
|
+
align-items: center;
|
|
862
|
+
gap: 0.8rem;
|
|
863
|
+
color: `,`;
|
|
864
|
+
`],h("gray2")),To=g.span.withConfig({displayName:"DateSeparator__Label"})([`
|
|
865
|
+
font-size: 1.3rem;
|
|
866
|
+
letter-spacing: 0.016rem;
|
|
867
|
+
white-space: nowrap;
|
|
868
|
+
`]),Ro=({label:e})=>r.jsxs(Do,{children:[r.jsx(wa,{}),r.jsxs(qo,{children:[r.jsx(wn,{size:16}),r.jsx(To,{children:e})]}),r.jsx(wa,{})]}),zo=6e4;function ka(e){const t=ir(),a=or(t);return sr(e,new Date().getTime(),{locale:a})+" ago"}function Oo(e){const t=[...e].sort((o,s)=>s.updatedAt-o.updatedAt),a=new Map;for(const o of t){const s=ka(o.updatedAt),d=a.get(s)||[];a.set(s,[...d,o])}const i=[],l=new Set;for(const o of t){const s=ka(o.updatedAt);l.has(s)||(l.add(s),i.push({label:s,conversations:a.get(s)||[]}))}return i}function $o(e){const[t,a]=n.useState(0);return n.useEffect(()=>{const i=setInterval(()=>{a(l=>l+1)},zo);return()=>clearInterval(i)},[]),n.useMemo(()=>Oo(e),[e,t])}function Bo(e,t){if(!t.trim())return e;const a=t.toLowerCase().trim();return e.filter(i=>i.conversationName.toLowerCase().includes(a))}const Aa=g.div.withConfig({displayName:"ChatHistoryView__Container"})([`
|
|
869
|
+
display: flex;
|
|
870
|
+
flex-direction: column;
|
|
871
|
+
height: 100%;
|
|
872
|
+
width: 100%;
|
|
873
|
+
padding: 2rem 1rem 4rem 1rem;
|
|
874
|
+
background: `,`;
|
|
875
|
+
overflow: hidden;
|
|
876
|
+
`],h("chatBackground")),Wo=g.div.withConfig({displayName:"ChatHistoryView__SearchContainer"})([`
|
|
877
|
+
position: relative;
|
|
878
|
+
display: flex;
|
|
879
|
+
align-items: center;
|
|
880
|
+
flex-shrink: 0;
|
|
881
|
+
`]),Po=g.div.withConfig({displayName:"ChatHistoryView__SearchIcon"})([`
|
|
882
|
+
position: absolute;
|
|
883
|
+
left: 1.2rem;
|
|
884
|
+
display: flex;
|
|
885
|
+
align-items: center;
|
|
886
|
+
color: `,`;
|
|
887
|
+
pointer-events: none;
|
|
888
|
+
z-index: 1;
|
|
889
|
+
`],h("gray2")),Qo=g.button.withConfig({displayName:"ChatHistoryView__ClearButton"})([`
|
|
890
|
+
position: absolute;
|
|
891
|
+
right: 0.8rem;
|
|
892
|
+
display: flex;
|
|
893
|
+
align-items: center;
|
|
894
|
+
justify-content: center;
|
|
895
|
+
padding: 0.2rem;
|
|
896
|
+
background: transparent;
|
|
897
|
+
border: none;
|
|
898
|
+
border-radius: 4px;
|
|
899
|
+
cursor: pointer;
|
|
900
|
+
color: `,`;
|
|
901
|
+
|
|
902
|
+
&:hover {
|
|
903
|
+
color: `,`;
|
|
904
|
+
}
|
|
905
|
+
`],h("gray2"),h("foreground")),Ko=g(dr).withConfig({displayName:"ChatHistoryView__SearchInput"})([`
|
|
906
|
+
width: 100%;
|
|
907
|
+
background: transparent;
|
|
908
|
+
color: `,`;
|
|
909
|
+
padding: 0.8rem 3.6rem 0.8rem 3.6rem;
|
|
910
|
+
border: 1px solid `,`4d;
|
|
911
|
+
height: 3rem;
|
|
912
|
+
border-radius: 0.6rem;
|
|
913
|
+
|
|
914
|
+
&:focus {
|
|
915
|
+
background: transparent;
|
|
916
|
+
border-color: `,`;
|
|
917
|
+
}
|
|
918
|
+
`],h("foreground"),h("gray2"),h("pinkDarker")),Uo=g.div.withConfig({displayName:"ChatHistoryView__ListContainer"})([`
|
|
919
|
+
display: flex;
|
|
920
|
+
flex-direction: column;
|
|
921
|
+
gap: 0.6rem;
|
|
922
|
+
padding: 2rem 0.4rem;
|
|
923
|
+
overflow-y: auto;
|
|
924
|
+
flex: 1;
|
|
925
|
+
min-height: 0;
|
|
926
|
+
`]),Ma=g.div.withConfig({displayName:"ChatHistoryView__EmptyState"})([`
|
|
927
|
+
display: flex;
|
|
928
|
+
flex-direction: column;
|
|
929
|
+
align-items: center;
|
|
930
|
+
justify-content: center;
|
|
931
|
+
flex: 1;
|
|
932
|
+
color: `,`;
|
|
933
|
+
font-size: 1.3rem;
|
|
934
|
+
text-align: center;
|
|
935
|
+
padding: 2rem;
|
|
936
|
+
`],h("gray2")),Go=g(Re.Content).withConfig({displayName:"ChatHistoryView__AlertDialogContent"})([`
|
|
937
|
+
background: `,`;
|
|
938
|
+
`],h("chatBackground")),Yo=g.div.withConfig({displayName:"ChatHistoryView__DialogHeader"})([`
|
|
939
|
+
display: flex;
|
|
940
|
+
align-items: center;
|
|
941
|
+
justify-content: space-between;
|
|
942
|
+
padding: 1.5rem 2rem;
|
|
943
|
+
border-bottom: 1px solid `,`;
|
|
944
|
+
`],h("selection")),Xo=g.h3.withConfig({displayName:"ChatHistoryView__DialogTitle"})([`
|
|
945
|
+
margin: 0;
|
|
946
|
+
font-weight: 500;
|
|
947
|
+
color: `,`;
|
|
948
|
+
`],h("foreground")),Jo=g.p.withConfig({displayName:"ChatHistoryView__DialogDescription"})([`
|
|
949
|
+
margin: 2rem;
|
|
950
|
+
font-size: 1.4rem;
|
|
951
|
+
line-height: 1.5;
|
|
952
|
+
`]),e0=g.div.withConfig({displayName:"ChatHistoryView__DialogButtons"})([`
|
|
953
|
+
display: flex;
|
|
954
|
+
justify-content: flex-end;
|
|
955
|
+
gap: 1rem;
|
|
956
|
+
padding: 0 2rem 0 2rem;
|
|
957
|
+
`]),t0=g(he).attrs({skin:"secondary"}).withConfig({displayName:"ChatHistoryView__CancelButton"})([""]),n0=g(he).withConfig({displayName:"ChatHistoryView__DeleteButton"})([`
|
|
958
|
+
background: `,`;
|
|
959
|
+
border-color: `,`;
|
|
960
|
+
|
|
961
|
+
&:hover:not(:disabled) {
|
|
962
|
+
background: `,`;
|
|
963
|
+
filter: brightness(1.1);
|
|
964
|
+
}
|
|
965
|
+
`],h("red"),h("red"),h("red")),a0=({currentConversationId:e})=>{const[t,a]=n.useState(""),[i,l]=n.useState(!1),[o,s]=n.useState(null),d=n.useRef(null),{conversationMetas:u,chatWindowState:p,openChatWindow:f,updateConversationName:c,deleteConversation:y}=pt(),{status:b}=Fe(),{buffers:x}=It(),w=Ee(Me.query.getTables),A=n.useMemo(()=>Array.from(u.values()),[u]),j=n.useMemo(()=>Bo(A,t),[A,t]),C=$o(j),M=(S,m)=>{if(S){if(m==="buffer"){const N=x.find(H=>H.id===S);if(N)return N.label}else if(m==="table"){const N=w.find(H=>H.id===S);if(N)return N.table_name}}},v=async S=>{await f(S)},E=async(S,m)=>{await c(S,m)},z=S=>{s(S),l(!0)},Z=async()=>{o&&await y(o),l(!1),s(null)},T=()=>{l(!1),s(null)};return n.useEffect(()=>{d.current&&d.current.scrollIntoView({block:"center"})},[]),A.length===0?r.jsx(Aa,{children:r.jsx(Ma,{"data-hook":"chat-history-empty",children:"No conversations yet"})}):r.jsxs(Aa,{children:[r.jsxs(Wo,{children:[r.jsx(Po,{children:r.jsx(jn,{size:18})}),r.jsx(Ko,{type:"text",placeholder:"Search chats",value:t,onChange:S=>a(S.target.value),"data-hook":"chat-history-search"}),t&&r.jsx(Qo,{onClick:()=>a(""),title:"Clear search","data-hook":"chat-history-search-clear",children:r.jsx(mn,{size:16})})]}),r.jsxs(Uo,{"data-hook":"chat-history-list",children:[C.map((S,m)=>r.jsxs(yt.Fragment,{children:[m>0&&r.jsx(Ro,{label:S.label}),S.conversations.map(N=>{const H=N.id===e;return r.jsx("div",{ref:H?d:void 0,children:r.jsx(Fo,{conversation:N,subtitle:N.bufferId??N.tableId?M(N.bufferId??N.tableId,N.bufferId?"buffer":"table"):void 0,isCurrent:H,hasOngoingProcess:N.id===p.activeConversationId&&pe(b),disabled:pe(b)&&N.id!==p.activeConversationId,onSelect:v,onRename:E,onDelete:z})},N.id)})]},S.label)),j.length===0&&t&&r.jsx(Ma,{children:"No chats match your search"})]}),r.jsx(Re.Root,{open:i,onOpenChange:l,children:r.jsxs(Re.Portal,{children:[r.jsx(lr,{children:r.jsx(cr,{primitive:Re.Overlay})}),r.jsxs(Go,{maxwidth:"40rem",children:[r.jsx(Yo,{children:r.jsx(Xo,{children:"Delete conversation"})}),r.jsx(Jo,{children:"Are you sure you want to delete this conversation? This action cannot be undone."}),r.jsxs(e0,{children:[r.jsx(Re.Cancel,{asChild:!0,children:r.jsx(t0,{onClick:T,children:"Cancel"})}),r.jsx(Re.Action,{asChild:!0,children:r.jsx(n0,{onClick:Z,children:"Delete"})})]})]})]})})]})};async function r0(e){var p,f;const{normalizedSQL:t,queryKey:a,namespaceKey:i,quest:l,dispatch:o,executionRefs:s,releaseExecution:d}=e,{promise:u}=l.queryRaw(t,{limit:"0,1000",explain:!0,cancellable:!0});try{const c=await u;if(s.current[i]||(s.current[i]={}),s.current[i][a]={success:!0,queryText:t,startOffset:-1,endOffset:-1},o(Ge.setResult(c)),c.type===Ye.DDL||c.type===Ye.DML){o(Ge.addNotification({query:a,content:r.jsx(Xe,{query:t})},i)),Je.publish(et.MSG_QUERY_SCHEMA);return}if(c.type===Ye.NOTICE){o(Ge.addNotification({query:a,content:r.jsxs(le,{color:"foreground",ellipsis:!0,title:t,children:[c.notice,t!==""?`: ${t}`:""]}),type:Te.NOTICE,sideContent:r.jsx(Xe,{query:t})},i)),Je.publish(et.MSG_QUERY_SCHEMA);return}c.type===Ye.DQL&&(o(Ge.addNotification({query:a,jitCompiled:((p=c.explain)==null?void 0:p.jitCompiled)??!1,content:r.jsx(ur,{...c.timings,rowCount:c.count}),sideContent:r.jsx(Xe,{query:t})},i)),Je.publish(et.MSG_QUERY_DATASET,c))}catch(c){const y=c;s.current[i]||(s.current[i]={}),s.current[i][a]={success:!1,queryText:t,startOffset:-1,endOffset:-1},o(Ge.addNotification({query:a,content:r.jsx(le,{color:"red",children:y.error||y.message||"Query execution failed"}),type:Te.ERROR,sideContent:r.jsx(Xe,{query:t})},i))}finally{(f=e.onSettled)==null||f.call(e),d(a)}}const i0=g(he).withConfig({displayName:"AIChatWindow__CancelButton"})([`
|
|
966
|
+
padding: 1.2rem 0.6rem;
|
|
967
|
+
`]),s0=g.div.withConfig({displayName:"AIChatWindow__HeaderLeft"})([`
|
|
968
|
+
display: flex;
|
|
969
|
+
align-items: center;
|
|
970
|
+
gap: 1rem;
|
|
971
|
+
flex: 1;
|
|
972
|
+
min-width: 0;
|
|
973
|
+
overflow: hidden;
|
|
974
|
+
`]),o0=g.span.withConfig({displayName:"AIChatWindow__HeaderTitle"})([`
|
|
975
|
+
white-space: nowrap;
|
|
976
|
+
overflow: hidden;
|
|
977
|
+
text-overflow: ellipsis;
|
|
978
|
+
font-size: 1.6rem;
|
|
979
|
+
`]),Xt=g(he).attrs(({$active:e})=>({skin:"transparent",$active:e})).withConfig({displayName:"AIChatWindow__HeaderButton"})([`
|
|
980
|
+
color: `,`;
|
|
981
|
+
padding: 0.6rem;
|
|
982
|
+
|
|
983
|
+
`,`
|
|
984
|
+
`],h("foreground"),({$active:e})=>e&&re([`
|
|
985
|
+
background: `,`;
|
|
986
|
+
`],h("selection"))),l0=g.div.withConfig({displayName:"AIChatWindow__HeaderRight"})([`
|
|
987
|
+
display: flex;
|
|
988
|
+
align-items: center;
|
|
989
|
+
gap: 0.5rem;
|
|
990
|
+
flex-shrink: 0;
|
|
991
|
+
`]),c0=g.div.withConfig({displayName:"AIChatWindow__ChatWindowContent"})([`
|
|
992
|
+
display: flex;
|
|
993
|
+
height: 100%;
|
|
994
|
+
width: 100%;
|
|
995
|
+
overflow: hidden;
|
|
996
|
+
`]),d0=g.div.withConfig({displayName:"AIChatWindow__InitialQueryContainer"})([`
|
|
997
|
+
display: flex;
|
|
998
|
+
flex-direction: column;
|
|
999
|
+
gap: 1rem;
|
|
1000
|
+
padding: 1.5rem;
|
|
1001
|
+
overflow-y: auto;
|
|
1002
|
+
flex: 1 1 auto;
|
|
1003
|
+
min-height: 0;
|
|
1004
|
+
width: 100%;
|
|
1005
|
+
`]),u0=g.div.withConfig({displayName:"AIChatWindow__InitialQueryBox"})([`
|
|
1006
|
+
display: flex;
|
|
1007
|
+
flex-direction: column;
|
|
1008
|
+
align-self: flex-end;
|
|
1009
|
+
flex-shrink: 0;
|
|
1010
|
+
overflow: hidden;
|
|
1011
|
+
width: 100%;
|
|
1012
|
+
`]),h0=g.div.withConfig({displayName:"AIChatWindow__InitialQueryEditor"})([`
|
|
1013
|
+
width: 100%;
|
|
1014
|
+
overflow: hidden;
|
|
1015
|
+
`]),m0=g.div.withConfig({displayName:"AIChatWindow__ButtonContainer"})([`
|
|
1016
|
+
display: flex;
|
|
1017
|
+
justify-content: flex-start;
|
|
1018
|
+
align-items: center;
|
|
1019
|
+
gap: 1rem;
|
|
1020
|
+
width: 100%;
|
|
1021
|
+
margin-top: 0.5rem;
|
|
1022
|
+
`]),p0=g.div.withConfig({displayName:"AIChatWindow__BlankChatContainer"})([`
|
|
1023
|
+
display: flex;
|
|
1024
|
+
flex-direction: column;
|
|
1025
|
+
align-items: flex-start;
|
|
1026
|
+
justify-content: center;
|
|
1027
|
+
gap: 1.2rem;
|
|
1028
|
+
padding: 1.8rem;
|
|
1029
|
+
flex: 1 1 auto;
|
|
1030
|
+
min-height: 0;
|
|
1031
|
+
max-width: 40rem;
|
|
1032
|
+
text-align: center;
|
|
1033
|
+
margin: 0 auto;
|
|
1034
|
+
`]),g0=g.h2.withConfig({displayName:"AIChatWindow__BlankChatHeading"})([`
|
|
1035
|
+
font-size: 2rem;
|
|
1036
|
+
font-weight: 600;
|
|
1037
|
+
text-align: left;
|
|
1038
|
+
color: `,`;
|
|
1039
|
+
margin: 0;
|
|
1040
|
+
`],h("foreground")),f0=g.p.withConfig({displayName:"AIChatWindow__BlankChatSubheading"})([`
|
|
1041
|
+
font-size: 1.4rem;
|
|
1042
|
+
font-weight: 400;
|
|
1043
|
+
color: `,`;
|
|
1044
|
+
text-align: left;
|
|
1045
|
+
margin: 0;
|
|
1046
|
+
line-height: 1.5;
|
|
1047
|
+
`],h("gray2")),va=g(D).withConfig({displayName:"AIChatWindow__ChatPanel"})([`
|
|
1048
|
+
display: flex;
|
|
1049
|
+
flex-direction: column;
|
|
1050
|
+
align-items: stretch;
|
|
1051
|
+
height: 100%;
|
|
1052
|
+
width: 100%;
|
|
1053
|
+
gap: 0;
|
|
1054
|
+
`]),x0=()=>{const e=gn(),t=Ee(Me.console.getActiveSidebar),{quest:a,questExecution:i}=n.useContext(_t),{editorRef:l,showPreviewBuffer:o,closePreviewBuffer:s,addBuffer:d,executionRefs:u,highlightQuery:p}=It(),{conversationMetas:f,activeConversationMessages:c,chatWindowState:y,isLoadingMessages:b,isStreaming:x,setIsStreaming:w,scrollToMessageId:A,setScrollToMessageId:j,closeChatWindow:C,openBlankChatWindow:M,openHistoryView:v,closeHistoryView:E,getConversationMeta:z,addMessage:Z,removeMessages:T,updateMessage:S,updateMessagesWithCompaction:m,updateConversationName:N,acceptSuggestion:H,rejectSuggestion:ce,persistMessages:Q}=pt(),{status:R,setStatus:U,abortController:ae,canUse:X,hasSchemaAccess:_e,currentModel:fe,apiKey:Oe,aiAssistantSettings:$e}=Fe(),L=Ee(Me.query.getTables),{active:_}=hr(),J=(_==null?void 0:_.queryKey)??null,Be=y.activeConversationId?z(y.activeConversationId):null,k=n.useMemo(()=>Be?{...Be,messages:c}:null,[Be,c]),Ie=n.useMemo(()=>k?k.bufferId!==void 0?k.bufferId:k.id:-1,[k==null?void 0:k.bufferId,k==null?void 0:k.id]),Le=Ee(Me.query.getQueryNotificationsForBuffer(Ie)),xe=n.useRef(null),ke=n.useRef(!1),B=n.useRef(null),q=n.useMemo(()=>Tt(k==null?void 0:k.currentSQL),[k==null?void 0:k.currentSQL]),de=n.useMemo(()=>mr(k==null?void 0:k.queryKey),[k==null?void 0:k.queryKey]),W=c,nt=n.useMemo(()=>pr(W)!==null,[W]),at=n.useMemo(()=>W.length>0&&!b,[W,b]),P=n.useMemo(()=>W.length===0&&q&&q.trim()!==`
|
|
1055
|
+
`&&X&&!pe(R),[W.length,q,X,R]),rt=n.useMemo(()=>!P||!k||!k.queryKey||!k.bufferId||!l.current?!1:_n(k.queryKey,k.bufferId,u,l)!==null,[P,k,l,u]),We=P&&rt&&X&&!pe(R),G=y.isHistoryOpen??!1,Mt=f.size>0,vt=n.useMemo(()=>pe(R)?!0:k?k.messages.length===0&&!k.queryKey&&!k.tableId:!1,[k,R]),jt=n.useMemo(()=>{if(G)return"Chat history";if(!k)return"";if(k.conversationName)return k.conversationName;const I=k.messages[0];if(I!=null&&I.displayType)switch(I.displayType){case"fix_request":return"Fix query";case"explain_request":return"Explain query";case"ask_request":return"Ask AI";case"health_issue_request":return"Health issue analysis";default:return"AI Assistant"}return"AI Assistant"},[k,G]),it=n.useCallback(()=>{G?E():v()},[G,E,v]),st=()=>W.length>0?"Ask a follow up question or request refinement...":(k==null?void 0:k.tableId)!=null||q!=null&&q.trim()?"Ask a question or request an edit...":"Ask AI about your tables, or generate a query...",ot=(I,F=!1)=>{if(!X||!y.activeConversationId||!k)return;ve(je.AI_CHAT_SEND);const O=y.activeConversationId;F&&s();const ue=k.messages.some(dt=>dt.role==="assistant");Ze(pn({conversationId:O,userMessage:I,currentSQL:q,conversationHistory:k.messages,isFirstMessage:!ue,settings:{model:fe,apiKey:Oe},aiAssistantSettings:$e,questClient:a,tables:L,hasSchemaAccess:_e,abortSignal:ae==null?void 0:ae.signal}),{addMessage:Z,removeMessages:T,updateMessage:S,setStatus:U,setIsStreaming:w,persistMessages:Q,updateConversationName:N,updateMessagesWithCompaction:m})},V=n.useCallback(async I=>{y.activeConversationId&&(ve(je.AI_CHAT_ACCEPT),await H({conversationId:y.activeConversationId,messageId:I}))},[y.activeConversationId,H]),Y=n.useCallback(async I=>{y.activeConversationId&&(ve(je.AI_CHAT_REJECT),await ce(y.activeConversationId,I),setTimeout(()=>{var F;(F=xe.current)==null||F.focus()},100))},[y.activeConversationId,ce]),ye=n.useCallback(I=>{if(!k)return;const F=Ce(I),O=Dt(F);i.requestExecution(Ie,O,()=>{const ue=window.setTimeout(()=>{e(Lt.query.addNotification({query:O,type:Te.LOADING,content:r.jsxs(D,{gap:"1rem",align:"center",children:[r.jsx(le,{color:"foreground",children:"Running..."}),r.jsx(i0,{skin:"error",onClick:()=>{i.cancelActive()},children:r.jsx(hn,{size:"18px"})})]}),sideContent:r.jsx(Xe,{query:F})},Ie)),B.current=null},1e3);B.current=ue,r0({normalizedSQL:F,queryKey:O,namespaceKey:Ie,quest:a,dispatch:e,executionRefs:u,releaseExecution:i.releaseExecution,onSettled:()=>{B.current===ue&&(window.clearTimeout(ue),B.current=null)}})})},[k,u,Ie,a,i]),lt=n.useCallback(I=>{var F;((F=i.getActive())==null?void 0:F.queryKey)===I&&(B.current!==null&&(window.clearTimeout(B.current),B.current=null),i.cancelActive())},[i]),se=n.useCallback(async()=>{if(ve(je.AI_CONTEXT_BADGE_CLICK,{type:k!=null&&k.tableId?"table":"query"}),(k==null?void 0:k.queryKey)&&(k==null?void 0:k.bufferId))return await p(k.queryKey,k.bufferId);if(k!=null&&k.tableId){const I=L.find(F=>F.id===k.tableId);if(I)return e(Lt.console.pushSidebarHistory({type:"tableDetails",payload:{tableName:I.table_name,isMatView:I.table_type==="M",isView:I.table_type==="V"}})),!0}return!1},[k==null?void 0:k.queryKey,k==null?void 0:k.bufferId,k==null?void 0:k.tableId,p,L]),Ae=n.useCallback(()=>{j(null)},[j]),$=n.useCallback(async(I,F=!1)=>{if(!(F&&await se()))if(I.type==="diff"){if(!y.activeConversationId)return;o({type:"diff",original:I.original,modified:I.modified,conversationId:y.activeConversationId})}else d({value:I.value})},[o,d,y.activeConversationId,se]),be=n.useCallback(async(I,F)=>{if(!y.activeConversationId)return;const O=gr(F,!1);try{await H({conversationId:y.activeConversationId,messageId:I,skipDefaultMessage:!0}),Z({role:"user",content:`User replaced query with one of your previous suggestions. Now the query is:
|
|
1056
|
+
|
|
1057
|
+
\`\`\`sql
|
|
1058
|
+
${O.replaceAll(/\s+/g," ").trim()}
|
|
1059
|
+
\`\`\``,timestamp:Date.now(),hideFromUI:!0}),await Q(y.activeConversationId)}catch(ue){console.error("Error applying SQL to editor:",ue),xt.error("Failed to apply changes to editor")}},[y.activeConversationId,H,Z,Q]),ee=n.useCallback(async I=>{if(!y.activeConversationId||!X||pe(R))return;const F=y.activeConversationId,O=W.find(K=>K.id===I);if(!O)return;const ue=W.findIndex(K=>K.id===I);if(ue<0)return;const dt=W.slice(ue).map(K=>K.id),Ha=new Set(dt);T(dt);const ut={settings:{model:fe,apiKey:Oe},aiAssistantSettings:$e,questClient:a,tables:L,hasSchemaAccess:_e,abortSignal:ae==null?void 0:ae.signal},ht={addMessage:Z,updateMessage:S,removeMessages:T,setStatus:U,setIsStreaming:w,persistMessages:Q,updateConversationName:N,updateMessagesWithCompaction:m};switch(O.displayType){case"explain_request":{if(!O.sql)return;Ze(tn({conversationId:F,queryText:O.sql,...ut}),ht);break}case"fix_request":{if(!O.sql)return;Ze(nn({conversationId:F,queryText:O.sql,...ut}),ht);break}case"schema_explain_request":{if(!O.displaySchemaData)return;const K=O.displaySchemaData;try{const oe=K.kind==="matview"?await a.showMatViewDDL(K.tableName):K.kind==="view"?await a.showViewDDL(K.tableName):await a.showTableDDL(K.tableName);if((oe==null?void 0:oe.type)!==Ye.DQL||!oe.data||oe.data.length===0){xt.error("Failed to fetch table schema for retry");return}const mt=oe.data[0];if(!mt.ddl){xt.error("Failed to fetch table schema for retry");return}Ze(fr({conversationId:F,tableName:K.tableName,schema:mt.ddl,kindLabel:xr(K.kind),schemaDisplayData:K,...ut}),ht)}catch(oe){console.error("Error fetching DDL for retry:",oe),xt.error("Failed to fetch table schema for retry")}break}case"ask_request":default:{const K=O.displayUserMessage||O.content||"",oe=W.filter(Et=>!Ha.has(Et.id)),mt=oe.some(Et=>Et.role==="assistant");Ze(pn({conversationId:F,userMessage:K,currentSQL:O.sql||q,conversationHistory:oe,isFirstMessage:!mt,...ut}),ht);break}}},[y.activeConversationId,X,R,W,T,fe,Oe,$e,a,L,_e,ae,Z,S,U,w,Q,N,m,q]),Jt=n.useRef(null),ct=n.useCallback(()=>{var I,F;(F=(I=Jt.current)==null?void 0:I.querySelector('button[data-hook="button-explain-query"]'))==null||F.click()},[]),Ht=n.useCallback(I=>{P&&(I.metaKey||I.ctrlKey)&&(I.key==="e"||I.key==="E")&&(I.preventDefault(),ct())},[P]);n.useEffect(()=>{if(P)return Je.subscribe(et.EXPLAIN_QUERY_EXEC,ct),document.addEventListener("keydown",Ht),()=>{document.removeEventListener("keydown",Ht),Je.unsubscribe(et.EXPLAIN_QUERY_EXEC,ct)}},[P,Ht,ct]),n.useEffect(()=>()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),n.useEffect(()=>{ke.current||G||b||xe.current&&(xe.current.focus(),ke.current=!0)},[G,b]);const ja=n.useCallback(async()=>{var I;ke.current=!1,await M(),(I=xe.current)==null||I.focus()},[M]);return(t==null?void 0:t.type)!=="aiChat"||!k&&!G?null:r.jsx(r.Fragment,{children:r.jsx(yr,{mode:"side","data-hook":"ai-chat-window",open:(t==null?void 0:t.type)==="aiChat",onOpenChange:I=>{I||C()},onDismiss:C,trigger:r.jsx("span",{}),title:r.jsxs(s0,{children:[r.jsx(gt,{size:20,variant:"filled"}),r.jsx(o0,{"data-hook":"chat-window-title",children:jt})]}),afterTitle:r.jsxs(l0,{children:[r.jsx(Xt,{onClick:ja,title:"New chat","aria-label":"New chat",disabled:vt,"data-hook":"chat-window-new",children:r.jsx(br,{size:16,weight:"bold"})}),r.jsx(Xt,{$active:G,onClick:it,title:G?"Back to chat":"Chat history","aria-label":G?"Back to chat":"Chat history","aria-pressed":G,disabled:!Mt||pe(R),"data-hook":"chat-window-history",children:r.jsx(kn,{size:16,weight:"bold"})}),r.jsx(Xt,{onClick:C,title:"Close","aria-label":"Close AI chat","data-hook":"chat-window-close",children:r.jsx(mn,{size:16,weight:"bold"})})]}),children:r.jsx(c0,{children:b?r.jsx(va,{children:r.jsx(Zt,{size:20,style:{margin:"auto"}})}):G?r.jsx(a0,{currentConversationId:y.previousConversationId??null}):r.jsxs(va,{children:[at?r.jsx(go,{messages:W,onAcceptChange:V,onRejectChange:Y,onRunQuery:ye,onOpenInEditor:$,onApplyToEditor:be,onRetry:ee,onCancelQuery:lt,runningQueryKey:J,queryNotifications:Le,isOperationInProgress:pe(R),editorSQL:de.queryText,isStreaming:x,isLoadingMessages:b,scrollToMessageId:A,onScrollToMessageComplete:Ae}):q&&q.trim()?r.jsxs(d0,{children:[r.jsx(u0,{"data-hook":"chat-initial-query-box",children:r.jsx(h0,{"data-hook":"chat-lite-editor",children:r.jsx(Ue,{value:q.trim(),maxHeight:216,onOpenInEditor:()=>$({type:"code",value:q.trim()},!0)})})}),(P||We)&&r.jsxs(m0,{ref:Jt,children:[P&&r.jsx(qr,{conversationId:k.id,queryText:q.trim()}),We&&r.jsx(Rr,{})]})]}):r.jsxs(p0,{"data-hook":"chat-blank-state",children:[r.jsx(g0,{children:"Leverage AI directly in your database"}),r.jsx(f0,{children:"Our AI Assistant is a specialized programming and support agent that makes you more effective and helps you solve problems as you interface with your QuestDB database. Start a conversation."})]}),r.jsx(Eo,{ref:xe,onSend:I=>ot(I,nt),disabled:!X||pe(R),placeholder:st(),contextSQL:de.queryText,contextTableId:k==null?void 0:k.tableId,onContextClick:se})]})})})})};export{x0 as default};
|