PageSourceSearch

https://klarety.ai/_next/static/chunks/6650.0c2023cdd3a7d76b.js

js klarety.ai collected 2026-10-05 15:40:04 UTC 42,350 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6650],{10215:(e,t,s)=>{s.d(t,{K:()=>n});var a=s(99680),r=s(7620);function n(e){let t,s,n=(0,a.c)(3),[l,i]=(0,r.useState)(!1);return n[0]!==e?(t=()=>{let t=window.matchMedia("(min-width: ".concat(e,"px)")),s=()=>i(t.matches);return s(),t.addEventListener("change",s),()=>t.removeEventListener("change",s)},s=[e],n[0]=e,n[1]=t,n[2]=s):(t=n[1],s=n[2]),(0,r.useEffect)(t,s),l}},15691:(e,t,s)=>{s.d(t,{X:()=>g});var a=s(54568),r=s(99680),n=s(93891),l=s(22483),i=s(54250),o=s(89021),c=s(32485),d=s(14602),u=s(82490),m=s(10677),h=s(61497),x=s(15126);function f(e){let t,s,n,l,i,o,c,d,u,f,g,p,b,y,v,j,N,w=(0,r.c)(40),{item:S}=e;return w[0]!==S.outcome?(t=function(e){switch(e){case"SUCCESS":return{label:"Success",tone:"text-emerald-600 dark:text-emerald-400"};case"ESTIMATED":return{label:"Estimated",tone:"text-muted-foreground"};case"REJECTED_COST":case"REJECTED_CUMULATIVE_BUDGET":return{label:"Blocked (cost)",tone:"text-amber-600 dark:text-amber-400"};case"REJECTED_NOT_READ_ONLY":case"REJECTED_MULTI_STATEMENT":return{label:"Blocked (guard)",tone:"text-amber-600 dark:text-amber-400"};case"ERROR":return{label:"Error",tone:"text-destructive"};default:return{label:e,tone:"text-muted-foreground"}}}(S.outcome),w[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,x.cn)("flex flex-col gap-1 px-3 py-2.5 text-xs",m.U.navItem),w[6]=l):l=w[6],i="geobricks-query-history-item",n="flex items-center justify-between gap-2",s=(0,x.cn)("font-medium",t.tone),w[0]=S.outcome,w[1]=t,w[2]=s,w[3]=n,w[4]=l,w[5]=i):(t=w[1],s=w[2],n=w[3],l=w[4],i=w[5]),w[7]!==t.label||w[8]!==s?(o=(0,a.jsx)("span",{className:s,children:t.label}),w[7]=t.label,w[8]=s,w[9]=o):o=w[9],w[10]!==S.queriedAt?(c=new Date(S.queriedAt).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"}),w[10]=S.queriedAt,w[11]=c):c=w[11],w[12]!==c?(d=(0,a.jsx)("span",{className:"text-muted-foreground",children:c}),w[12]=c,w[13]=d):d=w[13],w[14]!==n||w[15]!==o||w[16]!==d?(u=(0,a.jsxs)("div",{className:n,children:[o,d]}),w[14]=n,w[15]=o,w[16]=d,w[17]=u):u=w[17],w[18]!==S.rowsReturned?(f=S.rowsReturned.toLocaleString("en-US"),w[18]=S.rowsReturned,w[19]=f):f=w[19],w[20]!==S.durationMs?(g=S.durationMs.toLocaleString("en-US"),w[20]=S.durationMs,w[21]=g):g=w[21],w[22]!==g||w[23]!==f?(p=(0,a.jsxs)("span",{children:[f," rows \xb7"," ",g," ms"]}),w[22]=g,w[23]=f,w[24]=p):p=w[24],w[25]!==S.creditsCharged?(b=S.creditsCharged>0?"".concat((0,h.H)(S.creditsCharged)," credits"):"0 credits",w[25]=S.creditsCharged,w[26]=b):b=w[26],w[27]!==b?(y=(0,a.jsx)("span",{className:"tabular-nums",children:b}),w[27]=b,w[28]=y):y=w[28],w[29]!==p||w[30]!==y?(v=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-muted-foreground",children:[p,y]}),w[29]=p,w[30]=y,w[31]=v):v=w[31],w[32]!==S.rejectionReason?(j=S.rejectionReason?(0,a.jsx)("p",{className:"text-muted-foreground/90",children:S.rejectionReason}):null,w[32]=S.rejectionReason,w[33]=j):j=w[33],w[34]!==v||w[35]!==j||w[36]!==l||w[37]!==i||w[38]!==u?(N=(0,a.jsxs)("li",{className:l,"data-testid":i,children:[u,v,j]}),w[34]=v,w[35]=j,w[36]=l,w[37]=i,w[38]=u,w[39]=N):N=w[39],N}function g(e){let t,s,m,h,f=(0,r.c)(13),{enabled:g,limit:b,className:y,"data-testid":v}=e,j=void 0===g||g,N=void 0===b?50:b,w=void 0===v?"geobricks-query-history-list":v;f[0]!==j||f[1]!==N?(t={offset:0,limit:N,enabled:j},f[0]=j,f[1]=N,f[2]=t):t=f[2];let S=function(e){let t,s,a,u,m,h,x,f=(0,r.c)(16),{getToken:g,isLoaded:p,isSignedIn:b}=(0,n.d)(),y=(0,c.useActiveScope)();if(f[0]!==e||f[1]!==y){let{enabled:r,...n}=e;s=n,t=void 0===r||r,u=l.useQuery,a=(0,d.kX)(o.Q.queryHistory(s),y),f[0]=e,f[1]=y,f[2]=t,f[3]=s,f[4]=a,f[5]=u}else t=f[2],s=f[3],a=f[4],u=f[5];f[6]!==g||f[7]!==s?(m=()=>(0,i.w0)(g,s),f[6]=g,f[7]=s,f[8]=m):m=f[8];let v=t&&p&&!!b&&!!y;return f[9]!==y?(h=(0,d.wG)(y),f[9]=y,f[10]=h):h=f[10],f[11]!==a||f[12]!==m||f[13]!==v||f[14]!==h?(x={queryKey:a,queryFn:m,enabled:v,staleTime:1e4,placeholderData:h},f[11]=a,f[12]=m,f[13]=v,f[14]=h,f[15]=x):x=f[15],u(x)}(t);
1return f[3]!==y?(s=(0,x.cn)("min-h-0 flex-1 overflow-auto",y),f[3]=y,f[4]=s):s=f[4],f[5]!==S.data||f[6]!==S.isError||f[7]!==S.isPending?(m=S.isPending?(0,a.jsx)(u.Z,{label:"Loading history",testId:"geobricks-query-history-loading",className:"h-full",minHeightClassName:"min-h-[160px]"}):S.isError?(0,a.jsx)("div",{className:"p-4 text-sm text-muted-foreground","data-testid":"geobricks-query-history-error",children:"Could not load query history. Try again in a moment."}):S.data&&0!==S.data.items.length?(0,a.jsx)("ul",{className:"divide-y divide-border/60",children:S.data.items.map(p)}):(0,a.jsx)("div",{className:"p-4 text-sm text-muted-foreground","data-testid":"geobricks-query-history-empty",children:"No queries yet. Run one in the SQL editor to see it here."}),f[5]=S.data,f[6]=S.isError,f[7]=S.isPending,f[8]=m):m=f[8],f[9]!==s||f[10]!==m||f[11]!==w?(h=(0,a.jsx)("div",{className:s,"data-testid":w,children:m}),f[9]=s,f[10]=m,f[11]=w,f[12]=h):h=f[12],h}function p(e){return(0,a.jsx)(f,{item:e},e.queryAuditId)}},18174:(e,t,s)=>{s.d(t,{CG:()=>d,Fm:()=>x,Qs:()=>g,cj:()=>c,h:()=>h,qp:()=>f});var a=s(54568),r=s(99680);s(7620);var n=s(97180),l=s(39139),i=s(15126),o=s(34409);function c(e){let t,s,l=(0,r.c)(4);return l[0]!==e?({...t}=e,l[0]=e,l[1]=t):t=l[1],l[2]!==t?(s=(0,a.jsx)(n.bL,{"data-slot":"sheet",...t}),l[2]=t,l[3]=s):s=l[3],s}function d(e){let t,s,l=(0,r.c)(4);return l[0]!==e?({...t}=e,l[0]=e,l[1]=t):t=l[1],l[2]!==t?(s=(0,a.jsx)(n.l9,{"data-slot":"sheet-trigger",...t}),l[2]=t,l[3]=s):s=l[3],s}function u(e){let t,s,l=(0,r.c)(4);return l[0]!==e?({...t}=e,l[0]=e,l[1]=t):t=l[1],l[2]!==t?(s=(0,a.jsx)(n.ZL,{"data-slot":"sheet-portal",...t}),l[2]=t,l[3]=s):s=l[3],s}function m(e){let t,s,l,o,c=(0,r.c)(8);return c[0]!==e?({className:t,...s}=e,c[0]=e,c[1]=t,c[2]=s):(t=c[1],s=c[2]),c[3]!==t?(l=(0,i.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 duration-300",t),c[3]=t,c[4]=l):l=c[4],c[5]!==s||c[6]!==l?(o=(0,a.jsx)(n.hJ,{"data-slot":"sheet-overlay",className:l,...s}),c[5]=s,c[6]=l,c[7]=o):o=c[7],o}function h(e){let t,s,c,d,h,x,f,g,p,b,y=(0,r.c)(21);y[0]!==e?({className:s,children:t,side:h,onPointerDownOutside:c,...d}=e,y[0]=e,y[1]=t,y[2]=s,y[3]=c,y[4]=d,y[5]=h):(t=y[1],s=y[2],c=y[3],d=y[4],h=y[5]);let v=void 0===h?"right":h;y[6]===Symbol.for("react.memo_cache_sentinel")?(x=(0,a.jsx)(m,{}),y[6]=x):x=y[6];let j="right"===v&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",N="left"===v&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",w="top"===v&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",S="bottom"===v&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";return y[7]!==s||y[8]!==j||y[9]!==N||y[10]!==w||y[11]!==S?(f=(0,i.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg duration-300",j,N,w,S,s),y[7]=s,y[8]=j,y[9]=N,y[10]=w,y[11]=S,y[12]=f):f=y[12],y[13]!==c?(g=e=>{if((0,o.G)(e.target))return void e.preventDefault();null==c||c(e)},y[13]=c,y[14]=g):g=y[14],y[15]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(n.bm,{className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,a.jsx)(l.A,{className:"size-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]}),y[15]=p):p=y[15],y[16]!==t||y[17]!==d||y[18]!==f||y[19]!==g?(b=(0,a.jsxs)(u,{children:[x,(0,a.jsxs)(n.UC,{"data-slot":"sheet-content",className:f,onPointerDownOutside:g,...d,children:[t,p]})]}),y[16]=t,y[17]=d,y[18]=f,y[19]=g,y[20]=b):b=y[20],b}function x(e){let t,s,n,l,o=(0,r.c)(8);return o[0]!==e?({className:t,...s}=e,o[0]=e,o[1]=t,o[2]=s):(t=o[1],s=o[2]),o[3]!==t?(n=(0,i.cn)("flex flex-col gap-1.5 p-4",t),o[3]=t,o[4]=n):n=o[4],o[5]!==s||o[6]!==n?(l=(0,a.jsx)("div",{"data-slot":"sheet-header",className:n,...s}),o[5]=s,o[6]=n,o[7]=l):l=o[7],l}function f(e){let t,s,l,o,c=(0,r.c)(8);return c[0]!==e?({className:t,...s}=e,c[0]=e,c[1]=t,c[2]=s):(t=c[1],s=c[2]),c[3]!==t?(l=(0,i.cn)("text-foreground font-semibold",t),c[3]=t,c[4]=l):l=c[4],c[5]!==s||c[6]!==l?(o=(0,a.jsx)(n.hE,{"data-slot":"sheet-title",className:l,...s}),c[5]=s,c[6]=l,c[7]=o):o=c[7],o}function g(e){let t,s,l,o,c=(0,r.c)(8);return c[0]!==e?({className:t,...s}=e,c[0]=e,c[1]=t,c[2]=s):(t=c[1],s=c[2]),c[3]!==t?(l=(0,i.cn)("text-muted-foreground text-sm",t),c[3]=t,c[4]=l):l=c[4],c[5]!==s||c[6]!==l?(o=(0,a.jsx)(n.VY,{"data-slot":"sheet-
1description",className:l,...s}),c[5]=s,c[6]=l,c[7]=o):o=c[7],o}},44651:(e,t,s)=>{s.d(t,{y:()=>i});var a=s(54568),r=s(99680),n=s(46486),l=s(15126);function i(e){let t,s,i,o,c=(0,r.c)(8);return c[0]!==e?({className:t,...s}=e,c[0]=e,c[1]=t,c[2]=s):(t=c[1],s=c[2]),c[3]!==t?(i=(0,l.cn)("size-4 animate-spin",t),c[3]=t,c[4]=i):i=c[4],c[5]!==s||c[6]!==i?(o=(0,a.jsx)(n.A,{role:"status","aria-label":"Loading",className:i,...s}),c[5]=s,c[6]=i,c[7]=o):o=c[7],o}},54250:(e,t,s)=>{s.d(t,{BG:()=>r,b7:()=>u,hp:()=>i,q9:()=>d,qJ:()=>o,w0:()=>c});var a=s(46105);class r extends Error{constructor(e,t,s){super(e),this.status=t,this.code=s,this.name="GeobricksQueryRequestError"}}function n(){let e="https://backend.klarety.ai";if(!e)throw new r("NEXT_PUBLIC_BACKEND_URL is not configured",0);return e}async function l(e){let t=await e();return{Accept:"application/json",...t?{Authorization:"Bearer ".concat(t)}:{}}}async function i(e,t){let s=await fetch("".concat(n(),"/v1/geobricks/query"),{method:"POST",headers:{...await l(e),"Content-Type":"application/json"},body:JSON.stringify({sql:t})});if(!s.ok){let e,t="Query failed (".concat(s.status,")");try{let a=await s.json();a.message&&(t=a.message),a.code&&(e=a.code)}catch(e){}throw new r(t,s.status,e)}return a.m1h.parse(await s.json())}async function o(e,t){let s=await fetch("".concat(n(),"/v1/geobricks/query/estimate"),{method:"POST",headers:{...await l(e),"Content-Type":"application/json"},body:JSON.stringify({sql:t})});if(!s.ok){let e="Estimate failed (".concat(s.status,")");try{let t=await s.json();t.message&&(e=t.message)}catch(e){}throw new r(e,s.status)}return a.T$r.parse(await s.json())}async function c(e,t){let s=new URL("".concat(n(),"/v1/geobricks/query/history"));s.searchParams.set("offset",String(t.offset)),s.searchParams.set("limit",String(t.limit));let i=await fetch(s,{headers:await l(e)});if(!i.ok)throw new r("Failed to load query history (".concat(i.status,")"),i.status);return a.kj.parse(await i.json())}async function d(e,t){let s=new URL("".concat(n(),"/v1/geobricks/query/").concat(encodeURIComponent(t.queryId),"/cell"));s.searchParams.set("row",String(t.row)),s.searchParams.set("column",t.column);let i=await fetch(s,{headers:await l(e)});if(!i.ok)throw new r("Failed to load geometry (".concat(i.status,")"),i.status);return a.bu.parse(await i.json())}async function u(e){let t=await fetch("".concat(n(),"/v1/geobricks/schema"),{headers:await l(e)});if(!t.ok)throw new r("Failed to load schema (".concat(t.status,")"),t.status);return a.fwd.parse(await t.json())}},61497:(e,t,s)=>{s.d(t,{H:()=>a});function a(e){return(Math.floor(100*e)/100).toFixed(2)}},62063:(e,t,s)=>{s.d(t,{F:()=>i});var a=s(54568),r=s(99680);s(7620);var n=s(26158),l=s(15126);function i(e){let t,s,i,c,d,u,m,h,x,f=(0,r.c)(15);return f[0]!==e?({className:s,children:t,...i}=e,f[0]=e,f[1]=t,f[2]=s,f[3]=i):(t=f[1],s=f[2],i=f[3]),f[4]!==s?(c=(0,l.cn)("relative",s),f[4]=s,f[5]=c):c=f[5],f[6]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.cn)("focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1","[&>div]:block!"),f[6]=d):d=f[6],f[7]!==t?(u=(0,a.jsx)(n.LM,{"data-slot":"scroll-area-viewport",className:d,children:t}),f[7]=t,f[8]=u):u=f[8],f[9]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(o,{}),h=(0,a.jsx)(n.OK,{}),f[9]=m,f[10]=h):(m=f[9],h=f[10]),f[11]!==i||f[12]!==c||f[13]!==u?(x=(0,a.jsxs)(n.bL,{"data-slot":"scroll-area",className:c,...i,children:[u,m,h]}),f[11]=i,f[12]=c,f[13]=u,f[14]=x):x=f[14],x}function o(e){let t,s,i,o,c,d,u=(0,r.c)(13);u[0]!==e?({className:t,orientation:i,...s}=e,u[0]=e,u[1]=t,u[2]=s,u[3]=i):(t=u[1],s=u[2],i=u[3]);let m=void 0===i?"vertical":i,h="vertical"===m&&"h-full w-2.5 border-l border-l-transparent",x="horizontal"===m&&"h-2.5 flex-col border-t border-t-transparent";return u[4]!==t||u[5]!==h||u[6]!==x?(o=(0,l.cn)("flex touch-none p-px transition-colors select-none",h,x,t),u[4]=t,u[5]=h,u[6]=x,u[7]=o):o=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(n.lr,{"data-slot":"scroll-area-thumb",className:"bg-muted-foreground
1/30 relative flex-1 rounded-full"}),u[8]=c):c=u[8],u[9]!==m||u[10]!==s||u[11]!==o?(d=(0,a.jsx)(n.VM,{"data-slot":"scroll-area-scrollbar",orientation:m,className:o,...s,children:c}),u[9]=m,u[10]=s,u[11]=o,u[12]=d):d=u[12],d}},66692:(e,t,s)=>{s.d(t,{q:()=>a});let a=(0,s(32166).v)(e=>({sql:"SELECT *\nFROM v_features\nLIMIT 100",selectedViewName:null,setSql:t=>e({sql:t}),setSelectedViewName:t=>e({selectedViewName:t})}))},84269:(e,t,s)=>{s.r(t),s.d(t,{GeobricksQueryEditorWorkspace:()=>W});var a=s(54568),r=s(99680),n=s(7620),l=s(12417),i=s(4549),o=s(86668),c=s(67753),d=s(10775),u=s(70747),m=s(465),h=s(93891),x=s(22483),f=s(54250),g=s(89021),p=s(82490),b=s(10677);function y(e,t){let s=e.trim();if(s)return s;switch(t){case"geometry":return"GEOMETRY";case"timestamp":return"TIMESTAMP";case"numeric":return"NUMERIC";case"boolean":return"BOOLEAN";case"binary":return"BINARY";case"string":return"VARCHAR";default:return t}}var v=s(46105);function j(e){let t=v.HoZ.safeParse(e);return t.success?t.data:null}function N(e){return"".concat(e.geometryType," \xb7 ").concat(e.vertexCount.toLocaleString("en-US")," pts")}var w=s(15126);function S(e){var t,s,l,i,o,c,d;let{result:u,isPending:v=!1}=e,j=(0,n.useRef)(null),[N,S]=(0,n.useState)(null),_=null!=(s=null==u?void 0:u.columns)?s:[],q=null!=(l=null==u?void 0:u.rows)?l:[],C=function(e,t,s,a){let n,l,i,o=(0,r.c)(13),{getToken:c,isLoaded:d,isSignedIn:u}=(0,h.d)();o[0]!==s||o[1]!==e||o[2]!==t?(n=g.Q.queryCell(null!=e?e:"",null!=t?t:-1,null!=s?s:""),o[0]=s,o[1]=e,o[2]=t,o[3]=n):n=o[3],o[4]!==s||o[5]!==c||o[6]!==e||o[7]!==t?(l=()=>(0,f.q9)(c,{queryId:null!=e?e:"",row:null!=t?t:0,column:null!=s?s:""}),o[4]=s,o[5]=c,o[6]=e,o[7]=t,o[8]=l):l=o[8];let m=a&&d&&!!u&&!!e&&null!=t&&!!s;return o[9]!==n||o[10]!==l||o[11]!==m?(i={queryKey:n,queryFn:l,enabled:m,staleTime:1/0},o[9]=n,o[10]=l,o[11]=m,o[12]=i):i=o[12],(0,x.useQuery)(i)}(null!=(i=null==u?void 0:u.queryId)?i:null,null!=(o=null==N?void 0:N.row)?o:null,null!=(c=null==N?void 0:N.column)?c:null,null!=N),E=(0,n.useMemo)(()=>0===_.length?"1fr":_.map(()=>"minmax(140px, 1fr)").join(" "),[_]),U=(0,m.Te)({count:q.length,getScrollElement:()=>j.current,estimateSize:()=>32,overscan:12,enabled:q.length>40});if(v)return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,a.jsx)("div",{className:(0,w.cn)("px-3 py-2",b.U.header),children:(0,a.jsx)("p",{className:"text-xs font-medium text-foreground",children:"Results"})}),(0,a.jsx)(p.Z,{label:"Running query",testId:"geobricks-query-results-loading",className:"flex-1",minHeightClassName:"min-h-[200px]"})]});if(!u)return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,a.jsx)("div",{className:(0,w.cn)("px-3 py-2",b.U.header),children:(0,a.jsx)("p",{className:"text-xs font-medium text-foreground",children:"Results"})}),(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center p-6 text-sm text-muted-foreground","data-testid":"geobricks-query-results-empty",children:"Run a query to see results."})]});if(0===u.rowCount)return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,a.jsx)("div",{className:(0,w.cn)("px-3 py-2",b.U.header),children:(0,a.jsx)("p",{className:"text-xs font-medium text-foreground",children:"Results"})}),(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center p-6 text-sm text-muted-foreground","data-testid":"geobricks-query-results-zero",children:"Query returned 0 rows."})]});let T=q.length>40,R=T?U.getVirtualItems():null;return(0,a.jsxs)("div",{className:"relative flex h-full min-h-0 flex-col",children:[(0,a.jsxs)("div",{className:(0,w.cn)("flex items-center justify-between px-3 py-2",b.U.header),children:[(0,a.jsx)("p",{className:"text-xs font-medium text-foreground",children:"Results"}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground tabular-nums",children:[u.rowCount.toLocaleString("en-US")," rows"]})]}),u.truncated?(0,a.jsxs)("div",{className:(0,w.cn)("border-b px-3 py-1.5 text-xs",b.U.banner),"data-testid":"geobricks-query-truncated-banner",role:"status",children:["Results truncated at ",u.rowCount.toLocaleStr
1ing("en-US")," rows."]}):null,(0,a.jsxs)("div",{ref:j,className:"min-h-0 flex-1 overflow-auto","data-testid":"geobricks-query-results-grid",children:[(0,a.jsx)("div",{className:(0,w.cn)("sticky top-0 z-10 grid border-b border-l text-xs font-medium backdrop-blur-sm",b.U.tableHeader,b.U.panelBorder),style:{gridTemplateColumns:E,minWidth:140*_.length,height:44},children:_.map(e=>(0,a.jsxs)("div",{className:"flex min-w-0 flex-col justify-center border-r border-border/60 px-2 py-1",title:"".concat(e.name," (").concat(y(e.typeName,e.kind),")"),children:[(0,a.jsx)("span",{className:"truncate font-medium text-foreground",children:e.name}),(0,a.jsx)("span",{className:"truncate text-[10px] text-muted-foreground",children:y(e.typeName,e.kind)})]},e.name))}),T&&R?(0,a.jsx)("div",{className:"relative",style:{height:U.getTotalSize(),minWidth:140*_.length},children:R.map(e=>{let t=q[e.index];return t?(0,a.jsx)("div",{className:"absolute left-0 grid w-full border-l border-border/60 text-xs",style:{gridTemplateColumns:E,height:e.size,transform:"translateY(".concat(e.start,"px)")},children:_.map((s,r)=>(0,a.jsx)(k,{kind:s.kind,value:t[r],numeric:"numeric"===s.kind,onExpandGeometry:"geometry"===s.kind?()=>S({row:e.index,column:s.name}):void 0},"".concat(e.index,"-").concat(s.name)))},e.key):null})}):(0,a.jsx)("div",{style:{minWidth:140*_.length},children:q.map((e,t)=>(0,a.jsx)("div",{className:"grid border-l border-border/60 text-xs",style:{gridTemplateColumns:E,height:32},children:_.map((s,r)=>(0,a.jsx)(k,{kind:s.kind,value:e[r],numeric:"numeric"===s.kind,onExpandGeometry:"geometry"===s.kind?()=>S({row:t,column:s.name}):void 0},"".concat(t,"-").concat(s.name)))},t))})]}),N?(0,a.jsx)("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-4","data-testid":"geobricks-geometry-expand",children:(0,a.jsxs)("div",{className:"max-h-[80%] w-full max-w-2xl overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[(0,a.jsxs)("p",{className:"text-sm font-medium",children:[N.column," \xb7 row ",N.row+1]}),(0,a.jsx)("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground",onClick:()=>S(null),"data-testid":"geobricks-geometry-expand-close",children:"Close"})]}),(0,a.jsx)("pre",{className:"flex max-h-[420px] min-h-[120px] items-center justify-center overflow-auto p-3 font-mono text-xs",children:C.isPending?(0,a.jsx)(p.Z,{label:"Loading geometry",testId:"geobricks-geometry-loading",minHeightClassName:"min-h-[80px]"}):C.isError?"Could not load geometry. The result may have expired.":null!=(d=null==(t=C.data)?void 0:t.geojson)?d:"No geometry."})]})}):null]})}function k(e){let t,s,n,l,i=(0,r.c)(14),{kind:o,value:c,numeric:d,onExpandGeometry:u}=e;if(i[0]!==o||i[1]!==u||i[2]!==c){s=Symbol.for("react.early_return_sentinel");e:{let e,r="geometry"===o?j(c):null;if(i[5]!==o||i[6]!==c?(e=function(e,t){if(null==t)return"";switch(e){case"geometry":{let e=j(t);return e?N(e):String(t)}case"timestamp":if("string"==typeof t){let e=new Date(t);if(!Number.isNaN(e.getTime()))return e.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}return String(t);case"numeric":if("number"==typeof t)return t.toLocaleString("en-US");return String(t);case"boolean":return t?"true":"false";case"binary":case"string":return String(t);default:return String(e)}}(o,c),i[5]=o,i[6]=c,i[7]=e):e=i[7],t=e,"geometry"===o&&r&&u){let e;i[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,w.cn)("flex items-center truncate px-2 text-left text-primary hover:underline",b.U.cell),i[8]=e):e=i[8],s=(0,a.jsx)("button",{type:"button",className:e,title:N(r),onClick:u,"data-testid":"geobricks-geometry-cell",children:t});break e}}i[0]=o,i[1]=u,i[2]=c,i[3]=t,i[4]=s}else t=i[3],s=i[4];if(s!==Symbol.for("react.early_return_sentinel"))return s;let m=d&&"justify-end tabular-nums";return i[9]!==m?(n=(0,w.cn)("flex items-center truncate px-2",b.U.cell,m),i[9]=m,i[10]=n):n=i[10],i[11]!==t||i[12]!==n?(l=(0,a.jsx)("div",{className:n,title:t,children:t}),i[11]=t,i[12]=n,i[13]=l):l=i[13],l}var _=s(15691);function q(e){let t,s,n=(0,r.c)(3),{open:l}=e;return l?(n[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsxs)("div",{className:(0,w.cn)("flex items-center gap-1.5 px-3 py-2",b.U.header),children:[(0,a.jsx)(d.A,{className:"size-3.5 text-muted-foreground","aria-hidden":!0}),(0,a.jsx)("p",{className:b.U.sectionLabel,children:"History"})]}),n[0]=t):t=n[0],n[1]!==l?(s=(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col","data-testid":"geobricks-query-history-panel",children:[t,(0,a.jsx)(_.X,{enabled:l})]}),n[1]=l,n[2]=s):s=n[2],s):null}var C=s(6336),E=s(95943),U=s(66692),T=s(62063);function R(e){let t,s,n,l,i,o,c,d,u=(0,r.c)(18),{viewName:m,columns:h}=e,x="geobricks-schema-columns-".concat(m);return u[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.cn)("shrink-0 px-3 py-2",b.U.header),u[0]=t):t=u[0],u[1]!==m?(s=(0,a.jsx)("p",{className:"text-xs font-medium text-foreground break-all",children:m}
1),u[1]=m,u[2]=s):s=u[2],u[3]!==h.length?(n=h.length.toLocaleString("en-US"),u[3]=h.length,u[4]=n):n=u[4],u[5]!==n?(l=(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:[n," columns"]}),u[5]=n,u[6]=l):l=u[6],u[7]!==s||u[8]!==l?(i=(0,a.jsxs)("div",{className:t,children:[s,l]}),u[7]=s,u[8]=l,u[9]=i):i=u[9],u[10]!==h?(o=h.map(z),u[10]=h,u[11]=o):o=u[11],u[12]!==o?(c=(0,a.jsx)(T.F,{className:"min-h-0 flex-1",children:(0,a.jsx)("ul",{className:"px-2 pb-2",children:o})}),u[12]=o,u[13]=c):c=u[13],u[14]!==x||u[15]!==i||u[16]!==c?(d=(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":x,children:[i,c]}),u[14]=x,u[15]=i,u[16]=c,u[17]=d):d=u[17],d}function z(e){let t=y(e.typeName,e.kind);return(0,a.jsxs)("li",{className:"rounded-md px-2 py-1.5 transition-colors hover:bg-muted/20","data-testid":"geobricks-schema-column-".concat(e.name),title:"".concat(e.name," \xb7 ").concat(t," \xb7 ").concat(function(e){switch(e){case"geometry":return"Geometry";case"timestamp":return"Time";case"numeric":return"Number";case"boolean":return"Boolean";case"binary":return"Binary";case"string":return"Text";default:return e}}(e.kind)),children:[(0,a.jsx)("p",{className:"text-sm leading-snug font-medium break-all text-foreground",children:e.name}),(0,a.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:t})]},e.name)}function L(e){var t,s,n,l;let i,o,c,d,u,m,h,x,f,g,y,v,j,N,S=(0,r.c)(37),{onViewSelect:k}=e,{data:_,isPending:q,isError:z}=(0,E.X)(),L=(0,U.q)(M),I=(0,U.q)(A),Q=(0,U.q)(P);S[0]!==(null==_?void 0:_.views)?(i=null!=(s=null==_?void 0:_.views)?s:[],S[0]=null==_?void 0:_.views,S[1]=i):i=S[1];let F=i,H=null!=(n=null!=L?L:null==(t=F[0])?void 0:t.viewName)?n:null;S[2]!==H||S[3]!==F?(o=null!=(l=F.find(e=>e.viewName===H))?l:F[0],S[2]=H,S[3]=F,S[4]=o):o=S[4];let O=o;S[5]!==k||S[6]!==I||S[7]!==Q?(c=e=>{I(e),Q("SELECT *\nFROM ".concat(e,"\nLIMIT 100")),null==k||k()},S[5]=k,S[6]=I,S[7]=Q,S[8]=c):c=S[8];let D=c;if(q){let e;return S[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(p.Z,{label:"Loading schema",testId:"geobricks-schema-loading",className:"h-full",minHeightClassName:"min-h-[200px]"}),S[9]=e):e=S[9],e}if(z){let e;return S[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:"p-3 text-sm text-destructive","data-testid":"geobricks-schema-error",children:"Could not load schema."}),S[10]=e):e=S[10],e}if(0===F.length){let e;return S[11]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:"p-3 text-sm text-muted-foreground","data-testid":"geobricks-schema-empty",children:"No views available."}),S[11]=e):e=S[11],e}if(S[12]===Symbol.for("react.memo_cache_sentinel")?(d=(0,w.cn)("flex h-full min-h-0 flex-col",b.U.panel),S[12]=d):d=S[12],S[13]===Symbol.for("react.memo_cache_sentinel")?(u=(0,w.cn)("shrink-0 px-3 py-2.5",b.U.header),m=(0,a.jsx)("p",{className:b.U.sectionLabel,children:"Schema"}),S[13]=u,S[14]=m):(u=S[13],m=S[14]),S[15]!==F.length?(h=F.length.toLocaleString("en-US"),S[15]=F.length,S[16]=h):h=S[16],S[17]!==h?(x=(0,a.jsxs)("div",{className:u,children:[m,(0,a.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[h," views in your workspace"]})]}),S[17]=h,S[18]=x):x=S[18],S[19]===Symbol.for("react.memo_cache_sentinel")?(f=(0,a.jsx)("p",{className:(0,w.cn)("shrink-0 px-3 py-2",b.U.sectionLabel),children:"Tables"}),S[19]=f):f=S[19],S[20]!==(null==O?void 0:O.viewName)||S[21]!==D||S[22]!==F){let e;S[24]!==(null==O?void 0:O.viewName)||S[25]!==D?(e=e=>{let t=e.viewName===(null==O?void 0:O.viewName);return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",className:(0,w.cn)("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm",t?b.U.navItemActive:(0,w.cn)(b.U.navItem,"text-foreground")),"data-testid":"geobricks-schema-view-".concat(e.viewName),onClick:()=>D(e.viewName),children:[(0,a.jsx)(C.A,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,a.jsx)("span",{className:"min-w-0 flex-1 break-all font-medium leading-snug",children:e.viewName}),(0,a.jsx)("span",{className:"shrink-0 pt-0.5 text-xs text-muted-foreground tabular-nums",children:e.columns.length})]})},e.viewName)},S[24]=null==O?void 0:O.viewName,S[25]=D,S[26]=e):e=S[26],g=F.map(e),S[20]=null==O?void 0:O.viewName,S[21]=D,S[22]=F,S[23]=g}else g=S[23];return S[27]!==g?(y=(0,a.jsxs)("div",{className:"flex min-h-0 max-h-[42%] flex-col border-b border-border",children:[f,(0,a.jsx)(T.F,{className:"min-h-0 flex-1",children:(0,a.jsx)("ul",{className:"space-y-0.5 px-1 pb-2","data-testid":"geobricks-schema-view-list",children:g})})]}),S[27]=g,S[28]=y):y=S[28],S[29]!==O?(v=O?(0,a.jsx)(R,{viewName:O.viewName,columns:O.columns}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center p-4 text-center text-xs text-muted-foreground",children:"Select a table to view its columns."}),S[29]=O,S[30]=v):v=S[30],S[31]!==y||S[32]!==v?(j=(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[y,v]}),S[31]=y,S[32]=v,S[33]=j):j=S[33],S[34]!==j||S[35]!==x?(N=(0,a.jsxs)("div",{className:d,"data-testid":"geobricks-schema-browser",children:[x,j]}),S[34]=j,S[35]=x,S[36]=N):N=S[36],N}function P(e){return e.setSql}function A(e){return e.setSelectedViewName}function M(e){return e.selectedViewName}var I=s(61497),Q=s(44651);function F(e){let t,s,n,l,i=(0,r.c)(22),{result:o,error:c,isPending:d}=e;if(d){let e,t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,w.cn)("flex items-center justify-center gap-2 px-3 py-2",b.U.footer),i[0]=e):e=i[0],i[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsxs)("div",{className:e,"data-testid":"geobricks-query-status",children:[(0,a.jsx)(Q.y,{className:"size-3.5 text-primary"}),(0,a.jsx)("span",{className:"sr-only",children:"Running query"})]}),i[1]=t):t=i[1],t}if(c){let e,t,s=c instanceof f.BG?c.status:500,r=c instanceof Error?c.message:"Query failed.";if(i[2]!==r||i[3]!==s)e=403===s?"Query editor requires the Expert plan.":402===s?"Not enough credits to run this query. Add credits and try again.":410===s?"This query result expired. Run the query again.":r||"Query failed.",i[2]=r,i[3]=s,i[4]=e;else e=i[4];return i[5]!==e?(t=(0,a.jsx)("div",{className:"border-t border-border bg-destructive/5 px-3 py-1.5 text-xs text-destructive","data-testid":"geobricks-query-status-error",role:"alert",children:e}),i[5]=e,i[6]=t):t=i[6],t}if(!o){let e;return i[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:(0,w.cn)("px-3 py-1.5 text-xs text-muted-foreground",b.U.footer),"data-testid":"geobricks-query-status",children:"Ready"}),i[7]=e):e=i[7],e}
1i[8]!==o.rowCount?(t=o.rowCount.toLocaleString("en-US"),i[8]=o.rowCount,i[9]=t):t=i[9];let u="".concat(t," rows");if(i[10]!==o.creditsCharged||i[11]!==o.durationMs||i[12]!==o.truncated||i[13]!==u){if(s=[u],o.durationMs>0){let e;i[15]!==o.durationMs?(e=o.durationMs.toLocaleString("en-US"),i[15]=o.durationMs,i[16]=e):e=i[16],s.push("".concat(e," ms"))}if(o.creditsCharged>0){let e;i[17]!==o.creditsCharged?(e=(0,I.H)(o.creditsCharged),i[17]=o.creditsCharged,i[18]=e):e=i[18],s.push("".concat(e," credits"))}o.truncated&&s.push("truncated"),i[10]=o.creditsCharged,i[11]=o.durationMs,i[12]=o.truncated,i[13]=u,i[14]=s}else s=i[14];i[19]===Symbol.for("react.memo_cache_sentinel")?(n=(0,w.cn)("px-3 py-1.5 text-xs text-muted-foreground",b.U.footer),i[19]=n):n=i[19];let m=s.join(" \xb7 ");return i[20]!==m?(l=(0,a.jsx)("div",{className:n,"data-testid":"geobricks-query-status",children:m}),i[20]=m,i[21]=l):l=i[21],l}var H=s(12351),O=s(10215),D=s(42734),B=s(51034),G=s(8780),V=s(55470),J=s(84630);function Z(e){let t,s,n,l,i=(0,r.c)(8);return i[0]!==e?({className:t,...s}=e,i[0]=e,i[1]=t,i[2]=s):(t=i[1],s=i[2]),i[3]!==t?(n=(0,w.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),i[3]=t,i[4]=n):n=i[4],i[5]!==s||i[6]!==n?(l=(0,a.jsx)(J.YZ,{"data-slot":"resizable-panel-group",className:n,...s}),i[5]=s,i[6]=n,i[7]=l):l=i[7],l}function K(e){let t,s,n=(0,r.c)(4);return n[0]!==e?({...t}=e,n[0]=e,n[1]=t):t=n[1],n[2]!==t?(s=(0,a.jsx)(J.Zk,{"data-slot":"resizable-panel",...t}),n[2]=t,n[3]=s):s=n[3],s}function X(e){let t,s,n,l,i,o,c=(0,r.c)(12);return c[0]!==e?({withHandle:n,className:t,...s}=e,c[0]=e,c[1]=t,c[2]=s,c[3]=n):(t=c[1],s=c[2],n=c[3]),c[4]!==t?(l=(0,w.cn)("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),c[4]=t,c[5]=l):l=c[5],c[6]!==n?(i=n&&(0,a.jsx)("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:(0,a.jsx)(V.A,{className:"size-2.5"})}),c[6]=n,c[7]=i):i=c[7],c[8]!==s||c[9]!==l||c[10]!==i?(o=(0,a.jsx)(J.TW,{"data-slot":"resizable-handle",className:l,...s,children:i}),c[8]=s,c[9]=l,c[10]=i,c[11]=o):o=c[11],o}var Y=s(18174);let $=(0,l.default)(()=>Promise.all([s.e(77401),s.e(15864),s.e(990)]).then(s.bind(s,990)).then(e=>e.QueryEditorPane),{loadableGenerated:{webpack:()=>[990]},ssr:!1,loading:()=>(0,a.jsx)(p.Z,{label:"Loading editor",testId:"geobricks-query-editor-loading",className:"h-full",minHeightClassName:"min-h-0"})});function W(){let e,t,s,l,m,x,g,p,y,v,j,N,k,_,C,E,T,R,z,P,A,M,Q,V,J,W,es,ea,er,en,el,ei,eo,ec,ed=(0,r.c)(84),{openPersonalUpgradeOrToast:eu}=(0,B.Q)("expert"),em=(0,D.FK)(),eh=(0,U.q)(et),ex=function(){let e,t=(0,r.c)(2),{getToken:s}=(0,h.d)();return t[0]!==s?(e={mutationFn:e=>(0,f.hp)(s,e)},t[0]=s,t[1]=e):e=t[1],(0,H.useMutation)(e)}(),ef=function(){let e,t=(0,r.c)(2),{getToken:s}=(0,h.d)();return t[0]!==s?(e={mutationFn:e=>(0,f.qJ)(s,e)},t[0]=s,t[1]=e):e=t[1],(0,H.useMutation)(e)}(),[eg,ep]=(0,n.useState)(null),[eb,ey]=(0,n.useState)(null),[ev,ej]=(0,n.useState)(!1),[eN,ew]=(0,n.useState)(!1),[eS,ek]=(0,n.useState)(!1),e_=(0,n.useRef)(null),eq=(0,O.K)(768),eC=em>0;ed[0]!==eC||ed[1]!==ex||ed[2]!==eu||ed[3]!==eh?(e=()=>{let e=eh.trim();if(e&&!ex.isPending){if(!eC)return void eu();ey(null),ex.mutate(e,{onSuccess:e=>ep(e)})}},ed[0]=eC,ed[1]=ex,ed[2]=eu,ed[3]=eh,ed[4]=e):e=ed[4];let eE=e;ed[5]!==ef||ed[6]!==eh?(t=()=>{let e=eh.trim();e&&!ef.isPending&&ef.mutate(e,{onSuccess:e=>ey(e)})},ed[5]=ef,ed[6]=eh,ed[7]=t):t=ed[7];let eU=t;ed[8]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{let e=e_.current;if(e){if(e.isCollapsed()){e.expand(),ew(!1);return}e.collapse(),ew(!0)}},ed[8]=s):s=ed[8];let eT=s;ed[9]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(L,{onViewSelect:()=>ej(!1)}),ed[9]=l):l=ed[9];let eR=l;ed[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,w.cn)("h-full min-h-0 min-w-0",b.U.panel),ed[10]=m):m=ed[10],ed[11]!==ex.isPending||ed[12]!==eE?(x=(0,a.jsx)(K,{defaultSize:38,minSize:22,className:"min-h-0",children:(0,a.jsx)("div",{className:"flex h-full min-h-0 flex-col",children:(0,a.jsx)($,{onRun:eE,isPending:ex.isPending,disabled:!1,showToolbar:!1})})}),ed[11]=ex.isPending,ed[12]=eE,ed[13]=x):x=ed[13],ed[14]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsx)(X,{withHandle:!0,className:"z-20 shrink-0 bg-border data-[panel-group-direction=vertical]:h-2 data-[panel-group-direction=vertical]:after:h-3"}),ed[14]=g):g=ed[14],ed[15]!==ex.isPending||ed[16]!==eg?(p=(0,a.jsx)(S,{result:eg,isPending:ex.isPending}),ed[15]=ex.isPending,ed[16]=eg,ed[17]=p):p=ed[17],ed[18]!==ex.error||ed[19]!==ex.isPending||ed[20]!==eg?(y=(0,a.jsx)(F,{result:eg,error:ex.error,isPending:ex.isPending}),ed[18]=ex.error,ed[19]=ex.isPending,ed[20]=eg,ed[21]=y):y=ed[21],ed[22]!==p||ed[23]!==y?(v=(0,a.jsx)(K,{defaultSize:62,minSize:28,className:"min-h-0",children:(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[p,y]})}),ed[22]=p,ed[23]=y,ed[24]=v):v=ed[24],ed[25]!==x||ed[26]!==v?(j=(0,a.jsx)("div",{className:m,children:(0,a.jsxs)(Z,{direction:"vertical",className:"h-full min-h-0",children:[x,g,v]})}),ed[25]=x,ed[26]=v,ed[27]=j):j=ed[27];let ez=j;ed[28]===Symbol.for("react.memo_cache_sentinel")?(N=(0,w.cn)("flex h-full min-h-0 flex-col overflow-hidden",b.U.workspace),ed[28]=N):N=ed[28],ed[29]===Symbol.for("react.memo_cache_sentinel")?(k=(0,w.cn)("flex items-center gap-2 px-2 py-2 sm:px-3",b.U.toolbar),ed[29]=k):k=ed[29],ed[30]!==eq||ed[31]!==eN||ed[32]!==ev?(_=eq?(0,a.jsxs)(G.$,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0 px-2.5",onClick:eT,"data-testid":"geobricks-schema-collapse-toggle","aria-label":eN?"Show schema panel":"Hide schema panel","aria-pressed":!eN,children:[eN?(0,a.jsx)(i.A,{className:"size-3.5","aria-hidden":!0}):(0,a.jsx)(o.A,{className:"size-3.5","aria-hidden":!0}),(0,a.jsx)("span",{className:"sr-only sm:not-sr-only sm:ml-1.5",children:"Schema"})]}):(0,a.jsxs)(Y.cj,{open:ev,onOpenChange:ej,children:[(0,a.jsx)(Y.CG,{asChild:!0,children:(0,a.jsxs)(G.$,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0 px-2.5","data-testid":"geobricks-schema-sheet-trigger",children:[(0,a.jsx)(i.A,{className:"size-3.5","aria-hidden":!0}),(0,a.jsx)("span",{className:"sr-only sm:not-sr-only sm:ml-1.5",children:"Schema"})]})}),(0,a.jsxs)(Y.h,{side:"left",className:"w-[min(92vw,22rem)] gap-0 p-0 sm:w-80",children:[(0,a.jsx)(Y.Fm,{className:"border-b border-border px-4 py-3 text-left",children:(0,a.jsx)(Y.qp,{className:"text-base",children:"Schema"})}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:eR})]})]}),ed[30]=eq,ed[31]=eN,ed[32]=ev,ed[33]=_):_=ed[33],ed[34]===Symbol.for("react.memo_cache_sentinel")?(C=(0,a.jsx)("div",{className:"min-w-0 truncate text-sm font-medium text-foreground",children:"SQL editor"}),ed[34]=C):C=ed[34],ed[35]!==_?(E=(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[_,C]}),ed[35]=_,ed[36]=E):E=ed[36],ed[37]!==ef.isPending||ed[38]!==eh?(T=ef.isPending||!eh.trim(),ed[37]=ef.isPending,ed[38]=eh,ed[39]=T):T=ed[39],ed[40]===Symbol.for("react.memo_cache_sentinel")?(R=(0,a.jsx)(c.A,{className:"size-3.5","aria-hidden":!0}),ed[40]=R):R=ed[40];let eL=ef.isPending?"Estimating…":"Estimate";ed[41]!==eL?(z=(0,a.jsx)("span",{className:"sr-only sm:not-sr-only",children:eL}),ed[41]=eL,ed[42]=z):z=ed[42],ed[43]!==eU||ed[44]!==T||ed[45]!==z?(P=(0,a.jsxs)(G.$,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0 gap-1.5 px-2.5",disabled:T,onClick:eU,"data-testid":"geobricks-query-estimate",children:[R,z]}),ed[43]=eU,ed[44]=T,ed[45]=z,ed[46]=P):P=ed[46];let eP=eS?"secondary":"outline";ed[47]===Symbol.for("react.memo_cache_sentinel")?(A=()=>ek(ee),ed[47]=A):A=ed[47],ed[48]===Symbol.for("react.memo_cache_sentinel")?(M=(0,a.jsx)(d.A,{className:"size-3.5","aria-hidden":!0}),Q=(0,a.jsx)("span",{className:"sr-only sm:not-sr-only",children:"History"}),ed[48]=M,ed[49]=Q):(M=ed[48],Q=ed[49]),ed[50]!==eS||ed[51]!==eP?(V=(0,a.jsxs)(G.$,{type:"button",variant:eP,size:"sm",className:"h-8 shrink-0 gap-1.5 px-2.5",onClick:A,"data-testid":"geobricks-query-history-toggle","aria-pressed":eS,children:[M,Q]}),ed[50]=eS,ed[51]=eP,ed[52]=V):V=ed[52],ed[53]!==eC||ed[54]!==ex.isPending||ed[55]!==eh?(J=ex.isPending||!eh.trim()||!eC,ed[53]=eC,ed[54]=ex.isPending,ed[55]=eh,ed[56]=J):J=ed[56];let eA=eC?void 0:"Add credits to run queries";ed[57]===Symbol.for("react.memo_cache_sentinel")?(W=(0,a.jsx)(u.A,{className:"size-3.5","aria-hidden":!0}),ed[57]=W):W=ed[57];let eM=ex.isPending?"Running…":eC?"Run":"No credits";if(ed[58]!==eE||ed[59]!==J||ed[60]!==eA||ed[61]!==eM?(es=(0,a.jsxs)(G.$,{type:"button",size:"sm",className:"h-8 shrink-0 gap-1.5 px-3",disabled:J,onClick:eE,"data-testid":"geobricks-query-run",title:eA,children:[W,eM]}),ed[58]=eE,ed[59]=J,ed[60]=eA,ed[61]=eM,ed[62]=es):es=ed[62],ed[63]!==E||ed[64]!==P||ed[65]!==V||ed[66]!==e
1s?(ea=(0,a.jsxs)("div",{className:k,children:[E,P,V,es]}),ed[63]=E,ed[64]=P,ed[65]=V,ed[66]=es,ed[67]=ea):ea=ed[67],ed[68]!==eb){var eI;er=eb?(0,a.jsxs)("div",{className:(0,w.cn)("flex items-center justify-between border-b px-3 py-1.5 text-xs",b.U.banner),"data-testid":"geobricks-query-estimate-banner",role:"status",children:[(0,a.jsx)("span",{children:"ESTIMATED"===eb.outcome?null!=eb.estimatedCredits?"Estimated cost: ".concat((0,I.H)(eb.estimatedCredits)," credits"):"Estimated cost: negligible or unavailable for this query. Actual cost is still metered when you run it.":null!=(eI=eb.rejectionReason)?eI:"This query would be rejected before running."}),(0,a.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-foreground",onClick:()=>ey(null),"data-testid":"geobricks-query-estimate-dismiss",children:"Dismiss"})]}):null,ed[68]=eb,ed[69]=er}else er=ed[69];return ed[70]!==ez||ed[71]!==eq?(en=(0,a.jsx)("div",{className:"min-h-0 flex-1",children:eq?(0,a.jsxs)(Z,{direction:"horizontal",className:"h-full min-h-0",children:[(0,a.jsx)(K,{ref:e_,defaultSize:30,minSize:22,maxSize:48,collapsible:!0,collapsedSize:0,className:"min-w-0",onCollapse:()=>ew(!0),onExpand:()=>ew(!1),children:(0,a.jsx)("aside",{className:(0,w.cn)("flex h-full min-h-0 min-w-0 flex-col border-r",b.U.panel,b.U.panelBorder),children:eR})}),(0,a.jsx)(X,{withHandle:!0,className:"bg-border"}),(0,a.jsx)(K,{defaultSize:70,minSize:40,className:"min-h-0 min-w-0",children:(0,a.jsx)("div",{className:"h-full min-h-0 min-w-0",children:ez})})]}):ez}),ed[70]=ez,ed[71]=eq,ed[72]=en):en=ed[72],ed[73]===Symbol.for("react.memo_cache_sentinel")?(el=(0,a.jsx)(Y.Fm,{className:"border-b border-border px-4 py-3 text-left",children:(0,a.jsx)(Y.qp,{className:"text-base",children:"Query history"})}),ed[73]=el):el=ed[73],ed[74]!==eS?(ei=(0,a.jsxs)(Y.h,{side:"right",className:"w-[min(92vw,22rem)] gap-0 p-0 sm:w-80",children:[el,(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:(0,a.jsx)(q,{open:eS})})]}),ed[74]=eS,ed[75]=ei):ei=ed[75],ed[76]!==eS||ed[77]!==ei?(eo=(0,a.jsx)(Y.cj,{open:eS,onOpenChange:ek,children:ei}),ed[76]=eS,ed[77]=ei,ed[78]=eo):eo=ed[78],ed[79]!==ea||ed[80]!==er||ed[81]!==en||ed[82]!==eo?(ec=(0,a.jsxs)("div",{className:N,"data-testid":"geobricks-query-editor",children:[ea,er,en,eo]}),ed[79]=ea,ed[80]=er,ed[81]=en,ed[82]=eo,ed[83]=ec):ec=ed[83],ec}function ee(e){return!e}function et(e){return e.sql}},89021:(e,t,s)=>{s.d(t,{Q:()=>a});let a={all:["geobricks"],families:()=>[...a.all,"families"],catalogMaps:()=>[...a.all,"catalog-maps"],datasets:e=>[...a.all,"datasets",e],datasetOverview:e=>[...a.all,"dataset",e],datasetRename:e=>[...a.all,"dataset-rename",e],datasetDelete:e=>[...a.all,"dataset-delete",e],datasetInference:e=>[...a.all,"dataset-inference",e],datasetObservationTime:e=>[...a.all,"dataset-observation-time",e],explorerFacets:e=>[...a.all,"explorer-facets",e],explorerGroups:e=>[...a.all,"explorer-groups",e],explorerAgentCounts:e=>[...a.all,"explorer-agent-counts",e],explorerDatasets:e=>[...a.all,"explorer-datasets",e],datasetAsset:e=>[...a.all,"dataset-asset",e],explorerAoi:(e,t)=>[...a.all,"explorer-aoi",e,t],schema:()=>[...a.all,"schema"],queryCell:(e,t,s)=>[...a.all,"query-cell",e,t,s],queryHistory:e=>[...a.all,"query-history",e],ontologyBindings:()=>[...a.all,"ontology-bindings"],ontologyVocabulary:()=>[...a.all,"ontology-vocabulary"],graphSummary:()=>[...a.all,"graph-summary"],graphDatasets:e=>[...a.all,"graph-datasets",e],graphEntities:e=>[...a.all,"graph-entities",e],graphCommunities:e=>[...a.all,"graph-communities",e],graphNeighbourhood:(e,t)=>[...a.all,"graph-neighbourhood",e,t]}},95943:(e,t,s)=>{s.d(t,{X:()=>o});var a=s(99680),r=s(93891),n=s(22483),l=s(54250),i=s(89021);function o(){let e,t,s,o=(0,a.c)(6),{getToken:c,isLoaded:d,isSignedIn:u}=(0,r.d)();o[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.Q.schema(),o[0]=e):e=o[0],o[1]!==c?(t=()=>(0,l.b7)(c),o[1]=c,o[2]=t):t=o[2];let m=d&&!!u;return o[3]!==t||o[4]!==m?(s={queryKey:e,queryFn:t,enabled:m,staleTime:3e5},o[3]=t,o[4]=m,o[5]=s):s=o[5],(0,n.useQuery)(s)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.