@questdb/web-console 1.1.11 → 1.1.12

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.
@@ -0,0 +1,1011 @@
1
+ import{p as $,Q as Ge,s as re,u as fe,a as De,j as s,A as Se,K as Et,c as f,B as ie,b as qe,e as Ae,E as ve,d as Xe,M as Ye,g as Je,f as et,i as tt,h as S,k as nt,l as $n,m as at,F as rt,w as Wn,n as Un,o as Qn,q as Pn,C as Kn,r as it,t as He,v as U,x as xe,y as ot,z as Gn,D as Me,G as Xn,H as ce,I as lt,J as Yn,L as jt,N as Ee,O as ye,P as Jn,R as ea,S as ta,T as na,U as aa,V as ze,W as _t,X as Vt,Y as ra,Z as st,_ as ct,$ as ia,a0 as Zt,a1 as de,a2 as oa,a3 as la,a4 as sa,a5 as ca,a6 as da,a7 as ua,a8 as ha,a9 as ma,aa as It,ab as pa,ac as ga,ad as fa,ae as oe,af as xa,ag as ya,ah as ba,ai as Lt,aj as be,ak as ka,al as Ca,am as wa,an as Aa,ao as va,ap as dt,aq as Ha,ar as Ma}from"./index-BD25QvPt.js";import{b as t,E as le,H as x,R as Nt,Z as Ft,C as ue,U as Ea,D as ja}from"./vendor-DsPrTxrp.js";const _a=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Va=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Za=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Ia=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),La=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Na=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Fa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M71.68,97.22,34.74,128l36.94,30.78a12,12,0,1,1-15.36,18.44l-48-40a12,12,0,0,1,0-18.44l48-40A12,12,0,0,1,71.68,97.22Zm176,21.56-48-40a12,12,0,1,0-15.36,18.44L221.26,128l-36.94,30.78a12,12,0,1,0,15.36,18.44l48-40a12,12,0,0,0,0-18.44ZM164.1,28.72a12,12,0,0,0-15.38,7.18l-64,176a12,12,0,0,0,7.18,15.37A11.79,11.79,0,0,0,96,228a12,12,0,0,0,11.28-7.9l64-176A12,12,0,0,0,164.1,28.72Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M240,128l-48,40H64L16,128,64,88H192Z",opacity:"0.2"}),t.createElement("path",{d:"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"}))],["fill",t.createElement(t.Fragment,null,t.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,40ZM92.8,145.6a8,8,0,1,1-9.6,12.8l-32-24a8,8,0,0,1,0-12.8l32-24a8,8,0,0,1,9.6,12.8L69.33,128Zm58.89-71.4-32,112a8,8,0,1,1-15.38-4.4l32-112a8,8,0,0,1,15.38,4.4Zm53.11,60.2-32,24a8,8,0,0,1-9.6-12.8L186.67,128,163.2,110.4a8,8,0,1,1,9.6-12.8l32,24a8,8,0,0,1,0,12.8Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M67.84,92.61,25.37,128l42.47,35.39a6,6,0,1,1-7.68,9.22l-48-40a6,6,0,0,1,0-9.22l48-40a6,6,0,0,1,7.68,9.22Zm176,30.78-48-40a6,6,0,1,0-7.68,9.22L230.63,128l-42.47,35.39a6,6,0,1,0,7.68,9.22l48-40a6,6,0,0,0,0-9.22Zm-81.79-89A6,6,0,0,0,154.36,38l-64,176A6,6,0,0,0,94,221.64a6.15,6.15,0,0,0,2,.36,6,6,0,0,0,5.64-3.95l64-176A6,6,0,0,0,162.05,34.36Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M66.56,91.07,22.25,128l44.31,36.93A4,4,0,0,1,64,172a3.94,3.94,0,0,1-2.56-.93l-48-40a4,4,0,0,1,0-6.14l48-40a4,4,0,0,1,5.12,6.14Zm176,33.86-48-40a4,4,0,1,0-5.12,6.14L233.75,128l-44.31,36.93a4,4,0,1,0,5.12,6.14l48-40a4,4,0,0,0,0-6.14ZM161.37,36.24a4,4,0,0,0-5.13,2.39l-64,176a4,4,0,0,0,2.39,5.13A4.12,4.12,0,0,0,96,220a4,4,0,0,0,3.76-2.63l64-176A4,4,0,0,0,161.37,36.24Z"}))]]),Da=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Sa=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),qa=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),za=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Ra=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),Ta=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36ZM60,60h56V196H60ZM196,196H140V60h56Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),t.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M120,44V212a4,4,0,0,1-4,4H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h60A4,4,0,0,1,120,44Zm80-4H140a4,4,0,0,0-4,4V212a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42ZM54,200V56a2,2,0,0,1,2-2h66V202H56A2,2,0,0,1,54,200Zm148,0a2,2,0,0,1-2,2H134V54h66a2,2,0,0,1,2,2Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44ZM52,200V56a4,4,0,0,1,4-4h68V204H56A4,4,0,0,1,52,200Zm152,0a4,4,0,0,1-4,4H132V52h68a4,4,0,0,1,4,4Z"}))]]),Oa=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Dt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:_a}));Dt.displayName="ArrowUpIcon";const St=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Va}));St.displayName="ChatDotsIcon";const qt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Za}));qt.displayName="ChatTextIcon";const zt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Ia}));zt.displayName="ClockCountdownIcon";const Rt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:La}));Rt.displayName="ClockCounterClockwiseIcon";const Tt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Na}));Tt.displayName="CodeBlockIcon";const Ot=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Fa}));Ot.displayName="CodeIcon";const Bt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Da}));Bt.displayName="GaugeIcon";const $t=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Sa}));$t.displayName="KeyReturnIcon";const Wt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:qa}));Wt.displayName="MagnifyingGlassIcon";const Ut=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:za}));Ut.displayName="PencilSimpleLineIcon";const Qt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Ra}));Qt.displayName="PlusIcon";const ut=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Ta}));ut.displayName="SquareSplitHorizontalIcon";const Pt=t.forwardRef((e,n)=>t.createElement($,{ref:n,...e,weights:Oa}));Pt.displayName="TrashSimpleIcon";const Ba=x(S).attrs({alignItems:"center",gap:"0"}).withConfig({displayName:"ExplainQueryButton__KeyBinding"})([`
2
+ color: `,`;
3
+ `],({theme:e})=>e.color.pinkPrimary),$a=qe.isMacintosh||qe.isIOS?"\u2318":"Ctrl",Wa=qe.isMacintosh||qe.isIOS?"Cmd+E":"Ctrl+E",Ua=x(ie).withConfig({displayName:"ExplainQueryButton__ExplainButton"})([`
4
+ gap: 1rem;
5
+ `]),Qa=({conversationId:e,queryText:n})=>{const{quest:a}=t.useContext(Ge),o=le(re.query.getTables),{setStatus:l,abortController:i,hasSchemaAccess:r,currentModel:d,apiKey:u}=fe(),{addMessage:p,updateMessage:h,updateConversationName:c,persistMessages:b}=De(),k=()=>{const g=d,A=u;(async()=>{const w=`Using your tools when necessary, explain this SQL query in detail.:
6
+
7
+ \`\`\`sql
8
+ ${n}
9
+ \`\`\``;p({role:"user",content:w,timestamp:Date.now(),displayType:"explain_request",sql:n});const y=crypto.randomUUID();p({id:y,role:"assistant",content:"",timestamp:Date.now(),operationHistory:[]}),Ae.publish(ve.AI_QUERY_HIGHLIGHT,e);const M=Xe(g),H={model:g,provider:M,apiKey:A},_=Ye.find(Z=>Z.isTestModel&&Z.provider===M);_&&Je({firstUserMessage:w,settings:{model:_.value,provider:M,apiKey:A}}).then(Z=>{Z&&c(e,Z)});const I=Z=>{h(e,y,{operationHistory:[...Z]})},D=await et({userMessage:w,conversationHistory:[],currentSQL:n,settings:H,modelToolsClient:nt(a,r?o:void 0),setStatus:(Z,N)=>l(Z,{...N??{},conversationId:e},I),abortSignal:i==null?void 0:i.signal,operation:"explain"});if(tt(D)){const Z=D;h(e,y,{error:Z.type!=="aborted"?Z.message:"Operation has been cancelled"}),await b(e);return}const E=D;if(!E.explanation){h(e,y,{error:"No explanation received from AI Assistant"}),await b(e);return}h(e,y,{content:E.explanation,explanation:E.explanation,tokenUsage:E.tokenUsage}),await b(e)})()};return s.jsxs(Ua,{skin:"gradient",gradientWeight:"thin",onClick:k,title:`Explain query with AI Assistant (${Wa})`,"data-hook":"button-explain-query",children:[s.jsx(Se,{size:12,variant:"hollow"}),"Explain query",s.jsxs(Ba,{children:[s.jsx(Et,{keyString:$a,color:f("pinkPrimary"),hoverColor:f("pinkPrimary")}),s.jsx(Et,{keyString:"E",color:f("pinkPrimary"),hoverColor:f("pinkPrimary")})]})]})},Kt=(e,n,a,o)=>{if(!(a!=null&&a.current)||!o.current)return null;const l=o.current.getModel();if(!l)return null;const i=a.current[n.toString()];if(!i)return null;const r=i[e];if(!r||!r.error)return null;const d=r.selection?r.selection.startOffset:r.startOffset,u=r.selection?r.selection.endOffset:r.endOffset,p=l.getPositionAt(d),h=l.getPositionAt(d+r.error.position),c=l.getWordAtPosition(h),b=l.getPositionAt(u),k=r.selection?l.getValueInRange({startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:b.lineNumber,endColumn:b.column}):$n(e).queryText;return{errorMessage:r.error.error||"Query execution failed",word:c?c.word:null,fixStart:d,fixEnd:u,queryText:k}},Pa=x(ie).withConfig({displayName:"FixQueryButton__FixButton"})([`
10
+ gap: 1rem;
11
+ `]),Ka=()=>{const{quest:e}=t.useContext(Ge),{editorRef:n,executionRefs:a}=at(),o=le(re.query.getTables),{setStatus:l,abortController:i,hasSchemaAccess:r,currentModel:d,apiKey:u}=fe(),{chatWindowState:p,getConversationMeta:h,addMessage:c,updateMessage:b,updateConversationName:k,persistMessages:g}=De(),A=async()=>{const w=p.activeConversationId,y=h(w),M=Kt(y.queryKey,y.bufferId,a,n),{errorMessage:H,queryText:_,word:I}=M,D=`Fix this SQL query that has an error:
12
+
13
+ \`\`\`sql
14
+ ${_}
15
+ \`\`\`
16
+
17
+ Error: ${H}${I?`
18
+
19
+ Error near: "${I}"`:""}`;c({role:"user",content:D,timestamp:Date.now(),displayType:"fix_request",sql:_});const E=crypto.randomUUID();c({id:E,role:"assistant",content:"",timestamp:Date.now(),operationHistory:[]}),Ae.publish(ve.AI_QUERY_HIGHLIGHT,y.id);const Z=Xe(d),N={model:d,provider:Z,apiKey:u},m=Ye.find(j=>j.isTestModel&&j.provider===Z);m&&Je({firstUserMessage:D,settings:{model:m.value,provider:Z,apiKey:u}}).then(j=>{j&&k(y.id,j)});const L=j=>{b(y.id,E,{operationHistory:[...j]})},R=await et({userMessage:D,conversationHistory:[],currentSQL:_,settings:N,modelToolsClient:nt(e,r?o:void 0),setStatus:(j,Y)=>l(j,{...Y??{},conversationId:y.id},L),abortSignal:i==null?void 0:i.signal,operation:"fix"});if(tt(R)){const j=R;b(y.id,E,{error:j.type!=="aborted"?j.message:"Operation has been cancelled"}),await g(y.id);return}const q=R;if(!q.sql&&q.explanation){b(y.id,E,{content:q.explanation,explanation:q.explanation,tokenUsage:q.tokenUsage}),await g(y.id);return}if(!q.sql){b(y.id,E,{error:"No fixed query or explanation received from AI Assistant"}),await g(y.id);return}const C=q.explanation?`SQL Query:
20
+ \`\`\`sql
21
+ ${q.sql}
22
+ \`\`\`
23
+
24
+ Explanation:
25
+ ${q.explanation}`:`SQL Query:
26
+ \`\`\`sql
27
+ ${q.sql}
28
+ \`\`\``;b(y.id,E,{content:C,sql:q.sql,explanation:q.explanation,tokenUsage:q.tokenUsage}),await g(y.id)};return s.jsxs(Pa,{skin:"gradient",gradientWeight:"thin",onClick:A,title:"Fix query with AI Assistant","data-hook":"button-fix-query",children:[s.jsx(Se,{size:12,variant:"hollow"}),"Fix query"]})},Gt=x.div.withConfig({displayName:"LiteEditor__EditorWrapper"})([`
29
+ position: relative;
30
+ padding: `,`;
31
+ border-radius: 8px;
32
+ border: `,`;
33
+ background: `,`;
34
+ overflow: hidden;
35
+
36
+ .monaco-editor-background {
37
+ background: `,`;
38
+ }
39
+
40
+ .monaco-editor {
41
+ background: `,`;
42
+ }
43
+
44
+ .editor.original {
45
+ display: none !important;
46
+ }
47
+
48
+ .editor-scrollable {
49
+ width: 100% !important;
50
+ }
51
+
52
+ .view-lines {
53
+ width: 100% !important;
54
+ pointer-events: none;
55
+ }
56
+
57
+ .current-line {
58
+ background: transparent !important;
59
+ border: 0 !important;
60
+ }
61
+
62
+ .margin {
63
+ display: none !important;
64
+ }
65
+
66
+ .monaco-scrollable-element {
67
+ left: 0 !important;
68
+ }
69
+
70
+ .scrollbar {
71
+ display: none !important;
72
+ }
73
+
74
+ .open-in-editor-btn {
75
+ opacity: 0;
76
+ transition: opacity 0.15s ease-in-out;
77
+ }
78
+
79
+ &:hover .open-in-editor-btn {
80
+ opacity: 1;
81
+ }
82
+ `],({$noBorder:e})=>e?0:"0 1.2rem",({$noBorder:e,theme:n})=>e?"none":`1px solid ${n.color.selection}`,({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.backgroundDarker),Xt=x(ie).attrs({skin:"transparent"}).withConfig({displayName:"LiteEditor__OpenInEditorButton"})([`
83
+ gap: 1rem;
84
+ font-size: 1.2rem;
85
+ background: `,`;
86
+ border: 0;
87
+ color: `,`;
88
+ `],({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.offWhite),ht=x(Kn).withConfig({displayName:"LiteEditor__SuccessIcon"})([`
89
+ position: absolute;
90
+ transform: translate(75%, -75%);
91
+ color: `,`;
92
+ `],({theme:e})=>e.color.green),Yt=x.div.withConfig({displayName:"LiteEditor__ButtonsContainer"})([`
93
+ position: absolute;
94
+ top: 0.8rem;
95
+ right: 1.2rem;
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: flex-end;
99
+ gap: 1.2rem;
100
+ z-index: 10;
101
+ `]),mt=x(ie).withConfig({displayName:"LiteEditor__CopyButtonBase"})([`
102
+ color: #e5e7eb;
103
+ padding: 0 0.6rem;
104
+ background: `,`;
105
+ `],({theme:e})=>e.color.backgroundDarker),Ga=x(mt).withConfig({displayName:"LiteEditor__CopyButtonFloating"})([`
106
+ position: absolute;
107
+ top: 0.2rem;
108
+ right: 0.8rem;
109
+ z-index: 10;
110
+ `]),je=Nt.memo(({language:e=Un,theme:n="dracula",fontSize:a=12,padding:o={top:8,bottom:8},lineHeight:l=20,maxHeight:i,...r})=>{const d=Ft(),u=t.useRef(!1),[p,h]=t.useState(!1),c=w=>{Pn(w),h(!0),setTimeout(()=>h(!1),2e3)},b=w=>w.split(`
111
+ `).length*l+(r.diffEditor?0:16);if(r.diffEditor)return s.jsxs(Gt,{$noBorder:!0,style:{height:i,paddingTop:8,paddingBottom:8},children:[s.jsxs(Yt,{children:[s.jsxs(Xt,{className:"open-in-editor-btn",onClick:()=>r.onOpenInEditor(r.original,r.modified),title:"Open in editor","data-hook":"diff-open-in-editor-button",children:["Open in editor",s.jsx(ut,{size:"1.8rem",color:d.color.offWhite})]}),s.jsxs(mt,{skin:"transparent",onClick:()=>c(r.modified),title:"Copy to clipboard",children:[p&&s.jsx(ht,{size:"1rem"}),s.jsx(rt,{size:"1.8rem"})]})]}),s.jsx(Wn,{height:i,language:e,original:r.original,modified:r.modified,theme:n,onMount:w=>{w.onDidUpdateDiff(()=>{var M;if(u.current)return;const y=(M=w.getLineChanges())==null?void 0:M[0];y&&(u.current=!0,w.getModifiedEditor().revealLineInCenter(y.modifiedStartLineNumber))})},options:{readOnly:!0,lineNumbers:"off",minimap:{enabled:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},automaticLayout:!0,folding:!1,wordWrap:"on",glyphMargin:!1,renderSideBySide:!1,enableSplitViewResizing:!1,renderIndicators:!1,renderOverviewRuler:!1,hideCursorInOverviewRuler:!0,originalEditable:!1,overviewRulerBorder:!1,fontSize:a,lineHeight:l}})]});const k=b(r.value),g=i?Math.min(k,i):k,A=k>i;return s.jsxs(Gt,{style:{height:g},children:[A?s.jsxs(Yt,{children:[s.jsxs(Xt,{className:"open-in-editor-btn",onClick:()=>r.onOpenInEditor(r.value),title:"Open in editor","data-hook":"code-open-in-editor-button",children:["Open in editor",s.jsx(ut,{size:"1.8rem",color:d.color.offWhite})]}),s.jsxs(mt,{skin:"transparent",onClick:()=>c(r.value??""),title:"Copy to clipboard",children:[p&&s.jsx(ht,{size:"1rem"}),s.jsx(rt,{size:"1.8rem"})]})]}):s.jsxs(Ga,{skin:"transparent",onClick:()=>c(r.value??""),title:"Copy to clipboard",children:[p&&s.jsx(ht,{size:"1rem"}),s.jsx(rt,{size:"1.8rem"})]}),s.jsx(Qn,{height:g,language:e,value:r.value,theme:n,options:{readOnly:!0,lineNumbers:"off",minimap:{enabled:!1},scrollBeyondLastLine:!1,folding:!1,glyphMargin:!1,lineDecorationsWidth:0,lineNumbersMinChars:0,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},fontSize:a,padding:o,lineHeight:l}})]})},(e,n)=>e.value===n.value&&e.diffEditor===n.diffEditor&&e.original===n.original&&e.modified===n.modified&&e.maxHeight===n.maxHeight&&e.onOpenInEditor===n.onOpenInEditor),Xa={tokenize:ar,partial:!0},Jt={tokenize:rr,partial:!0},en={tokenize:ir,partial:!0},tn={tokenize:or,partial:!0},Ya={tokenize:lr,partial:!0},nn={tokenize:tr,previous:rn},an={tokenize:nr,previous:on},se={tokenize:er,previous:ln},ne={},Ja={text:ne};let he=48;for(;he<123;)ne[he]=se,he++,he===58?he=65:he===91&&(he=97);ne[43]=se,ne[45]=se,ne[46]=se,ne[95]=se,ne[72]=[se,an],ne[104]=[se,an],ne[87]=[se,nn],ne[119]=[se,nn];function er(e,n,a){const o=this;let l,i;return r;function r(c){return!pt(c)||!ln.call(o,o.previous)||gt(o.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(c))}function d(c){return pt(c)?(e.consume(c),d):c===64?(e.consume(c),u):a(c)}function u(c){return c===46?e.check(Ya,h,p)(c):c===45||c===95||it(c)?(i=!0,e.consume(c),u):h(c)}function p(c){return e.consume(c),l=!0,u}function h(c){return i&&l&&He(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):a(c)}}function tr(e,n,a){const o=this;return l;function l(r){return r!==87&&r!==119||!rn.call(o,o.previous)||gt(o.events)?a(r):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Xa,e.attempt(Jt,e.attempt(en,i),a),a)(r))}function i(r){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(r)}}function nr(e,n,a){const o=this;let l="",i=!1;return r;function r(c){return(c===72||c===104)&&on.call(o,o.previous)&&!gt(o.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),d):a(c)}function d(c){if(He(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),d;if(c===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(c),u}return a(c)}function u(c){return c===47?(e.consume(c),i?p:(i=!0,u)):a(c)}function p(c){return c===null||Gn(c)||U(c)||xe(c)||ot(c)?a(c):e.attempt(Jt,e.attempt(en,h),a)(c)}function h(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function ar(e,n,a){let o=0;return l;function l(r){return(r===87||r===119)&&o<3?(o++,e.consume(r),l):r===46&&o===3?(e.consume(r),i):a(r)}function i(r){return r===null?a(r):n(r)}}function rr(e,n,a){let o,l,i;return r;function r(p){return p===46||p===95?e.check(tn,u,d)(p):p===null||U(p)||xe(p)||p!==45&&ot(p)?u(p):(i=!0,e.consume(p),r)}function d(p){return p===95?o=!0:(l=o,o=void 0),e.consume(p),r}function u(p){return l||o||!i?a(p):n(p)}}function ir(e,n){let a=0,o=0;return l;function l(r){return r===40?(a++,e.consume(r),l):r===41&&o<a?i(r):r===33||r===34||r===38||r===39||r===41||r===42||r===44||r===46||r===58||r===59||r===60||r===63||r===93||r===95||r===126?e.check(tn,n,i)(r):r===null||U(r)||xe(r)?n(r):(e.consume(r),l)}function i(r){return r===41&&o++,e.consume(r),l}}function or(e,n,a){return o;function o(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),o):d===38?(e.consume(d),i):d===93?(e.consume(d),l):d===60||d===null||U(d)||xe(d)?n(d):a(d)}function l(d){return d===null||d===40||d===91||U(d)||xe(d)?n(d):o(d)}function i(d){return He(d)?r(d):a(d)}function r(d){return d===59?(e.consume(d),o):He(d)?(e.consume(d),r):a(d)}}function lr(e,n,a){return o;function o(i){return e.consume(i),l}function l(i){return it(i)?a(i):n(i)}}function rn(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||U(e)}function on(e){return!He(e)}function ln(e){return!(e===47||pt(e))}function pt(e){return e===43||e===45||e===46||e===95||it(e)}function gt(e){let n=e.length,a=!1;for(;n--;){const o=e[n][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){a=!0;break}if(o._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const sr={tokenize:fr,partial:!0};function cr(){return{document:{91:{tokenize:mr,continuation:{tokenize:pr},exit:gr}},text:{91:{tokenize:hr},93:{add:"after",tokenize:dr,resolveTo:ur}}}}function dr(e,n,a){const o=this;let l=o.events.length;const i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let r;for(;l--;){const u=o.events[l][1];if(u.type==="labelImage"){r=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(!r||!r._balanced)return a(u);const p=Me(o.sliceSerialize({start:r.end,end:o.now()}));return p.codePointAt(0)!==94||!i.includes(p.slice(1))?a(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function ur(e,n){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 o={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 i={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},r={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},d=[e[a+1],e[a+2],["enter",o,n],e[a+3],e[a+4],["enter",l,n],["exit",l,n],["enter",i,n],["enter",r,n],["exit",r,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",o,n]];return e.splice(a,e.length-a+1,...d),e}function hr(e,n,a){const o=this,l=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let i=0,r;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(i>999||c===93&&!r||c===null||c===91||U(c))return a(c);if(c===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Me(o.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):a(c)}return U(c)||(r=!0),i++,e.consume(c),c===92?h:p}function h(c){return c===91||c===92||c===93?(e.consume(c),i++,p):p(c)}}function mr(e,n,a){const o=this,l=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let i,r=0,d;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):a(g)}function h(g){if(r>999||g===93&&!d||g===null||g===91||U(g))return a(g);if(g===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return i=Me(o.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return U(g)||(d=!0),r++,e.consume(g),g===92?c:h}function c(g){return g===91||g===92||g===93?(e.consume(g),r++,h):h(g)}function b(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),l.includes(i)||l.push(i),ce(e,k,"gfmFootnoteDefinitionWhitespace")):a(g)}function k(g){return n(g)}}function pr(e,n,a){return e.check(Xn,n,e.attempt(sr,n,a))}function gr(e){e.exit("gfmFootnoteDefinition")}function fr(e,n,a){const o=this;return ce(e,l,"gfmFootnoteDefinitionIndent",5);function l(i){const r=o.events[o.events.length-1];return r&&r[1].type==="gfmFootnoteDefinitionIndent"&&r[2].sliceSerialize(r[1],!0).length===4?n(i):a(i)}}function xr(e){let n=(e||{}).singleTilde;const a={tokenize:l,resolveAll:o};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(i,r){let d=-1;for(;++d<i.length;)if(i[d][0]==="enter"&&i[d][1].type==="strikethroughSequenceTemporary"&&i[d][1]._close){let u=d;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[d][1].end.offset-i[d][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[d][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[d][1].end)},h={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[d][1].start)},c=[["enter",p,r],["enter",i[u][1],r],["exit",i[u][1],r],["enter",h,r]],b=r.parser.constructs.insideSpan.null;b&&lt(c,c.length,0,Yn(b,i.slice(u+1,d),r)),lt(c,c.length,0,[["exit",h,r],["enter",i[d][1],r],["exit",i[d][1],r],["exit",p,r]]),lt(i,u-1,d-u+3,c),d=u+c.length-2;break}}for(d=-1;++d<i.length;)i[d][1].type==="strikethroughSequenceTemporary"&&(i[d][1].type="data");return i}function l(i,r,d){const u=this.previous,p=this.events;let h=0;return c;function c(k){return u===126&&p[p.length-1][1].type!=="characterEscape"?d(k):(i.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const g=jt(u);if(k===126)return h>1?d(k):(i.consume(k),h++,b);if(h<2&&!n)return d(k);const A=i.exit("strikethroughSequenceTemporary"),w=jt(k);return A._open=!w||w===2&&!!g,A._close=!g||g===2&&!!w,r(k)}}}class yr{constructor(){this.map=[]}add(n,a,o){br(this,n,a,o)}consume(n){if(this.map.sort((i,r)=>i[0]-r[0]),this.map.length===0)return;let a=this.map.length;const o=[];for(;a>0;)a-=1,o.push(n.slice(this.map[a][0]+this.map[a][1])),o.push(this.map[a][2]),n.length=this.map[a][0];o.push([...n]),n.length=0;let l=o.pop();for(;l;)n.push(...l),l=o.pop();this.map.length=0}}function br(e,n,a,o){let l=0;if(!(a===0&&o.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=a,e.map[l][2].push(...o);return}l+=1}e.map.push([n,a,o])}}function kr(e,n){let a=!1;const o=[];for(;n<e.length;){const l=e[n];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&o.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const i=o.length-1;o[i]=o[i]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);n+=1}return o}const Cr={flow:{null:{tokenize:wr,resolveAll:Ar}}};function wr(e,n,a){const o=this;let l=0,i=0,r;return d;function d(m){let L=o.events.length-1;for(;L>-1;){const C=o.events[L][1].type;if(C==="lineEnding"||C==="linePrefix")L--;else break}const R=L>-1?o.events[L][1].type:null,q=R==="tableHead"||R==="tableRow"?D:u;return q===D&&o.parser.lazy[o.now().line]?a(m):q(m)}function u(m){return e.enter("tableHead"),e.enter("tableRow"),p(m)}function p(m){return m===124||(r=!0,i+=1),h(m)}function h(m){return m===null?a(m):Ee(m)?i>1?(i=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),k):a(m):ye(m)?ce(e,h,"whitespace")(m):(i+=1,r&&(r=!1,l+=1),m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),r=!0,h):(e.enter("data"),c(m)))}function c(m){return m===null||m===124||U(m)?(e.exit("data"),h(m)):(e.consume(m),m===92?b:c)}function b(m){return m===92||m===124?(e.consume(m),c):c(m)}function k(m){return o.interrupt=!1,o.parser.lazy[o.now().line]?a(m):(e.enter("tableDelimiterRow"),r=!1,ye(m)?ce(e,g,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):g(m))}function g(m){return m===45||m===58?w(m):m===124?(r=!0,e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),A):I(m)}function A(m){return ye(m)?ce(e,w,"whitespace")(m):w(m)}function w(m){return m===58?(i+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),y):m===45?(i+=1,y(m)):m===null||Ee(m)?_(m):I(m)}function y(m){return m===45?(e.enter("tableDelimiterFiller"),M(m)):I(m)}function M(m){return m===45?(e.consume(m),M):m===58?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),H):(e.exit("tableDelimiterFiller"),H(m))}function H(m){return ye(m)?ce(e,_,"whitespace")(m):_(m)}function _(m){return m===124?g(m):m===null||Ee(m)?!r||l!==i?I(m):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(m)):I(m)}function I(m){return a(m)}function D(m){return e.enter("tableRow"),E(m)}function E(m){return m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),E):m===null||Ee(m)?(e.exit("tableRow"),n(m)):ye(m)?ce(e,E,"whitespace")(m):(e.enter("data"),Z(m))}function Z(m){return m===null||m===124||U(m)?(e.exit("data"),E(m)):(e.consume(m),m===92?N:Z)}function N(m){return m===92||m===124?(e.consume(m),Z):Z(m)}}function Ar(e,n){let a=-1,o=!0,l=0,i=[0,0,0,0],r=[0,0,0,0],d=!1,u=0,p,h,c;const b=new yr;for(;++a<e.length;){const k=e[a],g=k[1];k[0]==="enter"?g.type==="tableHead"?(d=!1,u!==0&&(sn(b,n,u,p,h),h=void 0,u=0),p={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},b.add(a,0,[["enter",p,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=!0,c=void 0,i=[0,0,0,0],r=[0,a+1,0,0],d&&(d=!1,h={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},b.add(a,0,[["enter",h,n]])),l=g.type==="tableDelimiterRow"?2:h?3:1):l&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(o=!1,r[2]===0&&(i[1]!==0&&(r[0]=r[1],c=Re(b,n,i,l,void 0,c),i=[0,0,0,0]),r[2]=a)):g.type==="tableCellDivider"&&(o?o=!1:(i[1]!==0&&(r[0]=r[1],c=Re(b,n,i,l,void 0,c)),i=r,r=[i[1],a,0,0])):g.type==="tableHead"?(d=!0,u=a):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=a,i[1]!==0?(r[0]=r[1],c=Re(b,n,i,l,a,c)):r[1]!==0&&(c=Re(b,n,r,l,a,c)),l=0):l&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(r[3]=a)}for(u!==0&&sn(b,n,u,p,h),b.consume(n.events),a=-1;++a<n.events.length;){const k=n.events[a];k[0]==="enter"&&k[1].type==="table"&&(k[1]._align=kr(n.events,a))}return e}function Re(e,n,a,o,l,i){const r=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(i.end=Object.assign({},ke(n.events,a[0])),e.add(a[0],0,[["exit",i,n]]));const u=ke(n.events,a[1]);if(i={type:r,start:Object.assign({},u),end:Object.assign({},u)},e.add(a[1],0,[["enter",i,n]]),a[2]!==0){const p=ke(n.events,a[2]),h=ke(n.events,a[3]),c={type:d,start:Object.assign({},p),end:Object.assign({},h)};if(e.add(a[2],0,[["enter",c,n]]),o!==2){const b=n.events[a[2]],k=n.events[a[3]];if(b[1].end=Object.assign({},k[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const g=a[2]+1,A=a[3]-a[2]-1;e.add(g,A,[])}}e.add(a[3]+1,0,[["exit",c,n]])}return l!==void 0&&(i.end=Object.assign({},ke(n.events,l)),e.add(l,0,[["exit",i,n]]),i=void 0),i}function sn(e,n,a,o,l){const i=[],r=ke(n.events,a);l&&(l.end=Object.assign({},r),i.push(["exit",l,n])),o.end=Object.assign({},r),i.push(["exit",o,n]),e.add(a+1,0,i)}function ke(e,n){const a=e[n],o=a[0]==="enter"?"start":"end";return a[1][o]}const vr={tokenize:Mr},Hr={text:{91:vr}};function Mr(e,n,a){const o=this;return l;function l(u){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?a(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),i)}function i(u){return U(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),r):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),r):a(u)}function r(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(u)}function d(u){return Ee(u)?n(u):ye(u)?e.check({tokenize:Er},n,a)(u):a(u)}}function Er(e,n,a){return ce(e,o,"whitespace");function o(l){return l===null?a(l):n(l)}}function jr(e){return Jn([Ja,cr(),xr(e),Cr,Hr])}function cn(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let o=0,l=a.indexOf(n);for(;l!==-1;)o++,l=a.indexOf(n,l+n.length);return o}function _r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Vr={}.hasOwnProperty,Zr=(function(e,n,a,o){let l,i;typeof n=="string"||n instanceof RegExp?(i=[[n,a]],l=o):(i=n,l=a),l||(l={});const r=ea(l.ignore||[]),d=Ir(i);let u=-1;for(;++u<d.length;)ta(e,"text",p);return e;function p(c,b){let k=-1,g;for(;++k<b.length;){const A=b[k];if(r(A,g?g.children.indexOf(A):void 0,g))return;g=A}if(g)return h(c,b)}function h(c,b){const k=b[b.length-1],g=d[u][0],A=d[u][1];let w=0;const y=k.children.indexOf(c);let M=!1,H=[];g.lastIndex=0;let _=g.exec(c.value);for(;_;){const I=_.index,D={index:_.index,input:_.input,stack:[...b,c]};let E=A(..._,D);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E!==!1&&(w!==I&&H.push({type:"text",value:c.value.slice(w,I)}),Array.isArray(E)?H.push(...E):E&&H.push(E),w=I+_[0].length,M=!0),!g.global)break;_=g.exec(c.value)}return M?(w<c.value.length&&H.push({type:"text",value:c.value.slice(w)}),k.children.splice(y,1,...H)):H=[c],y+H.length}});function Ir(e){const n=[];if(typeof e!="object")throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let a=-1;for(;++a<e.length;)n.push([dn(e[a][0]),un(e[a][1])])}else{let a;for(a in e)Vr.call(e,a)&&n.push([dn(a),un(e[a])])}return n}function dn(e){return typeof e=="string"?new RegExp(_r(e),"g"):e}function un(e){return typeof e=="function"?e:()=>e}const ft="phrasing",xt=["autolink","link","image","label"],Lr={transforms:[Rr],enter:{literalAutolink:Fr,literalAutolinkEmail:yt,literalAutolinkHttp:yt,literalAutolinkWww:yt},exit:{literalAutolink:zr,literalAutolinkEmail:qr,literalAutolinkHttp:Dr,literalAutolinkWww:Sr}},Nr={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ft,notInConstruct:xt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ft,notInConstruct:xt},{character:":",before:"[ps]",after:"\\/",inConstruct:ft,notInConstruct:xt}]};function Fr(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yt(e){this.config.enter.autolinkProtocol.call(this,e)}function Dr(e){this.config.exit.autolinkProtocol.call(this,e)}function Sr(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.url="http://"+this.sliceSerialize(e)}function qr(e){this.config.exit.autolinkEmail.call(this,e)}function zr(e){this.exit(e)}function Rr(e){Zr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Tr],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,Or]],{ignore:["link","linkReference"]})}function Tr(e,n,a,o,l){let i="";if(!hn(l)||(/^w/i.test(n)&&(a=n+a,n="",i="http://"),!Br(a)))return!1;const r=$r(a+o);if(!r[0])return!1;const d={type:"link",title:null,url:i+n+r[0],children:[{type:"text",value:n+r[0]}]};return r[1]?[d,{type:"text",value:r[1]}]:d}function Or(e,n,a,o){return!hn(o,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function Br(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function $r(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],o=a.indexOf(")");const l=cn(e,"(");let i=cn(e,")");for(;o!==-1&&l>i;)e+=a.slice(0,o+1),a=a.slice(o+1),o=a.indexOf(")"),i++;return[e,a]}function hn(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||xe(a)||ot(a))&&(!n||a!==47)}function mn(e){return e.label||!e.identifier?e.label||"":na(e.identifier)}function Wr(e,n,a){const o=n.indexStack,l=e.children||[],i=n.createTracker(a),r=[];let d=-1;for(o.push(-1);++d<l.length;){const u=l[d];o[o.length-1]=d,r.push(i.move(n.handle(u,e,n,{before:`
112
+ `,after:`
113
+ `,...i.current()}))),u.type!=="list"&&(n.bulletLastUsed=void 0),d<l.length-1&&r.push(i.move(Ur(u,l[d+1],e,n)))}return o.pop(),r.join("")}function Ur(e,n,a,o){let l=o.join.length;for(;l--;){const i=o.join[l](e,n,a,o);if(i===!0||i===1)break;if(typeof i=="number")return`
114
+ `.repeat(1+i);if(i===!1)return`
115
+
116
+ <!---->
117
+
118
+ `}return`
119
+
120
+ `}const Qr=/\r?\n|\r/g;function Pr(e,n){const a=[];let o=0,l=0,i;for(;i=Qr.exec(e);)r(e.slice(o,i.index)),a.push(i[0]),o=i.index+i[0].length,l++;return r(e.slice(o)),a.join("");function r(d){a.push(n(d,l,!d))}}function pn(e){if(!e._compiled){const n=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Kr(e,n){return gn(e,n.inConstruct,!0)&&!gn(e,n.notInConstruct,!1)}function gn(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let o=-1;for(;++o<n.length;)if(e.includes(n[o]))return!0;return!1}function fn(e,n,a){const o=(a.before||"")+(n||"")+(a.after||""),l=[],i=[],r={};let d=-1;for(;++d<e.unsafe.length;){const h=e.unsafe[d];if(!Kr(e.stack,h))continue;const c=pn(h);let b;for(;b=c.exec(o);){const k="before"in h||!!h.atBreak,g="after"in h,A=b.index+(k?b[1].length:0);l.includes(A)?(r[A].before&&!k&&(r[A].before=!1),r[A].after&&!g&&(r[A].after=!1)):(l.push(A),r[A]={before:k,after:g})}}l.sort(Gr);let u=a.before?a.before.length:0;const p=o.length-(a.after?a.after.length:0);for(d=-1;++d<l.length;){const h=l[d];h<u||h>=p||h+1<p&&l[d+1]===h+1&&r[h].after&&!r[h+1].before&&!r[h+1].after||l[d-1]===h-1&&r[h].before&&!r[h-1].before&&!r[h-1].after||(u!==h&&i.push(xn(o.slice(u,h),"\\")),u=h,/[!-/:-@[-`{-~]/.test(o.charAt(h))&&(!a.encode||!a.encode.includes(o.charAt(h)))?i.push("\\"):(i.push("&#x"+o.charCodeAt(h).toString(16).toUpperCase()+";"),u++))}return i.push(xn(o.slice(u,p),a.after)),i.join("")}function Gr(e,n){return e-n}function xn(e,n){const a=/\\(?=[!-/:-@[-`{-~])/g,o=[],l=[],i=e+n;let r=-1,d=0,u;for(;u=a.exec(i);)o.push(u.index);for(;++r<o.length;)d!==o[r]&&l.push(e.slice(d,o[r])),l.push("\\"),d=o[r];return l.push(e.slice(d)),l.join("")}function Te(e){const n=e||{},a=n.now||{};let o=n.lineShift||0,l=a.line||1,i=a.column||1;return{move:u,current:r,shift:d};function r(){return{now:{line:l,column:i},lineShift:o}}function d(p){o+=p}function u(p){const h=p||"",c=h.split(/\r?\n|\r/g),b=c[c.length-1];return l+=c.length-1,i=c.length===1?i+b.length:1+b.length+o,h}}yn.peek=l0;function Xr(){return{enter:{gfmFootnoteDefinition:Jr,gfmFootnoteDefinitionLabelString:e0,gfmFootnoteCall:a0,gfmFootnoteCallString:r0},exit:{gfmFootnoteDefinition:n0,gfmFootnoteDefinitionLabelString:t0,gfmFootnoteCall:o0,gfmFootnoteCallString:i0}}}function Yr(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:s0,footnoteReference:yn}}}function Jr(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function e0(){this.buffer()}function t0(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=Me(this.sliceSerialize(e)).toLowerCase()}function n0(e){this.exit(e)}function a0(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function r0(){this.buffer()}function i0(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=Me(this.sliceSerialize(e)).toLowerCase()}function o0(e){this.exit(e)}function yn(e,n,a,o){const l=Te(o);let i=l.move("[^");const r=a.enter("footnoteReference"),d=a.enter("reference");return i+=l.move(fn(a,mn(e),{...l.current(),before:i,after:"]"})),d(),r(),i+=l.move("]"),i}function l0(){return"["}function s0(e,n,a,o){const l=Te(o);let i=l.move("[^");const r=a.enter("footnoteDefinition"),d=a.enter("label");return i+=l.move(fn(a,mn(e),{...l.current(),before:i,after:"]"})),d(),i+=l.move("]:"+(e.children&&e.children.length>0?" ":"")),l.shift(4),i+=l.move(Pr(Wr(e,a,l.current()),c0)),r(),i}function c0(e,n,a){return n===0?e:(a?"":" ")+e}function bn(e,n,a){const o=n.indexStack,l=e.children||[],i=[];let r=-1,d=a.before;o.push(-1);let u=n.createTracker(a);for(;++r<l.length;){const p=l[r];let h;if(o[o.length-1]=r,r+1<l.length){let c=n.handle.handlers[l[r+1].type];c&&c.peek&&(c=c.peek),h=c?c(l[r+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else h=a.after;i.length>0&&(d==="\r"||d===`
121
+ `)&&p.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),d=" ",u=n.createTracker(a),u.move(i.join(""))),i.push(u.move(n.handle(p,e,n,{...u.current(),before:d,after:h}))),d=i[i.length-1].slice(-1)}return o.pop(),i.join("")}const d0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];kn.peek=g0;const u0={canContainEols:["delete"],enter:{strikethrough:m0},exit:{strikethrough:p0}},h0={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:d0}],handlers:{delete:kn}};function m0(e){this.enter({type:"delete",children:[]},e)}function p0(e){this.exit(e)}function kn(e,n,a,o){const l=Te(o),i=a.enter("strikethrough");let r=l.move("~~");return r+=bn(e,a,{...l.current(),before:r,after:"~"}),r+=l.move("~~"),i(),r}function g0(){return"~"}Cn.peek=f0;function Cn(e,n,a){let o=e.value||"",l="`",i=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(o);)l+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++i<a.unsafe.length;){const r=a.unsafe[i],d=pn(r);let u;if(r.atBreak)for(;u=d.exec(o);){let p=u.index;o.charCodeAt(p)===10&&o.charCodeAt(p-1)===13&&p--,o=o.slice(0,p)+" "+o.slice(u.index+1)}}return l+o+l}function f0(){return"`"}function x0(e){return e.length}function y0(e,n){const a=n||{},o=(a.align||[]).concat(),l=a.stringLength||x0,i=[],r=[],d=[],u=[];let p=0,h=-1;for(;++h<e.length;){const A=[],w=[];let y=-1;for(e[h].length>p&&(p=e[h].length);++y<e[h].length;){const M=b0(e[h][y]);if(a.alignDelimiters!==!1){const H=l(M);w[y]=H,(u[y]===void 0||H>u[y])&&(u[y]=H)}A.push(M)}r[h]=A,d[h]=w}let c=-1;if(typeof o=="object"&&"length"in o)for(;++c<p;)i[c]=wn(o[c]);else{const A=wn(o);for(;++c<p;)i[c]=A}c=-1;const b=[],k=[];for(;++c<p;){const A=i[c];let w="",y="";A===99?(w=":",y=":"):A===108?w=":":A===114&&(y=":");let M=a.alignDelimiters===!1?1:Math.max(1,u[c]-w.length-y.length);const H=w+"-".repeat(M)+y;a.alignDelimiters!==!1&&(M=w.length+M+y.length,M>u[c]&&(u[c]=M),k[c]=M),b[c]=H}r.splice(1,0,b),d.splice(1,0,k),h=-1;const g=[];for(;++h<r.length;){const A=r[h],w=d[h];c=-1;const y=[];for(;++c<p;){const M=A[c]||"";let H="",_="";if(a.alignDelimiters!==!1){const I=u[c]-(w[c]||0),D=i[c];D===114?H=" ".repeat(I):D===99?I%2?(H=" ".repeat(I/2+.5),_=" ".repeat(I/2-.5)):(H=" ".repeat(I/2),_=H):_=" ".repeat(I)}a.delimiterStart!==!1&&!c&&y.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&M==="")&&(a.delimiterStart!==!1||c)&&y.push(" "),a.alignDelimiters!==!1&&y.push(H),y.push(M),a.alignDelimiters!==!1&&y.push(_),a.padding!==!1&&y.push(" "),(a.delimiterEnd!==!1||c!==p-1)&&y.push("|")}g.push(a.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
122
+ `)}function b0(e){return e==null?"":String(e)}function wn(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}const k0={enter:{table:C0,tableData:An,tableHeader:An,tableRow:A0},exit:{codeText:v0,table:w0,tableData:bt,tableHeader:bt,tableRow:bt}};function C0(e){const n=e._align;this.enter({type:"table",align:n.map(a=>a==="none"?null:a),children:[]},e),this.setData("inTable",!0)}function w0(e){this.exit(e),this.setData("inTable")}function A0(e){this.enter({type:"tableRow",children:[]},e)}function bt(e){this.exit(e)}function An(e){this.enter({type:"tableCell",children:[]},e)}function v0(e){let n=this.resume();this.getData("inTable")&&(n=n.replace(/\\([\\|])/g,H0));const a=this.stack[this.stack.length-1];a.value=n,this.exit(e)}function H0(e,n){return n==="|"?n:e}function M0(e){const n=e||{},a=n.tableCellPadding,o=n.tablePipeAlign,l=n.stringLength,i=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
123
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:r,tableRow:d,tableCell:u,inlineCode:b}};function r(k,g,A,w){return p(h(k,A,w),k.align)}function d(k,g,A,w){const y=c(k,A,w),M=p([y]);return M.slice(0,M.indexOf(`
124
+ `))}function u(k,g,A,w){const y=A.enter("tableCell"),M=A.enter("phrasing"),H=bn(k,A,{...w,before:i,after:i});return M(),y(),H}function p(k,g){return y0(k,{align:g,alignDelimiters:o,padding:a,stringLength:l})}function h(k,g,A){const w=k.children;let y=-1;const M=[],H=g.enter("table");for(;++y<w.length;)M[y]=c(w[y],g,A);return H(),M}function c(k,g,A){const w=k.children;let y=-1;const M=[],H=g.enter("tableRow");for(;++y<w.length;)M[y]=u(w[y],k,g,A);return H(),M}function b(k,g,A){let w=Cn(k,g,A);return A.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function E0(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function j0(e){const n=e.options.listItemIndent||"tab";if(n===1||n==="1")return"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function _0(e,n,a,o){const l=j0(a);let i=a.bulletCurrent||E0(a);n&&n.type==="list"&&n.ordered&&(i=(typeof n.start=="number"&&n.start>-1?n.start:1)+(a.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let r=i.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(r=Math.ceil(r/4)*4);const d=a.createTracker(o);d.move(i+" ".repeat(r-i.length)),d.shift(r);const u=a.enter("listItem"),p=a.indentLines(a.containerFlow(e,d.current()),h);return u(),p;function h(c,b,k){return b?(k?"":" ".repeat(r))+c:(k?i:i+" ".repeat(r-i.length))+c}}const V0={exit:{taskListCheckValueChecked:vn,taskListCheckValueUnchecked:vn,paragraph:I0}},Z0={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:L0}};function vn(e){const n=this.stack[this.stack.length-2];n.checked=e.type==="taskListCheckValueChecked"}function I0(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const a=this.stack[this.stack.length-1],o=a.children[0];if(o&&o.type==="text"){const l=n.children;let i=-1,r;for(;++i<l.length;){const d=l[i];if(d.type==="paragraph"){r=d;break}}r===a&&(o.value=o.value.slice(1),o.value.length===0?a.children.shift():a.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,a.position.start=Object.assign({},o.position.start)))}}this.exit(e)}function L0(e,n,a,o){const l=e.children[0],i=typeof e.checked=="boolean"&&l&&l.type==="paragraph",r="["+(e.checked?"x":" ")+"] ",d=Te(o);i&&d.move(r);let u=_0(e,n,a,{...o,...d.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),u;function p(h){return h+r}}function N0(){return[Lr,Xr(),u0,k0,V0]}function F0(e){return{extensions:[Nr,Yr(),h0,M0(e),Z0]}}function D0(e={}){const n=this.data();a("micromarkExtensions",jr(e)),a("fromMarkdownExtensions",N0()),a("toMarkdownExtensions",F0(e));function a(o,l){(n[o]?n[o]:n[o]=[]).push(l)}}const S0=x.div.withConfig({displayName:"AssistantMarkdown__CodeBlockWrapper"})([`
125
+ margin: 1rem 0;
126
+ width: 100%;
127
+ `]),q0=x.div.withConfig({displayName:"AssistantMarkdown__MarkdownContent"})([`
128
+ margin: 0;
129
+ width: 100%;
130
+ font-family: `,`;
131
+ font-size: 1.4rem;
132
+ line-height: 2.1rem;
133
+ color: `,`;
134
+ overflow: visible;
135
+ word-break: break-word;
136
+
137
+ p {
138
+ margin: 0 0 1rem 0;
139
+ &:last-child {
140
+ margin-bottom: 0;
141
+ }
142
+ }
143
+
144
+ code {
145
+ background: `,`;
146
+ border: 1px solid `,`;
147
+ border-radius: 0.4rem;
148
+ padding: 0.1rem 0.4rem;
149
+ font-family: `,`;
150
+ font-size: 1.3rem;
151
+ color: `,`;
152
+ white-space: pre-wrap;
153
+ }
154
+
155
+ strong {
156
+ font-weight: 600;
157
+ color: `,`;
158
+ }
159
+
160
+ em {
161
+ font-style: italic;
162
+ }
163
+
164
+ ul,
165
+ ol {
166
+ margin: 0.5rem 0;
167
+ padding-left: 2rem;
168
+ }
169
+
170
+ li {
171
+ margin-bottom: 0.3rem;
172
+ }
173
+
174
+ a {
175
+ color: `,`;
176
+ text-decoration: none;
177
+ &:hover {
178
+ text-decoration: underline;
179
+ }
180
+ }
181
+
182
+ h1,
183
+ h2,
184
+ h3,
185
+ h4 {
186
+ margin: 1rem 0 0.5rem 0;
187
+ font-weight: 600;
188
+ }
189
+
190
+ h1 {
191
+ font-size: 1.8rem;
192
+ }
193
+ h2 {
194
+ font-size: 1.6rem;
195
+ }
196
+ h3 {
197
+ font-size: 1.5rem;
198
+ }
199
+ h4 {
200
+ font-size: 1.4rem;
201
+ }
202
+
203
+ blockquote {
204
+ border-left: 3px solid `,`;
205
+ margin: 1rem 0;
206
+ padding-left: 1rem;
207
+ color: `,`;
208
+ }
209
+
210
+ .table-wrapper {
211
+ overflow-x: auto;
212
+ margin: 1rem 0;
213
+ }
214
+
215
+ table {
216
+ border-collapse: collapse;
217
+ min-width: max-content;
218
+ border-radius: 0.8rem;
219
+ }
220
+
221
+ th,
222
+ td {
223
+ padding: 0.6rem 0.8rem;
224
+ border: 1px solid `,`;
225
+ text-align: left;
226
+ white-space: nowrap;
227
+ }
228
+
229
+ th {
230
+ background: `,`;
231
+ font-weight: 600;
232
+ }
233
+
234
+ td:last-child {
235
+ white-space: normal;
236
+ min-width: 200px;
237
+ }
238
+ `],({theme:e})=>e.font,f("foreground"),f("background"),f("selection"),({theme:e})=>e.fontMonospace,f("purple"),f("foreground"),({theme:e})=>e.color.cyan,f("selection"),f("gray2"),f("selection"),f("backgroundDarker")),z0=t.memo(({content:e,messageId:n,onOpenInEditor:a})=>{const o=t.useMemo(()=>({a:({children:l,href:i,...r})=>s.jsx("a",{...typeof i=="string"&&i.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},href:i,...r,children:l}),table:({children:l,...i})=>s.jsx("div",{className:"table-wrapper",children:s.jsx("table",{...i,children:l})}),pre:({children:l})=>s.jsx(s.Fragment,{children:l}),code:({children:l,className:i})=>{if(typeof i=="string"&&i.includes("language-")){const r=(Array.isArray(l)?l.join(""):typeof l=="string"?l:"").replace(/\n$/,"");return s.jsx(S0,{"data-hook":"chat-message-code-block",children:s.jsx(je,{value:r,maxHeight:216,onOpenInEditor:d=>a({type:"code",value:d})})},n)}return s.jsx("code",{children:l})}}),[n,a]);return s.jsx(q0,{children:s.jsx(aa,{remarkPlugins:[D0],components:o,children:e})})},(e,n)=>e.content===n.content&&e.messageId===n.messageId),R0=Ea([`
239
+ from {
240
+ transform: rotate(0deg);
241
+ }
242
+ to {
243
+ transform: rotate(360deg);
244
+ }
245
+ `]),T0=x.span.withConfig({displayName:"ChatMessages__LoadingIconWrapper"})([`
246
+ display: flex;
247
+ align-items: center;
248
+ justify-content: center;
249
+ animation: `,` 3s linear infinite;
250
+ `],R0),O0=()=>s.jsx(T0,{children:s.jsx(ha,{})}),B0=x(S).withConfig({displayName:"ChatMessages__MessagesContainer"})([`
251
+ display: flex;
252
+ flex-direction: column;
253
+ gap: 2rem;
254
+ padding: 2rem 1rem;
255
+ overflow-y: auto;
256
+ flex: 1 1 auto;
257
+ min-height: 0;
258
+ width: 100%;
259
+ `,`
260
+ `],({$scrolled:e})=>!e&&ue([`
261
+ opacity: 0;
262
+ `])),$0=x(S).attrs({align:"flex-start"}).withConfig({displayName:"ChatMessages__MessageBubble"})([`
263
+ display: flex;
264
+ flex-direction: column;
265
+ gap: 0.5rem;
266
+ padding: 0.8rem;
267
+ border-radius: 0.8rem;
268
+ width: 100%;
269
+ align-self: flex-end;
270
+ background: `,`;
271
+ border: 1px solid rgba(25, 26, 33, 0.32);
272
+ flex-shrink: 0;
273
+ overflow: visible;
274
+ `],f("loginBackground")),Hn=x(S).withConfig({displayName:"ChatMessages__UserRequestBox"})([`
275
+ display: flex;
276
+ flex-direction: column;
277
+ gap: 0.5rem;
278
+ padding: 0.8rem;
279
+ width: 100%;
280
+ align-self: flex-end;
281
+ background: `,`;
282
+ border: 1px solid rgba(25, 26, 33, 0.32);
283
+ border-radius: 0.6rem;
284
+ flex-shrink: 0;
285
+ overflow: visible;
286
+ `],f("loginBackground")),W0=x(S).attrs({alignItems:"center",gap:"0.8rem"}).withConfig({displayName:"ChatMessages__UserRequestHeader"})([`
287
+ width: 100%;
288
+ padding: 0.4rem;
289
+ flex: 1 0 auto;
290
+ `]),kt=x(S).withConfig({displayName:"ChatMessages__UserRequestContent"})([`
291
+ display: flex;
292
+ flex-direction: column;
293
+ border-radius: 0.6rem;
294
+ overflow: hidden;
295
+ flex-shrink: 0;
296
+ width: 100%;
297
+ align-items: flex-start;
298
+ `]),Mn=x.div.withConfig({displayName:"ChatMessages__InlineSQLEditor"})([`
299
+ width: 100%;
300
+ `]),U0=x(S).attrs({gap:"1rem",alignItems:"center"}).withConfig({displayName:"ChatMessages__OperationBadge"})([`
301
+ width: 100%;
302
+ padding: 0 0.4rem;
303
+ `]),Q0=x(S).attrs({align:"center",justifyContent:"center"}).withConfig({displayName:"ChatMessages__BadgeIconContainer"})([`
304
+ background: #290a13;
305
+ border: 1px solid rgba(122, 31, 58, 0.64);
306
+ border-radius: 0.4rem;
307
+ padding: 0.8rem;
308
+ width: 4.8rem;
309
+ height: 4rem;
310
+ flex-shrink: 0;
311
+ `]),P0=x.img.withConfig({displayName:"ChatMessages__BadgeIcon"})([`
312
+ width: 1.8rem;
313
+ height: 1.8rem;
314
+ `]),K0=x(de).withConfig({displayName:"ChatMessages__BadgeTitle"})([`
315
+ font-weight: 500;
316
+ font-size: 1.6rem;
317
+ line-height: 1.6rem;
318
+ color: `,`;
319
+ `],f("foreground")),G0=x(S).withConfig({displayName:"ChatMessages__BadgeDescriptionContainer"})([`
320
+ padding: 0.8rem;
321
+ width: 100%;
322
+ `]),X0=x(de).withConfig({displayName:"ChatMessages__BadgeDescriptionText"})([`
323
+ font-size: 1.4rem;
324
+ line-height: 2.1rem;
325
+ color: `,`;
326
+ `],f("foreground")),Y0=x(S).withConfig({displayName:"ChatMessages__SchemaNameDisplay"})([`
327
+ margin-left: 0.4rem;
328
+ padding: 0.8rem 1.2rem;
329
+ align-items: center;
330
+ gap: 1rem;
331
+ border-radius: 8px;
332
+ border: 1px solid `,`;
333
+ background: `,`;
334
+ `],f("selection"),f("backgroundDarker")),J0=x(de).withConfig({displayName:"ChatMessages__SchemaName"})([`
335
+ font-size: 1.4rem;
336
+ color: `,`;
337
+ `],f("foreground")),En=x(de).withConfig({displayName:"ChatMessages__MessageContent"})([`
338
+ font-size: 1.4rem;
339
+ line-height: 1.8rem;
340
+ color: `,`;
341
+ white-space: pre-wrap;
342
+ word-wrap: break-word;
343
+ overflow: visible;
344
+ `],f("foreground")),ei=x(S).withConfig({displayName:"ChatMessages__ExplanationBox"})([`
345
+ display: flex;
346
+ flex-direction: column;
347
+ gap: 0.5rem;
348
+ width: 100%;
349
+ align-self: flex-start;
350
+ text-align: left;
351
+ background: transparent;
352
+ padding: 0.4rem;
353
+ border-radius: 0.6rem;
354
+ flex-shrink: 0;
355
+ overflow: visible;
356
+
357
+ `,`
358
+
359
+ .assistant-label,
360
+ .token-display {
361
+ transition: opacity 0.2s;
362
+ opacity: 0;
363
+ }
364
+
365
+ &:hover {
366
+ .assistant-label,
367
+ .token-display {
368
+ opacity: 1;
369
+ }
370
+ }
371
+ `],({$hasOperationHistory:e})=>e&&ue([`
372
+ padding-top: 0;
373
+ `])),ti=x(S).attrs({alignItems:"center",gap:"1rem"}).withConfig({displayName:"ChatMessages__AssistantHeader"})([`
374
+ width: 100%;
375
+ padding: 0.4rem;
376
+ flex: 1 0 auto;
377
+ `]),ni=x(de).attrs({className:"assistant-label"}).withConfig({displayName:"ChatMessages__AssistantLabel"})([`
378
+ font-family: `,`;
379
+ font-size: 1.4rem;
380
+ text-transform: uppercase;
381
+ color: `,`;
382
+ line-height: 1;
383
+ `],({theme:e})=>e.fontMonospace,f("foreground")),ai=x(S).attrs({className:"token-display"}).withConfig({displayName:"ChatMessages__TokenDisplay"})([`
384
+ align-items: center;
385
+ gap: 0.9rem;
386
+ margin: 0 0 0 auto;
387
+ `]),ri=x(S).withConfig({displayName:"ChatMessages__ExplanationContent"})([`
388
+ display: flex;
389
+ flex-direction: column;
390
+ border-radius: 0.6rem;
391
+ padding: 0.8rem;
392
+ overflow: visible;
393
+ flex-shrink: 0;
394
+ width: 100%;
395
+ `]),ii=x.div.withConfig({displayName:"ChatMessages__Divider"})([`
396
+ width: 100%;
397
+ height: 1px;
398
+ background: linear-gradient(90deg, #9c274b 0%, rgba(54, 14, 26, 0) 100%);
399
+ margin-bottom: 1.5rem;
400
+ `]),oi=x.div.withConfig({displayName:"ChatMessages__OperationHistoryContainer"})([`
401
+ margin-bottom: 1rem;
402
+ padding-bottom: 1rem;
403
+ width: 100%;
404
+ `,`
405
+ `],({$trimBottom:e})=>e&&ue([`
406
+ margin-bottom: 0;
407
+ padding-bottom: 0.3rem;
408
+ `])),li=x.div.withConfig({displayName:"ChatMessages__ErrorContainer"})([`
409
+ display: flex;
410
+ align-items: center;
411
+ flex-shrink: 0;
412
+ gap: 1rem;
413
+ padding: 1rem 1.2rem;
414
+ border-radius: 0.6rem;
415
+ border: 1px solid `,`;
416
+ color: `,`;
417
+ font-size: 1.4rem;
418
+ line-height: 2rem;
419
+ width: 100%;
420
+ `],f("red"),f("foreground")),si=x(S).withConfig({displayName:"ChatMessages__DiffContainer"})([`
421
+ display: flex;
422
+ flex-direction: column;
423
+ gap: 10px;
424
+ margin-top: 1rem;
425
+ padding: 8px 12px;
426
+ border: 1px solid `,`;
427
+ border-radius: 8px;
428
+ background: `,`;
429
+ width: 100%;
430
+ `],f("selection"),f("backgroundDarker")),ci=x(S).withConfig({displayName:"ChatMessages__DiffHeader"})([`
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: space-between;
434
+ padding-bottom: 8px;
435
+ border-bottom: 1px solid `,`;
436
+ width: 100%;
437
+ `,`
438
+ `],f("selectionDarker"),({$isExpanded:e})=>!e&&ue([`
439
+ border-bottom: 0;
440
+ padding-bottom: 0;
441
+ `])),di=x(S).withConfig({displayName:"ChatMessages__DiffHeaderLeft"})([`
442
+ display: flex;
443
+ align-items: center;
444
+ gap: 1rem;
445
+ padding: 4px 0;
446
+ `]),ui=x.span.withConfig({displayName:"ChatMessages__DiffHeaderLabel"})([`
447
+ font-size: 1.4rem;
448
+ color: `,`;
449
+ `],f("offWhite")),hi=x(S).withConfig({displayName:"ChatMessages__DiffHeaderRight"})([`
450
+ display: flex;
451
+ align-items: center;
452
+ gap: 1.8rem;
453
+ margin-left: auto;
454
+ `]),mi=x(S).withConfig({displayName:"ChatMessages__DiffHeaderStatus"})([`
455
+ display: flex;
456
+ align-items: center;
457
+ gap: 0.8rem;
458
+ color: `,`;
459
+ font-size: 1.3rem;
460
+ `],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?f("red"):a?f("cyan"):e?f("greenDarker"):f("gray2")),pi=x.span.withConfig({displayName:"ChatMessages__StatusIcon"})([`
461
+ display: flex;
462
+ align-items: center;
463
+ color: `,`;
464
+ `],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?f("red"):a?f("cyan"):e?f("greenDarker"):f("gray2")),Ct=x.button.withConfig({displayName:"ChatMessages__IconButton"})([`
465
+ display: flex;
466
+ align-items: center;
467
+ justify-content: center;
468
+ padding: 0;
469
+ background: transparent;
470
+ border: none;
471
+ cursor: pointer;
472
+ height: 22px;
473
+ width: 22px;
474
+ color: `,`;
475
+
476
+ &:hover {
477
+ svg {
478
+ filter: brightness(1.3);
479
+ }
480
+ }
481
+ `],f("gray2")),gi=x(Ct).withConfig({displayName:"ChatMessages__ExpandButton"})([`
482
+ width: 16px;
483
+ height: 16px;
484
+ `]),fi=x.div.withConfig({displayName:"ChatMessages__DiffEditorWrapper"})([`
485
+ position: relative;
486
+ height: 300px;
487
+ width: 100%;
488
+ `]),xi=x(S).withConfig({displayName:"ChatMessages__ButtonBar"})([`
489
+ padding: 0.5rem;
490
+ gap: 1rem;
491
+ justify-content: center;
492
+ flex-shrink: 0;
493
+ width: fit-content;
494
+ margin: 0 auto;
495
+ background: `,`;
496
+ border: 1px solid `,`;
497
+ border-radius: 0.4rem;
498
+ `],f("backgroundDarker"),f("selection")),yi=x(ie).withConfig({displayName:"ChatMessages__AcceptButton"})([`
499
+ background: `,`;
500
+ color: `,`;
501
+ border: 0.1rem solid `,`;
502
+ width: 10rem;
503
+
504
+ &:hover:not(:disabled) {
505
+ background: `,`;
506
+ border-color: `,`;
507
+ filter: brightness(1.2);
508
+ }
509
+ `],({theme:e})=>e.color.pinkDarker,f("foreground"),({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker),bi=x(ie).withConfig({displayName:"ChatMessages__RejectButton"})([`
510
+ background: `,`;
511
+ color: `,`;
512
+ border: 0.1rem solid `,`;
513
+ width: 10rem;
514
+
515
+ &:hover:not(:disabled) {
516
+ background: `,`;
517
+ border-color: `,`;
518
+ }
519
+ `],f("background"),f("foreground"),({theme:e})=>e.color.pinkDarker,f("selection"),({theme:e})=>e.color.pinkDarker),ki=e=>{switch(e){case"fix_request":return{icon:"/assets/icon-fix-queries.svg",title:"Fix Query",description:"Help me debug and fix the error with the attached SQL query"};case"explain_request":return{icon:"/assets/icon-explain-queries.svg",title:"Explain Query",description:"Explain this query in detail"};case"schema_explain_request":return{icon:"/assets/icon-explain-schema.svg",title:"Explain Schema",description:"Provide an overview, detailed column descriptions and storage details."};default:return null}},Ci=e=>{switch(e){case"loading":return s.jsx(O0,{});case"success":return s.jsx(ua,{});case"error":return s.jsx(da,{});default:return s.jsx(ca,{})}},wi=({messages:e,onAcceptChange:n,onRejectChange:a,onRunQuery:o,onOpenInEditor:l,onApplyToEditor:i,running:r,aiSuggestionRequest:d,queryNotifications:u,queryStartOffset:p=0,isOperationInProgress:h,editorSQL:c})=>{const b=Ft(),k=t.useRef(null),g=t.useRef(null),{status:A}=fe(),[w,y]=t.useState(!1),M=t.useRef(!1),H=t.useCallback(()=>{if(w&&M.current)return;const C=w?"smooth":"instant";setTimeout(()=>{var j;(j=k.current)==null||j.scrollIntoView({behavior:C}),y(!0)})},[w]);t.useEffect(()=>{const C=g.current;if(!C)return;const j=()=>{M.current=!0};return C.addEventListener("wheel",j),()=>C.removeEventListener("wheel",j)},[]),t.useEffect(()=>{M.current=!1},[e.length]);const _=t.useMemo(()=>{for(let C=e.length-1;C>=0;C--){const j=e[C];if(j.role==="assistant"&&j.sql)return C}return-1},[e]),I=t.useRef(_>=0?_:-1),[D,E]=t.useState(_>=0?new Set([_]):new Set);t.useEffect(()=>{_>=0&&_!==I.current&&(E(C=>new Set([...C,_])),I.current=_)},[_]);const Z=C=>C>=1e3?`${(C/1e3).toFixed(1)}K`:C.toString(),N=t.useMemo(()=>e.reduce((C,j)=>{var Y;return C+(j.hideFromUI?0:(((Y=j.operationHistory)==null?void 0:Y.length)??0)+(j.error||j.content?1:0))},0),[e]);t.useEffect(()=>{H()},[N]);const m=[];e.forEach((C,j)=>{C.hideFromUI||m.push({message:C,originalIndex:j})});const L=m.length>0?m[m.length-1].originalIndex:-1,R=t.useMemo(()=>{for(let C=e.length-1;C>=0;C--)if(e[C].role==="assistant"&&!e[C].hideFromUI)return C;return-1},[e]),q=C=>{for(let j=C+1;j<e.length;j++)if(e[j].role==="user"&&!e[j].hideFromUI)return!0;return!1};return s.jsxs(B0,{ref:g,$scrolled:w,"data-hook":"chat-messages-container",children:[m.map(({message:C,originalIndex:j})=>{var me;const Y=`${C.id}`,Ce=ze(C.sql||"")===ze(c||"");if(C.role==="user"){const v=C.displayType,Q=C.sql;if(v&&(v==="fix_request"||v==="explain_request"||v==="schema_explain_request")){const z=ki(v);let P=null;if(v==="schema_explain_request"&&C.displaySchemaData){const F=C.displaySchemaData;P=s.jsx(kt,{children:s.jsxs(Y0,{children:[s.jsx(_t,{kind:F.kind,partitionBy:F.partitionBy,walEnabled:F.walEnabled,designatedTimestamp:F.designatedTimestamp}),s.jsx(J0,{children:F.tableName})]})})}else Q&&(P=s.jsx(kt,{children:s.jsx(Mn,{"data-hook":"user-request-sql-editor",children:s.jsx(je,{value:Q,maxHeight:216,onOpenInEditor:F=>l({type:"code",value:F},Ce)})})}));return s.jsxs(Hn,{"data-hook":"chat-message-user",children:[s.jsxs(U0,{children:[s.jsx(Q0,{children:s.jsx(P0,{src:z==null?void 0:z.icon,alt:z==null?void 0:z.title})}),s.jsx(K0,{children:z==null?void 0:z.title})]}),(z==null?void 0:z.description)&&s.jsx(G0,{children:s.jsx(X0,{children:z.description})}),P]},Y)}if(v==="ask_request"&&Q){const z=C.displayUserMessage||C.content;return s.jsxs(Hn,{"data-hook":"chat-message-user",children:[s.jsx(W0,{children:s.jsx(En,{children:z})}),s.jsx(kt,{children:s.jsx(Mn,{"data-hook":"user-request-sql-editor",children:s.jsx(je,{value:Q,maxHeight:216,onOpenInEditor:P=>l({type:"code",value:P},Ce)})})})]},Y)}return s.jsx($0,{"data-hook":"chat-message-user",children:s.jsx(En,{children:C.content})},Y)}else{const v=C.explanation||C.content,Q=C.tokenUsage;let z=null;Q&&typeof Q.inputTokens=="number"&&typeof Q.outputTokens=="number"&&(z=s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontWeight:600},children:Z(Q.inputTokens)})," ","input /"," ",s.jsx("span",{style:{fontWeight:600},children:Z(Q.outputTokens)})," ","output tokens"]}));const P=!!C.sql,F=D.has(j),K=C.isAccepted===!0,T=C.isRejected===!0,ae=P&&!K&&!T&&q(j),_e=P&&!K&&!T&&!ae&&j===L;let B="neutral";if(C.sql){const X=ze(C.sql);if(r===Vt.AI_SUGGESTION&&d&&ze(d.query)===X)B="loading";else if(u){const J=ra(X,p),pe=(me=u[J])==null?void 0:me.latest;pe&&(pe.type===st.ERROR?B="error":(pe.type===st.SUCCESS||pe.type===st.INFO)&&(B="success"))}}const Oe=ct(C.previousSQL),Ve=ct(C.sql),G=C.operationHistory,Ze=!!C.error,Be=j===R&&h===!0,Ie=!!G&&G.length>0;return s.jsxs(ei,{$hasOperationHistory:Ie,"data-hook":"chat-message-assistant",children:[Ie&&s.jsxs(s.Fragment,{children:[s.jsx(ii,{}),s.jsx(oi,{$trimBottom:Ze||!C.content,children:s.jsx(ia,{operationHistory:G,status:A,isLive:Be,onScrollNeeded:H})})]}),Ze&&s.jsxs(li,{"data-hook":"chat-message-error",children:[s.jsx(Zt,{size:16,color:b.color.red,style:{flexShrink:0}}),C.error]}),C.content&&s.jsxs(s.Fragment,{children:[s.jsxs(ti,{"data-hook":"assistant-header",children:[s.jsx(Se,{size:20,variant:"filled"}),s.jsx(ni,{children:"Assistant"}),z&&s.jsxs(ai,{className:"token-display",children:[s.jsx(Bt,{size:"16px",color:b.color.gray2}),s.jsx(de,{size:"sm",color:"gray2",children:z})]})]}),s.jsxs(ri,{children:[s.jsx(z0,{content:v,messageId:C.id,onOpenInEditor:l}),P&&s.jsxs(si,{"data-hook":"inline-diff-container",children:[s.jsxs(ci,{$isExpanded:F,children:[s.jsxs(di,{children:[s.jsx(Ot,{size:22,color:"#BDBDBD"}),s.jsx(ui,{children:"Suggested change"})]}),(K||T||ae)&&s.jsxs(mi,{$isAccepted:K,$isRejected:T,$isRejectedWithFollowUp:ae,"data-hook":T?"diff-status-rejected":ae?"diff-status-followed-up":"diff-status-accepted",children:[s.jsx(pi,{$isAccepted:K,$isRejected:T,$isRejectedWithFollowUp:ae,children:T?s.jsx(oa,{size:"14px"}):ae?s.jsx(St,{size:"14px"}):s.jsx(la,{size:"14px"})}),T?"Rejected":ae?"Followed up":"Accepted"]}),s.jsxs(hi,{children:[s.jsx(Ct,{onClick:X=>{X.stopPropagation(),C.sql&&o&&o(C.sql)},title:"Run this query","data-hook":"message-action-run-sql",children:Ci(B)}),!_e&&i&&!(j===_&&K)&&!Ce&&s.jsx(Ct,{onClick:X=>{X.stopPropagation(),C.id&&C.sql&&!h&&i(C.id,C.sql)},title:"Apply to editor",disabled:h,style:{opacity:h?.5:1,cursor:h?"not-allowed":"pointer"},"data-hook":"message-action-apply",children:s.jsx($t,{size:22,color:"#BDBDBD"})}),s.jsx(gi,{title:"Expand diff view","data-hook":"diff-expand-button",onClick:()=>{E(X=>{const J=new Set(X);return J.has(j)?J.delete(j):J.add(j),J})},children:s.jsx(sa,{})})]})]}),F&&s.jsxs(s.Fragment,{children:[s.jsx(fi,{children:s.jsx(je,{diffEditor:!0,original:Oe,modified:Ve,maxHeight:300,onOpenInEditor:(X,J)=>l({type:"diff",original:X,modified:J})})}),_e&&s.jsxs(xi,{align:"center",justifyContent:"center",children:[a&&C.id&&s.jsx(bi,{onClick:()=>a(C.id),"data-hook":"message-action-reject",children:"Reject"}),n&&C.id&&s.jsx(yi,{onClick:()=>n(C.id),"data-hook":"message-action-accept",children:"Accept"})]})]})]})]})]})]},Y)}}),s.jsx("div",{ref:k})]})},Ai=x(S).withConfig({displayName:"ChatInput__InputContainer"})([`
520
+ display: flex;
521
+ flex-direction: column;
522
+ align-items: stretch;
523
+ gap: 0.8rem;
524
+ padding: 1rem 1.2rem;
525
+ flex-shrink: 0;
526
+ width: 100%;
527
+ margin-top: auto;
528
+ border-top: 1px solid `,`;
529
+ `],f("selection")),vi=x(S).withConfig({displayName:"ChatInput__InputWrapper"})([`
530
+ display: flex;
531
+ position: relative;
532
+ width: 100%;
533
+ overflow: hidden;
534
+ `]),Hi=x.textarea.withConfig({displayName:"ChatInput__StyledTextArea"})([`
535
+ flex: 1;
536
+ min-height: 8rem;
537
+ max-height: 30rem;
538
+ line-height: 1.3;
539
+ padding: `,`;
540
+ background: `,`;
541
+ border: 1px solid `,`;
542
+ border-radius: 0.6rem;
543
+ color: `,`;
544
+ font-size: 1.4rem;
545
+ font-family: `,`;
546
+ resize: none;
547
+ outline: none;
548
+
549
+ &:focus {
550
+ border-color: `,`;
551
+ }
552
+
553
+ &::placeholder {
554
+ color: `,`;
555
+ }
556
+
557
+ &:disabled {
558
+ opacity: 0.5;
559
+ }
560
+ `],({$hasContext:e})=>e?"4.4rem 4.5rem 1.2rem 1.2rem":"1.2rem 4.5rem 1.2rem 1.2rem",f("backgroundDarker"),f("selection"),f("foreground"),({theme:e})=>e.font,f("pinkDarker"),f("gray2")),Mi=x.button.withConfig({displayName:"ChatInput__ActionButton"})([`
561
+ position: absolute;
562
+ right: 0.8rem;
563
+ bottom: 0.8rem;
564
+ padding: 0.6rem;
565
+ border: none;
566
+ display: flex;
567
+ align-items: center;
568
+ justify-content: center;
569
+ border-radius: 0.4rem;
570
+ cursor: pointer;
571
+ `]),Ei=x.div.withConfig({displayName:"ChatInput__ContextBadgeContainer"})([`
572
+ position: absolute;
573
+ padding: 0.8rem;
574
+ top: 2px;
575
+ border-radius: 0.6rem;
576
+ left: 1px;
577
+ width: calc(100% - 0.2rem);
578
+ display: inline-flex;
579
+ background: `,`;
580
+ `],f("backgroundDarker")),ji=x.div.withConfig({displayName:"ChatInput__ContextBadge"})([`
581
+ display: flex;
582
+ padding: 0.3rem 0.6rem;
583
+ align-items: center;
584
+ gap: 0.4rem;
585
+ line-height: 1.4;
586
+ border-radius: 0.6rem;
587
+ border: 1px solid `,`;
588
+ background: `,`;
589
+ color: `,`;
590
+ font-size: 1.3rem;
591
+ user-select: none;
592
+
593
+ `,`
594
+ `],f("selection"),f("chatBackground"),f("gray2"),({$type:e})=>e==="sql"&&ue([`
595
+ cursor: pointer;
596
+
597
+ &:hover {
598
+ border: 1px solid `,`;
599
+ color: `,`;
600
+ }
601
+ `],f("offWhite"),f("offWhite"))),_i=x.div.withConfig({displayName:"ChatInput__ContextBadgeIcon"})([`
602
+ display: flex;
603
+ align-items: center;
604
+ color: `,`;
605
+ flex-shrink: 0;
606
+
607
+ svg {
608
+ color: `,`;
609
+ }
610
+ `],f("gray2"),f("gray2")),Vi=x(Mi).withConfig({displayName:"ChatInput__SendButton"})([`
611
+ background: `,`;
612
+ color: `,`;
613
+
614
+ &:hover:not(:disabled) {
615
+ background: `,`;
616
+ }
617
+
618
+ &:disabled {
619
+ opacity: 0.5;
620
+ cursor: not-allowed;
621
+ }
622
+ `],f("pinkDarker"),f("foreground"),f("pink")),Zi=x.div.withConfig({displayName:"ChatInput__ThoughtStream"})([`
623
+ display: flex;
624
+ position: relative;
625
+ width: 100%;
626
+ background: `,`;
627
+ border: 1px solid transparent;
628
+ background:
629
+ linear-gradient(`,", ",`)
630
+ padding-box,
631
+ `,` border-box;
632
+ border-radius: 0.6rem;
633
+ height: 4rem;
634
+
635
+ `,`
636
+ `],f("backgroundDarker"),f("backgroundDarker"),f("backgroundDarker"),ga,({$aborted:e})=>e&&ue([`
637
+ background: `,`;
638
+ border: 1px solid `,`;
639
+ `],f("backgroundDarker"),f("red"))),Ii=x.div.withConfig({displayName:"ChatInput__ThoughtStreamContent"})([`
640
+ display: flex;
641
+ align-items: center;
642
+ background: `,`;
643
+ gap: 0.8rem;
644
+ width: 100%;
645
+ height: 100%;
646
+ border-radius: 0.6rem;
647
+ padding: 0 1.2rem;
648
+ padding-right: `,`;
649
+ `],f("backgroundDarker"),({$aborted:e})=>e?"1.2rem":"4.5rem"),Li=x(Zt).withConfig({displayName:"ChatInput__CloseCircleIcon"})([`
650
+ width: 2rem;
651
+ height: 2rem;
652
+ color: `,`;
653
+ flex-shrink: 0;
654
+ `],f("red")),Ni=x.div.withConfig({displayName:"ChatInput__ThoughtText"})([`
655
+ font-weight: 500;
656
+ font-size: 1.4rem;
657
+ color: `,`;
658
+ `,`
659
+ `],f("gray2"),({$aborted:e})=>!e&&fa),Fi=x.button.withConfig({displayName:"ChatInput__StopButton"})([`
660
+ position: absolute;
661
+ right: 0.8rem;
662
+ top: 50%;
663
+ transform: translateY(-50%);
664
+ width: 2.6rem;
665
+ height: 2.6rem;
666
+ border-radius: 50%;
667
+ border: none;
668
+ display: flex;
669
+ align-items: center;
670
+ justify-content: center;
671
+ cursor: pointer;
672
+ transition: all 0.15s ease;
673
+ background: #da152832;
674
+ color: #da1e28;
675
+
676
+ &:hover {
677
+ background: `,`;
678
+ color: `,`;
679
+ }
680
+ `],f("red"),f("foreground")),jn=(e,n=30)=>{if(!e)return"";const a=e.trim().replace(/\s+/g," ");return a.length<=n?a:a.slice(0,n)+"..."},Di=e=>{switch(e){case"T":return"table";case"M":return"matview";case"V":return"view";default:return"table"}},Si=t.forwardRef(({onSend:e,disabled:n=!1,placeholder:a="Ask a question or request a refinement...",contextSQL:o,contextTableId:l,onContextClick:i},r)=>{const[d,u]=t.useState(""),p=t.useRef(null),h=le(re.query.getTables),c=t.useMemo(()=>l==null?null:h.find(E=>E.id===l)??null,[l,h]),b=c!=null&&c.table_name?jn(c.table_name):o?jn(o):null,k=!!b;t.useImperativeHandle(r,()=>({focus:()=>{var E;(E=p.current)==null||E.focus()}}));const{status:g,abortOperation:A}=fe(),w=oe(g),y=g===ma.Aborted;t.useEffect(()=>{p.current&&(p.current.style.height="auto",p.current.style.height=`${p.current.scrollHeight}px`)},[d]);const M=()=>{const E=d.trim();E&&!n&&!w&&(e(E),u(""),p.current&&(p.current.style.height="auto"))},H=E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),M())},_=()=>{c||i()},I=()=>{A()},D=w||y;return s.jsxs(Ai,{children:[D?s.jsxs(Zi,{$aborted:y,"data-hook":"chat-assistant-modes",children:[s.jsxs(Ii,{$aborted:y,children:[y?s.jsx(Li,{}):s.jsx(It,{size:20}),s.jsx(Ni,{$aborted:y,children:g})]}),!y&&s.jsx(Fi,{onClick:I,title:"Stop generation","data-hook":"chat-stop-button",children:s.jsx(pa,{size:"14px"})})]}):s.jsxs(vi,{children:[k&&s.jsx(Ei,{children:s.jsxs(ji,{role:"presentation",onClick:_,$type:c?"table":"sql","data-hook":"chat-context-badge",children:[s.jsx(_i,{children:c?s.jsx(_t,{kind:Di(c.table_type??"T"),partitionBy:c.partitionBy,walEnabled:c.walEnabled,designatedTimestamp:c.designatedTimestamp}):s.jsx(Tt,{size:14,weight:"regular"})}),b]})}),s.jsx(Hi,{ref:p,value:d,onChange:E=>u(E.target.value),onKeyDown:H,placeholder:a,disabled:n,rows:1,$hasContext:k,"data-hook":"chat-input-textarea"}),s.jsx(Vi,{onClick:M,disabled:!d.trim()||n,title:"Send (Enter) \u2022 New line (Shift+Enter)","data-hook":"chat-send-button",children:s.jsx(Dt,{size:20,weight:"bold"})})]}),s.jsx(de,{color:"gray2",size:"sm",align:"center",children:"Chats are connected to a single query to improve responses."})]})}),_n=x.div.withConfig({displayName:"ChatHistoryItem__Container"})([`
681
+ display: flex;
682
+ align-items: center;
683
+ gap: 0.6rem;
684
+ padding: 0.4rem 0.8rem;
685
+ border-radius: 4px;
686
+ cursor: `,`;
687
+ background: `,`;
688
+ opacity: `,`;
689
+
690
+ &:hover {
691
+ background: `,`;
692
+
693
+ .chat-title {
694
+ color: `,`;
695
+ }
696
+ }
697
+ `],({$disabled:e})=>e?"not-allowed":"pointer",f("transparent"),({$disabled:e})=>e?.5:1,({$disabled:e})=>e?"transparent":f("selection"),({$disabled:e})=>e?f("offWhite"):f("foreground")),qi=x.div.withConfig({displayName:"ChatHistoryItem__IconWrapper"})([`
698
+ display: flex;
699
+ align-items: center;
700
+ justify-content: center;
701
+ flex-shrink: 0;
702
+ color: `,`;
703
+ `],f("gray2")),zi=x.div.withConfig({displayName:"ChatHistoryItem__Content"})([`
704
+ display: flex;
705
+ flex-direction: column;
706
+ flex: 1;
707
+ min-width: 0;
708
+ padding-left: 0.4rem;
709
+ `]),Ri=x.div.attrs({className:"chat-title"}).withConfig({displayName:"ChatHistoryItem__Title"})([`
710
+ padding: 0.2rem 0.4rem;
711
+ border: 1px solid transparent;
712
+ color: `,`;
713
+ white-space: nowrap;
714
+ overflow: hidden;
715
+ text-overflow: ellipsis;
716
+ transform: translateX(-0.4rem);
717
+ `],f("offWhite")),Ti=x.input.withConfig({displayName:"ChatHistoryItem__TitleInput"})([`
718
+ color: `,`;
719
+ background: transparent;
720
+ border: 1px solid `,`;
721
+ border-radius: 6px;
722
+ outline: none;
723
+ padding: 0.2rem 0.4rem;
724
+ font-family: inherit;
725
+ transform: translateX(-0.4rem);
726
+
727
+ &:focus {
728
+ outline: none;
729
+ }
730
+
731
+ &::selection {
732
+ background: `,`;
733
+ }
734
+ &::-moz-selection {
735
+ background: `,`;
736
+ }
737
+ &::-webkit-selection {
738
+ background: `,`;
739
+ }
740
+ `],f("foreground"),f("pinkDarker"),f("pinkPrimary"),f("pinkPrimary"),f("pinkPrimary")),Oi=x.div.withConfig({displayName:"ChatHistoryItem__Subtitle"})([`
741
+ font-size: 1.2rem;
742
+ line-height: 1.5;
743
+ color: `,`;
744
+ white-space: nowrap;
745
+ overflow: hidden;
746
+ text-overflow: ellipsis;
747
+ `],f("gray2")),Bi=x.div.withConfig({displayName:"ChatHistoryItem__ActionsContainer"})([`
748
+ display: flex;
749
+ align-items: center;
750
+ gap: 0.4rem;
751
+ flex-shrink: 0;
752
+ `]),Vn=x.button.withConfig({displayName:"ChatHistoryItem__ActionButton"})([`
753
+ display: flex;
754
+ align-items: center;
755
+ justify-content: center;
756
+ padding: 0.4rem;
757
+ background: transparent;
758
+ border: none;
759
+ border-radius: 4px;
760
+ cursor: pointer;
761
+ color: `,`;
762
+ opacity: 0;
763
+
764
+ `,`:hover & {
765
+ opacity: 1;
766
+ }
767
+
768
+ &:hover {
769
+ background: `,`;
770
+ }
771
+ `],f("foreground"),_n,f("backgroundDarker")),$i=x.span.withConfig({displayName:"ChatHistoryItem__CurrentIndicator"})([`
772
+ font-size: 1.2rem;
773
+ line-height: 1.5rem;
774
+ color: #9ca3af;
775
+ white-space: nowrap;
776
+ `]),Wi=({conversation:e,subtitle:n,isCurrent:a,hasOngoingProcess:o,disabled:l,onSelect:i,onRename:r,onDelete:d})=>{const[u,p]=t.useState(!1),[h,c]=t.useState(e.conversationName),b=t.useRef(null);t.useEffect(()=>{u&&b.current&&(b.current.focus(),b.current.select())},[u]);const k=H=>{H.stopPropagation(),c(e.conversationName),p(!0)},g=H=>{H.stopPropagation(),d(e.id)},A=()=>{const H=h.trim();H&&H!==e.conversationName&&r(e.id,H),p(!1)},w=H=>{H.key==="Enter"?A():H.key==="Escape"&&(c(e.conversationName),p(!1))},y=()=>{A()},M=()=>{!u&&!l&&i(e.id)};return s.jsxs(_n,{onClick:M,$disabled:l,"data-hook":"chat-history-item",children:[s.jsx(qi,{children:s.jsx(qt,{size:18})}),s.jsxs(zi,{children:[u?s.jsx(Ti,{ref:b,value:h,onChange:H=>c(H.target.value),onKeyDown:w,onBlur:y,onClick:H=>H.stopPropagation(),"data-hook":"chat-history-rename"}):s.jsx(Ri,{"data-hook":"chat-history-title",children:e.conversationName}),n&&s.jsx(Oi,{children:n})]}),s.jsxs(Bi,{children:[!u&&s.jsxs(s.Fragment,{children:[s.jsx(Vn,{onClick:k,title:"Edit title","data-hook":"chat-history-edit",children:s.jsx(Ut,{size:18})}),!o&&s.jsx(Vn,{onClick:g,title:"Delete","data-hook":"chat-history-delete",children:s.jsx(Pt,{size:18})})]}),a&&s.jsx($i,{children:"Current"})]})]})},Ui=x.div.withConfig({displayName:"DateSeparator__Container"})([`
777
+ display: flex;
778
+ align-items: center;
779
+ gap: 1rem;
780
+ padding: 0.4rem 0;
781
+ width: 100%;
782
+ `]),Zn=x.div.withConfig({displayName:"DateSeparator__Line"})([`
783
+ flex: 1;
784
+ height: 1px;
785
+ background: `,`;
786
+ `],f("selection")),Qi=x.div.withConfig({displayName:"DateSeparator__LabelContainer"})([`
787
+ display: flex;
788
+ align-items: center;
789
+ gap: 0.8rem;
790
+ color: `,`;
791
+ `],f("gray2")),Pi=x.span.withConfig({displayName:"DateSeparator__Label"})([`
792
+ font-size: 1.3rem;
793
+ letter-spacing: 0.016rem;
794
+ white-space: nowrap;
795
+ `]),Ki=({label:e})=>s.jsxs(Ui,{children:[s.jsx(Zn,{}),s.jsxs(Qi,{children:[s.jsx(zt,{size:16}),s.jsx(Pi,{children:e})]}),s.jsx(Zn,{})]}),Gi=6e4;function In(e){const n=xa(),a=ba(n);return ya(e,new Date().getTime(),{locale:a})+" ago"}function Xi(e){const n=[...e].sort((i,r)=>r.updatedAt-i.updatedAt),a=new Map;for(const i of n){const r=In(i.updatedAt),d=a.get(r)||[];a.set(r,[...d,i])}const o=[],l=new Set;for(const i of n){const r=In(i.updatedAt);l.has(r)||(l.add(r),o.push({label:r,conversations:a.get(r)||[]}))}return o}function Yi(e){const[n,a]=t.useState(0);return t.useEffect(()=>{const o=setInterval(()=>{a(l=>l+1)},Gi);return()=>clearInterval(o)},[]),t.useMemo(()=>Xi(e),[e,n])}function Ji(e,n){if(!n.trim())return e;const a=n.toLowerCase().trim();return e.filter(o=>o.conversationName.toLowerCase().includes(a))}const Ln=x.div.withConfig({displayName:"ChatHistoryView__Container"})([`
796
+ display: flex;
797
+ flex-direction: column;
798
+ height: 100%;
799
+ width: 100%;
800
+ padding: 2rem 1rem 4rem 1rem;
801
+ background: `,`;
802
+ overflow: hidden;
803
+ `],f("chatBackground")),e1=x.div.withConfig({displayName:"ChatHistoryView__SearchContainer"})([`
804
+ position: relative;
805
+ display: flex;
806
+ align-items: center;
807
+ flex-shrink: 0;
808
+ `]),t1=x.div.withConfig({displayName:"ChatHistoryView__SearchIcon"})([`
809
+ position: absolute;
810
+ left: 1.2rem;
811
+ display: flex;
812
+ align-items: center;
813
+ color: `,`;
814
+ pointer-events: none;
815
+ z-index: 1;
816
+ `],f("gray2")),n1=x.button.withConfig({displayName:"ChatHistoryView__ClearButton"})([`
817
+ position: absolute;
818
+ right: 0.8rem;
819
+ display: flex;
820
+ align-items: center;
821
+ justify-content: center;
822
+ padding: 0.2rem;
823
+ background: transparent;
824
+ border: none;
825
+ border-radius: 4px;
826
+ cursor: pointer;
827
+ color: `,`;
828
+
829
+ &:hover {
830
+ color: `,`;
831
+ }
832
+ `],f("gray2"),f("foreground")),a1=x(wa).withConfig({displayName:"ChatHistoryView__SearchInput"})([`
833
+ width: 100%;
834
+ background: transparent;
835
+ color: `,`;
836
+ padding: 0.8rem 3.6rem 0.8rem 3.6rem;
837
+ border: 1px solid `,`4d;
838
+ height: 3rem;
839
+ border-radius: 0.6rem;
840
+
841
+ &:focus {
842
+ background: transparent;
843
+ border-color: `,`;
844
+ }
845
+ `],f("foreground"),f("gray2"),f("pinkDarker")),r1=x.div.withConfig({displayName:"ChatHistoryView__ListContainer"})([`
846
+ display: flex;
847
+ flex-direction: column;
848
+ gap: 0.6rem;
849
+ padding: 2rem 0.4rem;
850
+ overflow-y: auto;
851
+ flex: 1;
852
+ min-height: 0;
853
+ `]),Nn=x.div.withConfig({displayName:"ChatHistoryView__EmptyState"})([`
854
+ display: flex;
855
+ flex-direction: column;
856
+ align-items: center;
857
+ justify-content: center;
858
+ flex: 1;
859
+ color: `,`;
860
+ font-size: 1.3rem;
861
+ text-align: center;
862
+ padding: 2rem;
863
+ `],f("gray2")),i1=x(be.Content).withConfig({displayName:"ChatHistoryView__AlertDialogContent"})([`
864
+ background: `,`;
865
+ `],f("chatBackground")),o1=x.div.withConfig({displayName:"ChatHistoryView__DialogHeader"})([`
866
+ display: flex;
867
+ align-items: center;
868
+ justify-content: space-between;
869
+ padding: 1.5rem 2rem;
870
+ border-bottom: 1px solid `,`;
871
+ `],f("selection")),l1=x.h3.withConfig({displayName:"ChatHistoryView__DialogTitle"})([`
872
+ margin: 0;
873
+ font-weight: 500;
874
+ color: `,`;
875
+ `],f("foreground")),s1=x.p.withConfig({displayName:"ChatHistoryView__DialogDescription"})([`
876
+ margin: 2rem;
877
+ font-size: 1.4rem;
878
+ line-height: 1.5;
879
+ `]),c1=x.div.withConfig({displayName:"ChatHistoryView__DialogButtons"})([`
880
+ display: flex;
881
+ justify-content: flex-end;
882
+ gap: 1rem;
883
+ padding: 0 2rem 0 2rem;
884
+ `]),d1=x(ie).attrs({skin:"secondary"}).withConfig({displayName:"ChatHistoryView__CancelButton"})([""]),u1=x(ie).withConfig({displayName:"ChatHistoryView__DeleteButton"})([`
885
+ background: `,`;
886
+ border-color: `,`;
887
+
888
+ &:hover:not(:disabled) {
889
+ background: `,`;
890
+ filter: brightness(1.1);
891
+ }
892
+ `],f("red"),f("red"),f("red")),h1=({currentConversationId:e})=>{const[n,a]=t.useState(""),[o,l]=t.useState(!1),[i,r]=t.useState(null),d=t.useRef(null),{conversationMetas:u,chatWindowState:p,openChatWindow:h,updateConversationName:c,deleteConversation:b}=De(),{status:k}=fe(),{buffers:g}=at(),A=le(re.query.getTables),w=t.useMemo(()=>Array.from(u.values()),[u]),y=t.useMemo(()=>Ji(w,n),[w,n]),M=Yi(y),H=(N,m)=>{if(N){if(m==="buffer"){const L=g.find(R=>R.id===N);if(L)return L.label}else if(m==="table"){const L=A.find(R=>R.id===N);if(L)return L.table_name}}},_=N=>{h(N)},I=(N,m)=>{c(N,m)},D=N=>{r(N),l(!0)},E=()=>{i&&b(i),l(!1),r(null)},Z=()=>{l(!1),r(null)};return t.useEffect(()=>{d.current&&d.current.scrollIntoView({block:"center"})},[]),w.length===0?s.jsx(Ln,{children:s.jsx(Nn,{"data-hook":"chat-history-empty",children:"No conversations yet"})}):s.jsxs(Ln,{children:[s.jsxs(e1,{children:[s.jsx(t1,{children:s.jsx(Wt,{size:18})}),s.jsx(a1,{type:"text",placeholder:"Search chats",value:n,onChange:N=>a(N.target.value),onKeyDown:N=>{N.key==="Escape"&&n&&a("")},"data-hook":"chat-history-search"}),n&&s.jsx(n1,{onClick:()=>a(""),title:"Clear search",children:s.jsx(Lt,{size:16})})]}),s.jsxs(r1,{"data-hook":"chat-history-list",children:[M.map((N,m)=>s.jsxs(Nt.Fragment,{children:[m>0&&s.jsx(Ki,{label:N.label}),N.conversations.map(L=>{const R=L.id===e;return s.jsx("div",{ref:R?d:void 0,children:s.jsx(Wi,{conversation:L,subtitle:L.bufferId??L.tableId?H(L.bufferId??L.tableId,L.bufferId?"buffer":"table"):void 0,isCurrent:R,hasOngoingProcess:L.id===p.activeConversationId&&oe(k),disabled:oe(k)&&L.id!==p.activeConversationId,onSelect:_,onRename:I,onDelete:D})},L.id)})]},N.label)),y.length===0&&n&&s.jsx(Nn,{children:"No chats match your search"})]}),s.jsx(be.Root,{open:o,onOpenChange:l,children:s.jsxs(be.Portal,{children:[s.jsx(ka,{children:s.jsx(Ca,{primitive:be.Overlay})}),s.jsxs(i1,{maxwidth:"40rem",children:[s.jsx(o1,{children:s.jsx(l1,{children:"Delete conversation"})}),s.jsx(s1,{children:"Are you sure you want to delete this conversation? This action cannot be undone."}),s.jsxs(c1,{children:[s.jsx(be.Cancel,{asChild:!0,children:s.jsx(d1,{onClick:Z,children:"Cancel"})}),s.jsx(be.Action,{asChild:!0,children:s.jsx(u1,{onClick:E,children:"Delete"})})]})]})]})})]})},m1=x.div.withConfig({displayName:"AIChatWindow__Container"})([`
893
+ display: flex;
894
+ flex-direction: column;
895
+ height: 100%;
896
+ width: 100%;
897
+ overflow: hidden;
898
+ background: `,`;
899
+ border-left: 0.2rem `,` solid;
900
+ `],f("chatBackground"),f("backgroundDarker")),p1=x.div.withConfig({displayName:"AIChatWindow__Header"})([`
901
+ height: 46px;
902
+ padding: 0 1.5rem;
903
+ display: flex;
904
+ align-items: center;
905
+ justify-content: space-between;
906
+ background: `,`;
907
+ flex-shrink: 0;
908
+ `],f("backgroundLighter")),g1=x.div.withConfig({displayName:"AIChatWindow__HeaderLeft"})([`
909
+ display: flex;
910
+ align-items: center;
911
+ gap: 1rem;
912
+ flex: 1;
913
+ min-width: 0;
914
+ overflow: hidden;
915
+ `]),f1=x.span.withConfig({displayName:"AIChatWindow__HeaderTitle"})([`
916
+ white-space: nowrap;
917
+ overflow: hidden;
918
+ text-overflow: ellipsis;
919
+ font-size: 1.6rem;
920
+ `]),wt=x(ie).attrs(({$active:e})=>({skin:"transparent",$active:e})).withConfig({displayName:"AIChatWindow__HeaderButton"})([`
921
+ color: `,`;
922
+ padding: 0.6rem;
923
+
924
+ `,`
925
+ `],f("foreground"),({$active:e})=>e&&ue([`
926
+ background: `,`;
927
+ `],f("selection"))),x1=x.div.withConfig({displayName:"AIChatWindow__HeaderRight"})([`
928
+ display: flex;
929
+ align-items: center;
930
+ gap: 0.5rem;
931
+ flex-shrink: 0;
932
+ `]),y1=x.div.withConfig({displayName:"AIChatWindow__ChatWindowContent"})([`
933
+ display: flex;
934
+ height: calc(100% - 46px);
935
+ width: 100%;
936
+ overflow: hidden;
937
+ `]),b1=x.div.withConfig({displayName:"AIChatWindow__InitialQueryContainer"})([`
938
+ display: flex;
939
+ flex-direction: column;
940
+ gap: 1rem;
941
+ padding: 1.5rem;
942
+ overflow-y: auto;
943
+ flex: 1 1 auto;
944
+ min-height: 0;
945
+ width: 100%;
946
+ `]),k1=x.div.withConfig({displayName:"AIChatWindow__InitialQueryBox"})([`
947
+ display: flex;
948
+ flex-direction: column;
949
+ align-self: flex-end;
950
+ flex-shrink: 0;
951
+ overflow: hidden;
952
+ width: 100%;
953
+ `]),C1=x.div.withConfig({displayName:"AIChatWindow__InitialQueryEditor"})([`
954
+ width: 100%;
955
+ overflow: hidden;
956
+ `]),w1=x.div.withConfig({displayName:"AIChatWindow__ButtonContainer"})([`
957
+ display: flex;
958
+ justify-content: flex-start;
959
+ align-items: center;
960
+ gap: 1rem;
961
+ width: 100%;
962
+ margin-top: 0.5rem;
963
+ `]),A1=x.div.withConfig({displayName:"AIChatWindow__BlankChatContainer"})([`
964
+ display: flex;
965
+ flex-direction: column;
966
+ align-items: flex-start;
967
+ justify-content: center;
968
+ gap: 1.2rem;
969
+ padding: 1.8rem;
970
+ flex: 1 1 auto;
971
+ min-height: 0;
972
+ max-width: 40rem;
973
+ text-align: center;
974
+ margin: 0 auto;
975
+ `]),v1=x.h2.withConfig({displayName:"AIChatWindow__BlankChatHeading"})([`
976
+ font-size: 2rem;
977
+ font-weight: 600;
978
+ text-align: left;
979
+ color: `,`;
980
+ margin: 0;
981
+ `],f("foreground")),H1=x.p.withConfig({displayName:"AIChatWindow__BlankChatSubheading"})([`
982
+ font-size: 1.4rem;
983
+ font-weight: 400;
984
+ color: `,`;
985
+ text-align: left;
986
+ margin: 0;
987
+ line-height: 1.5;
988
+ `],f("gray2")),Fn=x(S).withConfig({displayName:"AIChatWindow__ChatPanel"})([`
989
+ display: flex;
990
+ flex-direction: column;
991
+ align-items: stretch;
992
+ height: 100%;
993
+ width: 100%;
994
+ gap: 0;
995
+ `]),M1=()=>{const e=ja(),n=le(re.console.getActiveSidebar),{quest:a}=t.useContext(Ge),{editorRef:o,showPreviewBuffer:l,closePreviewBuffer:i,executionRefs:r,highlightQuery:d}=at(),{conversationMetas:u,activeConversationMessages:p,chatWindowState:h,isLoadingMessages:c,closeChatWindow:b,openBlankChatWindow:k,openHistoryView:g,closeHistoryView:A,getConversationMeta:w,addMessage:y,updateMessage:M,replaceConversationMessages:H,updateConversationName:_,acceptSuggestion:I,rejectSuggestion:D,persistMessages:E}=De(),{status:Z,setStatus:N,abortController:m,canUse:L,hasSchemaAccess:R,currentModel:q,apiKey:C}=fe(),j=le(re.query.getTables),Y=le(re.query.getRunning),Ce=le(re.query.getAISuggestionRequest),me=h.activeConversationId?w(h.activeConversationId):null,v=t.useMemo(()=>me?{...me,messages:p}:null,[me,p]),Q=v==null?void 0:v.bufferId,z=le(re.query.getQueryNotificationsForBuffer(Q??-1)),P=t.useRef(null),F=t.useMemo(()=>ct(v==null?void 0:v.currentSQL),[v]),K=t.useMemo(()=>Aa(v==null?void 0:v.queryKey),[v==null?void 0:v.queryKey]),T=p,ae=t.useMemo(()=>va(T),[T]),_e=t.useMemo(()=>T.length>0&&!c,[T,c]),B=t.useMemo(()=>T.length===0&&F&&F.trim()!==`
996
+ `&&L&&!oe(Z),[T.length,F,L,Z]),Oe=t.useMemo(()=>!B||!v||!v.queryKey||!v.bufferId||!o.current?!1:Kt(v.queryKey,v.bufferId,r,o)!==null,[B,v,o,r]),Ve=B&&Oe&&L&&!oe(Z),G=h.isHistoryOpen??!1,Ze=u.size>0,Be=t.useMemo(()=>oe(Z)?!0:v?v.messages.length===0&&!v.queryKey&&!v.tableId:!1,[v,Z]),Ie=t.useMemo(()=>{if(G)return"Chat history";if(!v)return"";if(v.conversationName)return v.conversationName;const V=v.messages[0];if(V!=null&&V.displayType)switch(V.displayType){case"fix_request":return"Fix query";case"explain_request":return"Explain query";case"ask_request":return"Ask AI";default:return"AI Assistant"}return"AI Assistant"},[v,G]),X=t.useCallback(()=>{G?A():g()},[G,A,g]),J=()=>T.length>0?"Ask a follow up question or request refinement...":(v==null?void 0:v.tableId)!=null||F!=null&&F.trim()?"Ask a question or request an edit...":"Ask AI about your tables, or generate a query...",pe=(V,W=!1)=>{if(!L||!h.activeConversationId||!v)return;const ee=h.activeConversationId;W&&i();const we=v.messages.some(te=>te.role==="assistant");let Ne=V,Ue,Qe,Pe;!we&&F&&F.trim()&&(Ne=`Current SQL query:
997
+ \`\`\`sql
998
+ ${F}
999
+ \`\`\`
1000
+
1001
+ User request: ${V}`,Ue="ask_request",Qe=F.trim(),Pe=V),we||Ae.publish(ve.AI_QUERY_HIGHLIGHT,ee);const Rn={role:"user",content:Ne,timestamp:Date.now(),...Ue&&{displayType:Ue},...Qe&&{sql:Qe},...Pe&&{displayUserMessage:Pe}};y(Rn);const Fe=crypto.randomUUID();y({id:Fe,role:"assistant",content:"",timestamp:Date.now(),operationHistory:[]});const Ke=Xe(q),Tn={model:q,provider:Ke,apiKey:C};if(!we){const te=Ye.find(O=>O.isTestModel&&O.provider===Ke);te&&Je({firstUserMessage:Ne,settings:{model:te.value,provider:Ke,apiKey:C}}).then(O=>{O&&_(ee,O)})}const On=te=>{M(ee,Fe,{operationHistory:[...te]})};(async()=>{const te=await et({userMessage:Ne,conversationHistory:v.messages.filter(ge=>!ge.isCompacted),currentSQL:F,settings:Tn,modelToolsClient:nt(a,R?j:void 0),setStatus:(ge,Bn)=>N(ge,{...Bn??{},conversationId:ee},On),abortSignal:m==null?void 0:m.signal});if(tt(te)){const ge=te;M(ee,Fe,{error:ge.type!=="aborted"?ge.message:"Operation has been cancelled"});return}const O=te;let Ht=O.explanation||"Response received";const Mt="sql"in O&&O.sql&&O.sql.trim()!=="";Mt&&(Ht=`SQL Query:
1002
+ \`\`\`sql
1003
+ ${O.sql}
1004
+ \`\`\`
1005
+
1006
+ Explanation:
1007
+ ${O.explanation||""}`),O.compactedConversationHistory&&H(ee,O.compactedConversationHistory),M(ee,Fe,{content:Ht,...Mt&&{sql:O.sql},explanation:O.explanation,tokenUsage:O.tokenUsage})})().then(async()=>{await E(ee)})},Dn=t.useCallback(async V=>{h.activeConversationId&&(await I({conversationId:h.activeConversationId,messageId:V}),e(dt.query.setAISuggestionRequest(null)))},[h.activeConversationId,I]),Sn=t.useCallback(async V=>{h.activeConversationId&&(await D(h.activeConversationId,V),setTimeout(()=>{var W;(W=P.current)==null||W.focus()},100))},[h.activeConversationId,D]),qn=t.useCallback(V=>{const W=V.trim().endsWith(";")?V.trim().slice(0,-1):V.trim();e(dt.query.setAISuggestionRequest({query:W,startOffset:K.startOffset})),e(dt.query.toggleRunning(Vt.AI_SUGGESTION))},[K.startOffset]),$e=t.useCallback(async()=>!(v!=null&&v.queryKey)||!(v!=null&&v.bufferId)?!1:await d(v.queryKey,v.bufferId),[v,d]),At=t.useCallback(async(V,W=!1)=>{if(!(W&&await $e()))if(V.type==="diff"){if(!h.activeConversationId)return;l({type:"diff",original:V.original,modified:V.modified,conversationId:h.activeConversationId})}else l({type:"code",value:V.value})},[l,h.activeConversationId,$e]),zn=t.useCallback(async(V,W)=>{if(!h.activeConversationId)return;const ee=Ha(W,!1);try{await I({conversationId:h.activeConversationId,messageId:V,skipDefaultMessage:!0}),y({role:"user",content:`User replaced query with one of your previous suggestions. Now the query is:
1008
+
1009
+ \`\`\`sql
1010
+ ${ee.replaceAll(/\s+/g," ").trim()}
1011
+ \`\`\``,timestamp:Date.now(),hideFromUI:!0}),await E(h.activeConversationId)}catch(we){console.error("Error applying SQL to editor:",we),Ma.error("Failed to apply changes to editor")}},[h.activeConversationId,I,y,E]),vt=t.useRef(null),Le=t.useCallback(()=>{var V,W;(W=(V=vt.current)==null?void 0:V.querySelector('button[data-hook="button-explain-query"]'))==null||W.click()},[]),We=t.useCallback(V=>{B&&(V.metaKey||V.ctrlKey)&&(V.key==="e"||V.key==="E")&&(V.preventDefault(),Le())},[B]);return t.useEffect(()=>{if(B)return Ae.subscribe(ve.EXPLAIN_QUERY_EXEC,Le),document.addEventListener("keydown",We),()=>{document.removeEventListener("keydown",We),Ae.unsubscribe(ve.EXPLAIN_QUERY_EXEC,Le)}},[B,We,Le]),n!=="aiChat"||!v&&!G?null:s.jsxs(m1,{"data-hook":"ai-chat-window",children:[s.jsxs(p1,{children:[s.jsxs(g1,{children:[s.jsx(Se,{size:20,variant:"filled"}),s.jsx(f1,{"data-hook":"chat-window-title",children:Ie})]}),s.jsxs(x1,{children:[s.jsx(wt,{onClick:k,title:"New chat",disabled:Be,"data-hook":"chat-window-new",children:s.jsx(Qt,{size:16,weight:"bold"})}),s.jsx(wt,{$active:G,onClick:X,title:G?"Back to chat":"Chat history",disabled:!Ze||oe(Z),"data-hook":"chat-window-history",children:s.jsx(Rt,{size:16,weight:"bold"})}),s.jsx(wt,{onClick:b,title:"Close","data-hook":"chat-window-close",children:s.jsx(Lt,{size:16,weight:"bold"})})]})]}),s.jsx(y1,{children:c?s.jsx(Fn,{children:s.jsx(It,{size:20,style:{margin:"auto"}})}):G?s.jsx(h1,{currentConversationId:h.previousConversationId??null}):s.jsxs(Fn,{children:[_e?s.jsx(wi,{messages:T,onAcceptChange:Dn,onRejectChange:Sn,onRunQuery:qn,onOpenInEditor:At,onApplyToEditor:zn,running:Y,aiSuggestionRequest:Ce,queryNotifications:z,queryStartOffset:K.startOffset,isOperationInProgress:oe(Z),editorSQL:K.queryText}):F&&F.trim()?s.jsxs(b1,{children:[s.jsx(k1,{"data-hook":"chat-initial-query-box",children:s.jsx(C1,{"data-hook":"chat-lite-editor",children:s.jsx(je,{value:F.trim(),maxHeight:216,onOpenInEditor:V=>At({type:"code",value:V},!0)})})}),(B||Ve)&&s.jsxs(w1,{ref:vt,children:[B&&s.jsx(Qa,{conversationId:v.id,queryText:F.trim()}),Ve&&s.jsx(Ka,{})]})]}):s.jsxs(A1,{"data-hook":"chat-blank-state",children:[s.jsx(v1,{children:"Leverage AI directly in your database"}),s.jsx(H1,{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."})]}),s.jsx(Si,{ref:P,onSend:V=>pe(V,ae),disabled:!L||oe(Z),placeholder:J(),contextSQL:K.queryText,contextTableId:v==null?void 0:v.tableId,onContextClick:$e})]})})]})};export{M1 as default};