react-semaphor 0.1.31 → 0.1.32

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.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as a, jsx as e, Fragment as q } from "react/jsx-runtime";
2
- import { c as ce, a2 as Ys, u as Q, a3 as St, a4 as kt, B as z, a5 as Dt, a6 as He, a7 as qs, _ as pt, a8 as Ze, a9 as lt, aa as El, ab as Ke, ac as rt, ad as it, ae as ot, af as gt, ag as $, ah as Ae, ai as Tt, I as ge, aj as Ks, ak as Xt, al as pi, am as Qn, an as Js, f as B, ao as Ws, ap as fi, aq as Al, ar as gi, as as vi, at as ma, au as re, w as Hn, av as xi, aw as yi, ax as Zt, ay as Ye, az as ne, aA as Ee, aB as Ct, aC as Ue, aD as Na, aE as sa, aF as ba, aG as Ni, aH as na, aI as vt, aJ as Je, aK as We, aL as Ca, aM as Xe, aN as Me, aO as tt, aP as Qs, aQ as Xa, aR as ha, aS as jt, aT as Ut, aU as Hs, aV as Xs, aW as bi, aX as Oa, aY as Zs, aZ as en, a_ as tn, a$ as an, R as Ot, b0 as Il, b1 as Ci, b2 as sn, b3 as Ra, b4 as nn, b5 as ln, b6 as wa, b7 as Sa, b8 as ka, b9 as rn, ba as os, bb as on, bc as Ol, bd as Rl, be as cn, bf as me, bg as he, bh as pe, bi as fe, bj as H, bk as Fl, bl as Pl, bm as wi, bn as Si, bo as Rt, bp as ki, bq as Di, br as Ft, bs as Pt, bt as Ve, bu as dt, bv as bt, a0 as O, bw as Mt, bx as cs, by as ds, bz as dn, bA as Ti, bB as mt, bC as Rs, bD as $t, bE as Fs, bF as Ll, bG as zl, bH as Mi, bI as un, bJ as mn, bK as hn, bL as pn, bM as fn, bN as gn, bO as vn, bP as xn, bQ as Ei, bR as us, bS as Fa, a1 as oe, bT as Ai, bU as wt, bV as Ii, o as la, bW as Vl, bX as $e, bY as Oi, bZ as Pa, b_ as Za, b$ as yn, c0 as Ka, c1 as La, c2 as Nn, c3 as Ri, c4 as Fi, c5 as Pi, c6 as Li, c7 as zi, v as Vi, c8 as es, c9 as _l, ca as ms, cb as _i, cc as st, cd as ji, ce as Ui, cf as Ja, cg as $i, ch as Wa, ci as Qa, cj as hs, W as za, A as Xn, Q as Zn, K as jl, J as Ul, y as zt, z as Gi, G as Bi, T as Yi, ck as el, cl as tl, cm as ps, cn as fs, co as gs, cp as Va, cq as qi, cr as ts, cs as _t, ct as $l, cu as vs, cv as Gl, cw as ht, cx as Se, cy as ke, cz as De, cA as Bl, cB as Ma, cC as Yl, cD as ql, cE as _a, g as Gt, cF as al, cG as Kl, cH as Ki, cI as Ps, cJ as Jl, cK as bn, cL as Wl, cM as Ea, cN as sl, cO as Ji, cP as Wi, cQ as Qi, cR as Ql, cS as Hi, cT as Xi, cU as Hl, cV as Zi, cW as xs, cX as eo, cY as to, cZ as Ls, c_ as ea, c$ as nt, d0 as ta, d1 as ao, d2 as so, d3 as ys, d4 as no, d5 as Cn, d6 as lo, d7 as wn, d8 as ro, d9 as Xl, da as Ha, db as Zl, dc as io, dd as oo, de as co, df as Sn, dg as uo, dh as mo, di as nl, dj as ho, E as ja, b as kn, dk as po, dl as fo, dm as go, dn as vo, dp as xo, dq as yo, dr as er, ds as Dn, dt as tr, du as ar, dv as sr, dw as nr, dx as lr, dy as Tn, dz as Mn, dA as rr, dB as ir, dC as or, dD as En, dE as Ns, dF as bs, dG as No, P as Bt, e as Yt, dH as bo, dI as Wt, dJ as Co, dK as wo, dL as So, dM as ko, dN as Do, dO as To, dP as cr, dQ as ut, dR as Aa, dS as as, dT as Vt, h as ra, dU as Mo, dV as Eo, dW as Ao, dX as Io, dY as Oo, dZ as dr, d_ as Ro, i as Cs, j as ws, k as Ss, l as ks, m as ua, n as Ua, d$ as Fo, e0 as ft, e1 as Ga, e2 as ll, e3 as Po, e4 as rl, e5 as Lo, e6 as zo, e7 as Vo, e8 as _o, e9 as il, ea as jo, eb as Uo, ec as $o, ed as Go, ee as Bo, ef as Yo, O as ol, eg as cl, eh as qo, ei as Ko, ej as ur, ek as Jo, el as mr, em as Wo, en as Qo, eo as Ho, ep as Xo, eq as Zo, er as ec, es as tc, et as ac, eu as sc, ev as nc, ew as lc, ex as rc, ey as ic, ez as oc, eA as cc, eB as dc, eC as hr, eD as Ms, eE as An, eF as uc, eG as mc, eH as hc, eI as pc, eJ as pa, eK as fa, eL as fc, eM as pr, eN as gc, eO as zs, eP as vc, eQ as xc, eR as yc, eS as ss, eT as Qt, eU as Vs, eV as _s, eW as ns, eX as fr, eY as ga, eZ as va, e_ as In, e$ as Nc, f0 as bc, f1 as Cc, f2 as wc, f3 as Sc, f4 as kc, f5 as Dc, f6 as Tc, f7 as Es, f8 as Mc, f9 as Ec, fa as Ac, F as gr, fb as Ic, fc as Oc, fd as Rc, fe as vr, ff as xr, fg as Fc, fh as yr, fi as Pc, fj as Lc, fk as zc, fl as Vc, fm as _c, S as jc, fn as Uc, U as $c, fo as Gc, C as Bc } from "./index-HexevzNd.js";
2
+ import { c as ce, a2 as Ys, u as Q, a3 as St, a4 as kt, B as z, a5 as Dt, a6 as He, a7 as qs, _ as pt, a8 as Ze, a9 as lt, aa as El, ab as Ke, ac as rt, ad as it, ae as ot, af as gt, ag as $, ah as Ae, ai as Tt, I as ge, aj as Ks, ak as Xt, al as pi, am as Qn, an as Js, f as B, ao as Ws, ap as fi, aq as Al, ar as gi, as as vi, at as ma, au as re, w as Hn, av as xi, aw as yi, ax as Zt, ay as Ye, az as ne, aA as Ee, aB as Ct, aC as Ue, aD as Na, aE as sa, aF as ba, aG as Ni, aH as na, aI as vt, aJ as Je, aK as We, aL as Ca, aM as Xe, aN as Me, aO as tt, aP as Qs, aQ as Xa, aR as ha, aS as jt, aT as Ut, aU as Hs, aV as Xs, aW as bi, aX as Oa, aY as Zs, aZ as en, a_ as tn, a$ as an, R as Ot, b0 as Il, b1 as Ci, b2 as sn, b3 as Ra, b4 as nn, b5 as ln, b6 as wa, b7 as Sa, b8 as ka, b9 as rn, ba as os, bb as on, bc as Ol, bd as Rl, be as cn, bf as me, bg as he, bh as pe, bi as fe, bj as H, bk as Fl, bl as Pl, bm as wi, bn as Si, bo as Rt, bp as ki, bq as Di, br as Ft, bs as Pt, bt as Ve, bu as dt, bv as bt, a0 as O, bw as Mt, bx as cs, by as ds, bz as dn, bA as Ti, bB as mt, bC as Rs, bD as $t, bE as Fs, bF as Ll, bG as zl, bH as Mi, bI as un, bJ as mn, bK as hn, bL as pn, bM as fn, bN as gn, bO as vn, bP as xn, bQ as Ei, bR as us, bS as Fa, a1 as oe, bT as Ai, bU as wt, bV as Ii, o as la, bW as Vl, bX as $e, bY as Oi, bZ as Pa, b_ as Za, b$ as yn, c0 as Ka, c1 as La, c2 as Nn, c3 as Ri, c4 as Fi, c5 as Pi, c6 as Li, c7 as zi, v as Vi, c8 as es, c9 as _l, ca as ms, cb as _i, cc as st, cd as ji, ce as Ui, cf as Ja, cg as $i, ch as Wa, ci as Qa, cj as hs, W as za, A as Xn, Q as Zn, K as jl, J as Ul, y as zt, z as Gi, G as Bi, T as Yi, ck as el, cl as tl, cm as ps, cn as fs, co as gs, cp as Va, cq as qi, cr as ts, cs as _t, ct as $l, cu as vs, cv as Gl, cw as ht, cx as Se, cy as ke, cz as De, cA as Bl, cB as Ma, cC as Yl, cD as ql, cE as _a, g as Gt, cF as al, cG as Kl, cH as Ki, cI as Ps, cJ as Jl, cK as bn, cL as Wl, cM as Ea, cN as sl, cO as Ji, cP as Wi, cQ as Qi, cR as Ql, cS as Hi, cT as Xi, cU as Hl, cV as Zi, cW as xs, cX as eo, cY as to, cZ as Ls, c_ as ea, c$ as nt, d0 as ta, d1 as ao, d2 as so, d3 as ys, d4 as no, d5 as Cn, d6 as lo, d7 as wn, d8 as ro, d9 as Xl, da as Ha, db as Zl, dc as io, dd as oo, de as co, df as Sn, dg as uo, dh as mo, di as nl, dj as ho, E as ja, b as kn, dk as po, dl as fo, dm as go, dn as vo, dp as xo, dq as yo, dr as er, ds as Dn, dt as tr, du as ar, dv as sr, dw as nr, dx as lr, dy as Tn, dz as Mn, dA as rr, dB as ir, dC as or, dD as En, dE as Ns, dF as bs, dG as No, P as Bt, e as Yt, dH as bo, dI as Wt, dJ as Co, dK as wo, dL as So, dM as ko, dN as Do, dO as To, dP as cr, dQ as ut, dR as Aa, dS as as, dT as Vt, h as ra, dU as Mo, dV as Eo, dW as Ao, dX as Io, dY as Oo, dZ as dr, d_ as Ro, i as Cs, j as ws, k as Ss, l as ks, m as ua, n as Ua, d$ as Fo, e0 as ft, e1 as Ga, e2 as ll, e3 as Po, e4 as rl, e5 as Lo, e6 as zo, e7 as Vo, e8 as _o, e9 as il, ea as jo, eb as Uo, ec as $o, ed as Go, ee as Bo, ef as Yo, O as ol, eg as cl, eh as qo, ei as Ko, ej as ur, ek as Jo, el as mr, em as Wo, en as Qo, eo as Ho, ep as Xo, eq as Zo, er as ec, es as tc, et as ac, eu as sc, ev as nc, ew as lc, ex as rc, ey as ic, ez as oc, eA as cc, eB as dc, eC as hr, eD as Ms, eE as An, eF as uc, eG as mc, eH as hc, eI as pc, eJ as pa, eK as fa, eL as fc, eM as pr, eN as gc, eO as zs, eP as vc, eQ as xc, eR as yc, eS as ss, eT as Qt, eU as Vs, eV as _s, eW as ns, eX as fr, eY as ga, eZ as va, e_ as In, e$ as Nc, f0 as bc, f1 as Cc, f2 as wc, f3 as Sc, f4 as kc, f5 as Dc, f6 as Tc, f7 as Es, f8 as Mc, f9 as Ec, fa as Ac, F as gr, fb as Ic, fc as Oc, fd as Rc, fe as vr, ff as xr, fg as Fc, fh as yr, fi as Pc, fj as Lc, fk as zc, fl as Vc, fm as _c, S as jc, fn as Uc, U as $c, fo as Gc, C as Bc } from "./index-C5-7DCLL.js";
3
3
  import * as js from "react";
4
4
  import qe, { useState as _, useRef as yt, useEffect as ye, useMemo as et, useCallback as Ce, useContext as On, Suspense as Nr } from "react";
5
5
  import { createPortal as Yc } from "react-dom";
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("react/jsx-runtime"),s=require("./index-BdPUTTPW.js"),k=require("react"),Vt=require("react-dom");function zt(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return n.default=t,Object.freeze(n)}const ss=zt(k);/**
1
+ "use strict";const e=require("react/jsx-runtime"),s=require("./index-p33qmYMH.js"),k=require("react"),Vt=require("react-dom");function zt(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return n.default=t,Object.freeze(n)}const ss=zt(k);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -90475,21 +90475,36 @@ function h$({
90475
90475
  {
90476
90476
  components: {
90477
90477
  // Override how paragraphs are rendered
90478
- p: ({ node: s, ...l }) => /* @__PURE__ */ p("p", { className: X("text-sm leading-relaxed mb-4 text-foreground/90", n), ...l }),
90478
+ p: ({ node: s, ...l }) => /* @__PURE__ */ p(
90479
+ "p",
90480
+ {
90481
+ className: X(
90482
+ "mb-4 text-sm leading-relaxed text-foreground/90",
90483
+ n
90484
+ ),
90485
+ ...l
90486
+ }
90487
+ ),
90479
90488
  code: ({ node: s, ...l }) => {
90480
90489
  var u, d;
90481
90490
  const c = (d = (u = s == null ? void 0 : s.children) == null ? void 0 : u[0]) == null ? void 0 : d.value;
90482
90491
  return c && /^#([0-9a-fA-F]{6})$/.test(c) ? /* @__PURE__ */ p(
90483
90492
  "code",
90484
90493
  {
90485
- className: X("rounded-lg bg-muted px-2.5 py-1.5 text-sm font-mono", n),
90494
+ className: X(
90495
+ "rounded-lg bg-muted px-2.5 py-1.5 font-mono text-sm",
90496
+ n
90497
+ ),
90486
90498
  style: { backgroundColor: c },
90487
90499
  ...l
90488
90500
  }
90489
90501
  ) : /* @__PURE__ */ p(
90490
90502
  "code",
90491
90503
  {
90492
- className: X("rounded-lg bg-muted/50 border border-border/50 px-2 py-1 text-sm font-mono text-foreground/80 transition-colors hover:bg-muted/70", n),
90504
+ className: X(
90505
+ "rounded-lg border border-border/50 bg-muted/50 px-2 py-1 font-mono text-xs text-foreground/80 transition-colors hover:bg-muted/70",
90506
+ n
90507
+ ),
90493
90508
  ...l
90494
90509
  }
90495
90510
  );
@@ -90512,36 +90527,96 @@ function h$({
90512
90527
  ul: ({ node: s, ...l }) => /* @__PURE__ */ p(
90513
90528
  "ul",
90514
90529
  {
90515
- className: X("mb-4 ml-6 list-disc space-y-2 text-sm marker:text-muted-foreground", n),
90530
+ className: X(
90531
+ "mb-4 ml-6 list-disc space-y-2 text-sm marker:text-muted-foreground",
90532
+ n
90533
+ ),
90516
90534
  ...l
90517
90535
  }
90518
90536
  ),
90519
90537
  ol: ({ node: s, ...l }) => /* @__PURE__ */ p(
90520
90538
  "ol",
90521
90539
  {
90522
- className: X("mb-4 ml-6 list-decimal space-y-2 text-sm marker:text-muted-foreground", n),
90540
+ className: X(
90541
+ "mb-4 ml-6 list-decimal space-y-2 text-sm marker:text-muted-foreground",
90542
+ n
90543
+ ),
90544
+ ...l
90545
+ }
90546
+ ),
90547
+ li: ({ node: s, ...l }) => /* @__PURE__ */ p(
90548
+ "li",
90549
+ {
90550
+ className: X("pl-2 leading-relaxed text-foreground/90", n),
90523
90551
  ...l
90524
90552
  }
90525
90553
  ),
90526
- li: ({ node: s, ...l }) => /* @__PURE__ */ p("li", { className: X("pl-2 leading-relaxed text-foreground/90", n), ...l }),
90527
90554
  a: ({ node: s, ...l }) => /* @__PURE__ */ p(
90528
90555
  "a",
90529
90556
  {
90530
90557
  target: "_blank",
90531
90558
  rel: "noopener noreferrer",
90532
- className: X("text-blue-600 underline underline-offset-2 decoration-1 transition-all hover:text-blue-700 hover:decoration-2", n),
90559
+ className: X(
90560
+ "text-blue-600 underline decoration-1 underline-offset-2 transition-all hover:text-blue-700 hover:decoration-2",
90561
+ n
90562
+ ),
90563
+ ...l
90564
+ }
90565
+ ),
90566
+ h1: ({ node: s, ...l }) => /* @__PURE__ */ p(
90567
+ "h1",
90568
+ {
90569
+ className: X(
90570
+ "mb-4 mt-6 text-2xl font-semibold tracking-tight text-foreground",
90571
+ n
90572
+ ),
90573
+ ...l
90574
+ }
90575
+ ),
90576
+ h2: ({ node: s, ...l }) => /* @__PURE__ */ p(
90577
+ "h2",
90578
+ {
90579
+ className: X(
90580
+ "mb-3 mt-5 text-xl font-semibold tracking-tight text-foreground",
90581
+ n
90582
+ ),
90583
+ ...l
90584
+ }
90585
+ ),
90586
+ h3: ({ node: s, ...l }) => /* @__PURE__ */ p(
90587
+ "h3",
90588
+ {
90589
+ className: X(
90590
+ "mb-2 mt-4 text-lg font-medium text-foreground",
90591
+ n
90592
+ ),
90593
+ ...l
90594
+ }
90595
+ ),
90596
+ h4: ({ node: s, ...l }) => /* @__PURE__ */ p(
90597
+ "h4",
90598
+ {
90599
+ className: X(
90600
+ "mb-2 mt-3 text-base font-medium text-foreground/90",
90601
+ n
90602
+ ),
90603
+ ...l
90604
+ }
90605
+ ),
90606
+ strong: ({ node: s, ...l }) => /* @__PURE__ */ p(
90607
+ "strong",
90608
+ {
90609
+ className: X("font-semibold text-foreground", n),
90533
90610
  ...l
90534
90611
  }
90535
90612
  ),
90536
- h1: ({ node: s, ...l }) => /* @__PURE__ */ p("h1", { className: X("text-2xl font-semibold tracking-tight mb-4 mt-6 text-foreground", n), ...l }),
90537
- h2: ({ node: s, ...l }) => /* @__PURE__ */ p("h2", { className: X("text-xl font-semibold tracking-tight mb-3 mt-5 text-foreground", n), ...l }),
90538
- h3: ({ node: s, ...l }) => /* @__PURE__ */ p("h3", { className: X("text-lg font-medium mb-2 mt-4 text-foreground", n), ...l }),
90539
- h4: ({ node: s, ...l }) => /* @__PURE__ */ p("h4", { className: X("text-base font-medium mb-2 mt-3 text-foreground/90", n), ...l }),
90540
- strong: ({ node: s, ...l }) => /* @__PURE__ */ p("strong", { className: X("font-semibold text-foreground", n), ...l }),
90541
90613
  blockquote: ({ node: s, ...l }) => /* @__PURE__ */ p(
90542
90614
  "blockquote",
90543
90615
  {
90544
- className: X("my-4 border-l-4 border-muted-foreground/30 bg-muted/20 pl-4 pr-4 py-3 italic text-foreground/80 rounded-r-md", n),
90616
+ className: X(
90617
+ "my-4 rounded-r-md border-l-4 border-muted-foreground/30 bg-muted/20 py-3 pl-4 pr-4 italic text-foreground/80",
90618
+ n
90619
+ ),
90545
90620
  ...l
90546
90621
  }
90547
90622
  ),
@@ -90549,10 +90624,7 @@ function h$({
90549
90624
  table: ({ node: s, ...l }) => /* @__PURE__ */ p("div", { className: "my-6 overflow-x-auto rounded-lg border border-border/50 shadow-sm", children: /* @__PURE__ */ p(
90550
90625
  "table",
90551
90626
  {
90552
- className: X(
90553
- "w-full table-auto border-collapse text-sm",
90554
- n
90555
- ),
90627
+ className: X("w-full table-auto border-collapse text-sm", n),
90556
90628
  ...l
90557
90629
  }
90558
90630
  ) }),
@@ -90572,18 +90644,33 @@ function h$({
90572
90644
  }
90573
90645
  );
90574
90646
  },
90575
- tr: ({ node: s, ...l }) => /* @__PURE__ */ p("tr", { className: X("border-b border-border/30 transition-colors hover:bg-muted/30 last:border-0", n), ...l }),
90647
+ tr: ({ node: s, ...l }) => /* @__PURE__ */ p(
90648
+ "tr",
90649
+ {
90650
+ className: X(
90651
+ "border-b border-border/30 transition-colors last:border-0 hover:bg-muted/30",
90652
+ n
90653
+ ),
90654
+ ...l
90655
+ }
90656
+ ),
90576
90657
  th: ({ node: s, ...l }) => /* @__PURE__ */ p(
90577
90658
  "th",
90578
90659
  {
90579
90660
  className: X(
90580
- "px-4 py-3 text-left font-medium text-sm tracking-wide",
90661
+ "px-4 py-3 text-left text-sm font-medium tracking-wide",
90581
90662
  n
90582
90663
  ),
90583
90664
  ...l
90584
90665
  }
90585
90666
  ),
90586
- td: ({ node: s, ...l }) => /* @__PURE__ */ p("td", { className: X("px-4 py-3 align-top text-foreground/90", n), ...l })
90667
+ td: ({ node: s, ...l }) => /* @__PURE__ */ p(
90668
+ "td",
90669
+ {
90670
+ className: X("px-4 py-3 align-top text-foreground/90", n),
90671
+ ...l
90672
+ }
90673
+ )
90587
90674
  // You can add more overrides for other elements like h1, h2, etc.
90588
90675
  },
90589
90676
  remarkPlugins: [rVe],
@@ -927,7 +927,7 @@ prismjs/prism.js:
927
927
  `))+1))}const i="#".repeat(o),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(i+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
928
928
  `,...s.current()});return/^[\t ]/.test(c)&&(c=hg(c.charCodeAt(0))+c.slice(1)),c=c?i+" "+c:i,n.options.closeAtx&&(c+=" "+i),l(),a(),c}PK.peek=U7e;function PK(e){return e.value||""}function U7e(){return"<"}AK.peek=W7e;function AK(e,t,n,r){const o=TD(n),s=o==='"'?"Quote":"Apostrophe",i=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),a()),c+=l.move(")"),i(),c}function W7e(){return"!"}IK.peek=q7e;function IK(e,t,n,r){const o=e.referenceType,s=n.enter("imageReference");let i=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),i();const u=n.stack;n.stack=[],i=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return i(),n.stack=u,s(),o==="full"||!c||c!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function q7e(){return"!"}OK.peek=G7e;function OK(e,t,n){let r=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const i=n.unsafe[s],a=n.compilePattern(i);let l;if(i.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return o+r+o}function G7e(){return"`"}function FK(e,t){const n=SD(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$K.peek=Y7e;function $K(e,t,n,r){const o=TD(n),s=o==='"'?"Quote":"Apostrophe",i=n.createTracker(r);let a,l;if(FK(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let f=i.move("<");return f+=i.move(n.containerPhrasing(e,{before:f,after:">",...i.current()})),f+=i.move(">"),a(),n.stack=u,f}a=n.enter("link"),l=n.enter("label");let c=i.move("[");return c+=i.move(n.containerPhrasing(e,{before:c,after:"](",...i.current()})),c+=i.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=i.move("<"),c+=i.move(n.safe(e.url,{before:c,after:">",...i.current()})),c+=i.move(">")):(l=n.enter("destinationRaw"),c+=i.move(n.safe(e.url,{before:c,after:e.title?" ":")",...i.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=i.move(" "+o),c+=i.move(n.safe(e.title,{before:c,after:o,...i.current()})),c+=i.move(o),l()),c+=i.move(")"),a(),c}function Y7e(e,t,n){return FK(e,n)?"<":"["}LK.peek=Z7e;function LK(e,t,n,r){const o=e.referenceType,s=n.enter("linkReference");let i=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),i();const u=n.stack;n.stack=[],i=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return i(),n.stack=u,s(),o==="full"||!c||c!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Z7e(){return"["}function PD(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function K7e(e){const t=PD(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function X7e(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function zK(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Q7e(e,t,n,r){const o=n.enter("list"),s=n.bulletCurrent;let i=e.ordered?X7e(n):PD(n);const a=e.ordered?i==="."?")":".":K7e(n);let l=t&&n.bulletLastUsed?i===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),zK(n)===i&&u){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(i=a),n.bulletCurrent=i;const c=n.containerFlow(e,r);return n.bulletLastUsed=i,n.bulletCurrent=s,o(),c}function J7e(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function eBe(e,t,n,r){const o=J7e(n);let s=n.bulletCurrent||PD(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let i=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(i-s.length)),a.shift(i);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(f,h,p){return h?(p?"":" ".repeat(i))+f:(p?s:s+" ".repeat(i-s.length))+f}}function tBe(e,t,n,r){const o=n.enter("paragraph"),s=n.enter("phrasing"),i=n.containerPhrasing(e,r);return s(),o(),i}const nBe=$1(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rBe(e,t,n,r){return(e.children.some(function(i){return nBe(i)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oBe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}BK.peek=sBe;function BK(e,t,n,r){const o=oBe(n),s=n.enter("strong"),i=n.createTracker(r),a=i.move(o+o);let l=i.move(n.containerPhrasing(e,{after:o,before:a,...i.current()}));const c=l.charCodeAt(0),u=bv(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=hg(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=bv(r.after.charCodeAt(0),f,o);h.inside&&(l=l.slice(0,-1)+hg(f));const p=i.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},a+l+p}function sBe(e,t,n){return n.options.strong||"*"}function iBe(e,t,n,r){return n.safe(e.value,r)}function aBe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function lBe(e,t,n){const r=(zK(n)+(n.options.ruleSpaces?" ":"")).repeat(aBe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const VK={blockquote:D7e,break:P4,code:F7e,definition:L7e,emphasis:TK,hardBreak:P4,heading:H7e,html:PK,image:AK,imageReference:IK,inlineCode:OK,link:$K,linkReference:LK,list:Q7e,listItem:eBe,paragraph:tBe,root:rBe,strong:BK,text:iBe,thematicBreak:lBe};function cBe(){return{enter:{table:uBe,tableData:A4,tableHeader:A4,tableRow:fBe},exit:{codeText:hBe,table:dBe,tableData:jE,tableHeader:jE,tableRow:jE}}}function uBe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function dBe(e){this.exit(e),this.data.inTable=void 0}function fBe(e){this.enter({type:"tableRow",children:[]},e)}function jE(e){this.exit(e)}function A4(e){this.enter({type:"tableCell",children:[]},e)}function hBe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pBe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pBe(e,t){return t==="|"?t:e}function mBe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
929
929
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:i,tableCell:l,tableRow:a}};function i(p,m,b,y){return c(u(p,b,y),p.align)}function a(p,m,b,y){const g=f(p,b,y),x=c([g]);return x.slice(0,x.indexOf(`
930
- `))}function l(p,m,b,y){const g=b.enter("tableCell"),x=b.enter("phrasing"),v=b.containerPhrasing(p,{...y,before:s,after:s});return x(),g(),v}function c(p,m){return R7e(p,{align:m,alignDelimiters:r,padding:n,stringLength:o})}function u(p,m,b){const y=p.children;let g=-1;const x=[],v=m.enter("table");for(;++g<y.length;)x[g]=f(y[g],m,b);return v(),x}function f(p,m,b){const y=p.children;let g=-1;const x=[],v=m.enter("tableRow");for(;++g<y.length;)x[g]=l(y[g],p,m,b);return v(),x}function h(p,m,b){let y=VK.inlineCode(p,m,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function gBe(){return{exit:{taskListCheckValueChecked:I4,taskListCheckValueUnchecked:I4,paragraph:yBe}}}function bBe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xBe}}}function I4(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function yBe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let s=-1,i;for(;++s<o.length;){const a=o[s];if(a.type==="paragraph"){i=a;break}}i===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function xBe(e,t,n,r){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(i);let l=VK.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+i}}function vBe(){return[Q9e(),x7e(),C7e(),cBe(),gBe()]}function wBe(e){return{extensions:[J9e(),v7e(e),E7e(),mBe(e),bBe()]}}const SBe={tokenize:jBe,partial:!0},HK={tokenize:RBe,partial:!0},UK={tokenize:MBe,partial:!0},WK={tokenize:DBe,partial:!0},CBe={tokenize:TBe,partial:!0},qK={name:"wwwAutolink",tokenize:kBe,previous:YK},GK={name:"protocolAutolink",tokenize:_Be,previous:ZK},el={name:"emailAutolink",tokenize:NBe,previous:KK},la={};function EBe(){return{text:la}}let Ec=48;for(;Ec<123;)la[Ec]=el,Ec++,Ec===58?Ec=65:Ec===91&&(Ec=97);la[43]=el;la[45]=el;la[46]=el;la[95]=el;la[72]=[el,GK];la[104]=[el,GK];la[87]=[el,qK];la[119]=[el,qK];function NBe(e,t,n){const r=this;let o,s;return i;function i(f){return!Ok(f)||!KK.call(r,r.previous)||AD(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Ok(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(CBe,u,c)(f):f===45||f===95||Ur(f)?(s=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),o=!0,l}function u(f){return s&&o&&oo(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function kBe(e,t,n){const r=this;return o;function o(i){return i!==87&&i!==119||!YK.call(r,r.previous)||AD(r.events)?n(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(SBe,e.attempt(HK,e.attempt(UK,s),n),n)(i))}function s(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function _Be(e,t,n){const r=this;let o="",s=!1;return i;function i(f){return(f===72||f===104)&&ZK.call(r,r.previous)&&!AD(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(oo(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=o.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?c:(s=!0,l)):n(f)}function c(f){return f===null||hv(f)||pn(f)||Hu(f)||I1(f)?n(f):e.attempt(HK,e.attempt(UK,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function jBe(e,t,n){let r=0;return o;function o(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),o):i===46&&r===3?(e.consume(i),s):n(i)}function s(i){return i===null?n(i):t(i)}}function RBe(e,t,n){let r,o,s;return i;function i(c){return c===46||c===95?e.check(WK,l,a)(c):c===null||pn(c)||Hu(c)||c!==45&&I1(c)?l(c):(s=!0,e.consume(c),i)}function a(c){return c===95?r=!0:(o=r,r=void 0),e.consume(c),i}function l(c){return o||r||!s?n(c):t(c)}}function MBe(e,t){let n=0,r=0;return o;function o(i){return i===40?(n++,e.consume(i),o):i===41&&r<n?s(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(WK,t,s)(i):i===null||pn(i)||Hu(i)?t(i):(e.consume(i),o)}function s(i){return i===41&&r++,e.consume(i),o}}function DBe(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),o):a===60||a===null||pn(a)||Hu(a)?t(a):n(a)}function o(a){return a===null||a===40||a===91||pn(a)||Hu(a)?t(a):r(a)}function s(a){return oo(a)?i(a):n(a)}function i(a){return a===59?(e.consume(a),r):oo(a)?(e.consume(a),i):n(a)}}function TBe(e,t,n){return r;function r(s){return e.consume(s),o}function o(s){return Ur(s)?n(s):t(s)}}function YK(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pn(e)}function ZK(e){return!oo(e)}function KK(e){return!(e===47||Ok(e))}function Ok(e){return e===43||e===45||e===46||e===95||Ur(e)}function AD(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const PBe={tokenize:BBe,partial:!0};function ABe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$Be,continuation:{tokenize:LBe},exit:zBe}},text:{91:{name:"gfmFootnoteCall",tokenize:FBe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IBe,resolveTo:OBe}}}}function IBe(e,t,n){const r=this;let o=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!i||!i._balanced)return n(l);const c=Qs(r.sliceSerialize({start:i.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function OBe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function FBe(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,i;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!i||f===null||f===91||pn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return o.includes(Qs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return pn(f)||(i=!0),s++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function $Be(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,i=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(i>999||m===93&&!a||m===null||m===91||pn(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Qs(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return pn(m)||(a=!0),i++,e.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(e.consume(m),i++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o.includes(s)||o.push(s),zt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function LBe(e,t,n){return e.check(Mb,t,e.attempt(PBe,t,n))}function zBe(e){e.exit("gfmFootnoteDefinition")}function BBe(e,t,n){const r=this;return zt(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(s):n(s)}}function VBe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(i,a){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let c=l;for(;c--;)if(i[c][0]==="exit"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[c][1].end.offset-i[c][1].start.offset){i[l][1].type="strikethroughSequence",i[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},i[c][1].start),end:Object.assign({},i[l][1].end)},f={type:"strikethroughText",start:Object.assign({},i[c][1].end),end:Object.assign({},i[l][1].start)},h=[["enter",u,a],["enter",i[c][1],a],["exit",i[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&Uo(h,h.length,0,O1(p,i.slice(c+1,l),a)),Uo(h,h.length,0,[["exit",f,a],["enter",i[l][1],a],["exit",i[l][1],a],["exit",u,a]]),Uo(i,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function s(i,a,l){const c=this.previous,u=this.events;let f=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(i.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const b=sh(c);if(m===126)return f>1?l(m):(i.consume(m),f++,p);if(f<2&&!n)return l(m);const y=i.exit("strikethroughSequenceTemporary"),g=sh(m);return y._open=!g||g===2&&!!b,y._close=!b||b===2&&!!g,a(m)}}}class HBe{constructor(){this.map=[]}add(t,n,r){UBe(this,t,n,r)}consume(t){if(this.map.sort(function(s,i){return s[0]-i[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const s of o)t.push(s);o=r.pop()}this.map.length=0}}function UBe(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function WBe(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function qBe(){return{flow:{null:{name:"table",tokenize:GBe,resolveAll:YBe}}}}function GBe(e,t,n){const r=this;let o=0,s=0,i;return a;function a(R){let M=r.events.length-1;for(;M>-1;){const I=r.events[M][1].type;if(I==="lineEnding"||I==="linePrefix")M--;else break}const T=M>-1?r.events[M][1].type:null,O=T==="tableHead"||T==="tableRow"?S:l;return O===S&&r.parser.lazy[r.now().line]?n(R):O(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(i=!0,s+=1),u(R)}function u(R){return R===null?n(R):qe(R)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),p):n(R):kt(R)?zt(e,u,"whitespace")(R):(s+=1,i&&(i=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),i=!0,u):(e.enter("data"),f(R)))}function f(R){return R===null||R===124||pn(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?h:f)}function h(R){return R===92||R===124?(e.consume(R),f):f(R)}function p(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),i=!1,kt(R)?zt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?y(R):R===124?(i=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),b):C(R)}function b(R){return kt(R)?zt(e,y,"whitespace")(R):y(R)}function y(R){return R===58?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),g):R===45?(s+=1,g(R)):R===null||qe(R)?w(R):C(R)}function g(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):C(R)}function x(R){return R===45?(e.consume(R),x):R===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(R))}function v(R){return kt(R)?zt(e,w,"whitespace")(R):w(R)}function w(R){return R===124?m(R):R===null||qe(R)?!i||o!==s?C(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):C(R)}function C(R){return n(R)}function S(R){return e.enter("tableRow"),N(R)}function N(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),N):R===null||qe(R)?(e.exit("tableRow"),t(R)):kt(R)?zt(e,N,"whitespace")(R):(e.enter("data"),j(R))}function j(R){return R===null||R===124||pn(R)?(e.exit("data"),N(R)):(e.consume(R),R===92?_:j)}function _(R){return R===92||R===124?(e.consume(R),j):j(R)}}function YBe(e,t){let n=-1,r=!0,o=0,s=[0,0,0,0],i=[0,0,0,0],a=!1,l=0,c,u,f;const h=new HBe;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(O4(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],i=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),o=m.type==="tableDelimiterRow"?2:u?3:1):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(s[1]!==0&&(i[0]=i[1],f=o0(h,t,s,o,void 0,f),s=[0,0,0,0]),i[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(i[0]=i[1],f=o0(h,t,s,o,void 0,f)),s=i,i=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(i[0]=i[1],f=o0(h,t,s,o,n,f)):i[1]!==0&&(f=o0(h,t,i,o,n,f)),o=0):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=n)}for(l!==0&&O4(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=WBe(t.events,n))}return e}function o0(e,t,n,r,o,s){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Od(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Od(t.events,n[1]);if(s={type:i,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Od(t.events,n[2]),u=Od(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return o!==void 0&&(s.end=Object.assign({},Od(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function O4(e,t,n,r,o){const s=[],i=Od(t.events,n);o&&(o.end=Object.assign({},i),s.push(["exit",o,t])),r.end=Object.assign({},i),s.push(["exit",r,t]),e.add(n+1,0,s)}function Od(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZBe={name:"tasklistCheck",tokenize:XBe};function KBe(){return{text:{91:ZBe}}}function XBe(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return pn(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),i):n(l)}function i(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return qe(l)?t(l):kt(l)?e.check({tokenize:QBe},t,n)(l):n(l)}}function QBe(e,t,n){return zt(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function JBe(e){return nK([EBe(),ABe(),VBe(e),qBe(),KBe()])}const eVe={};function tVe(e){const t=this,n=e||eVe,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(JBe(n)),s.push(vBe()),i.push(wBe(n))}const Dl=E.forwardRef(({children:e,className:t,tooltip:n,onClick:r,openDelay:o=300,buttonProps:s,disabled:i,...a},l)=>d.jsx(Ya,{children:d.jsxs(Xo,{delayDuration:o,children:[d.jsx(Qo,{asChild:!0,children:d.jsx(le,{disabled:i,ref:l,size:"sm",variant:"ghost",onClick:r,...a,...s,className:K(`${Jd}`,t),children:e})}),n&&d.jsx(js,{side:"bottom",sideOffset:10,children:n})]})}));Dl.displayName="IconButton";var ID="Collapsible",[nVe,XK]=mr(ID),[rVe,OD]=nVe(ID),QK=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[l=!1,c]=jr({prop:r,defaultProp:o,onChange:i});return d.jsx(rVe,{scope:n,disabled:s,contentId:qn(),open:l,onOpenToggle:k.useCallback(()=>c(u=>!u),[c]),children:d.jsx(Me.div,{"data-state":zD(l),"data-disabled":s?"":void 0,...a,ref:t})})});QK.displayName=ID;var JK="CollapsibleTrigger",FD=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=OD(JK,n);return d.jsx(Me.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":zD(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:we(e.onClick,o.onOpenToggle)})});FD.displayName=JK;var $D="CollapsibleContent",LD=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OD($D,e.__scopeCollapsible);return d.jsx(Gn,{present:n||o.open,children:({present:s})=>d.jsx(oVe,{...r,ref:t,present:s})})});LD.displayName=$D;var oVe=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=OD($D,n),[a,l]=k.useState(r),c=k.useRef(null),u=ot(t,c),f=k.useRef(0),h=f.current,p=k.useRef(0),m=p.current,b=i.open||a,y=k.useRef(b),g=k.useRef(void 0);return k.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),_r(()=>{const x=c.current;if(x){g.current=g.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const v=x.getBoundingClientRect();f.current=v.height,p.current=v.width,y.current||(x.style.transitionDuration=g.current.transitionDuration,x.style.animationName=g.current.animationName),l(r)}},[i.open,r]),d.jsx(Me.div,{"data-state":zD(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...s,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:b&&o})});function zD(e){return e?"open":"closed"}var eX=QK,sVe=FD,iVe=LD;const ih=eX,ah=FD,lh=LD;function tX(){const{authToken:e,tokenProps:t}=Ue(),{currentUser:n}=Xi(),r=Ki({mutationFn:async o=>{if(!(e!=null&&e.accessToken))throw new Error("No authentication token available");const i=`${t.apiServiceUrl||""}/v1/feedback`,a={...o,user:n,tokenContext:t},l=await tc(i,e.accessToken,a,"POST");if(!l||!l.success)throw new Error((l==null?void 0:l.error)||"Failed to send feedback");return l},onSuccess:o=>{Le.success(`Feedback sent successfully! Issue: ${o.issueNumber}`,{duration:5e3})},onError:o=>{console.error("Feedback submission error:",o),Le.error("Failed to send feedback. Please try again later.",{duration:5e3})}});return{sendFeedback:r.mutate,sendFeedbackAsync:r.mutateAsync,isLoading:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,data:r.data,reset:r.reset}}function V1(e,t,n){return{category:e,userMessage:n,systemState:t,metadata:{url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString(),viewport:`${window.innerWidth}x${window.innerHeight}`}}}function pg({open:e,onOpenChange:t,feedbackData:n,onSuccess:r,showDebugInfo:o=!1}){var g,x,v,w,C,S,N,j,_,R,M,T,O;const[s,i]=E.useState(""),[a,l]=E.useState(!1),{sendFeedback:c,isLoading:u,isSuccess:f,data:h,reset:p}=tX();E.useEffect(()=>{f&&r&&r()},[f,r]);const m=()=>{const I={...n,userMessage:s.trim()||void 0};c(I)},b=()=>{i(""),l(!1),p(),t(!1)},y={category:n.category,error:{message:(g=n.systemState)==null?void 0:g.errorMessage,sql:(x=n.systemState)==null?void 0:x.generatedSql,errorSql:(v=n.systemState)==null?void 0:v.errorSql},assistantType:(w=n.systemState)==null?void 0:w.assistantType,toolType:(C=n.systemState)==null?void 0:C.toolType,userQuery:(S=n.systemState)==null?void 0:S.userQuery,messages:(N=n.systemState)==null?void 0:N.messages,aiContext:(j=n.systemState)==null?void 0:j.aiContext,toolInput:(_=n.systemState)==null?void 0:_.toolInput,toolOutput:(R=n.systemState)==null?void 0:R.toolOutput,cardConfig:(M=n.systemState)==null?void 0:M.cardConfig,dataSource:(T=n.systemState)==null?void 0:T.dataSource,filters:(O=n.systemState)==null?void 0:O.dashboardFilters,metadata:n.metadata};return d.jsx(ai,{open:e,onOpenChange:b,children:d.jsxs(Ms,{className:"max-w-2xl",children:[d.jsxs(Ds,{children:[d.jsx(Ts,{children:f?"Feedback Sent Successfully":n.category==="dashboard-assistant"||n.category==="editor-assistant"?"Report an issue":"Report Query Generation Issue"}),d.jsx(Qi,{children:f?`Your feedback has been submitted with issue number: ${h==null?void 0:h.issueNumber}`:n.category==="dashboard-assistant"||n.category==="editor-assistant"?"Help us improve the AI responses. Your feedback will be sent to our support team.":"Help us improve by reporting this query generation issue. Your feedback will be sent to our support team."})]}),!f&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(ue,{htmlFor:"message",children:"Additional Information (Optional)"}),d.jsx(ph,{id:"message",placeholder:"Please describe what you were trying to do when this error occurred...",value:s,onChange:I=>i(I.target.value),className:"min-h-[100px] resize-none ring-inset focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0",disabled:u})]}),o&&d.jsxs(ih,{open:a,onOpenChange:l,children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ah,{asChild:!0,children:d.jsxs(le,{variant:"ghost",size:"sm",className:"flex flex-1 items-center justify-between p-2 hover:bg-muted",children:[d.jsx("span",{className:"text-sm font-medium",children:"View data to be sent"}),a?d.jsx(Eo,{className:"h-4 w-4"}):d.jsx(Js,{className:"h-4 w-4"})]})}),d.jsx(rh,{text:JSON.stringify(y,null,2),className:"h-8 w-8 shrink-0"})]}),d.jsx(lh,{className:"mt-2",children:d.jsx(Wi,{className:"h-[300px] w-full rounded-md border bg-muted/50 p-4",children:d.jsx("div",{className:"text-xs overflow-auto break-all whitespace-pre-wrap",children:d.jsx(Fl,{code:JSON.stringify(y,null,2),language:"json"})})})})]})]}),d.jsxs(li,{children:[d.jsx(le,{variant:"outline",onClick:b,disabled:u,children:"Cancel"}),d.jsx(le,{onClick:m,disabled:u,className:"min-w-[100px]",children:u?d.jsxs(d.Fragment,{children:[d.jsx(Ns,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Feedback"})]})]}),f&&d.jsxs("div",{className:"flex flex-col items-center space-y-4 py-6",children:[d.jsx(Nne,{className:"h-12 w-12 text-green-600"}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-lg font-medium",children:"Thank you for your feedback!"}),d.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Issue Number:"," ",d.jsx("span",{className:"font-mono font-medium",children:h==null?void 0:h.issueNumber})]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Our support team will review your feedback and take appropriate action."})]}),d.jsx(le,{onClick:b,className:"mt-4",children:"Close"})]})]})})}var Xl=(e=>(e.QUERY_GENERATION="query-generation",e.DASHBOARD_ASSISTANT="dashboard-assistant",e.EDITOR_ASSISTANT="editor-assistant",e))(Xl||{});function aVe(e,t){var r;if(!e||e.length===0)return"";const n=e.findIndex(o=>o.id===t);if(n===-1)return"";for(let o=n-1;o>=0;o--)if(e[o].role==="user"){const s=(r=e[o].parts)==null?void 0:r.find(i=>i.type==="text");return(s==null?void 0:s.text)||""}return""}function lVe({messageId:e,messageText:t,messages:n,className:r}){const[o,s]=E.useState("none"),[i,a]=E.useState(!1),[l,c]=E.useState(null),u=O_(),f=mh(),{isLoading:h}=tX(),{isLocalDev:p,isConsoleMode:m}=vb(),b=async()=>{if(o==="positive"){s("none"),Le.info("Feedback removed");return}s("positive"),Le.success("Thank you for your feedback!")},y=()=>{const v=aVe(n,e),w=u==="dashboard"?Xl.DASHBOARD_ASSISTANT:Xl.EDITOR_ASSISTANT,C=V1(w,{assistantType:u,userQuery:v,messages:n,aiContext:f,messageId:e,feedbackType:"negative",assistantResponse:t});c(C),a(!0)},g=v=>{a(v),v||c(null)},x=()=>{s("negative")};return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K("flex items-center gap-1",r),children:[d.jsx(Dl,{onClick:b,disabled:h,tooltip:o==="positive"?"Positive feedback given (click to undo)":"Helpful response",className:K("h-6 w-6 p-1",o==="positive"?"text-green-600 dark:text-green-500":"text-muted-foreground hover:text-foreground"),children:d.jsx(Lne,{className:K("h-3.5 w-3.5",o==="positive"&&"fill-current")})}),d.jsx(Dl,{onClick:y,disabled:h,tooltip:o==="negative"?"Negative feedback given (click to update)":"Report issue",className:K("h-6 w-6 p-1",o==="negative"?"text-red-600 dark:text-red-500":"text-muted-foreground hover:text-foreground"),children:d.jsx($ne,{className:K("h-3.5 w-3.5",o==="negative"&&"fill-current")})})]}),l&&d.jsx(pg,{open:i,onOpenChange:g,feedbackData:l,onSuccess:x,showDebugInfo:m||p})]})}function F4({text:e,handleRun:t,className:n,messageId:r,messages:o}){const s=te(a=>a.themeStyle),i={p:({node:a,...l})=>d.jsx("p",{className:K("text-sm leading-relaxed mb-4 text-foreground/90",n),...l}),code:({node:a,...l})=>{var u,f;const c=(f=(u=a==null?void 0:a.children)==null?void 0:u[0])==null?void 0:f.value;return c&&/^#([0-9a-fA-F]{6})$/.test(c)?d.jsx("code",{className:K("rounded-lg bg-muted px-2.5 py-1.5 text-sm font-mono",n),style:{backgroundColor:c},...l}):d.jsx("code",{className:K("rounded-lg bg-muted/50 border border-border/50 px-2 py-1 text-sm font-mono text-foreground/80 transition-colors hover:bg-muted/70",n),...l})},pre:a=>d.jsx(q9e,{...a,handleRun:t}),ul:({node:a,...l})=>d.jsx("ul",{className:K("mb-4 ml-6 list-disc space-y-2 text-sm marker:text-muted-foreground",n),...l}),ol:({node:a,...l})=>d.jsx("ol",{className:K("mb-4 ml-6 list-decimal space-y-2 text-sm marker:text-muted-foreground",n),...l}),li:({node:a,...l})=>d.jsx("li",{className:K("pl-2 leading-relaxed text-foreground/90",n),...l}),a:({node:a,...l})=>d.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:K("text-blue-600 underline underline-offset-2 decoration-1 transition-all hover:text-blue-700 hover:decoration-2",n),...l}),h1:({node:a,...l})=>d.jsx("h1",{className:K("text-2xl font-semibold tracking-tight mb-4 mt-6 text-foreground",n),...l}),h2:({node:a,...l})=>d.jsx("h2",{className:K("text-xl font-semibold tracking-tight mb-3 mt-5 text-foreground",n),...l}),h3:({node:a,...l})=>d.jsx("h3",{className:K("text-lg font-medium mb-2 mt-4 text-foreground",n),...l}),h4:({node:a,...l})=>d.jsx("h4",{className:K("text-base font-medium mb-2 mt-3 text-foreground/90",n),...l}),strong:({node:a,...l})=>d.jsx("strong",{className:K("font-semibold text-foreground",n),...l}),blockquote:({node:a,...l})=>d.jsx("blockquote",{className:K("my-4 border-l-4 border-muted-foreground/30 bg-muted/20 pl-4 pr-4 py-3 italic text-foreground/80 rounded-r-md",n),...l}),table:({node:a,...l})=>d.jsx("div",{className:"my-6 overflow-x-auto rounded-lg border border-border/50 shadow-sm",children:d.jsx("table",{className:K("w-full table-auto border-collapse text-sm",n),...l})}),thead:({node:a,...l})=>{var c,u,f,h,p,m;return d.jsx("thead",{style:{backgroundColor:(f=(u=(c=s==null?void 0:s.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor)==null?void 0:f[0],color:Aa((m=(p=(h=s==null?void 0:s.chart)==null?void 0:h.dataset)==null?void 0:p.backgroundColor)==null?void 0:m[0])},className:"sticky top-0",...l})},tr:({node:a,...l})=>d.jsx("tr",{className:K("border-b border-border/30 transition-colors hover:bg-muted/30 last:border-0",n),...l}),th:({node:a,...l})=>d.jsx("th",{className:K("px-4 py-3 text-left font-medium text-sm tracking-wide",n),...l}),td:({node:a,...l})=>d.jsx("td",{className:K("px-4 py-3 align-top text-foreground/90",n),...l})};return d.jsxs("div",{className:"group relative pr-16",children:[d.jsx(F8e,{components:i,remarkPlugins:[tVe],children:e}),r&&d.jsx("div",{className:"absolute right-0 top-1 opacity-0 transition-opacity group-hover:opacity-100",children:d.jsx(lVe,{messageId:r,messageText:e,messages:o})})]})}const Uu=["image/png","image/jpeg","image/jpg","image/gif","image/webp"],cVe=["application/pdf","text/plain","text/markdown"],uVe=["text/csv","application/json","text/xml","application/xml"],dVe=["text/javascript","application/javascript","text/typescript","application/x-typescript","text/x-python","application/x-python-code","text/x-sql","application/sql"],fVe=[...Uu,...cVe,...uVe,...dVe],nX=10*1024*1024,xa=5,rX={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".csv":"text/csv",".json":"application/json",".xml":"text/xml",".js":"text/javascript",".jsx":"text/javascript",".ts":"text/typescript",".tsx":"text/typescript",".py":"text/x-python",".sql":"text/x-sql"};function hVe(e){if(fVe.includes(e.type))return!0;const t=BD(e.name);return t?Object.prototype.hasOwnProperty.call(rX,t):!1}function BD(e){const t=e.lastIndexOf(".");return t===-1?"":e.substring(t).toLowerCase()}function oX(e){if(e.type)return e.type;const t=BD(e.name);return rX[t]||"application/octet-stream"}function pVe(e){return e.size<=nX}function mg(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+n[r]}function $4(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const s=r.result.split(",")[1];t(s)},r.onerror=n,r.readAsDataURL(e)})}function mVe(e){return new Promise((t,n)=>{if(!Uu.includes(oX(e))){n(new Error("Not an image file"));return}const r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}async function VD(e){const t=oX(e),n=Uu.includes(t),r={id:crypto.randomUUID(),name:e.name,size:e.size,type:t};if(n)try{r.preview=await mVe(e),r.data=r.preview.split(",")[1]}catch(o){console.error("Failed to create image preview:",o),r.data=await $4(e)}else r.data=await $4(e);return r}function sX(e){const t=[],n=[];for(const r of e)hVe(r)?pVe(r)?t.push(r):n.push({file:r,error:`File too large: ${mg(r.size)} (max ${mg(nX)})`}):n.push({file:r,error:`File type not supported: ${r.type||BD(r.name)}`});return{valid:t,errors:n}}function gVe(e){var r;const t=(r=e.clipboardData)==null?void 0:r.items;if(!t)return[];const n=[];for(let o=0;o<t.length;o++){const s=t[o];if(s.kind==="file"){const i=s.getAsFile();i&&Uu.includes(i.type)&&n.push(i)}}return n}function bVe({files:e,onRemove:t,showRemove:n=!0,className:r=""}){if(e.length===0)return null;const o=s=>Uu.includes(s)?Rne:s.includes("pdf")||s.includes("text")?Go:s.includes("javascript")||s.includes("typescript")||s.includes("python")||s.includes("sql")?jne:rL;return d.jsx("div",{className:`flex flex-wrap gap-2 ${r}`,children:e.map(s=>{const i=o(s.type),a=Uu.includes(s.type);return d.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border border-border bg-muted/50 p-2 transition-colors hover:bg-muted",children:[a&&s.preview?d.jsx("div",{className:"relative h-12 w-12 overflow-hidden rounded",children:d.jsx("img",{src:s.preview,alt:s.name,className:"h-full w-full object-cover"})}):d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded bg-background",children:d.jsx(i,{className:"h-6 w-6 text-muted-foreground"})}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"max-w-[150px] truncate text-xs font-medium",children:s.name}),d.jsx("span",{className:"text-xs text-muted-foreground",children:mg(s.size)}),s.uploadProgress!==void 0&&s.uploadProgress<100&&d.jsx(vM,{value:s.uploadProgress,className:"mt-1 h-1 w-full"})]}),n&&t&&d.jsx(le,{variant:"ghost",size:"icon",className:"absolute -right-2 -top-2 h-5 w-5 rounded-full bg-background opacity-0 shadow-sm transition-opacity group-hover:opacity-100",onClick:()=>t(s.id),children:d.jsx(ln,{className:"h-3 w-3"})})]},s.id)})})}function yVe({file:e,className:t=""}){return Uu.includes(e.type)&&e.preview?d.jsxs("div",{className:`inline-block ${t}`,children:[d.jsx("img",{src:e.preview,alt:e.name,className:"max-h-64 max-w-full rounded-lg border border-border"}),d.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[e.name," • ",mg(e.size)]})]}):d.jsxs("div",{className:`inline-flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-2 ${t}`,children:[d.jsx(Go,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("span",{className:"text-sm",children:e.name}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",mg(e.size),")"]})]})}const L4={"tool-getTableColumns":{"input-streaming":"Fetching table columns...","input-available":"Reading column definitions..."},"tool-getChartDataFromSqlAndPython":{"input-streaming":"Planning...","input-available":"Fetching data..."},"tool-getChartDataFromCardConfig":{"input-streaming":"Planning...","input-available":"Fetching data..."},"tool-getForecastDataFromSqlAndPython":{"input-streaming":"Planning...","input-available":"Fetching data..."},"tool-getChartSQLSyntax":{"input-streaming":"Generating SQL syntax...","input-available":"SQL syntax generated"},"tool-validateCardConfigFormat":{"input-streaming":"Validating card config format...","input-available":"Card config format validated"},"tool-generateQueryConfig":{"input-streaming":"Generating query config...","input-available":"Sending query config..."},"tool-askForMoreInfo":{"input-streaming":"Asking for more information...","input-available":"More information requested"},"tool-createChartFromSql":{"input-streaming":"Creating chart...","input-available":"Chart created"},"tool-getUserSql":{"input-streaming":"Getting SQL...","input-available":"SQL retrieved"},"tool-inspectTableData":{"input-streaming":"Inspecting table data...","input-available":"Analyzing data..."},"tool-getDomainRelationships":{"input-streaming":"Getting domain relationships...","input-available":"Analyzing data..."}};function iX(e,t){var r;if((r=L4[e])!=null&&r[t])return L4[e][t];const n=e.replace("tool-","").replace(/([A-Z])/g," $1").toLowerCase().trim();return t==="input-streaming"?`Processing ${n}...`:`Preparing ${n} response...`}function xVe({part:e,showTools:t}){if(!t)return null;const{input:n,output:r,...o}=e;return e.type,d.jsx("div",{className:"space-y-3",children:t&&d.jsxs(ih,{children:[d.jsxs("div",{className:"inline-flex items-center gap-2",children:[d.jsxs(ah,{className:"rounded-md border border-foreground/20 p-1 px-2 font-mono text-xs text-foreground/80 hover:bg-foreground/5",children:[d.jsx("span",{className:"font-bold",children:"Tool:"})," ",e.type.split("-")[1]]}),Pv]}),d.jsx(lh,{className:"mt-2 font-mono text-xs",children:d.jsxs("div",{className:"space-y-2 px-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{children:"Args:"}),d.jsx(Fl,{language:"json",code:JSON.stringify(o,null,2)})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{children:"Input:"}),d.jsx(Fl,{language:"json",code:JSON.stringify(n,null,2)})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{children:"Output:"}),d.jsx(Fl,{language:"json",code:JSON.stringify(r,null,2)})]})]})})]})})}function vVe({part:e,messages:t}){const[n,r]=E.useState(!1),[o,s]=E.useState(null),i=O_(),a=mh(),{tokenProps:l}=E.useContext(Dg);Xi();const c=()=>{var b;const u=t==null?void 0:t.filter(y=>y.role==="user").pop(),f=(b=u==null?void 0:u.parts)==null?void 0:b.find(y=>y.type==="text"),h=(f==null?void 0:f.text)||"",p=i==="dashboard"?Xl.DASHBOARD_ASSISTANT:Xl.EDITOR_ASSISTANT,m=V1(p,{errorMessage:e.errorText||"Tool invocation error occurred",toolType:e.type,toolInput:e.input,toolOutput:null,assistantType:i,userQuery:h,messages:t,aiContext:a});s(m),r(!0)};return d.jsxs(d.Fragment,{children:[d.jsxs(ih,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(ah,{className:"",children:d.jsxs(ue,{className:"flex cursor-pointer items-center hover:text-foreground",children:[d.jsx(j_,{className:"mr-2 size-4 text-yellow-500"}),"Recovering from Error"]})}),d.jsxs(le,{variant:"ghost",size:"sm",className:"gap-1 text-[11px]",onClick:c,"aria-label":"Send feedback",children:[d.jsx(S_,{className:"h-3 w-3"}),"Send Feedback"]})]}),d.jsx(lh,{className:"mt-2 text-xs",children:d.jsxs("div",{className:"relative space-y-2 rounded-md border border-yellow-500 bg-yellow-50 p-4 text-black/80 dark:border-yellow-500/80 dark:bg-yellow-500/10 dark:text-white/80",children:[d.jsxs(ue,{className:"text-xs",children:["Tool Invocation Error (",e.type.split("-")[1],")"]}),d.jsx("p",{children:e.errorText})]})})]}),o&&d.jsx(pg,{open:n,onOpenChange:u=>{r(u),u||s(null)},feedbackData:o})]})}const H1={connectionId:"",connectionType:"none",mode:"semanticDomain",selectedEntities:[]},z4=E.memo(({cfg:e,onDatapointClick:t})=>d.jsx(Zw,{cfg:e,onDatapointClick:t}),(e,t)=>JSON.stringify(e.cfg)===JSON.stringify(t.cfg)&&e.onDatapointClick===t.onDatapointClick);function wVe({part:e,onAddToDashboard:t,messages:n,showTools:r=!1}){var L,D;const o=e.output,s=e.input,[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,f]=E.useState("visual"),[h,p]=E.useState(!1),[m,b]=E.useState(null),y=E.useMemo(()=>(e==null?void 0:e.toolCallId)??yr(),[e]),{queueMessage:g}=gh(),x=O_(),v=mh(),{tokenProps:w}=E.useContext(Dg),C=(w==null?void 0:w.type)==="dashboard";Xi();const S=()=>{const W=e.toolCallId;B().label;const q=`Can you explain how this visual was calculated? [ref: ${W}]`;g("dashboard",q)},N=()=>{var G;console.log("Send Feedback clicked",{activeAssistantType:x,messages:n,output:o,input:s,part:e});const W=n==null?void 0:n.filter(Z=>Z.role==="user").pop(),q=(G=W==null?void 0:W.parts)==null?void 0:G.find(Z=>Z.type==="text"),Y=(q==null?void 0:q.text)||"",V=x==="dashboard"?Xl.DASHBOARD_ASSISTANT:Xl.EDITOR_ASSISTANT;console.log("Feedback category:",V);const $=V1(V,{errorMessage:(o==null?void 0:o.error)||"An error occurred while generating the visualization",toolType:e.type,toolInput:s,toolOutput:o,assistantType:x,userQuery:Y,messages:n,aiContext:v,cardConfig:s==null?void 0:s.cardConfig,dataSource:o==null?void 0:o.dataSource,generatedSql:s==null?void 0:s.sql});console.log("Feedback payload prepared:",$),b($),p(!0)},j=s==null?void 0:s.chartType,_=s==null?void 0:s.connectionId,R=s==null?void 0:s.cardConfig,M=s==null?void 0:s.chartTitle,T=s==null?void 0:s.sql,O=(L=o==null?void 0:o.data)==null?void 0:L.userSql,I=s==null?void 0:s.python,A=(D=o==null?void 0:o.data)==null?void 0:D.records,F=o==null?void 0:o.dataSource,H=E.useMemo(()=>j?{id:y,config:R,type:j,dataSource:F,preferences:{tablePrefs:{pageSize:10}}}:null,[y,R,j,F]),U=E.useMemo(()=>!H||j==="pivotTable"?null:SR({card:H,cardType:j,data:A||[],queryConfig:{}}),[H,j,A]),z=E.useMemo(()=>{var $,G,Z,ee;if(j!=="pivotTable"||!o)return null;const W=(($=o.data)==null?void 0:$.pivotSchema)||[],q=((G=o.data)==null?void 0:G.subtotalColumns)||[],Y=(Z=o.data)==null?void 0:Z.columnSubtotalMeta,V=(ee=o.data)==null?void 0:ee.groupByColumns;return{records:A||[],pivotSchema:W,subtotalColumns:q,columnSubtotalMeta:Y,groupByColumns:V}},[j,o,A]),P=Xg(H,z),B=()=>{const W=H?zl(H.config):!1,q=Qw.find(V=>V.id===j),Y=q==null?void 0:q.icon;return I?{type:"advanced",label:"Advanced Analysis",icons:[su,QT]}:W&&Y?{type:"standard",label:"Standard Analysis",icons:[Y]}:{type:"sql",label:"SQL Analysis",icons:[su]}};if(!o)return null;if(o.error){const W=o.errorType||"unknown",q=o.hint||"",Y=o.rootCause||o.error,V=o.shouldRetry!==!1,$=o.validationErrors||[],G=o.suggestions||[],Z=$.length>0,ee=Z?{border:"border-purple-500/60 dark:border-purple-500/50",bg:"bg-purple-50 dark:bg-purple-500/10",text:"text-purple-800 dark:text-purple-300",iconColor:"text-purple-600 dark:text-purple-500",accentBg:"bg-purple-100 dark:bg-purple-900/30",accentText:"text-purple-900 dark:text-purple-200"}:{border:"border-yellow-500/60 dark:border-yellow-500/50",bg:"bg-yellow-50 dark:bg-yellow-500/10",text:"text-yellow-800 dark:text-yellow-300",iconColor:"text-yellow-600 dark:text-yellow-500",accentBg:"bg-yellow-100 dark:bg-yellow-900/30",accentText:"text-yellow-900 dark:text-yellow-200"},Q=()=>Z?V?"Configuration validation failed. Retrying...":"Configuration validation failed":W==="group_by_error"?V?"SQL grouping error. Retrying...":"SQL grouping error":W==="syntax_error"?V?"SQL syntax error. Retrying...":"SQL syntax error":W==="type_mismatch"?V?"Data type mismatch. Retrying...":"Data type mismatch":V?"Retrying...":"Couldn't generate this visual";if(!r){const ne=V?"Let me try that a different way...":"I'm ready with a revised plan.",oe=q||(Y&&Y!==o.error?Y:"");return d.jsx("div",{className:"mt-2 rounded-md border border-border/40 bg-muted/30 p-3 text-xs",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(N_,{className:"size-4 shrink-0 text-primary","aria-hidden":"true"}),d.jsxs("div",{className:"space-y-1 text-foreground/80",children:[d.jsx("div",{className:"font-medium text-foreground",children:ne}),oe&&d.jsx("div",{className:"text-[11px] text-muted-foreground",children:oe})]})]})})}return d.jsxs(d.Fragment,{children:[d.jsx(ih,{open:l,onOpenChange:c,children:d.jsxs("div",{className:`relative space-y-2 rounded-md border ${ee.border} ${ee.bg} p-3 text-xs`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(j_,{className:`size-4 shrink-0 ${ee.iconColor}`,"aria-hidden":"true"}),d.jsx("span",{className:`font-medium ${ee.text}`,children:Q()})]}),Z&&d.jsx("div",{className:`text-[10px] ${ee.text} opacity-80`,children:"Self-healing defense: Config validated before execution"}),Y&&Y!==o.error&&d.jsxs("div",{className:"text-foreground/80",children:[d.jsx("span",{className:"font-semibold",children:"Issue:"})," ",Y]}),q&&d.jsxs("div",{className:`rounded-md ${ee.accentBg} p-2 ${ee.accentText}`,children:[d.jsx("span",{className:"font-semibold",children:"Fix:"})," ",q]}),$.length>0&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:`font-semibold ${ee.text}`,children:"Configuration issues found:"}),d.jsxs("ul",{className:"ml-4 list-disc space-y-0.5",children:[$.slice(0,3).map((ne,oe)=>d.jsx("li",{className:"text-foreground/70 dark:text-foreground/60",children:ne},oe)),$.length>3&&d.jsxs("li",{className:"text-muted-foreground",children:["...and ",$.length-3," more"]})]})]}),d.jsxs("div",{className:"flex items-center justify-between pt-1",children:[d.jsx(ah,{asChild:!0,children:d.jsxs(le,{variant:"ghost",size:"sm",className:`gap-1 text-[11px] ${ee.text}`,children:[l?"Hide":"View"," technical details",d.jsx(Eo,{className:`h-3 w-3 transition-transform ${l?"rotate-180":""}`})]})}),d.jsxs(le,{variant:"ghost",size:"sm",className:`gap-1 text-[11px] ${ee.text}`,onClick:N,children:[d.jsx(S_,{className:"h-3 w-3"}),"Report Issue"]})]}),d.jsxs(lh,{className:"mt-2 space-y-2",children:[G.length>0&&d.jsxs("div",{className:"rounded-md border border-blue-500/40 bg-background/60 p-2 dark:bg-background/40",children:[d.jsx("div",{className:"mb-1 text-[11px] font-semibold text-blue-900 dark:text-blue-200",children:"Suggested fixes:"}),d.jsx("ul",{className:"ml-3 list-disc space-y-1",children:G.map((ne,oe)=>d.jsx("li",{className:"text-[11px] leading-relaxed text-foreground/80",children:ne},oe))})]}),d.jsxs("div",{className:`rounded-md border ${ee.border} bg-background/60 p-2 dark:bg-background/40`,children:[d.jsx("div",{className:`mb-1 text-[11px] font-semibold ${ee.text}`,children:"Raw error:"}),d.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-foreground/80",children:o.error})]})]})]})}),m&&d.jsx(pg,{open:h,onOpenChange:ne=>{p(ne),ne||b(null)},feedbackData:m})]})}return d.jsxs(d.Fragment,{children:[d.jsxs(Fi,{className:"grid w-full max-w-full grid-cols-1 border border-muted bg-background shadow-sm",children:[d.jsx($i,{className:"pb-3",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"space-y-1",children:d.jsx("h3",{className:"text-base font-semibold text-foreground",children:M||"Untitled Chart"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[j!=="table"&&j!=="pivotTable"&&d.jsx(ui,{value:u,onValueChange:f,children:d.jsxs(Ps,{className:"h-8",children:[d.jsx(Fn,{value:"visual",className:"h-7 w-7 p-0","aria-label":"View as chart",children:d.jsx(Tg,{className:"h-3.5 w-3.5"})}),d.jsx(Fn,{value:"table",className:"h-7 w-7 p-0","aria-label":"View as table",children:d.jsx(Hv,{className:"h-3.5 w-3.5"})})]})}),!C&&d.jsx(le,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:()=>{t==null||t({sql:T||"",data:A||[],dataSource:F||H1,cardConfig:R,cardTitle:M||"Untitled Chart",connectionId:_||"",cardType:j||"bar",python:I||""})},"aria-label":"Add visual to dashboard",children:d.jsx(Yo,{className:"h-4 w-4"})})]})]})}),d.jsxs(Ba,{className:"space-y-4",children:[d.jsx("div",{className:K("isolate flex w-full grow flex-col",j!=="table"&&j!=="pivotTable"&&"min-h-[360px]"),children:d.jsx("div",{className:"flex grow flex-col",children:j==="table"&&H?d.jsx("div",{className:"min-w-0",children:d.jsx(Gm,{card:H,data:A||[],isLoading:!1})}):j==="pivotTable"&&P&&H?d.jsx(Kw,{data:P.data,card:H,options:P.options}):U&&j!=="table"&&j!=="pivotTable"?u==="table"?d.jsx("div",{className:"min-w-0 pb-6",children:d.jsx(Gm,{card:H,data:A||[],isLoading:!1})}):d.jsx(z4,{cfg:U}):U&&d.jsx(z4,{cfg:U})})}),(T||I||H&&zl(H.config))&&d.jsxs(ih,{open:i,onOpenChange:a,children:[d.jsxs("div",{className:"flex items-center justify-between border-t border-muted/40 pb-2 pt-2",children:[d.jsx("div",{className:"flex items-center gap-2",children:(()=>{const W=B();return d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[W.icons.map((q,Y)=>d.jsx(q,{className:"h-3 w-3"},Y)),d.jsx("span",{children:W.label}),d.jsx(le,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 hover:text-foreground",onClick:S,title:"Ask for explanation",children:d.jsx(If,{className:"h-3 w-3"})})]})})()}),d.jsx(ah,{asChild:!0,children:d.jsxs(le,{variant:"ghost",size:"sm",className:"gap-1 text-xs",children:[i?"Hide Details":"Show Details",d.jsx(Eo,{className:`h-3 w-3 transition-transform ${i?"rotate-180":""}`})]})})]}),d.jsxs(lh,{className:"space-y-3 pb-6",children:[O&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(su,{className:"h-4 w-4 text-blue-600"}),d.jsx("span",{className:"text-sm font-medium text-foreground",children:"SQL Query"})]}),d.jsx(rh,{text:O,className:"-mr-1"})]}),d.jsx("div",{className:"rounded-md border bg-muted/30",children:d.jsx(Fl,{language:"sql",code:O})})]}),I&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(QT,{className:"h-4 w-4 text-green-600"}),d.jsx("span",{className:"text-sm font-medium text-foreground",children:"Python"})]}),d.jsx(rh,{text:I,className:"-mr-1"})]}),d.jsx("div",{className:"rounded-md border bg-muted/30",children:d.jsx(Fl,{language:"python",code:I})})]})]})]})]})]}),m&&d.jsx(pg,{open:h,onOpenChange:W=>{p(W),W||b(null)},feedbackData:m})]})}const SVe=["tool-getChartDataFromSqlAndPython","tool-getChartDataFromCardConfig","tool-getForecastDataFromSqlAndPython","tool-generateQueryConfig"];function CVe({part:e,idx:t,showTools:n,onAddToDashboard:r,messages:o}){if(!e.state)return null;if(e.state==="input-streaming"||e.state==="input-available"){const s=iX(e.type,e.state);return d.jsx(EVe,{text:s})}if(e.state==="output-available"){const s=SVe.includes(e.type);return d.jsxs("div",{className:"my-2 space-y-2",children:[n&&d.jsx(xVe,{part:e,showTools:n}),s&&r&&d.jsx(wVe,{part:e,onAddToDashboard:r,messages:o,showTools:n})]},t)}return e.state==="output-error"?n?d.jsx("div",{className:"mt-2",children:d.jsx(vVe,{part:e,messages:o})},t):d.jsx("div",{className:"my-2 rounded-md border border-border/40 bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"I hit a snag while working on that and will adjust the approach."},t):d.jsx("div",{},t)}function EVe({text:e}){return d.jsx("div",{className:"mt-2 animate-pulse text-sm text-muted-foreground",children:e})}const B4=/```quickreply\s*([\s\S]*?)```/i;function NVe(e){let t=e,n=null;const r=e.toLowerCase().indexOf("```quickreply");if(r!==-1){const i=e.match(B4);if(i)n=i[1].trim(),t=e.replace(i[0],"").trim();else return{cleanedText:e.slice(0,r).trimEnd(),quickReplies:[]}}else{const i=e.match(B4);i&&(n=i[1].trim(),t=e.replace(i[0],"").trim())}const o=t===e?e.toLowerCase().indexOf("quickreply"):-1;if(!n&&o!==-1){const i=e.indexOf("{",o);if(i!==-1){let a=0,l=-1;for(let c=i;c<e.length;c++){const u=e[c];if(u==="{")a++;else if(u==="}"&&(a--,a===0)){l=c;break}}if(l!==-1)n=e.slice(i,l+1).trim(),t=(e.slice(0,o)+e.slice(l+1)).trim();else return{cleanedText:e.slice(0,o).trimEnd(),quickReplies:[]}}else return{cleanedText:e.slice(0,o).trimEnd(),quickReplies:[]}}let s=[];if(n)try{const i=JSON.parse(n);s=(Array.isArray(i==null?void 0:i.options)?i.options:[]).map(l=>{const c=typeof(l==null?void 0:l.label)=="string"?l.label.trim():"",u=typeof(l==null?void 0:l.value)=="string"?l.value.trim():"";return c&&u?{label:c,value:u}:null}).filter(Boolean)}catch{s=[]}return{cleanedText:t.trim(),quickReplies:s}}function kVe(e){if(e==null)return"Something went wrong.";if(e instanceof Error)return e.message||"Something went wrong.";const t=r=>{if(!r||typeof r!="object")return null;const o=r.error&&typeof r.error=="object"?r.error:r,s=typeof o.code=="string"&&o.code?o.code.trim():"",i=typeof o.docs=="string"&&o.docs?`
930
+ `))}function l(p,m,b,y){const g=b.enter("tableCell"),x=b.enter("phrasing"),v=b.containerPhrasing(p,{...y,before:s,after:s});return x(),g(),v}function c(p,m){return R7e(p,{align:m,alignDelimiters:r,padding:n,stringLength:o})}function u(p,m,b){const y=p.children;let g=-1;const x=[],v=m.enter("table");for(;++g<y.length;)x[g]=f(y[g],m,b);return v(),x}function f(p,m,b){const y=p.children;let g=-1;const x=[],v=m.enter("tableRow");for(;++g<y.length;)x[g]=l(y[g],p,m,b);return v(),x}function h(p,m,b){let y=VK.inlineCode(p,m,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function gBe(){return{exit:{taskListCheckValueChecked:I4,taskListCheckValueUnchecked:I4,paragraph:yBe}}}function bBe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xBe}}}function I4(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function yBe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let s=-1,i;for(;++s<o.length;){const a=o[s];if(a.type==="paragraph"){i=a;break}}i===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function xBe(e,t,n,r){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(i);let l=VK.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+i}}function vBe(){return[Q9e(),x7e(),C7e(),cBe(),gBe()]}function wBe(e){return{extensions:[J9e(),v7e(e),E7e(),mBe(e),bBe()]}}const SBe={tokenize:jBe,partial:!0},HK={tokenize:RBe,partial:!0},UK={tokenize:MBe,partial:!0},WK={tokenize:DBe,partial:!0},CBe={tokenize:TBe,partial:!0},qK={name:"wwwAutolink",tokenize:kBe,previous:YK},GK={name:"protocolAutolink",tokenize:_Be,previous:ZK},el={name:"emailAutolink",tokenize:NBe,previous:KK},la={};function EBe(){return{text:la}}let Ec=48;for(;Ec<123;)la[Ec]=el,Ec++,Ec===58?Ec=65:Ec===91&&(Ec=97);la[43]=el;la[45]=el;la[46]=el;la[95]=el;la[72]=[el,GK];la[104]=[el,GK];la[87]=[el,qK];la[119]=[el,qK];function NBe(e,t,n){const r=this;let o,s;return i;function i(f){return!Ok(f)||!KK.call(r,r.previous)||AD(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return Ok(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(CBe,u,c)(f):f===45||f===95||Ur(f)?(s=!0,e.consume(f),l):u(f)}function c(f){return e.consume(f),o=!0,l}function u(f){return s&&o&&oo(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function kBe(e,t,n){const r=this;return o;function o(i){return i!==87&&i!==119||!YK.call(r,r.previous)||AD(r.events)?n(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(SBe,e.attempt(HK,e.attempt(UK,s),n),n)(i))}function s(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function _Be(e,t,n){const r=this;let o="",s=!1;return i;function i(f){return(f===72||f===104)&&ZK.call(r,r.previous)&&!AD(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(oo(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const h=o.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?c:(s=!0,l)):n(f)}function c(f){return f===null||hv(f)||pn(f)||Hu(f)||I1(f)?n(f):e.attempt(HK,e.attempt(UK,u),n)(f)}function u(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function jBe(e,t,n){let r=0;return o;function o(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),o):i===46&&r===3?(e.consume(i),s):n(i)}function s(i){return i===null?n(i):t(i)}}function RBe(e,t,n){let r,o,s;return i;function i(c){return c===46||c===95?e.check(WK,l,a)(c):c===null||pn(c)||Hu(c)||c!==45&&I1(c)?l(c):(s=!0,e.consume(c),i)}function a(c){return c===95?r=!0:(o=r,r=void 0),e.consume(c),i}function l(c){return o||r||!s?n(c):t(c)}}function MBe(e,t){let n=0,r=0;return o;function o(i){return i===40?(n++,e.consume(i),o):i===41&&r<n?s(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(WK,t,s)(i):i===null||pn(i)||Hu(i)?t(i):(e.consume(i),o)}function s(i){return i===41&&r++,e.consume(i),o}}function DBe(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),o):a===60||a===null||pn(a)||Hu(a)?t(a):n(a)}function o(a){return a===null||a===40||a===91||pn(a)||Hu(a)?t(a):r(a)}function s(a){return oo(a)?i(a):n(a)}function i(a){return a===59?(e.consume(a),r):oo(a)?(e.consume(a),i):n(a)}}function TBe(e,t,n){return r;function r(s){return e.consume(s),o}function o(s){return Ur(s)?n(s):t(s)}}function YK(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pn(e)}function ZK(e){return!oo(e)}function KK(e){return!(e===47||Ok(e))}function Ok(e){return e===43||e===45||e===46||e===95||Ur(e)}function AD(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const PBe={tokenize:BBe,partial:!0};function ABe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$Be,continuation:{tokenize:LBe},exit:zBe}},text:{91:{name:"gfmFootnoteCall",tokenize:FBe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IBe,resolveTo:OBe}}}}function IBe(e,t,n){const r=this;let o=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!i||!i._balanced)return n(l);const c=Qs(r.sliceSerialize({start:i.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function OBe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function FBe(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,i;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!i||f===null||f===91||pn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return o.includes(Qs(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return pn(f)||(i=!0),s++,e.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function $Be(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,i=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(i>999||m===93&&!a||m===null||m===91||pn(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Qs(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return pn(m)||(a=!0),i++,e.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(e.consume(m),i++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o.includes(s)||o.push(s),zt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function LBe(e,t,n){return e.check(Mb,t,e.attempt(PBe,t,n))}function zBe(e){e.exit("gfmFootnoteDefinition")}function BBe(e,t,n){const r=this;return zt(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(s):n(s)}}function VBe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(i,a){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let c=l;for(;c--;)if(i[c][0]==="exit"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[c][1].end.offset-i[c][1].start.offset){i[l][1].type="strikethroughSequence",i[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},i[c][1].start),end:Object.assign({},i[l][1].end)},f={type:"strikethroughText",start:Object.assign({},i[c][1].end),end:Object.assign({},i[l][1].start)},h=[["enter",u,a],["enter",i[c][1],a],["exit",i[c][1],a],["enter",f,a]],p=a.parser.constructs.insideSpan.null;p&&Uo(h,h.length,0,O1(p,i.slice(c+1,l),a)),Uo(h,h.length,0,[["exit",f,a],["enter",i[l][1],a],["exit",i[l][1],a],["exit",u,a]]),Uo(i,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function s(i,a,l){const c=this.previous,u=this.events;let f=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(i.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const b=sh(c);if(m===126)return f>1?l(m):(i.consume(m),f++,p);if(f<2&&!n)return l(m);const y=i.exit("strikethroughSequenceTemporary"),g=sh(m);return y._open=!g||g===2&&!!b,y._close=!b||b===2&&!!g,a(m)}}}class HBe{constructor(){this.map=[]}add(t,n,r){UBe(this,t,n,r)}consume(t){if(this.map.sort(function(s,i){return s[0]-i[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const s of o)t.push(s);o=r.pop()}this.map.length=0}}function UBe(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function WBe(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function qBe(){return{flow:{null:{name:"table",tokenize:GBe,resolveAll:YBe}}}}function GBe(e,t,n){const r=this;let o=0,s=0,i;return a;function a(R){let M=r.events.length-1;for(;M>-1;){const I=r.events[M][1].type;if(I==="lineEnding"||I==="linePrefix")M--;else break}const T=M>-1?r.events[M][1].type:null,O=T==="tableHead"||T==="tableRow"?S:l;return O===S&&r.parser.lazy[r.now().line]?n(R):O(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(i=!0,s+=1),u(R)}function u(R){return R===null?n(R):qe(R)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),p):n(R):kt(R)?zt(e,u,"whitespace")(R):(s+=1,i&&(i=!1,o+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),i=!0,u):(e.enter("data"),f(R)))}function f(R){return R===null||R===124||pn(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?h:f)}function h(R){return R===92||R===124?(e.consume(R),f):f(R)}function p(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),i=!1,kt(R)?zt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?y(R):R===124?(i=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),b):C(R)}function b(R){return kt(R)?zt(e,y,"whitespace")(R):y(R)}function y(R){return R===58?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),g):R===45?(s+=1,g(R)):R===null||qe(R)?w(R):C(R)}function g(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):C(R)}function x(R){return R===45?(e.consume(R),x):R===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(R))}function v(R){return kt(R)?zt(e,w,"whitespace")(R):w(R)}function w(R){return R===124?m(R):R===null||qe(R)?!i||o!==s?C(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):C(R)}function C(R){return n(R)}function S(R){return e.enter("tableRow"),N(R)}function N(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),N):R===null||qe(R)?(e.exit("tableRow"),t(R)):kt(R)?zt(e,N,"whitespace")(R):(e.enter("data"),j(R))}function j(R){return R===null||R===124||pn(R)?(e.exit("data"),N(R)):(e.consume(R),R===92?_:j)}function _(R){return R===92||R===124?(e.consume(R),j):j(R)}}function YBe(e,t){let n=-1,r=!0,o=0,s=[0,0,0,0],i=[0,0,0,0],a=!1,l=0,c,u,f;const h=new HBe;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(O4(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],i=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),o=m.type==="tableDelimiterRow"?2:u?3:1):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(s[1]!==0&&(i[0]=i[1],f=o0(h,t,s,o,void 0,f),s=[0,0,0,0]),i[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(i[0]=i[1],f=o0(h,t,s,o,void 0,f)),s=i,i=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(i[0]=i[1],f=o0(h,t,s,o,n,f)):i[1]!==0&&(f=o0(h,t,i,o,n,f)),o=0):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=n)}for(l!==0&&O4(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=WBe(t.events,n))}return e}function o0(e,t,n,r,o,s){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Od(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Od(t.events,n[1]);if(s={type:i,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Od(t.events,n[2]),u=Od(t.events,n[3]),f={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return o!==void 0&&(s.end=Object.assign({},Od(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function O4(e,t,n,r,o){const s=[],i=Od(t.events,n);o&&(o.end=Object.assign({},i),s.push(["exit",o,t])),r.end=Object.assign({},i),s.push(["exit",r,t]),e.add(n+1,0,s)}function Od(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZBe={name:"tasklistCheck",tokenize:XBe};function KBe(){return{text:{91:ZBe}}}function XBe(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return pn(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),i):n(l)}function i(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return qe(l)?t(l):kt(l)?e.check({tokenize:QBe},t,n)(l):n(l)}}function QBe(e,t,n){return zt(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function JBe(e){return nK([EBe(),ABe(),VBe(e),qBe(),KBe()])}const eVe={};function tVe(e){const t=this,n=e||eVe,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(JBe(n)),s.push(vBe()),i.push(wBe(n))}const Dl=E.forwardRef(({children:e,className:t,tooltip:n,onClick:r,openDelay:o=300,buttonProps:s,disabled:i,...a},l)=>d.jsx(Ya,{children:d.jsxs(Xo,{delayDuration:o,children:[d.jsx(Qo,{asChild:!0,children:d.jsx(le,{disabled:i,ref:l,size:"sm",variant:"ghost",onClick:r,...a,...s,className:K(`${Jd}`,t),children:e})}),n&&d.jsx(js,{side:"bottom",sideOffset:10,children:n})]})}));Dl.displayName="IconButton";var ID="Collapsible",[nVe,XK]=mr(ID),[rVe,OD]=nVe(ID),QK=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[l=!1,c]=jr({prop:r,defaultProp:o,onChange:i});return d.jsx(rVe,{scope:n,disabled:s,contentId:qn(),open:l,onOpenToggle:k.useCallback(()=>c(u=>!u),[c]),children:d.jsx(Me.div,{"data-state":zD(l),"data-disabled":s?"":void 0,...a,ref:t})})});QK.displayName=ID;var JK="CollapsibleTrigger",FD=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=OD(JK,n);return d.jsx(Me.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":zD(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:we(e.onClick,o.onOpenToggle)})});FD.displayName=JK;var $D="CollapsibleContent",LD=k.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OD($D,e.__scopeCollapsible);return d.jsx(Gn,{present:n||o.open,children:({present:s})=>d.jsx(oVe,{...r,ref:t,present:s})})});LD.displayName=$D;var oVe=k.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=OD($D,n),[a,l]=k.useState(r),c=k.useRef(null),u=ot(t,c),f=k.useRef(0),h=f.current,p=k.useRef(0),m=p.current,b=i.open||a,y=k.useRef(b),g=k.useRef(void 0);return k.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),_r(()=>{const x=c.current;if(x){g.current=g.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const v=x.getBoundingClientRect();f.current=v.height,p.current=v.width,y.current||(x.style.transitionDuration=g.current.transitionDuration,x.style.animationName=g.current.animationName),l(r)}},[i.open,r]),d.jsx(Me.div,{"data-state":zD(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...s,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:b&&o})});function zD(e){return e?"open":"closed"}var eX=QK,sVe=FD,iVe=LD;const ih=eX,ah=FD,lh=LD;function tX(){const{authToken:e,tokenProps:t}=Ue(),{currentUser:n}=Xi(),r=Ki({mutationFn:async o=>{if(!(e!=null&&e.accessToken))throw new Error("No authentication token available");const i=`${t.apiServiceUrl||""}/v1/feedback`,a={...o,user:n,tokenContext:t},l=await tc(i,e.accessToken,a,"POST");if(!l||!l.success)throw new Error((l==null?void 0:l.error)||"Failed to send feedback");return l},onSuccess:o=>{Le.success(`Feedback sent successfully! Issue: ${o.issueNumber}`,{duration:5e3})},onError:o=>{console.error("Feedback submission error:",o),Le.error("Failed to send feedback. Please try again later.",{duration:5e3})}});return{sendFeedback:r.mutate,sendFeedbackAsync:r.mutateAsync,isLoading:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,data:r.data,reset:r.reset}}function V1(e,t,n){return{category:e,userMessage:n,systemState:t,metadata:{url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString(),viewport:`${window.innerWidth}x${window.innerHeight}`}}}function pg({open:e,onOpenChange:t,feedbackData:n,onSuccess:r,showDebugInfo:o=!1}){var g,x,v,w,C,S,N,j,_,R,M,T,O;const[s,i]=E.useState(""),[a,l]=E.useState(!1),{sendFeedback:c,isLoading:u,isSuccess:f,data:h,reset:p}=tX();E.useEffect(()=>{f&&r&&r()},[f,r]);const m=()=>{const I={...n,userMessage:s.trim()||void 0};c(I)},b=()=>{i(""),l(!1),p(),t(!1)},y={category:n.category,error:{message:(g=n.systemState)==null?void 0:g.errorMessage,sql:(x=n.systemState)==null?void 0:x.generatedSql,errorSql:(v=n.systemState)==null?void 0:v.errorSql},assistantType:(w=n.systemState)==null?void 0:w.assistantType,toolType:(C=n.systemState)==null?void 0:C.toolType,userQuery:(S=n.systemState)==null?void 0:S.userQuery,messages:(N=n.systemState)==null?void 0:N.messages,aiContext:(j=n.systemState)==null?void 0:j.aiContext,toolInput:(_=n.systemState)==null?void 0:_.toolInput,toolOutput:(R=n.systemState)==null?void 0:R.toolOutput,cardConfig:(M=n.systemState)==null?void 0:M.cardConfig,dataSource:(T=n.systemState)==null?void 0:T.dataSource,filters:(O=n.systemState)==null?void 0:O.dashboardFilters,metadata:n.metadata};return d.jsx(ai,{open:e,onOpenChange:b,children:d.jsxs(Ms,{className:"max-w-2xl",children:[d.jsxs(Ds,{children:[d.jsx(Ts,{children:f?"Feedback Sent Successfully":n.category==="dashboard-assistant"||n.category==="editor-assistant"?"Report an issue":"Report Query Generation Issue"}),d.jsx(Qi,{children:f?`Your feedback has been submitted with issue number: ${h==null?void 0:h.issueNumber}`:n.category==="dashboard-assistant"||n.category==="editor-assistant"?"Help us improve the AI responses. Your feedback will be sent to our support team.":"Help us improve by reporting this query generation issue. Your feedback will be sent to our support team."})]}),!f&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(ue,{htmlFor:"message",children:"Additional Information (Optional)"}),d.jsx(ph,{id:"message",placeholder:"Please describe what you were trying to do when this error occurred...",value:s,onChange:I=>i(I.target.value),className:"min-h-[100px] resize-none ring-inset focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0",disabled:u})]}),o&&d.jsxs(ih,{open:a,onOpenChange:l,children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ah,{asChild:!0,children:d.jsxs(le,{variant:"ghost",size:"sm",className:"flex flex-1 items-center justify-between p-2 hover:bg-muted",children:[d.jsx("span",{className:"text-sm font-medium",children:"View data to be sent"}),a?d.jsx(Eo,{className:"h-4 w-4"}):d.jsx(Js,{className:"h-4 w-4"})]})}),d.jsx(rh,{text:JSON.stringify(y,null,2),className:"h-8 w-8 shrink-0"})]}),d.jsx(lh,{className:"mt-2",children:d.jsx(Wi,{className:"h-[300px] w-full rounded-md border bg-muted/50 p-4",children:d.jsx("div",{className:"text-xs overflow-auto break-all whitespace-pre-wrap",children:d.jsx(Fl,{code:JSON.stringify(y,null,2),language:"json"})})})})]})]}),d.jsxs(li,{children:[d.jsx(le,{variant:"outline",onClick:b,disabled:u,children:"Cancel"}),d.jsx(le,{onClick:m,disabled:u,className:"min-w-[100px]",children:u?d.jsxs(d.Fragment,{children:[d.jsx(Ns,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Feedback"})]})]}),f&&d.jsxs("div",{className:"flex flex-col items-center space-y-4 py-6",children:[d.jsx(Nne,{className:"h-12 w-12 text-green-600"}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-lg font-medium",children:"Thank you for your feedback!"}),d.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Issue Number:"," ",d.jsx("span",{className:"font-mono font-medium",children:h==null?void 0:h.issueNumber})]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Our support team will review your feedback and take appropriate action."})]}),d.jsx(le,{onClick:b,className:"mt-4",children:"Close"})]})]})})}var Xl=(e=>(e.QUERY_GENERATION="query-generation",e.DASHBOARD_ASSISTANT="dashboard-assistant",e.EDITOR_ASSISTANT="editor-assistant",e))(Xl||{});function aVe(e,t){var r;if(!e||e.length===0)return"";const n=e.findIndex(o=>o.id===t);if(n===-1)return"";for(let o=n-1;o>=0;o--)if(e[o].role==="user"){const s=(r=e[o].parts)==null?void 0:r.find(i=>i.type==="text");return(s==null?void 0:s.text)||""}return""}function lVe({messageId:e,messageText:t,messages:n,className:r}){const[o,s]=E.useState("none"),[i,a]=E.useState(!1),[l,c]=E.useState(null),u=O_(),f=mh(),{isLoading:h}=tX(),{isLocalDev:p,isConsoleMode:m}=vb(),b=async()=>{if(o==="positive"){s("none"),Le.info("Feedback removed");return}s("positive"),Le.success("Thank you for your feedback!")},y=()=>{const v=aVe(n,e),w=u==="dashboard"?Xl.DASHBOARD_ASSISTANT:Xl.EDITOR_ASSISTANT,C=V1(w,{assistantType:u,userQuery:v,messages:n,aiContext:f,messageId:e,feedbackType:"negative",assistantResponse:t});c(C),a(!0)},g=v=>{a(v),v||c(null)},x=()=>{s("negative")};return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K("flex items-center gap-1",r),children:[d.jsx(Dl,{onClick:b,disabled:h,tooltip:o==="positive"?"Positive feedback given (click to undo)":"Helpful response",className:K("h-6 w-6 p-1",o==="positive"?"text-green-600 dark:text-green-500":"text-muted-foreground hover:text-foreground"),children:d.jsx(Lne,{className:K("h-3.5 w-3.5",o==="positive"&&"fill-current")})}),d.jsx(Dl,{onClick:y,disabled:h,tooltip:o==="negative"?"Negative feedback given (click to update)":"Report issue",className:K("h-6 w-6 p-1",o==="negative"?"text-red-600 dark:text-red-500":"text-muted-foreground hover:text-foreground"),children:d.jsx($ne,{className:K("h-3.5 w-3.5",o==="negative"&&"fill-current")})})]}),l&&d.jsx(pg,{open:i,onOpenChange:g,feedbackData:l,onSuccess:x,showDebugInfo:m||p})]})}function F4({text:e,handleRun:t,className:n,messageId:r,messages:o}){const s=te(a=>a.themeStyle),i={p:({node:a,...l})=>d.jsx("p",{className:K("mb-4 text-sm leading-relaxed text-foreground/90",n),...l}),code:({node:a,...l})=>{var u,f;const c=(f=(u=a==null?void 0:a.children)==null?void 0:u[0])==null?void 0:f.value;return c&&/^#([0-9a-fA-F]{6})$/.test(c)?d.jsx("code",{className:K("rounded-lg bg-muted px-2.5 py-1.5 font-mono text-sm",n),style:{backgroundColor:c},...l}):d.jsx("code",{className:K("rounded-lg border border-border/50 bg-muted/50 px-2 py-1 font-mono text-xs text-foreground/80 transition-colors hover:bg-muted/70",n),...l})},pre:a=>d.jsx(q9e,{...a,handleRun:t}),ul:({node:a,...l})=>d.jsx("ul",{className:K("mb-4 ml-6 list-disc space-y-2 text-sm marker:text-muted-foreground",n),...l}),ol:({node:a,...l})=>d.jsx("ol",{className:K("mb-4 ml-6 list-decimal space-y-2 text-sm marker:text-muted-foreground",n),...l}),li:({node:a,...l})=>d.jsx("li",{className:K("pl-2 leading-relaxed text-foreground/90",n),...l}),a:({node:a,...l})=>d.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:K("text-blue-600 underline decoration-1 underline-offset-2 transition-all hover:text-blue-700 hover:decoration-2",n),...l}),h1:({node:a,...l})=>d.jsx("h1",{className:K("mb-4 mt-6 text-2xl font-semibold tracking-tight text-foreground",n),...l}),h2:({node:a,...l})=>d.jsx("h2",{className:K("mb-3 mt-5 text-xl font-semibold tracking-tight text-foreground",n),...l}),h3:({node:a,...l})=>d.jsx("h3",{className:K("mb-2 mt-4 text-lg font-medium text-foreground",n),...l}),h4:({node:a,...l})=>d.jsx("h4",{className:K("mb-2 mt-3 text-base font-medium text-foreground/90",n),...l}),strong:({node:a,...l})=>d.jsx("strong",{className:K("font-semibold text-foreground",n),...l}),blockquote:({node:a,...l})=>d.jsx("blockquote",{className:K("my-4 rounded-r-md border-l-4 border-muted-foreground/30 bg-muted/20 py-3 pl-4 pr-4 italic text-foreground/80",n),...l}),table:({node:a,...l})=>d.jsx("div",{className:"my-6 overflow-x-auto rounded-lg border border-border/50 shadow-sm",children:d.jsx("table",{className:K("w-full table-auto border-collapse text-sm",n),...l})}),thead:({node:a,...l})=>{var c,u,f,h,p,m;return d.jsx("thead",{style:{backgroundColor:(f=(u=(c=s==null?void 0:s.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor)==null?void 0:f[0],color:Aa((m=(p=(h=s==null?void 0:s.chart)==null?void 0:h.dataset)==null?void 0:p.backgroundColor)==null?void 0:m[0])},className:"sticky top-0",...l})},tr:({node:a,...l})=>d.jsx("tr",{className:K("border-b border-border/30 transition-colors last:border-0 hover:bg-muted/30",n),...l}),th:({node:a,...l})=>d.jsx("th",{className:K("px-4 py-3 text-left text-sm font-medium tracking-wide",n),...l}),td:({node:a,...l})=>d.jsx("td",{className:K("px-4 py-3 align-top text-foreground/90",n),...l})};return d.jsxs("div",{className:"group relative pr-16",children:[d.jsx(F8e,{components:i,remarkPlugins:[tVe],children:e}),r&&d.jsx("div",{className:"absolute right-0 top-1 opacity-0 transition-opacity group-hover:opacity-100",children:d.jsx(lVe,{messageId:r,messageText:e,messages:o})})]})}const Uu=["image/png","image/jpeg","image/jpg","image/gif","image/webp"],cVe=["application/pdf","text/plain","text/markdown"],uVe=["text/csv","application/json","text/xml","application/xml"],dVe=["text/javascript","application/javascript","text/typescript","application/x-typescript","text/x-python","application/x-python-code","text/x-sql","application/sql"],fVe=[...Uu,...cVe,...uVe,...dVe],nX=10*1024*1024,xa=5,rX={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".csv":"text/csv",".json":"application/json",".xml":"text/xml",".js":"text/javascript",".jsx":"text/javascript",".ts":"text/typescript",".tsx":"text/typescript",".py":"text/x-python",".sql":"text/x-sql"};function hVe(e){if(fVe.includes(e.type))return!0;const t=BD(e.name);return t?Object.prototype.hasOwnProperty.call(rX,t):!1}function BD(e){const t=e.lastIndexOf(".");return t===-1?"":e.substring(t).toLowerCase()}function oX(e){if(e.type)return e.type;const t=BD(e.name);return rX[t]||"application/octet-stream"}function pVe(e){return e.size<=nX}function mg(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+n[r]}function $4(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const s=r.result.split(",")[1];t(s)},r.onerror=n,r.readAsDataURL(e)})}function mVe(e){return new Promise((t,n)=>{if(!Uu.includes(oX(e))){n(new Error("Not an image file"));return}const r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}async function VD(e){const t=oX(e),n=Uu.includes(t),r={id:crypto.randomUUID(),name:e.name,size:e.size,type:t};if(n)try{r.preview=await mVe(e),r.data=r.preview.split(",")[1]}catch(o){console.error("Failed to create image preview:",o),r.data=await $4(e)}else r.data=await $4(e);return r}function sX(e){const t=[],n=[];for(const r of e)hVe(r)?pVe(r)?t.push(r):n.push({file:r,error:`File too large: ${mg(r.size)} (max ${mg(nX)})`}):n.push({file:r,error:`File type not supported: ${r.type||BD(r.name)}`});return{valid:t,errors:n}}function gVe(e){var r;const t=(r=e.clipboardData)==null?void 0:r.items;if(!t)return[];const n=[];for(let o=0;o<t.length;o++){const s=t[o];if(s.kind==="file"){const i=s.getAsFile();i&&Uu.includes(i.type)&&n.push(i)}}return n}function bVe({files:e,onRemove:t,showRemove:n=!0,className:r=""}){if(e.length===0)return null;const o=s=>Uu.includes(s)?Rne:s.includes("pdf")||s.includes("text")?Go:s.includes("javascript")||s.includes("typescript")||s.includes("python")||s.includes("sql")?jne:rL;return d.jsx("div",{className:`flex flex-wrap gap-2 ${r}`,children:e.map(s=>{const i=o(s.type),a=Uu.includes(s.type);return d.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border border-border bg-muted/50 p-2 transition-colors hover:bg-muted",children:[a&&s.preview?d.jsx("div",{className:"relative h-12 w-12 overflow-hidden rounded",children:d.jsx("img",{src:s.preview,alt:s.name,className:"h-full w-full object-cover"})}):d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded bg-background",children:d.jsx(i,{className:"h-6 w-6 text-muted-foreground"})}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"max-w-[150px] truncate text-xs font-medium",children:s.name}),d.jsx("span",{className:"text-xs text-muted-foreground",children:mg(s.size)}),s.uploadProgress!==void 0&&s.uploadProgress<100&&d.jsx(vM,{value:s.uploadProgress,className:"mt-1 h-1 w-full"})]}),n&&t&&d.jsx(le,{variant:"ghost",size:"icon",className:"absolute -right-2 -top-2 h-5 w-5 rounded-full bg-background opacity-0 shadow-sm transition-opacity group-hover:opacity-100",onClick:()=>t(s.id),children:d.jsx(ln,{className:"h-3 w-3"})})]},s.id)})})}function yVe({file:e,className:t=""}){return Uu.includes(e.type)&&e.preview?d.jsxs("div",{className:`inline-block ${t}`,children:[d.jsx("img",{src:e.preview,alt:e.name,className:"max-h-64 max-w-full rounded-lg border border-border"}),d.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[e.name," • ",mg(e.size)]})]}):d.jsxs("div",{className:`inline-flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-2 ${t}`,children:[d.jsx(Go,{className:"h-4 w-4 text-muted-foreground"}),d.jsx("span",{className:"text-sm",children:e.name}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",mg(e.size),")"]})]})}const L4={"tool-getTableColumns":{"input-streaming":"Fetching table columns...","input-available":"Reading column definitions..."},"tool-getChartDataFromSqlAndPython":{"input-streaming":"Planning...","input-available":"Fetching data..."},"tool-getChartDataFromCardConfig":{"input-streaming":"Planning...","input-available":"Fetching data..."},"tool-getForecastDataFromSqlAndPython":{"input-streaming":"Planning...","input-available":"Fetching data..."},"tool-getChartSQLSyntax":{"input-streaming":"Generating SQL syntax...","input-available":"SQL syntax generated"},"tool-validateCardConfigFormat":{"input-streaming":"Validating card config format...","input-available":"Card config format validated"},"tool-generateQueryConfig":{"input-streaming":"Generating query config...","input-available":"Sending query config..."},"tool-askForMoreInfo":{"input-streaming":"Asking for more information...","input-available":"More information requested"},"tool-createChartFromSql":{"input-streaming":"Creating chart...","input-available":"Chart created"},"tool-getUserSql":{"input-streaming":"Getting SQL...","input-available":"SQL retrieved"},"tool-inspectTableData":{"input-streaming":"Inspecting table data...","input-available":"Analyzing data..."},"tool-getDomainRelationships":{"input-streaming":"Getting domain relationships...","input-available":"Analyzing data..."}};function iX(e,t){var r;if((r=L4[e])!=null&&r[t])return L4[e][t];const n=e.replace("tool-","").replace(/([A-Z])/g," $1").toLowerCase().trim();return t==="input-streaming"?`Processing ${n}...`:`Preparing ${n} response...`}function xVe({part:e,showTools:t}){if(!t)return null;const{input:n,output:r,...o}=e;return e.type,d.jsx("div",{className:"space-y-3",children:t&&d.jsxs(ih,{children:[d.jsxs("div",{className:"inline-flex items-center gap-2",children:[d.jsxs(ah,{className:"rounded-md border border-foreground/20 p-1 px-2 font-mono text-xs text-foreground/80 hover:bg-foreground/5",children:[d.jsx("span",{className:"font-bold",children:"Tool:"})," ",e.type.split("-")[1]]}),Pv]}),d.jsx(lh,{className:"mt-2 font-mono text-xs",children:d.jsxs("div",{className:"space-y-2 px-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{children:"Args:"}),d.jsx(Fl,{language:"json",code:JSON.stringify(o,null,2)})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{children:"Input:"}),d.jsx(Fl,{language:"json",code:JSON.stringify(n,null,2)})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{children:"Output:"}),d.jsx(Fl,{language:"json",code:JSON.stringify(r,null,2)})]})]})})]})})}function vVe({part:e,messages:t}){const[n,r]=E.useState(!1),[o,s]=E.useState(null),i=O_(),a=mh(),{tokenProps:l}=E.useContext(Dg);Xi();const c=()=>{var b;const u=t==null?void 0:t.filter(y=>y.role==="user").pop(),f=(b=u==null?void 0:u.parts)==null?void 0:b.find(y=>y.type==="text"),h=(f==null?void 0:f.text)||"",p=i==="dashboard"?Xl.DASHBOARD_ASSISTANT:Xl.EDITOR_ASSISTANT,m=V1(p,{errorMessage:e.errorText||"Tool invocation error occurred",toolType:e.type,toolInput:e.input,toolOutput:null,assistantType:i,userQuery:h,messages:t,aiContext:a});s(m),r(!0)};return d.jsxs(d.Fragment,{children:[d.jsxs(ih,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(ah,{className:"",children:d.jsxs(ue,{className:"flex cursor-pointer items-center hover:text-foreground",children:[d.jsx(j_,{className:"mr-2 size-4 text-yellow-500"}),"Recovering from Error"]})}),d.jsxs(le,{variant:"ghost",size:"sm",className:"gap-1 text-[11px]",onClick:c,"aria-label":"Send feedback",children:[d.jsx(S_,{className:"h-3 w-3"}),"Send Feedback"]})]}),d.jsx(lh,{className:"mt-2 text-xs",children:d.jsxs("div",{className:"relative space-y-2 rounded-md border border-yellow-500 bg-yellow-50 p-4 text-black/80 dark:border-yellow-500/80 dark:bg-yellow-500/10 dark:text-white/80",children:[d.jsxs(ue,{className:"text-xs",children:["Tool Invocation Error (",e.type.split("-")[1],")"]}),d.jsx("p",{children:e.errorText})]})})]}),o&&d.jsx(pg,{open:n,onOpenChange:u=>{r(u),u||s(null)},feedbackData:o})]})}const H1={connectionId:"",connectionType:"none",mode:"semanticDomain",selectedEntities:[]},z4=E.memo(({cfg:e,onDatapointClick:t})=>d.jsx(Zw,{cfg:e,onDatapointClick:t}),(e,t)=>JSON.stringify(e.cfg)===JSON.stringify(t.cfg)&&e.onDatapointClick===t.onDatapointClick);function wVe({part:e,onAddToDashboard:t,messages:n,showTools:r=!1}){var L,D;const o=e.output,s=e.input,[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,f]=E.useState("visual"),[h,p]=E.useState(!1),[m,b]=E.useState(null),y=E.useMemo(()=>(e==null?void 0:e.toolCallId)??yr(),[e]),{queueMessage:g}=gh(),x=O_(),v=mh(),{tokenProps:w}=E.useContext(Dg),C=(w==null?void 0:w.type)==="dashboard";Xi();const S=()=>{const W=e.toolCallId;B().label;const q=`Can you explain how this visual was calculated? [ref: ${W}]`;g("dashboard",q)},N=()=>{var G;console.log("Send Feedback clicked",{activeAssistantType:x,messages:n,output:o,input:s,part:e});const W=n==null?void 0:n.filter(Z=>Z.role==="user").pop(),q=(G=W==null?void 0:W.parts)==null?void 0:G.find(Z=>Z.type==="text"),Y=(q==null?void 0:q.text)||"",V=x==="dashboard"?Xl.DASHBOARD_ASSISTANT:Xl.EDITOR_ASSISTANT;console.log("Feedback category:",V);const $=V1(V,{errorMessage:(o==null?void 0:o.error)||"An error occurred while generating the visualization",toolType:e.type,toolInput:s,toolOutput:o,assistantType:x,userQuery:Y,messages:n,aiContext:v,cardConfig:s==null?void 0:s.cardConfig,dataSource:o==null?void 0:o.dataSource,generatedSql:s==null?void 0:s.sql});console.log("Feedback payload prepared:",$),b($),p(!0)},j=s==null?void 0:s.chartType,_=s==null?void 0:s.connectionId,R=s==null?void 0:s.cardConfig,M=s==null?void 0:s.chartTitle,T=s==null?void 0:s.sql,O=(L=o==null?void 0:o.data)==null?void 0:L.userSql,I=s==null?void 0:s.python,A=(D=o==null?void 0:o.data)==null?void 0:D.records,F=o==null?void 0:o.dataSource,H=E.useMemo(()=>j?{id:y,config:R,type:j,dataSource:F,preferences:{tablePrefs:{pageSize:10}}}:null,[y,R,j,F]),U=E.useMemo(()=>!H||j==="pivotTable"?null:SR({card:H,cardType:j,data:A||[],queryConfig:{}}),[H,j,A]),z=E.useMemo(()=>{var $,G,Z,ee;if(j!=="pivotTable"||!o)return null;const W=(($=o.data)==null?void 0:$.pivotSchema)||[],q=((G=o.data)==null?void 0:G.subtotalColumns)||[],Y=(Z=o.data)==null?void 0:Z.columnSubtotalMeta,V=(ee=o.data)==null?void 0:ee.groupByColumns;return{records:A||[],pivotSchema:W,subtotalColumns:q,columnSubtotalMeta:Y,groupByColumns:V}},[j,o,A]),P=Xg(H,z),B=()=>{const W=H?zl(H.config):!1,q=Qw.find(V=>V.id===j),Y=q==null?void 0:q.icon;return I?{type:"advanced",label:"Advanced Analysis",icons:[su,QT]}:W&&Y?{type:"standard",label:"Standard Analysis",icons:[Y]}:{type:"sql",label:"SQL Analysis",icons:[su]}};if(!o)return null;if(o.error){const W=o.errorType||"unknown",q=o.hint||"",Y=o.rootCause||o.error,V=o.shouldRetry!==!1,$=o.validationErrors||[],G=o.suggestions||[],Z=$.length>0,ee=Z?{border:"border-purple-500/60 dark:border-purple-500/50",bg:"bg-purple-50 dark:bg-purple-500/10",text:"text-purple-800 dark:text-purple-300",iconColor:"text-purple-600 dark:text-purple-500",accentBg:"bg-purple-100 dark:bg-purple-900/30",accentText:"text-purple-900 dark:text-purple-200"}:{border:"border-yellow-500/60 dark:border-yellow-500/50",bg:"bg-yellow-50 dark:bg-yellow-500/10",text:"text-yellow-800 dark:text-yellow-300",iconColor:"text-yellow-600 dark:text-yellow-500",accentBg:"bg-yellow-100 dark:bg-yellow-900/30",accentText:"text-yellow-900 dark:text-yellow-200"},Q=()=>Z?V?"Configuration validation failed. Retrying...":"Configuration validation failed":W==="group_by_error"?V?"SQL grouping error. Retrying...":"SQL grouping error":W==="syntax_error"?V?"SQL syntax error. Retrying...":"SQL syntax error":W==="type_mismatch"?V?"Data type mismatch. Retrying...":"Data type mismatch":V?"Retrying...":"Couldn't generate this visual";if(!r){const ne=V?"Let me try that a different way...":"I'm ready with a revised plan.",oe=q||(Y&&Y!==o.error?Y:"");return d.jsx("div",{className:"mt-2 rounded-md border border-border/40 bg-muted/30 p-3 text-xs",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(N_,{className:"size-4 shrink-0 text-primary","aria-hidden":"true"}),d.jsxs("div",{className:"space-y-1 text-foreground/80",children:[d.jsx("div",{className:"font-medium text-foreground",children:ne}),oe&&d.jsx("div",{className:"text-[11px] text-muted-foreground",children:oe})]})]})})}return d.jsxs(d.Fragment,{children:[d.jsx(ih,{open:l,onOpenChange:c,children:d.jsxs("div",{className:`relative space-y-2 rounded-md border ${ee.border} ${ee.bg} p-3 text-xs`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(j_,{className:`size-4 shrink-0 ${ee.iconColor}`,"aria-hidden":"true"}),d.jsx("span",{className:`font-medium ${ee.text}`,children:Q()})]}),Z&&d.jsx("div",{className:`text-[10px] ${ee.text} opacity-80`,children:"Self-healing defense: Config validated before execution"}),Y&&Y!==o.error&&d.jsxs("div",{className:"text-foreground/80",children:[d.jsx("span",{className:"font-semibold",children:"Issue:"})," ",Y]}),q&&d.jsxs("div",{className:`rounded-md ${ee.accentBg} p-2 ${ee.accentText}`,children:[d.jsx("span",{className:"font-semibold",children:"Fix:"})," ",q]}),$.length>0&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:`font-semibold ${ee.text}`,children:"Configuration issues found:"}),d.jsxs("ul",{className:"ml-4 list-disc space-y-0.5",children:[$.slice(0,3).map((ne,oe)=>d.jsx("li",{className:"text-foreground/70 dark:text-foreground/60",children:ne},oe)),$.length>3&&d.jsxs("li",{className:"text-muted-foreground",children:["...and ",$.length-3," more"]})]})]}),d.jsxs("div",{className:"flex items-center justify-between pt-1",children:[d.jsx(ah,{asChild:!0,children:d.jsxs(le,{variant:"ghost",size:"sm",className:`gap-1 text-[11px] ${ee.text}`,children:[l?"Hide":"View"," technical details",d.jsx(Eo,{className:`h-3 w-3 transition-transform ${l?"rotate-180":""}`})]})}),d.jsxs(le,{variant:"ghost",size:"sm",className:`gap-1 text-[11px] ${ee.text}`,onClick:N,children:[d.jsx(S_,{className:"h-3 w-3"}),"Report Issue"]})]}),d.jsxs(lh,{className:"mt-2 space-y-2",children:[G.length>0&&d.jsxs("div",{className:"rounded-md border border-blue-500/40 bg-background/60 p-2 dark:bg-background/40",children:[d.jsx("div",{className:"mb-1 text-[11px] font-semibold text-blue-900 dark:text-blue-200",children:"Suggested fixes:"}),d.jsx("ul",{className:"ml-3 list-disc space-y-1",children:G.map((ne,oe)=>d.jsx("li",{className:"text-[11px] leading-relaxed text-foreground/80",children:ne},oe))})]}),d.jsxs("div",{className:`rounded-md border ${ee.border} bg-background/60 p-2 dark:bg-background/40`,children:[d.jsx("div",{className:`mb-1 text-[11px] font-semibold ${ee.text}`,children:"Raw error:"}),d.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-foreground/80",children:o.error})]})]})]})}),m&&d.jsx(pg,{open:h,onOpenChange:ne=>{p(ne),ne||b(null)},feedbackData:m})]})}return d.jsxs(d.Fragment,{children:[d.jsxs(Fi,{className:"grid w-full max-w-full grid-cols-1 border border-muted bg-background shadow-sm",children:[d.jsx($i,{className:"pb-3",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"space-y-1",children:d.jsx("h3",{className:"text-base font-semibold text-foreground",children:M||"Untitled Chart"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[j!=="table"&&j!=="pivotTable"&&d.jsx(ui,{value:u,onValueChange:f,children:d.jsxs(Ps,{className:"h-8",children:[d.jsx(Fn,{value:"visual",className:"h-7 w-7 p-0","aria-label":"View as chart",children:d.jsx(Tg,{className:"h-3.5 w-3.5"})}),d.jsx(Fn,{value:"table",className:"h-7 w-7 p-0","aria-label":"View as table",children:d.jsx(Hv,{className:"h-3.5 w-3.5"})})]})}),!C&&d.jsx(le,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:()=>{t==null||t({sql:T||"",data:A||[],dataSource:F||H1,cardConfig:R,cardTitle:M||"Untitled Chart",connectionId:_||"",cardType:j||"bar",python:I||""})},"aria-label":"Add visual to dashboard",children:d.jsx(Yo,{className:"h-4 w-4"})})]})]})}),d.jsxs(Ba,{className:"space-y-4",children:[d.jsx("div",{className:K("isolate flex w-full grow flex-col",j!=="table"&&j!=="pivotTable"&&"min-h-[360px]"),children:d.jsx("div",{className:"flex grow flex-col",children:j==="table"&&H?d.jsx("div",{className:"min-w-0",children:d.jsx(Gm,{card:H,data:A||[],isLoading:!1})}):j==="pivotTable"&&P&&H?d.jsx(Kw,{data:P.data,card:H,options:P.options}):U&&j!=="table"&&j!=="pivotTable"?u==="table"?d.jsx("div",{className:"min-w-0 pb-6",children:d.jsx(Gm,{card:H,data:A||[],isLoading:!1})}):d.jsx(z4,{cfg:U}):U&&d.jsx(z4,{cfg:U})})}),(T||I||H&&zl(H.config))&&d.jsxs(ih,{open:i,onOpenChange:a,children:[d.jsxs("div",{className:"flex items-center justify-between border-t border-muted/40 pb-2 pt-2",children:[d.jsx("div",{className:"flex items-center gap-2",children:(()=>{const W=B();return d.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[W.icons.map((q,Y)=>d.jsx(q,{className:"h-3 w-3"},Y)),d.jsx("span",{children:W.label}),d.jsx(le,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 hover:text-foreground",onClick:S,title:"Ask for explanation",children:d.jsx(If,{className:"h-3 w-3"})})]})})()}),d.jsx(ah,{asChild:!0,children:d.jsxs(le,{variant:"ghost",size:"sm",className:"gap-1 text-xs",children:[i?"Hide Details":"Show Details",d.jsx(Eo,{className:`h-3 w-3 transition-transform ${i?"rotate-180":""}`})]})})]}),d.jsxs(lh,{className:"space-y-3 pb-6",children:[O&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(su,{className:"h-4 w-4 text-blue-600"}),d.jsx("span",{className:"text-sm font-medium text-foreground",children:"SQL Query"})]}),d.jsx(rh,{text:O,className:"-mr-1"})]}),d.jsx("div",{className:"rounded-md border bg-muted/30",children:d.jsx(Fl,{language:"sql",code:O})})]}),I&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(QT,{className:"h-4 w-4 text-green-600"}),d.jsx("span",{className:"text-sm font-medium text-foreground",children:"Python"})]}),d.jsx(rh,{text:I,className:"-mr-1"})]}),d.jsx("div",{className:"rounded-md border bg-muted/30",children:d.jsx(Fl,{language:"python",code:I})})]})]})]})]})]}),m&&d.jsx(pg,{open:h,onOpenChange:W=>{p(W),W||b(null)},feedbackData:m})]})}const SVe=["tool-getChartDataFromSqlAndPython","tool-getChartDataFromCardConfig","tool-getForecastDataFromSqlAndPython","tool-generateQueryConfig"];function CVe({part:e,idx:t,showTools:n,onAddToDashboard:r,messages:o}){if(!e.state)return null;if(e.state==="input-streaming"||e.state==="input-available"){const s=iX(e.type,e.state);return d.jsx(EVe,{text:s})}if(e.state==="output-available"){const s=SVe.includes(e.type);return d.jsxs("div",{className:"my-2 space-y-2",children:[n&&d.jsx(xVe,{part:e,showTools:n}),s&&r&&d.jsx(wVe,{part:e,onAddToDashboard:r,messages:o,showTools:n})]},t)}return e.state==="output-error"?n?d.jsx("div",{className:"mt-2",children:d.jsx(vVe,{part:e,messages:o})},t):d.jsx("div",{className:"my-2 rounded-md border border-border/40 bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"I hit a snag while working on that and will adjust the approach."},t):d.jsx("div",{},t)}function EVe({text:e}){return d.jsx("div",{className:"mt-2 animate-pulse text-sm text-muted-foreground",children:e})}const B4=/```quickreply\s*([\s\S]*?)```/i;function NVe(e){let t=e,n=null;const r=e.toLowerCase().indexOf("```quickreply");if(r!==-1){const i=e.match(B4);if(i)n=i[1].trim(),t=e.replace(i[0],"").trim();else return{cleanedText:e.slice(0,r).trimEnd(),quickReplies:[]}}else{const i=e.match(B4);i&&(n=i[1].trim(),t=e.replace(i[0],"").trim())}const o=t===e?e.toLowerCase().indexOf("quickreply"):-1;if(!n&&o!==-1){const i=e.indexOf("{",o);if(i!==-1){let a=0,l=-1;for(let c=i;c<e.length;c++){const u=e[c];if(u==="{")a++;else if(u==="}"&&(a--,a===0)){l=c;break}}if(l!==-1)n=e.slice(i,l+1).trim(),t=(e.slice(0,o)+e.slice(l+1)).trim();else return{cleanedText:e.slice(0,o).trimEnd(),quickReplies:[]}}else return{cleanedText:e.slice(0,o).trimEnd(),quickReplies:[]}}let s=[];if(n)try{const i=JSON.parse(n);s=(Array.isArray(i==null?void 0:i.options)?i.options:[]).map(l=>{const c=typeof(l==null?void 0:l.label)=="string"?l.label.trim():"",u=typeof(l==null?void 0:l.value)=="string"?l.value.trim():"";return c&&u?{label:c,value:u}:null}).filter(Boolean)}catch{s=[]}return{cleanedText:t.trim(),quickReplies:s}}function kVe(e){if(e==null)return"Something went wrong.";if(e instanceof Error)return e.message||"Something went wrong.";const t=r=>{if(!r||typeof r!="object")return null;const o=r.error&&typeof r.error=="object"?r.error:r,s=typeof o.code=="string"&&o.code?o.code.trim():"",i=typeof o.docs=="string"&&o.docs?`
931
931
  More info: ${o.docs}`:"",a=typeof o.message=="string"&&o.message.trim()?o.message.trim():typeof o.error=="string"&&o.error.trim()?o.error.trim():null;if(a){const l=s?` (code: ${s})`:"",c=s==="insufficient_quota"||a.toLowerCase().includes("quota")?`
932
932
 
933
933
  Semaphor supports bring-your-own OpenAI API keys. Add yours in Settings or drop a note to support@semaphor.cloud and we’ll help you get set up.`:"";return`${a}${l}${i}${c}`}return null};if(typeof e=="string"){const r=e.trim();if(!r)return"Something went wrong.";try{const o=JSON.parse(r),s=t(o);if(s)return s}catch{}return r}const n=t(e);if(n)return n;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function HD({errorMessage:e}){return d.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-red-500/10 p-2 text-sm text-red-500 backdrop-blur-sm",children:[d.jsx(j_,{className:"mt-0.5 h-4 w-4 shrink-0"}),d.jsx("span",{className:"whitespace-pre-wrap break-words",children:kVe(e)})]})}function _Ve({error:e,resetErrorBoundary:t}){return d.jsxs("div",{className:"my-4 space-y-2 rounded-md border border-border/50 bg-muted/20 p-3",children:[d.jsx(HD,{errorMessage:e==null?void 0:e.message}),d.jsx("button",{type:"button",className:"text-xs font-medium text-muted-foreground underline hover:text-foreground",onClick:t,children:"Try again"})]})}function jVe({text:e,files:t}){return d.jsxs("div",{className:"group relative rounded-md border border-border/50 bg-muted/50 p-3 text-sm",children:[d.jsx(zne,{className:"float-left mr-2 mt-0.5 size-3.5"}),d.jsxs("div",{className:"space-y-2",children:[e&&d.jsx("div",{className:"whitespace-pre-line",children:e}),t&&t.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(n=>d.jsx(yVe,{file:n},n.id))})]}),e&&d.jsx("div",{className:"absolute right-1 top-1 opacity-0 transition-opacity group-hover:opacity-100",children:d.jsx(rh,{text:e,className:"h-6"})})]})}function RVe({text:e}){const t=e.split("|"),n=t[0],r=t[1]||"{}",o=JSON.parse(r);return d.jsxs("div",{className:"space-y-1 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-bold",children:"System Message:"})," ",n]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"font-mono text-xs",children:"Scope:"}),d.jsx(i3e,{children:JSON.stringify(o,null,2)})]})]})}function aX({status:e,errorMessage:t}){return e==="submitted"?d.jsx("div",{className:"mt-2 animate-pulse text-sm text-muted-foreground",children:"Thinking..."}):e==="streaming"?d.jsx("div",{className:"animate-pulse text-sm text-muted-foreground",children:d.jsx(Fu,{size:"sm","aria-label":"chat-status"})}):e==="error"?d.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:d.jsx(HD,{errorMessage:t})}):null}function lX({messages:e,showTools:t=!1,onAddToDashboard:n,showSystemMessage:r=!1,handleRun:o,onQuickReply:s,disableQuickReplies:i=!1}){return d.jsx("div",{children:e==null?void 0:e.map((a,l)=>{var c,u,f;if(a.role==="user"){const h=((c=a.parts)==null?void 0:c.filter(y=>y.type==="text"))||[],p=((u=a.parts)==null?void 0:u.filter(y=>y.type==="file"))||[],m=h.map(y=>y.text).join(`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-BdPUTTPW.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-p33qmYMH.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as a } from "../chunks/index-HexevzNd.js";
1
+ import { D as a } from "../chunks/index-C5-7DCLL.js";
2
2
  import { EMPTY_SELECTION as e } from "../types/index.js";
3
3
  export {
4
4
  a as Dashboard,
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BdPUTTPW.js"),v=require("./types/index.cjs"),u=require("./chunks/dashboard-plus-gTQOhalu.js"),a=require("react/jsx-runtime"),x=require("react");require("react-dom");function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const p=j(x);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-p33qmYMH.js"),v=require("./types/index.cjs"),u=require("./chunks/dashboard-plus-eOEXegP6.js"),a=require("react/jsx-runtime"),x=require("react");require("react-dom");function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const p=j(x);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { c as x, E as v, F as N, S as w, U as A, a as L, C as _, u as E, b as g, d as P, P as k, e as W, B as F, f as M, g as R, h as V, i as B, j as O, I as Q, k as I, l as j, m as q, n as U, o as z } from "./chunks/index-HexevzNd.js";
2
- import { D as ne, t as ie, R as de, r as le, r as ce, $ as Ye, K as ue, w as he, y as pe, M as fe, L as me, Q as Me, T as Ce, J as De, v as ge, H as ve, N as ye, G as be, A as Te, z as Se, V as xe, O as Ne, s as we, X as Ae, Z as Le, Y as _e, _ as Ee, x as Pe, p as ke, a1 as We, W as Fe, a0 as Re, q as Ve } from "./chunks/index-HexevzNd.js";
1
+ import { c as x, E as v, F as N, S as w, U as A, a as L, C as _, u as E, b as g, d as P, P as k, e as W, B as F, f as M, g as R, h as V, i as B, j as O, I as Q, k as I, l as j, m as q, n as U, o as z } from "./chunks/index-C5-7DCLL.js";
2
+ import { D as ne, t as ie, R as de, r as le, r as ce, $ as Ye, K as ue, w as he, y as pe, M as fe, L as me, Q as Me, T as Ce, J as De, v as ge, H as ve, N as ye, G as be, A as Te, z as Se, V as xe, O as Ne, s as we, X as Ae, Z as Le, Y as _e, _ as Ee, x as Pe, p as ke, a1 as We, W as Fe, a0 as Re, q as Ve } from "./chunks/index-C5-7DCLL.js";
3
3
  import { EMPTY_SELECTION as Oe } from "./types/index.js";
4
- import { A as Ie, R as je, b as qe, S as Ue, D as ze, a as Ge, V as He, c as $e, g as Ke } from "./chunks/dashboard-plus-BTFwb1Rw.js";
4
+ import { A as Ie, R as je, b as qe, S as Ue, D as ze, a as Ge, V as He, c as $e, g as Ke } from "./chunks/dashboard-plus-Cqj7tN1S.js";
5
5
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
6
6
  import * as h from "react";
7
7
  import { useMemo as G } from "react";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-gTQOhalu.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-eOEXegP6.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as f } from "../chunks/dashboard-plus-BTFwb1Rw.js";
1
+ import { D as f } from "../chunks/dashboard-plus-Cqj7tN1S.js";
2
2
  import { EMPTY_SELECTION as a } from "../types/index.js";
3
3
  export {
4
4
  a as EMPTY_SELECTION,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.31",
8
+ "version": "0.1.32",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",