@lunora/studio 1.0.0-alpha.366 → 1.0.0-alpha.367

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,4 +1,4 @@
1
- import{a as ft,b as zr,c as bn}from"./chunk-WL3MWYDB.js";import{d as Lr}from"./chunk-P6VNMPWR.js";import{a as fn}from"./chunk-S36FVTKK.js";import{a as Ge}from"./chunk-6FPV3EK2.js";import{c as gn}from"./chunk-BKI3JMXQ.js";import{a as dn}from"./chunk-3U6JHRLU.js";import{a as un}from"./chunk-HYTBZYDH.js";import{a as pn,b as Le,f as Hr,g as $r}from"./chunk-3SKL6OEA.js";import{a as $t}from"./chunk-GZWXXJKZ.js";import{a as mn}from"./chunk-HCOF7HOM.js";import{a as Er}from"./chunk-26Z7L3NM.js";import{a as co}from"./chunk-DHXZI632.js";import"./chunk-BOBQQR2H.js";import"./chunk-UBX5ZPLV.js";import"./chunk-VNH4OBJS.js";import{b as Ir,c as ao}from"./chunk-CL3JOU6F.js";import{a as uo}from"./chunk-2DT3QG6Q.js";import{a as an,b as yr}from"./chunk-ARYARX6T.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as Nr}from"./chunk-YESQLEOG.js";import{a as kr,b as Pr}from"./chunk-3D67ZJRW.js";import{a as lo}from"./chunk-HZK2UJ3K.js";import{b as Fr,c as Mr,f as so}from"./chunk-ZSWW2UGP.js";import{c as wr,d as xr,e as Sr,f as st,g as rn,h as _r,i as Cr}from"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as Rr}from"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as sn}from"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as cn}from"./chunk-ZMBRGW6J.js";import"./chunk-YUVGMKHG.js";import{a as Dr,b as Ar,c as Or,d as io,e as Tr,f as Vr}from"./chunk-ZYXDE5GW.js";import{a as Ce}from"./chunk-2W4UO5BC.js";import{b as ro,c as it}from"./chunk-C4IDZOYU.js";import{b as to,c as no,d as on,e as hr,m as nt}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as ne,h as He,i as $e,j as Ht,p as oo,q as ln,r as Ee,s as te,w as vr,x as gt}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as Et}from"./chunk-GWNGVKLG.js";import{a as mt,b as zt}from"./chunk-6G3E4PJ2.js";import{a as o,d as Me}from"./chunk-5PEAXTYQ.js";var Vs=Me(Et(),1);var Ot=Me(mt(),1);var q=Me(Et(),1),D=Me(mt(),1);var Rt=Me(Et(),1);var Y=Me(zt(),1),ot=Me(mt(),1);var fi=2166136261,pi=16777619,bi=o((t,e=fi)=>{let n=e;for(let l=0;l<t.length;l+=1)n^=t.charCodeAt(l),n=Math.imul(n,pi);return(n>>>0).toString(16).padStart(8,"0")},"L"),hi=/([a-z\d])([A-Z])/gu,wi=/[\s_-]+/u,xi=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),Si=o(t=>{let e=t.replaceAll(hi,"$1 $2").split(wi).map(l=>l.toLowerCase()).filter(l=>l.length>0),n=new Set(e);for(let l=0;l<e.length-1;l+=1){let r=e[l],a=e[l+1];r===void 0||a===void 0||(n.add(`${r}${a}`),n.add(`${r}_${a}`))}return[...n]},"ae"),jr="\u2022\u2022\u2022",Jr=o((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:bi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):jr}catch{return jr}},"U"),Br=o((t,e)=>{let n=new Map;for(let l of t)l.table===e&&n.set(l.column,l.strategy);return n},"V"),_i=o(t=>{for(let e of Si(t))if(xi.has(e))return!0;return!1},"ce"),Gr=o((t,e)=>{let n=e.filter(r=>!t.has(r)&&_i(r));if(n.length===0)return t;let l=new Map(t);for(let r of n)l.set(r,"redact");return l},"j"),Lt=o((t,e,n)=>{if(!n.enabled)return t;let l=n.columns.get(e);return l===void 0?t:Jr(t,l)},"_e"),hn=o((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let n={...t};for(let[l,r]of e.columns)l in n&&(n[l]=Jr(n[l],r));return n},"ie"),wn=o((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>hn(n,e)),"Me"),qr=o(t=>t==null?"\u2205":t===""?"(empty)":Ee(t),"z"),Ci=o(t=>{let e=(0,Rt.c)(32),{column:n,onFacetFilter:l,state:r}=t,a=ne(),s;e[0]!==n||e[1]!==l||e[2]!==r.result?.values?(s=o(w=>{let _=Number(w.currentTarget.dataset.index),S=r.result?.values[_];S!==void 0&&l(n,S.value)},"x"),e[0]=n,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let i=s,c=`db-facet-${n}`,u;e[4]!==n?(u=(0,Y.jsx)("span",{className:"font-medium text-foreground",children:n}),e[4]=n,e[5]=u):u=e[5];let d;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(d=r.loading&&r.result===null&&(0,Y.jsx)("span",{className:"text-muted-foreground",children:a("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=d):d=e[9];let g;e[10]!==r.error?(g=r.error!==null&&(0,Y.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let m;e[12]!==r.result?.values?(m=r.result?.values??[],e[12]=r.result?.values,e[13]=m):m=e[13];let h;if(e[14]!==n||e[15]!==i||e[16]!==m){let w;e[18]!==n||e[19]!==i?(w=o((_,S)=>(0,Y.jsxs)("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":S,"data-testid":`db-facet-value-${n}`,onClick:i,type:"button",children:[(0,Y.jsx)("span",{className:"truncate",children:qr(_.value)}),(0,Y.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:_.count})]},qr(_.value)),"c"),e[18]=n,e[19]=i,e[20]=w):w=e[20],h=m.map(w),e[14]=n,e[15]=i,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==n||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,Y.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${n}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=n,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,Y.jsxs)("section",{className:"flex flex-col gap-1","data-testid":c,children:[u,d,g,h,p]}),e[25]=c,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ue"),xn=o(t=>{let e=(0,Rt.c)(44),{columns:n,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,i=ne(),c;e[0]!==s?(c=o(v=>{let{column:F}=v.currentTarget.dataset;F!==void 0&&s(F)},"o"),e[0]=s,e[1]=c):c=e[1];let u=c,d;e[2]!==r?(d=o(v=>r.enabled&&r.columns.has(v),"a"),e[2]=r,e[3]=d):d=e[3];let g=d,m,h,p,b,w,_,S,y;if(e[4]!==n||e[5]!==l||e[6]!==g||e[7]!==i||e[8]!==u){y=Symbol.for("react.early_return_sentinel");e:{let v;e[17]!==g?(v=o(M=>!g(M),"y"),e[17]=g,e[18]=v):v=e[18];let F=n.filter(v),N;if(e[19]!==l||e[20]!==g?(N=Object.entries(l).filter(M=>{let[O]=M;return!g(O)}),e[19]=l,e[20]=g,e[21]=N):N=e[21],m=N,F.length===0){y=null;break e}_="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",S="db-facets",b="flex flex-col gap-1.5";let k;e[22]!==i?(k=i("Facets"),e[22]=i,e[23]=k):k=e[23],e[24]!==k?(w=(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:k}),e[24]=k,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let P;e[26]!==l||e[27]!==u?(P=o(M=>(0,Y.jsx)("button",{"aria-pressed":M in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":M,"data-testid":`db-facet-toggle-${M}`,onClick:u,type:"button",children:M},M),"A"),e[26]=l,e[27]=u,e[28]=P):P=e[28],p=F.map(P)}e[4]=n,e[5]=l,e[6]=g,e[7]=i,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=_,e[15]=S,e[16]=y}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],_=e[14],S=e[15],y=e[16];if(y!==Symbol.for("react.early_return_sentinel"))return y;let I;e[29]!==h||e[30]!==p?(I=(0,Y.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=I):I=e[31];let C;e[32]!==I||e[33]!==b||e[34]!==w?(C=(0,Y.jsxs)("div",{className:b,children:[w,I]}),e[32]=I,e[33]=b,e[34]=w,e[35]=C):C=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(v=>{let[F,N]=v;return(0,Y.jsx)(Ci,{column:F,onFacetFilter:a,state:N},F)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let x;return e[39]!==C||e[40]!==R||e[41]!==_||e[42]!==S?(x=(0,Y.jsxs)("aside",{className:_,"data-testid":S,children:[C,R]}),e[39]=C,e[40]=R,e[41]=_,e[42]=S,e[43]=x):x=e[43],x},"Te"),Sn=o(()=>{let[t,e]=(0,ot.useState)({}),n=Ge(t),l=(0,ot.useRef)({}),r=o(async(a,s)=>{let i=(l.current[a]??0)+1;l.current[a]=i,e(c=>a in c?{...c,[a]:{error:null,loading:!0,result:c[a]?.result??null}}:c);try{let c=await s(a);if(l.current[a]!==i)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:c}}:u)}catch(c){if(l.current[a]!==i)return;throw e(u=>a in u?{...u,[a]:{error:Ht(c),loading:!1,result:null}}:u),c}},"n");return{clearFacets:o(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:o(a=>yr(Object.keys(n.current).map(s=>r(s,a))),"refetchFacets"),toggleFacet:o((a,s)=>{if(a in n.current){e(i=>Object.fromEntries(Object.entries(i).filter(([c])=>c!==a)));return}e(i=>({...i,[a]:{error:null,loading:!0,result:null}})),s!==null&&te(r(a,s))},"toggleFacet")}},"$e"),vi=[],yi=o(()=>{let t=(0,Rt.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:n}=it(Ce.maskPolicies,e);return Array.isArray(n?.columns)?n.columns:vi},"fe"),_n=o(t=>{let e=(0,Rt.c)(16),{columns:n,selectedTable:l}=t,r=yi(),[a,s]=(0,ot.useState)(!0),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(()=>{s(Ri)},"g"),e[0]=i):i=e[0];let c=i,u;if(e[1]!==n||e[2]!==r||e[3]!==l){let b=Br(r,l??"");u=Gr(b,n),e[1]=n,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=o((b,w)=>({columns:Gr(Br(r,b),w),enabled:a}),"l"),e[5]=a,e[6]=r,e[7]=g):g=e[7];let m=g,h;e[8]!==d||e[9]!==a?(h={columns:d,enabled:a},e[8]=d,e[9]=a,e[10]=h):h=e[10];let p;return e[11]!==d||e[12]!==a||e[13]!==m||e[14]!==h?(p={maskColumns:d,maskOn:a,maskView:h,maskViewFor:m,onToggleMask:c},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Re");function Ri(t){return!t}o(Ri,"me");var Kr=34,Ur=600,Ii=o(t=>{let e=(0,Rt.c)(21),{item:n,onSelect:l,prefix:r,selected:a,start:s}=t,i;e[0]!==n.name||e[1]!==l?(i=o(()=>{l(n.name)},"g"),e[0]=n.name,e[1]=l,e[2]=i):i=e[2];let c=i,u=`translateY(${String(s)}px)`,d;e[3]!==u?(d={insetInline:0,position:"absolute",top:0,transform:u},e[3]=u,e[4]=d):d=e[4];let g=d,m=a?"bg-accent font-medium text-accent-foreground":"text-foreground",h;e[5]!==m?(h=gt("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",m),e[5]=m,e[6]=h):h=e[6];let p=`${r}-table-${n.name}`,b;e[7]!==n.name?(b=(0,Y.jsx)("span",{className:"truncate",children:n.name}),e[7]=n.name,e[8]=b):b=e[8];let w;e[9]!==n.rowCount?(w=(0,Y.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:n.rowCount}),e[9]=n.rowCount,e[10]=w):w=e[10];let _;e[11]!==c||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(_=(0,Y.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:c,type:"button",children:[b,w]}),e[11]=c,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=_):_=e[17];let S;return e[18]!==g||e[19]!==_?(S=(0,Y.jsx)("li",{style:g,children:_}),e[18]=g,e[19]=_,e[20]=S):S=e[20],S},"ge"),Cn=o(({header:t,onReload:e,onSelect:n,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let i=ne(),[c,u]=(0,ot.useState)(""),d=(0,ot.useRef)(null),g=o(b=>{u(b.target.value)},"l"),m=(0,ot.useMemo)(()=>{let b=c.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[c,s]),h=gn({count:m.length,estimateSize:o(()=>Kr,"estimateSize"),getScrollElement:o(()=>d.current,"getScrollElement"),initialRect:{height:Ur,width:240},observeElementRect:o((b,w)=>fn(b,w,Ur),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Kr};return(0,Y.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[t,(0,Y.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:i("Tables")}),e!==void 0&&(0,Y.jsx)("button",{"aria-label":r??i("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??i("Refresh"),type:"button",children:(0,Y.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,Y.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),(0,Y.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,Y.jsx)("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:i("search table\u2026"),type:"search",value:c})}),(0,Y.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,Y.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,Y.jsx)(Ii,{item:w,onSelect:n,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=Me(zt(),1);var Wr=Me(mt(),1);function Fi(t){return Mi(t)||typeof t=="function"||ki(t)}o(Fi,"isReactComponent");function Mi(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}o(Mi,"isClassComponent");function ki(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}o(ki,"isExoticComponent");function pt(t,e){return t==null?null:Fi(t)?Wr.default.createElement(t,e):t}o(pt,"flexRender");function mo(t){if("cell"in t&&t.cell){let e=t.cell,n=e.column.columnDef,l=e,r=n;return l.getIsAggregated?.()?pt(r.aggregatedCell??n.cell,e.getContext()):l.getIsPlaceholder?.()?null:pt(n.cell,e.getContext())}return"header"in t&&t.header?pt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?pt(t.footer.column.columnDef.footer,t.footer.getContext()):null}o(mo,"FlexRender");function Qr(t){let e=rn(t.source,t.selector,{compare:st});return typeof t.children=="function"?t.children(e):t.children}o(Qr,"Subscribe");function Xr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}o(Xr,"atomToStore");function go(t){let{createAtom:e,batch:n}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:n,untrack:o(r=>r(),"untrack"),createReadonlyAtom:o((r,a)=>{let s=a?.compare??Object.is,i=!1,c,u=o(()=>{let g=r();return(!i||!s(c,g))&&(c=g,i=!0),c},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:o((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:o(()=>{l.set(r=>r+1)},"commit")}}o(go,"renderPhaseReactivity");function fo(t,e=Object.is){let n=!1,l;return{get:t.get,markCommitted:o(r=>{l=r,n=!0},"markCommitted"),subscribe:o(r=>t.subscribe(a=>{(!n||!e(l,a))&&r(a)}),"subscribe")}}o(fo,"createRenderPhaseSource");function Yr(){return go({createAtom:Sr,batch:xr})}o(Yr,"reactReactivity");function It(t,e){return typeof t=="function"?t(e):t}o(It,"functionalUpdate");function ie(t){if(Array.isArray(t))return t.map(ie);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let n=e===null?$():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(n,a,{configurable:!0,enumerable:!0,value:ie(t[a]),writable:!0})}return n}return t}o(ie,"cloneState");function vn(t,e){let n=Object.keys(e),l=t;for(let r=0;r<n.length;r++){let a=n[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}o(vn,"copyInstancePropertiesWithoutMemos");function $(){return Object.create(null)}o($,"makeObjectMap");function qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}o(qe,"hasOwn");function Ke(t,e){return n=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>It(n,l))}}o(Ke,"makeStateUpdater");function Zr(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}o(Zr,"isPlainContainer");function el(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}o(el,"getEnumerableOwnKeys");var Pi=3;function Ni(t,e){return tl(t,e,Pi)}o(Ni,"stateSlicesEqual");function tl(t,e,n){if(Object.is(t,e))return!0;if(n<=0||!Zr(t)||!Zr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=el(t),r=el(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let i=0;i<l.length;i++){let c=l[i];if(!Object.prototype.propertyIsEnumerable.call(e,c)||!tl(a[c],s[c],n-1))return!1}return!0}o(tl,"stateSlicesEqualAtDepth");function je(t,e,n,l=Ni){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let i=It(n,s);return l(s,i)?s:i})}o(je,"setStateSlice");function nl(t){return t instanceof Function}o(nl,"isFunction");function ol(t,e){let n=[],l=o(r=>{r.forEach(a=>{n.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),n}o(ol,"flattenBy");var Di=o(({fn:t,memoDeps:e,onAfterCompare:n,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],i;return o(u=>{r?.();let d=e?.(u),g=!d||d.length!==s?.length;if(!g&&d){for(let m=0;m<d.length;m++)if(d[m]!==s[m]){g=!0;break}}return n?.(g),g&&(s=d,a?.(),i=t(...d??[]),l?.(i)),i},"memoizedFn")},"memo");function yn(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}o(yn,"skipFirstRun");var Ai=o((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function Ft({feature:t,fnName:e,objectId:n,onAfterUpdate:l,table:r,...a}){let s,i,c=0,u;function d(h,p){let b=c===0?"(1st run)":p?"(rerun #"+c+")":"(cache)";c++,console.groupCollapsed(`%c\u23F1 ${Ai(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${n?`(${e.split(".")[0]}Id: ${n})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
1
+ import{a as ft,b as zr,c as bn}from"./chunk-WL3MWYDB.js";import{d as Lr}from"./chunk-P6VNMPWR.js";import{a as fn}from"./chunk-S36FVTKK.js";import{a as Ge}from"./chunk-6FPV3EK2.js";import{c as gn}from"./chunk-BKI3JMXQ.js";import{a as dn}from"./chunk-3U6JHRLU.js";import{a as un}from"./chunk-HYTBZYDH.js";import{a as pn,b as Le,f as Hr,g as $r}from"./chunk-3SKL6OEA.js";import{a as $t}from"./chunk-GZWXXJKZ.js";import{a as mn}from"./chunk-HCOF7HOM.js";import{a as Er}from"./chunk-Y4QFNP4R.js";import{a as co}from"./chunk-DHXZI632.js";import"./chunk-BOBQQR2H.js";import"./chunk-UBX5ZPLV.js";import"./chunk-VNH4OBJS.js";import{b as Ir,c as ao}from"./chunk-CL3JOU6F.js";import{a as uo}from"./chunk-2DT3QG6Q.js";import{a as an,b as yr}from"./chunk-ARYARX6T.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as Nr}from"./chunk-YESQLEOG.js";import{a as kr,b as Pr}from"./chunk-3D67ZJRW.js";import{a as lo}from"./chunk-HZK2UJ3K.js";import{b as Fr,c as Mr,f as so}from"./chunk-ZSWW2UGP.js";import{c as wr,d as xr,e as Sr,f as st,g as rn,h as _r,i as Cr}from"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as Rr}from"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as sn}from"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as cn}from"./chunk-ZMBRGW6J.js";import"./chunk-YUVGMKHG.js";import{a as Dr,b as Ar,c as Or,d as io,e as Tr,f as Vr}from"./chunk-ZYXDE5GW.js";import{a as Ce}from"./chunk-2W4UO5BC.js";import{b as ro,c as it}from"./chunk-C4IDZOYU.js";import{b as to,c as no,d as on,e as hr,m as nt}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as ne,h as He,i as $e,j as Ht,p as oo,q as ln,r as Ee,s as te,w as vr,x as gt}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as Et}from"./chunk-GWNGVKLG.js";import{a as mt,b as zt}from"./chunk-6G3E4PJ2.js";import{a as o,d as Me}from"./chunk-5PEAXTYQ.js";var Vs=Me(Et(),1);var Ot=Me(mt(),1);var q=Me(Et(),1),D=Me(mt(),1);var Rt=Me(Et(),1);var Y=Me(zt(),1),ot=Me(mt(),1);var fi=2166136261,pi=16777619,bi=o((t,e=fi)=>{let n=e;for(let l=0;l<t.length;l+=1)n^=t.charCodeAt(l),n=Math.imul(n,pi);return(n>>>0).toString(16).padStart(8,"0")},"L"),hi=/([a-z\d])([A-Z])/gu,wi=/[\s_-]+/u,xi=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),Si=o(t=>{let e=t.replaceAll(hi,"$1 $2").split(wi).map(l=>l.toLowerCase()).filter(l=>l.length>0),n=new Set(e);for(let l=0;l<e.length-1;l+=1){let r=e[l],a=e[l+1];r===void 0||a===void 0||(n.add(`${r}${a}`),n.add(`${r}_${a}`))}return[...n]},"ae"),jr="\u2022\u2022\u2022",Jr=o((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:bi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):jr}catch{return jr}},"U"),Br=o((t,e)=>{let n=new Map;for(let l of t)l.table===e&&n.set(l.column,l.strategy);return n},"V"),_i=o(t=>{for(let e of Si(t))if(xi.has(e))return!0;return!1},"ce"),Gr=o((t,e)=>{let n=e.filter(r=>!t.has(r)&&_i(r));if(n.length===0)return t;let l=new Map(t);for(let r of n)l.set(r,"redact");return l},"j"),Lt=o((t,e,n)=>{if(!n.enabled)return t;let l=n.columns.get(e);return l===void 0?t:Jr(t,l)},"_e"),hn=o((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let n={...t};for(let[l,r]of e.columns)l in n&&(n[l]=Jr(n[l],r));return n},"ie"),wn=o((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>hn(n,e)),"Me"),qr=o(t=>t==null?"\u2205":t===""?"(empty)":Ee(t),"z"),Ci=o(t=>{let e=(0,Rt.c)(32),{column:n,onFacetFilter:l,state:r}=t,a=ne(),s;e[0]!==n||e[1]!==l||e[2]!==r.result?.values?(s=o(w=>{let _=Number(w.currentTarget.dataset.index),S=r.result?.values[_];S!==void 0&&l(n,S.value)},"x"),e[0]=n,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let i=s,c=`db-facet-${n}`,u;e[4]!==n?(u=(0,Y.jsx)("span",{className:"font-medium text-foreground",children:n}),e[4]=n,e[5]=u):u=e[5];let d;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(d=r.loading&&r.result===null&&(0,Y.jsx)("span",{className:"text-muted-foreground",children:a("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=d):d=e[9];let g;e[10]!==r.error?(g=r.error!==null&&(0,Y.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let m;e[12]!==r.result?.values?(m=r.result?.values??[],e[12]=r.result?.values,e[13]=m):m=e[13];let h;if(e[14]!==n||e[15]!==i||e[16]!==m){let w;e[18]!==n||e[19]!==i?(w=o((_,S)=>(0,Y.jsxs)("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":S,"data-testid":`db-facet-value-${n}`,onClick:i,type:"button",children:[(0,Y.jsx)("span",{className:"truncate",children:qr(_.value)}),(0,Y.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:_.count})]},qr(_.value)),"c"),e[18]=n,e[19]=i,e[20]=w):w=e[20],h=m.map(w),e[14]=n,e[15]=i,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==n||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,Y.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${n}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=n,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,Y.jsxs)("section",{className:"flex flex-col gap-1","data-testid":c,children:[u,d,g,h,p]}),e[25]=c,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ue"),xn=o(t=>{let e=(0,Rt.c)(44),{columns:n,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,i=ne(),c;e[0]!==s?(c=o(v=>{let{column:F}=v.currentTarget.dataset;F!==void 0&&s(F)},"o"),e[0]=s,e[1]=c):c=e[1];let u=c,d;e[2]!==r?(d=o(v=>r.enabled&&r.columns.has(v),"a"),e[2]=r,e[3]=d):d=e[3];let g=d,m,h,p,b,w,_,S,y;if(e[4]!==n||e[5]!==l||e[6]!==g||e[7]!==i||e[8]!==u){y=Symbol.for("react.early_return_sentinel");e:{let v;e[17]!==g?(v=o(M=>!g(M),"y"),e[17]=g,e[18]=v):v=e[18];let F=n.filter(v),N;if(e[19]!==l||e[20]!==g?(N=Object.entries(l).filter(M=>{let[O]=M;return!g(O)}),e[19]=l,e[20]=g,e[21]=N):N=e[21],m=N,F.length===0){y=null;break e}_="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",S="db-facets",b="flex flex-col gap-1.5";let k;e[22]!==i?(k=i("Facets"),e[22]=i,e[23]=k):k=e[23],e[24]!==k?(w=(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:k}),e[24]=k,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let P;e[26]!==l||e[27]!==u?(P=o(M=>(0,Y.jsx)("button",{"aria-pressed":M in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":M,"data-testid":`db-facet-toggle-${M}`,onClick:u,type:"button",children:M},M),"A"),e[26]=l,e[27]=u,e[28]=P):P=e[28],p=F.map(P)}e[4]=n,e[5]=l,e[6]=g,e[7]=i,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=_,e[15]=S,e[16]=y}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],_=e[14],S=e[15],y=e[16];if(y!==Symbol.for("react.early_return_sentinel"))return y;let I;e[29]!==h||e[30]!==p?(I=(0,Y.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=I):I=e[31];let C;e[32]!==I||e[33]!==b||e[34]!==w?(C=(0,Y.jsxs)("div",{className:b,children:[w,I]}),e[32]=I,e[33]=b,e[34]=w,e[35]=C):C=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(v=>{let[F,N]=v;return(0,Y.jsx)(Ci,{column:F,onFacetFilter:a,state:N},F)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let x;return e[39]!==C||e[40]!==R||e[41]!==_||e[42]!==S?(x=(0,Y.jsxs)("aside",{className:_,"data-testid":S,children:[C,R]}),e[39]=C,e[40]=R,e[41]=_,e[42]=S,e[43]=x):x=e[43],x},"Te"),Sn=o(()=>{let[t,e]=(0,ot.useState)({}),n=Ge(t),l=(0,ot.useRef)({}),r=o(async(a,s)=>{let i=(l.current[a]??0)+1;l.current[a]=i,e(c=>a in c?{...c,[a]:{error:null,loading:!0,result:c[a]?.result??null}}:c);try{let c=await s(a);if(l.current[a]!==i)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:c}}:u)}catch(c){if(l.current[a]!==i)return;throw e(u=>a in u?{...u,[a]:{error:Ht(c),loading:!1,result:null}}:u),c}},"n");return{clearFacets:o(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:o(a=>yr(Object.keys(n.current).map(s=>r(s,a))),"refetchFacets"),toggleFacet:o((a,s)=>{if(a in n.current){e(i=>Object.fromEntries(Object.entries(i).filter(([c])=>c!==a)));return}e(i=>({...i,[a]:{error:null,loading:!0,result:null}})),s!==null&&te(r(a,s))},"toggleFacet")}},"$e"),vi=[],yi=o(()=>{let t=(0,Rt.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:n}=it(Ce.maskPolicies,e);return Array.isArray(n?.columns)?n.columns:vi},"fe"),_n=o(t=>{let e=(0,Rt.c)(16),{columns:n,selectedTable:l}=t,r=yi(),[a,s]=(0,ot.useState)(!0),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(()=>{s(Ri)},"g"),e[0]=i):i=e[0];let c=i,u;if(e[1]!==n||e[2]!==r||e[3]!==l){let b=Br(r,l??"");u=Gr(b,n),e[1]=n,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=o((b,w)=>({columns:Gr(Br(r,b),w),enabled:a}),"l"),e[5]=a,e[6]=r,e[7]=g):g=e[7];let m=g,h;e[8]!==d||e[9]!==a?(h={columns:d,enabled:a},e[8]=d,e[9]=a,e[10]=h):h=e[10];let p;return e[11]!==d||e[12]!==a||e[13]!==m||e[14]!==h?(p={maskColumns:d,maskOn:a,maskView:h,maskViewFor:m,onToggleMask:c},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Re");function Ri(t){return!t}o(Ri,"me");var Kr=34,Ur=600,Ii=o(t=>{let e=(0,Rt.c)(21),{item:n,onSelect:l,prefix:r,selected:a,start:s}=t,i;e[0]!==n.name||e[1]!==l?(i=o(()=>{l(n.name)},"g"),e[0]=n.name,e[1]=l,e[2]=i):i=e[2];let c=i,u=`translateY(${String(s)}px)`,d;e[3]!==u?(d={insetInline:0,position:"absolute",top:0,transform:u},e[3]=u,e[4]=d):d=e[4];let g=d,m=a?"bg-accent font-medium text-accent-foreground":"text-foreground",h;e[5]!==m?(h=gt("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",m),e[5]=m,e[6]=h):h=e[6];let p=`${r}-table-${n.name}`,b;e[7]!==n.name?(b=(0,Y.jsx)("span",{className:"truncate",children:n.name}),e[7]=n.name,e[8]=b):b=e[8];let w;e[9]!==n.rowCount?(w=(0,Y.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:n.rowCount}),e[9]=n.rowCount,e[10]=w):w=e[10];let _;e[11]!==c||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(_=(0,Y.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:c,type:"button",children:[b,w]}),e[11]=c,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=_):_=e[17];let S;return e[18]!==g||e[19]!==_?(S=(0,Y.jsx)("li",{style:g,children:_}),e[18]=g,e[19]=_,e[20]=S):S=e[20],S},"ge"),Cn=o(({header:t,onReload:e,onSelect:n,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let i=ne(),[c,u]=(0,ot.useState)(""),d=(0,ot.useRef)(null),g=o(b=>{u(b.target.value)},"l"),m=(0,ot.useMemo)(()=>{let b=c.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[c,s]),h=gn({count:m.length,estimateSize:o(()=>Kr,"estimateSize"),getScrollElement:o(()=>d.current,"getScrollElement"),initialRect:{height:Ur,width:240},observeElementRect:o((b,w)=>fn(b,w,Ur),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Kr};return(0,Y.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[t,(0,Y.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:i("Tables")}),e!==void 0&&(0,Y.jsx)("button",{"aria-label":r??i("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??i("Refresh"),type:"button",children:(0,Y.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,Y.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),(0,Y.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,Y.jsx)("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:i("search table\u2026"),type:"search",value:c})}),(0,Y.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,Y.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,Y.jsx)(Ii,{item:w,onSelect:n,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=Me(zt(),1);var Wr=Me(mt(),1);function Fi(t){return Mi(t)||typeof t=="function"||ki(t)}o(Fi,"isReactComponent");function Mi(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}o(Mi,"isClassComponent");function ki(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}o(ki,"isExoticComponent");function pt(t,e){return t==null?null:Fi(t)?Wr.default.createElement(t,e):t}o(pt,"flexRender");function mo(t){if("cell"in t&&t.cell){let e=t.cell,n=e.column.columnDef,l=e,r=n;return l.getIsAggregated?.()?pt(r.aggregatedCell??n.cell,e.getContext()):l.getIsPlaceholder?.()?null:pt(n.cell,e.getContext())}return"header"in t&&t.header?pt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?pt(t.footer.column.columnDef.footer,t.footer.getContext()):null}o(mo,"FlexRender");function Qr(t){let e=rn(t.source,t.selector,{compare:st});return typeof t.children=="function"?t.children(e):t.children}o(Qr,"Subscribe");function Xr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}o(Xr,"atomToStore");function go(t){let{createAtom:e,batch:n}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:n,untrack:o(r=>r(),"untrack"),createReadonlyAtom:o((r,a)=>{let s=a?.compare??Object.is,i=!1,c,u=o(()=>{let g=r();return(!i||!s(c,g))&&(c=g,i=!0),c},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:o((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:o(()=>{l.set(r=>r+1)},"commit")}}o(go,"renderPhaseReactivity");function fo(t,e=Object.is){let n=!1,l;return{get:t.get,markCommitted:o(r=>{l=r,n=!0},"markCommitted"),subscribe:o(r=>t.subscribe(a=>{(!n||!e(l,a))&&r(a)}),"subscribe")}}o(fo,"createRenderPhaseSource");function Yr(){return go({createAtom:Sr,batch:xr})}o(Yr,"reactReactivity");function It(t,e){return typeof t=="function"?t(e):t}o(It,"functionalUpdate");function ie(t){if(Array.isArray(t))return t.map(ie);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let n=e===null?$():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(n,a,{configurable:!0,enumerable:!0,value:ie(t[a]),writable:!0})}return n}return t}o(ie,"cloneState");function vn(t,e){let n=Object.keys(e),l=t;for(let r=0;r<n.length;r++){let a=n[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}o(vn,"copyInstancePropertiesWithoutMemos");function $(){return Object.create(null)}o($,"makeObjectMap");function qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}o(qe,"hasOwn");function Ke(t,e){return n=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>It(n,l))}}o(Ke,"makeStateUpdater");function Zr(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}o(Zr,"isPlainContainer");function el(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}o(el,"getEnumerableOwnKeys");var Pi=3;function Ni(t,e){return tl(t,e,Pi)}o(Ni,"stateSlicesEqual");function tl(t,e,n){if(Object.is(t,e))return!0;if(n<=0||!Zr(t)||!Zr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=el(t),r=el(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let i=0;i<l.length;i++){let c=l[i];if(!Object.prototype.propertyIsEnumerable.call(e,c)||!tl(a[c],s[c],n-1))return!1}return!0}o(tl,"stateSlicesEqualAtDepth");function je(t,e,n,l=Ni){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let i=It(n,s);return l(s,i)?s:i})}o(je,"setStateSlice");function nl(t){return t instanceof Function}o(nl,"isFunction");function ol(t,e){let n=[],l=o(r=>{r.forEach(a=>{n.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),n}o(ol,"flattenBy");var Di=o(({fn:t,memoDeps:e,onAfterCompare:n,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],i;return o(u=>{r?.();let d=e?.(u),g=!d||d.length!==s?.length;if(!g&&d){for(let m=0;m<d.length;m++)if(d[m]!==s[m]){g=!0;break}}return n?.(g),g&&(s=d,a?.(),i=t(...d??[]),l?.(i)),i},"memoizedFn")},"memo");function yn(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}o(yn,"skipFirstRun");var Ai=o((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function Ft({feature:t,fnName:e,objectId:n,onAfterUpdate:l,table:r,...a}){let s,i,c=0,u;function d(h,p){let b=c===0?"(1st run)":p?"(rerun #"+c+")":"(cache)";c++,console.groupCollapsed(`%c\u23F1 ${Ai(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${n?`(${e.split(".")[0]}Id: ${n})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
2
2
  ${Math.max(0,Math.min(120-Math.log10(h)*60,120))}deg 100% 31%);`:""} `,`color: ${c<2?"#FF00FF":"#FF1493"}`,"color: #666","color: #87CEEB"),console.info({feature:t,state:r.store.state,deps:a.memoDeps?.toString()}),console.trace(),console.groupEnd()}o(d,"logTime");let g=o(()=>{if(!l)return;let{schedule:h,untrack:p}=r._reactivity;h(()=>p(()=>l()))},"onAfterUpdateHandler");return Di({...a,...{onAfterUpdate:o(()=>{g()},"onAfterUpdate")}})}o(Ft,"tableMemo");function rl(t,e="_"){let[n,l]=t.split(e);return{fnKey:l,fnName:`${n}.${l}`,parentName:n}}o(rl,"getFunctionNameInfo");function be(t,e,n){for(let[l,{fn:r,memoDeps:a}]of Object.entries(n)){let{fnKey:s,fnName:i}=rl(l);e[s]=a?Ft({memoDeps:a,fn:r,fnName:i,table:e,feature:t}):r}}o(be,"assignTableAPIs");function de(t,e,n,l){for(let[r,{fn:a,memoDeps:s}]of Object.entries(l)){let{fnKey:i,fnName:c}=rl(r);if(s){let u=`_memo_${i}`;e[i]=function(...d){if(!this[u]){let g=this;this[u]=Ft({memoDeps:o(m=>s(g,m),"memoDeps"),fn:o((...m)=>a(g,...m),"fn"),fnName:c,objectId:g.id,table:n,feature:t})}return this[u](...d)}}else e[i]=function(...u){return a(this,...u)}}}o(de,"assignPrototypeAPIs");function H(t,e,n,...l){return t[e]?.(...l)??n(t,...l)}o(H,"callMemoOrStaticFn");function ll(t){return t.row.getValue(t.column.id)}o(ll,"cell_getValue");function al(t){return t.getValue()??t.table.options.renderFallbackValue}o(al,"cell_renderValue");function sl(t){return{table:t.table,column:t.column,row:t.row,cell:t,getValue:o(()=>t.getValue(),"getValue"),renderValue:o(()=>t.renderValue(),"renderValue")}}o(sl,"cell_getContext");var il={assignCellPrototype:o((t,e)=>{de("coreCellsFeature",t,e,{cell_getValue:{fn:o(n=>ll(n),"fn")},cell_renderValue:{fn:o(n=>al(n),"fn")},cell_getContext:{fn:o(n=>sl(n),"fn"),memoDeps:o(n=>[n],"memoDeps")}})},"assignCellPrototype")};function Oi(t){if(!t._headerPrototype){t._headerPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignHeaderPrototype?.(t._headerPrototype,t)}return t._headerPrototype}o(Oi,"getHeaderPrototype");function po(t,e,n){let l=Oi(t),r=Object.create(l);r.colSpan=0,r.column=e,r.depth=n.depth,r.headerGroup=null,r.id=n.id??e.id,r.index=n.index,r.isPlaceholder=!!n.isPlaceholder,r.placeholderId=n.placeholderId,r.rowSpan=0,r.subHeaders=[];let a=t._headerInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}o(po,"constructHeader");function Xe(){return{start:[],end:[]}}o(Xe,"getDefaultColumnPinningState");function cl(t){let e=t.getAllColumns(),n=t.getAllLeafColumnsById(),{start:l}=t.atoms.columnPinning?.get()??Xe(),r=[];for(let a=0;a<l.length;a++){let s=n[l[a]];s&&H(s,"getIsVisible",me)&&r.push(s)}return ht(e,r,t,"start")}o(cl,"table_getStartHeaderGroups");function ul(t){let e=t.getAllColumns(),n=t.getAllLeafColumnsById(),{end:l}=t.atoms.columnPinning?.get()??Xe(),r=[];for(let a=0;a<l.length;a++){let s=n[l[a]];s&&H(s,"getIsVisible",me)&&r.push(s)}return ht(e,r,t,"end")}o(ul,"table_getEndHeaderGroups");function dl(t){let e=t.getAllColumns(),n=H(t,"getVisibleLeafColumns",bt),{start:l,end:r}=t.atoms.columnPinning?.get()??Xe();if(l.length||r.length){let a=[...l,...r];n=n.filter(s=>!a.includes(s.id))}return ht(e,n,t,"center")}o(dl,"table_getCenterHeaderGroups");function Ti(t){let{start:e}=t.atoms.columnPinning?.get()??Xe(),n=t.getAllLeafColumnsById(),l=[];for(let r=0;r<e.length;r++){let a=n[e[r]];a&&l.push(a)}return l}o(Ti,"table_getStartLeafColumns");function Vi(t){let{end:e}=t.atoms.columnPinning?.get()??Xe(),n=t.getAllLeafColumnsById(),l=[];for(let r=0;r<e.length;r++){let a=n[e[r]];a&&l.push(a)}return l}o(Vi,"table_getEndLeafColumns");function Ei(t){let{start:e,end:n}=t.atoms.columnPinning?.get()??Xe();if(!e.length&&!n.length)return t.getAllLeafColumns();let l=[...e,...n];return t.getAllLeafColumns().filter(r=>!l.includes(r.id))}o(Ei,"table_getCenterLeafColumns");function zi(t){return H(t,"getStartLeafColumns",Ti).filter(e=>H(e,"getIsVisible",me))}o(zi,"table_getStartVisibleLeafColumns");function Hi(t){return H(t,"getEndLeafColumns",Vi).filter(e=>H(e,"getIsVisible",me))}o(Hi,"table_getEndVisibleLeafColumns");function $i(t){return H(t,"getCenterLeafColumns",Ei).filter(e=>H(e,"getIsVisible",me))}o($i,"table_getCenterVisibleLeafColumns");function Ue(t,e){return e?e==="start"?H(t,"getStartVisibleLeafColumns",zi):e==="end"?H(t,"getEndVisibleLeafColumns",Hi):H(t,"getCenterVisibleLeafColumns",$i):H(t,"getVisibleLeafColumns",bt)}o(Ue,"table_getPinnedVisibleLeafColumns");function ml(){return $()}o(ml,"getDefaultColumnVisibilityState");function ho(t,e){jt(t)&&Bt(t.table,n=>{let l=Object.assign($(),n),r=e??!H(t,"getIsVisible",me),a=t.getLeafColumns();for(let s=0;s<a.length;s++){let i=a[s];jt(i)&&(l[i.id]=r)}return l})}o(ho,"column_toggleVisibility");function me(t){let e=t.table.atoms.columnVisibility?.get();if(!e)return!0;let n=t.columns;return n.length?n.some(l=>H(l,"getIsVisible",me)):(qe(e,t.id)?e[t.id]:void 0)??!0}o(me,"column_getIsVisible");function jt(t){return(t.columnDef.enableHiding??!0)&&(t.table.options.enableHiding??!0)}o(jt,"column_getCanHide");function gl(t){return e=>{ho(t,e.target.checked)}}o(gl,"column_getToggleVisibilityHandler");function bo(t){let e=t.getAllCells(),n=[];for(let u=0;u<e.length;u++){let d=e[u];H(d.column,"getIsVisible",me)&&n.push(d)}let{start:l,end:r}=t.table.atoms.columnPinning?.get()??Xe();if(!l.length&&!r.length)return n;let a=H(t,"getVisibleCellsByColumnId",Rn),s=[];for(let u=0;u<l.length;u++){let d=a[l[u]];d&&s.push(d)}let i=[];for(let u=0;u<r.length;u++){let d=a[r[u]];d&&i.push(d)}let c=[];for(let u=0;u<n.length;u++){let d=n[u],g=d.column.id;!l.includes(g)&&!r.includes(g)&&c.push(d)}return[...s,...c,...i]}o(bo,"row_getVisibleCells");function Rn(t){let e=$(),n=t.getAllCells();for(let l=0;l<n.length;l++){let r=n[l];H(r.column,"getIsVisible",me)&&(e[r.column.id]=r)}return e}o(Rn,"row_getVisibleCellsByColumnId");function fl(t){return t.getAllFlatColumns().filter(e=>H(e,"getIsVisible",me))}o(fl,"table_getVisibleFlatColumns");function bt(t){return t.getAllLeafColumns().filter(e=>H(e,"getIsVisible",me))}o(bt,"table_getVisibleLeafColumns");function Bt(t,e){je(t,"columnVisibility",e)}o(Bt,"table_setColumnVisibility");function pl(t,e){Bt(t,e?$():Object.assign($(),ie(t.initialState.columnVisibility??{})))}o(pl,"table_resetColumnVisibility");function wo(t,e){e=e??!xo(t);let n=$(),l=t.getAllLeafColumns();for(let r=0;r<l.length;r++){let a=l[r];n[a.id]=e||!jt(a)}Bt(t,n)}o(wo,"table_toggleAllColumnsVisible");function xo(t){return!t.getAllLeafColumns().some(e=>!H(e,"getIsVisible",me))}o(xo,"table_getIsAllColumnsVisible");function bl(t){return t.getAllLeafColumns().some(e=>H(e,"getIsVisible",me))}o(bl,"table_getIsSomeColumnsVisible");function hl(t){return e=>{wo(t,e.target.checked)}}o(hl,"table_getToggleAllColumnsVisibilityHandler");function wl(t,e=1){let n=e;for(let l=0;l<t.length;l++){let r=t[l];H(r,"getIsVisible",me)&&r.columns.length&&(n=Math.max(n,wl(r.columns,e+1)))}return n}o(wl,"getMaxHeaderDepth");function Li(t,e){return t?`${t}_${e}`:String(e)}o(Li,"formatHeaderGroupId");function ji(t,e,n,l){let r=t??"";return e&&(r=r?`${r}_${e}`:String(e)),n&&(r=r?`${r}_${n}`:n),l&&(r=r?`${r}_${l}`:l),r}o(ji,"formatHeaderId");function Bi(t,e){let n=0;for(let l=0;l<t.length;l++)t[l].column===e&&n++;return n}o(Bi,"countPendingHeadersForColumn");function xl(t,e,n,l,r,a){let s={depth:e,id:Li(l,e),headers:[]},i=[];for(let c=0;c<t.length;c++){if(!(c in t))continue;let u=t[c],d=i[i.length-1],g=u.column.depth===s.depth,m,h=!1;if(g&&u.column.parent?m=u.column.parent:(m=u.column,h=!0),d&&d.column===m)d.subHeaders.push(u);else{let p=po(n,m,{id:ji(l,e,m.id,u.id),isPlaceholder:h,placeholderId:h?String(Bi(i,m)):void 0,depth:e,index:i.length});p.subHeaders.push(u),i.push(p)}s.headers.push(u),u.headerGroup=s}for(let c=0;c<a.length;c++)a[c](s);r.push(s),e>0&&xl(i,e-1,n,l,r,a)}o(xl,"constructHeaderGroup");function Sl(t){for(let e=0;e<t.length;e++){let n=t[e];if(!H(n.column,"getIsVisible",me))continue;let l=0;if(n.subHeaders.length){Sl(n.subHeaders);for(let r=0;r<n.subHeaders.length;r++){let a=n.subHeaders[r];H(a.column,"getIsVisible",me)&&(l+=a.colSpan)}}else l=1;if(n.colSpan=l,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let r=1,a=n.subHeaders[0];for(;a;)a.rowSpan=0,r++,a=a.subHeaders.length===1&&a.subHeaders[0].column===n.column?a.subHeaders[0]:void 0;n.rowSpan=r}else n.rowSpan=1}}o(Sl,"updateHeaderSpans");function ht(t,e,n,l){let r=wl(t),a=[],s=n._headerGroupInstanceInitFns,i=new Array(e.length);for(let c=0;c<e.length;c++)c in e&&(i[c]=po(n,e[c],{depth:r,index:c}));return xl(i,r-1,n,l,a,s),a.reverse(),Sl(a[0]?.headers??[]),a}o(ht,"buildHeaderGroups");function Gi(t){if(!t._columnPrototype){t._columnPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignColumnPrototype?.(t._columnPrototype,t)}return t._columnPrototype}o(Gi,"getColumnPrototype");function _l(t,e,n,l){let r={...t.getDefaultColumnDef(),...e},a=r.accessorKey,s=a===void 0?void 0:String(a),i=r.id??s?.replaceAll(".","_")??(typeof r.header=="string"?r.header:void 0),c;if(r.accessorFn)c=r.accessorFn;else if(a!==void 0)if(typeof a=="string"&&a.includes(".")){let m=a.split(".");c=o(h=>{let p=h;for(let b=0;b<m.length;b++){let w=m[b];p=p?.[w]}return p},"accessorFn")}else c=o(m=>m[r.accessorKey],"accessorFn");if(!i)throw new Error;let u=Gi(t),d=Object.create(u);d.accessorFn=c,d.columnDef=r,d.columns=[],d.depth=n,d.id=`${String(i)}`,d.parent=l;let g=t._columnInstanceInitFns;for(let m=0;m<g.length;m++)g[m](d);return d}o(_l,"constructColumn");function Cl(){return[]}o(Cl,"getDefaultColumnOrderState");function So(t){let e=o(n=>{let l=$();for(let r=0;r<n.length;r++)l[n[r].id]=r;return l},"buildIndexes");return{all:e(Ue(t)),center:e(Ue(t,"center")),start:e(Ue(t,"start")),end:e(Ue(t,"end"))}}o(So,"table_getColumnIndexes");function vl(t,e){return H(t.table,"getColumnIndexes",So)[e==="start"?"start":e==="end"?"end":e==="center"?"center":"all"][t.id]??-1}o(vl,"column_getIndex");function yl(t,e){return Ue(t.table,e)[0]?.id===t.id}o(yl,"column_getIsFirstColumn");function Rl(t,e){let n=Ue(t.table,e);return n[n.length-1]?.id===t.id}o(Rl,"column_getIsLastColumn");function _o(t,e){je(t,"columnOrder",e)}o(_o,"table_setColumnOrder");function Il(t,e){_o(t,e?[]:ie(t.initialState.columnOrder??[]))}o(Il,"table_resetColumnOrder");function Gt(t){let e=t.atoms.columnOrder?.get();return n=>{let l=[];if(!e?.length)l=n;else{let r=new Map;for(let a=0;a<n.length;a++){let s=n[a];r.set(s.id,s)}for(let a=0;a<e.length;a++){let s=e[a],i=r.get(s);i&&(l.push(i),r.delete(s))}for(let a=0;a<n.length;a++){let s=n[a];r.has(s.id)&&l.push(s)}}return qi(t,l)}}o(Gt,"table_getOrderColumnsFn");function qi(t,e){let n=t.atoms.grouping?.get()??[],{groupedColumnMode:l}=t.options;if(!n.length||!l)return e;let r=e.filter(i=>!n.includes(i.id));if(l==="remove")return r;let a=new Map;for(let i=0;i<e.length;i++){let c=e[i];a.set(c.id,c)}let s=[];for(let i=0;i<n.length;i++){let c=a.get(n[i]);c&&s.push(c)}return[...s,...r]}o(qi,"orderColumns");function Fl(t){return[t,...t.columns.flatMap(e=>e.getFlatColumns())]}o(Fl,"column_getFlatColumns");function Ml(t){if(t.columns.length){let e=t.columns.flatMap(n=>n.getLeafColumns());return H(t.table,"getOrderColumns",Gt)(e)}return[t]}o(Ml,"column_getLeafColumns");function kl(t){return{header:o(e=>{let n=e.header.column.columnDef;return n.accessorKey?n.accessorKey:n.accessorFn?n.id:null},"header"),cell:o(e=>e.renderValue()?.toString?.()??null,"cell"),...Object.values(t._features).reduce((e,n)=>Object.assign(e,n.getDefaultColumnDef?.()),{}),...t.options.defaultColumn}}o(kl,"table_getDefaultColumnDef");function Pl(t,e,n,l=0){let r=new Array(e.length);for(let a=0;a<e.length;a++){if(!(a in e))continue;let s=e[a],i=_l(t,s,l,n),c=s;i.columns=c.columns?Pl(t,c.columns,i,l+1):[],r[a]=i}return r}o(Pl,"constructColumns");function Nl(t){return Pl(t,t.options.columns)}o(Nl,"table_getAllColumns");function Dl(t){return t.getAllColumns().flatMap(e=>e.getFlatColumns())}o(Dl,"table_getAllFlatColumns");function Al(t){let e=$(),n=t.getAllFlatColumns();for(let l=0;l<n.length;l++){let r=n[l];e[r.id]=r}return e}o(Al,"table_getAllFlatColumnsById");function Ol(t){let e=t.getAllColumns().flatMap(n=>n.getLeafColumns());return H(t,"getOrderColumns",Gt)(e)}o(Ol,"table_getAllLeafColumns");function Tl(t){let e=$(),n=t.getAllLeafColumns();for(let l=0;l<n.length;l++){let r=n[l];e[r.id]=r}return e}o(Tl,"table_getAllLeafColumnsById");function Vl(t,e){return t.getAllFlatColumnsById()[e]}o(Vl,"table_getColumn");var El={assignColumnPrototype:o((t,e)=>{de("coreColumnsFeature",t,e,{column_getFlatColumns:{fn:o(n=>Fl(n),"fn"),memoDeps:o(n=>[n.table.options.columns],"memoDeps")},column_getLeafColumns:{fn:o(n=>Ml(n),"fn"),memoDeps:o(n=>[n.table.atoms.columnOrder?.get(),n.table.atoms.grouping?.get(),n.table.options.columns,n.table.options.groupedColumnMode],"memoDeps")}})},"assignColumnPrototype"),constructTableAPIs:o(t=>{be("coreColumnsFeature",t,{table_getDefaultColumnDef:{fn:o(()=>kl(t),"fn"),memoDeps:o(()=>[t.options.defaultColumn],"memoDeps")},table_getAllColumns:{fn:o(()=>Nl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumns:{fn:o(()=>Dl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumnsById:{fn:o(()=>Al(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllLeafColumns:{fn:o(()=>Ol(t),"fn"),memoDeps:o(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getAllLeafColumnsById:{fn:o(()=>Tl(t),"fn"),memoDeps:o(()=>[t.getAllLeafColumns()],"memoDeps")},table_getColumn:{fn:o(e=>Vl(t,e),"fn")}})},"constructTableAPIs")};function zl(t,e){for(let n=0;n<t.subHeaders.length;n++)zl(t.subHeaders[n],e);e.push(t)}o(zl,"collectLeafHeaders");function Hl(t){let e=[];return zl(t,e),e}o(Hl,"header_getLeafHeaders");function $l(t){return{column:t.column,header:t,table:t.column.table}}o($l,"header_getContext");function Ll(t){let{start:e,end:n}=t.atoms.columnPinning?.get()??Xe(),l=t.getAllColumns(),r=H(t,"getVisibleLeafColumns",bt);if(!e.length&&!n.length)return ht(l,r,t);let a=t.getAllLeafColumnsById(),s=[];for(let u=0;u<e.length;u++){let d=a[e[u]];d&&H(d,"getIsVisible",me)&&s.push(d)}let i=[];for(let u=0;u<n.length;u++){let d=a[n[u]];d&&H(d,"getIsVisible",me)&&i.push(d)}let c=r.filter(u=>!e.includes(u.id)&&!n.includes(u.id));return ht(l,[...s,...c,...i],t)}o(Ll,"table_getHeaderGroups");function jl(t){return[...t.getHeaderGroups()].reverse()}o(jl,"table_getFooterGroups");function Bl(t){let e=t.getHeaderGroups(),n=[];for(let l=0;l<e.length;l++){let r=e[l].headers;for(let a=0;a<r.length;a++)n.push(r[a])}return n}o(Bl,"table_getFlatHeaders");function Gl(t){let e=t.getHeaderGroups()[0]?.headers??[],n=[];for(let l=0;l<e.length;l++){let r=e[l].getLeafHeaders();for(let a=0;a<r.length;a++)n.push(r[a])}return n}o(Gl,"table_getLeafHeaders");var ql={assignHeaderPrototype:o((t,e)=>{de("coreHeadersFeature",t,e,{header_getLeafHeaders:{fn:o(n=>Hl(n),"fn"),memoDeps:o(n=>[n.column.table.options.columns],"memoDeps")},header_getContext:{fn:o(n=>$l(n),"fn"),memoDeps:o(n=>[n.column.table.options.columns],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{be("coreHeadersFeature",t,{table_getHeaderGroups:{fn:o(()=>Ll(t),"fn"),memoDeps:o(()=>[t.options.columns,t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.options.groupedColumnMode],"memoDeps")},table_getFooterGroups:{fn:o(()=>jl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")},table_getFlatHeaders:{fn:o(()=>Bl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")},table_getLeafHeaders:{fn:o(()=>Gl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function Ki(t){if(!t._rowPrototype){t._rowPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignRowPrototype?.(t._rowPrototype,t)}return t._rowPrototype}o(Ki,"getRowPrototype");var Kl=o((t,e,n,l,r,a,s)=>{let i=Ki(t),c=Object.create(i);c._displayIndexCache=-1,c._uniqueValuesCache=$(),c._valuesCache=$(),c.depth=r,c.id=e,c.index=l,c.original=n,c.parentId=s,c.subRows=a??[];let u=t._rowInstanceInitFns;for(let d=0;d<u.length;d++)u[d](c);return c},"constructRow");var vo=/([0-9]+)/gm;function wt(t){let e=Object.assign((n,l,r)=>{let a=n.getValue(r),s=l.getValue(r),i=e.resolveDataValue;return i&&(a=i(a),s=i(s)),e.sort(a,s,n,l,r)},t);return e}o(wt,"constructSortFn");var yo=wt({resolveDataValue:o(t=>Fn(t).toLowerCase(),"resolveDataValue"),sort:o((t,e)=>Wl(t,e),"sort")}),Ui=wt({resolveDataValue:o(t=>Fn(t),"resolveDataValue"),sort:o((t,e)=>Wl(t,e),"sort")}),Ro=wt({resolveDataValue:o(t=>Fn(t).toLowerCase(),"resolveDataValue"),sort:o((t,e)=>Fo(t,e),"sort")}),Ji=wt({resolveDataValue:o(t=>Fn(t),"resolveDataValue"),sort:o((t,e)=>Fo(t,e),"sort")}),Io=wt({resolveDataValue:o(t=>Wi(t),"resolveDataValue"),sort:o((t,e)=>t>e?1:t<e?-1:0,"sort")}),Mt=wt({sort:o((t,e)=>Fo(t,e),"sort")});function Fo(t,e){return t===e?0:t>e?1:-1}o(Fo,"compareBasic");function Wi(t){return t instanceof Date?t.getTime():t}o(Wi,"toDateSortValue");function Fn(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}o(Fn,"toString");function Wl(t,e){let n=0,l=0,r=t.length,a=e.length;for(;n<r&&l<a;){let s=In(t.charCodeAt(n)),i=In(e.charCodeAt(l)),c=Co(t,n,s),u=Co(e,l,i);if(!s&&!i){let g=Qi(t,n,c,e,l,u);if(g)return g;n=c,l=u;continue}if(s!==i)return s?1:-1;let d=Xi(t,n,c,e,l,u);if(d)return d;n=c,l=u}return Jl(t,n)-Jl(e,l)}o(Wl,"compareAlphanumeric");function In(t){return t>=48&&t<=57}o(In,"isDigit");function Co(t,e,n){let l=e+1;for(;l<t.length&&In(t.charCodeAt(l))===n;)l++;return l}o(Co,"findChunkEnd");function Qi(t,e,n,l,r,a){let s=n-e,i=a-r,c=s<i?s:i;for(let u=0;u<c;u++){let d=t.charCodeAt(e+u),g=l.charCodeAt(r+u);if(d>g)return 1;if(g>d)return-1}return s>i?1:i>s?-1:0}o(Qi,"compareStringChunks");function Xi(t,e,n,l,r,a){let s=e;for(;s<n&&t.charCodeAt(s)===48;)s++;let i=r;for(;i<a&&l.charCodeAt(i)===48;)i++;let c=n-s,u=a-i;if(c===0&&u===0)return 0;if(c<=15&&u<=15){let m=Ul(t,s,n),h=Ul(l,i,a);return m>h?1:h>m?-1:0}let d=parseInt(t.slice(e,n),10),g=parseInt(l.slice(r,a),10);return d>g?1:g>d?-1:0}o(Xi,"compareNumericChunks");function Ul(t,e,n){let l=0;for(let r=e;r<n;r++)l=l*10+t.charCodeAt(r)-48;return l}o(Ul,"parseSmallInt");function Jl(t,e){let n=0,l=e;for(;l<t.length;)n++,l=Co(t,l,In(t.charCodeAt(l)));return n}o(Jl,"countRemainingChunks");function Ql(){return[]}o(Ql,"getDefaultCellSelectionState");function Yi(t,e){je(t,"cellSelection",e?Ql():ie(t.initialState.cellSelection)??Ql())}o(Yi,"table_resetCellSelection");function Xl(t){t.atoms.cellSelection&&(t.options.autoResetAll??t.options.autoResetCellSelection??!0)&&t._reactivity.schedule(()=>Yi(t))}o(Xl,"table_autoResetCellSelection");function Yl(t){t.atoms.expanded&&(t.options.autoResetAll??t.options.autoResetExpanded??!t.options.manualExpanding)&&t._reactivity.schedule(()=>Zi(t))}o(Yl,"table_autoResetExpanded");function Zi(t,e){let n=t.initialState.expanded;je(t,"expanded",e?$():n===!0?!0:Object.assign($(),ie(n??{})))}o(Zi,"table_resetExpanded");var Mn=0;function kn(t){if(t.options.autoResetAll??t.options.autoResetPageIndex??!t.options.manualPagination){if((t.atoms.pagination?.get()?.pageIndex??Mn)===Mn)return;nc(t,!0)}}o(kn,"table_autoResetPageIndex");function ec(t,e){je(t,"pagination",e)}o(ec,"table_setPagination");function tc(t,e){ec(t,n=>{let l=It(e,n.pageIndex),r=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return l=Math.max(0,Math.min(l,r)),{...n,pageIndex:l}})}o(tc,"table_setPageIndex");function nc(t,e){tc(t,e?Mn:t.initialState.pagination?.pageIndex??Mn)}o(nc,"table_resetPageIndex");function Zl(){return[]}o(Zl,"getDefaultSortingState");function Kt(t,e){je(t,"sorting",e)}o(Kt,"table_setSorting");function Mo(t,e){Kt(t,e?[]:ie(t.initialState.sorting??[]))}o(Mo,"table_resetSorting");function ea(t){t.atoms.sorting&&(t.options.autoResetAll??t.options.autoResetSorting??!1)&&Mo(t)}o(ea,"table_autoResetSorting");function ko(t){let e=t.table._rowModelFns.sortFns,n=t.table.getFilteredRowModel().flatRows.slice(0,10),l,r=!1;for(let a=0;a<n.length;a++){let s=n[a].getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]"){l="datetime";break}if(typeof s=="string"&&(r=!0,s.split(vo).length>1)){l="alphanumeric";break}}if(!l&&r&&(l="text"),l){let a=e?.[l];if(a||l==="alphanumeric"&&(a=e?.text),a)return a}return Mt}o(ko,"column_getAutoSortFn");function Po(t){let e=t.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<e.length;n++){let l=e[n].getValue(t.id);if(l!=null)return typeof l=="string"?"asc":"desc"}return"desc"}o(Po,"column_getAutoSortDir");function Pn(t){let e=t.table._rowModelFns.sortFns;return nl(t.columnDef.sortFn)?t.columnDef.sortFn:t.columnDef.sortFn==="auto"?ko(t):e?.[t.columnDef.sortFn]??Mt}o(Pn,"column_getSortFn");function No(t,e,n){let l=Ao(t,n&&qt(t)),r=typeof e<"u";Kt(t.table,a=>{let s=a.findIndex(m=>m.id===t.id),i=s===-1?void 0:a[s],c=[],u,d=r?e:l==="desc",g=!!(a.length&&qt(t)&&n);return g?i?u="toggle":u="add":i?u="toggle":u="replace",u==="toggle"&&(r||l||(u="remove")),u==="add"?(c=[...a,{id:t.id,desc:d}],c.splice(0,c.length-(t.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?c=g?a.map(m=>m.id===t.id?{...m,desc:d}:m):[{id:t.id,desc:d}]:u==="remove"?c=g?a.filter(m=>m.id!==t.id):[]:c=[{id:t.id,desc:d}],c})}o(No,"column_toggleSorting");function Do(t){return t.columnDef.sortDescFirst??t.table.options.sortDescFirst??Po(t)==="desc"?"desc":"asc"}o(Do,"column_getFirstSortDir");function Ao(t,e){let n=Do(t),l=Oo(t);return l?l!==n&&(t.table.options.enableSortingRemoval??!0)&&(!e||(t.table.options.enableMultiRemove??!0))?!1:l==="desc"?"asc":"desc":n}o(Ao,"column_getNextSortingOrder");function Ut(t){return(t.columnDef.enableSorting??!0)&&(t.table.options.enableSorting??!0)&&!!t.accessorFn}o(Ut,"column_getCanSort");function qt(t){return t.columnDef.enableMultiSort??t.table.options.enableMultiSort??!!t.accessorFn}o(qt,"column_getCanMultiSort");function Oo(t){let e=t.table.atoms.sorting?.get()?.find(n=>n.id===t.id);return e?e.desc?"desc":"asc":!1}o(Oo,"column_getIsSorted");function ta(t){return t.table.atoms.sorting?.get()?.findIndex(e=>e.id===t.id)??-1}o(ta,"column_getSortIndex");function na(t){Kt(t.table,e=>e.length?e.filter(n=>n.id!==t.id):[])}o(na,"column_clearSorting");function oa(t){let e=Ut(t);return n=>{e&&No(t,void 0,qt(t)?t.table.options.isMultiSortEvent?.(n):!1)}}o(oa,"column_getToggleSortingHandler");function ra(){return t=>Ft({feature:"coreRowModelsFeature",table:t,fnName:"table.getCoreRowModel",memoDeps:o(()=>[t.options.data],"memoDeps"),fn:o(()=>oc(t,t.options.data),"fn"),onAfterUpdate:yn(()=>{Yl(t),kn(t),ea(t),Xl(t)})})}o(ra,"createCoreRowModel");function la(t,e,n,l=0,r){let a=[];for(let s=0;s<n.length;s++){let i=n[s],c=Kl(t,t.getRowId(i,s,r),i,s,l,void 0,r?.id);e.flatRows.push(c),e.rowsById[c.id]=c,a.push(c),t.options.getSubRows&&(c.originalSubRows=t.options.getSubRows(i,s),c.originalSubRows?.length&&(c.subRows=la(t,e,c.originalSubRows,l+1,c)))}return a}o(la,"accessRows");function oc(t,e){let n={rows:[],flatRows:[],rowsById:$()};return n.rows=la(t,n,e),n}o(oc,"_createCoreRowModel");function aa(t){return t._rowModels.coreRowModel||(t._rowModels.coreRowModel=t.options.features.coreRowModel?.(t)??ra()(t)),t._rowModels.coreRowModel()}o(aa,"table_getCoreRowModel");function sa(t){return t.getCoreRowModel()}o(sa,"table_getPreFilteredRowModel");function ia(t){return t._rowModels.filteredRowModel||(t._rowModels.filteredRowModel=t.options.features.filteredRowModel?.(t)),t.options.manualFiltering||!t._rowModels.filteredRowModel?t.getPreFilteredRowModel():t._rowModels.filteredRowModel()}o(ia,"table_getFilteredRowModel");function ca(t){return t.getFilteredRowModel()}o(ca,"table_getPreGroupedRowModel");function ua(t){return t._rowModels.groupedRowModel||(t._rowModels.groupedRowModel=t.options.features.groupedRowModel?.(t)),t.options.manualGrouping||!t._rowModels.groupedRowModel?t.getPreGroupedRowModel():t._rowModels.groupedRowModel()}o(ua,"table_getGroupedRowModel");function da(t){return t.getGroupedRowModel()}o(da,"table_getPreSortedRowModel");function ma(t){return t._rowModels.sortedRowModel||(t._rowModels.sortedRowModel=t.options.features.sortedRowModel?.(t)),t.options.manualSorting||!t._rowModels.sortedRowModel?t.getPreSortedRowModel():t._rowModels.sortedRowModel()}o(ma,"table_getSortedRowModel");function ga(t){return t.getSortedRowModel()}o(ga,"table_getPreExpandedRowModel");function fa(t){return t._rowModels.expandedRowModel||(t._rowModels.expandedRowModel=t.options.features.expandedRowModel?.(t)),t.options.manualExpanding||!t._rowModels.expandedRowModel?t.getPreExpandedRowModel():t._rowModels.expandedRowModel()}o(fa,"table_getExpandedRowModel");function pa(t){return t.getExpandedRowModel()}o(pa,"table_getPrePaginatedRowModel");function ba(t){return t._rowModels.paginatedRowModel||(t._rowModels.paginatedRowModel=t.options.features.paginatedRowModel?.(t)),t.options.manualPagination||!t._rowModels.paginatedRowModel?t.getPrePaginatedRowModel():t._rowModels.paginatedRowModel()}o(ba,"table_getPaginatedRowModel");function ha(t){return t.getPaginatedRowModel()}o(ha,"table_getRowModel");var wa={constructTableAPIs:o(t=>{be("coreRowModelsFeature",t,{table_getCoreRowModel:{fn:o(()=>aa(t),"fn")},table_getPreFilteredRowModel:{fn:o(()=>sa(t),"fn")},table_getFilteredRowModel:{fn:o(()=>ia(t),"fn")},table_getPreGroupedRowModel:{fn:o(()=>ca(t),"fn")},table_getGroupedRowModel:{fn:o(()=>ua(t),"fn")},table_getPreSortedRowModel:{fn:o(()=>da(t),"fn")},table_getSortedRowModel:{fn:o(()=>ma(t),"fn")},table_getPreExpandedRowModel:{fn:o(()=>ga(t),"fn")},table_getExpandedRowModel:{fn:o(()=>fa(t),"fn")},table_getPrePaginatedRowModel:{fn:o(()=>pa(t),"fn")},table_getPaginatedRowModel:{fn:o(()=>ba(t),"fn")},table_getRowModel:{fn:o(()=>ha(t),"fn")}})},"constructTableAPIs")};function rc(t){if(!t._cellPrototype){t._cellPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignCellPrototype?.(t._cellPrototype,t)}return t._cellPrototype}o(rc,"getCellPrototype");function xa(t,e,n){let l=rc(n),r=Object.create(l);r.column=t,r.id=`${e.id}_${t.id}`,r.row=e;let a=n._cellInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}o(xa,"constructCell");function Sa(t){let e=t.table.getRowsInDisplayOrder(),n=t._displayIndexCache;return e[n]===t?n:-1}o(Sa,"row_getDisplayIndex");function _a(t){let e=t.getPrePaginatedRowModel().rows;if(t.options.paginateExpandedRows===!1){let n=[],l=o(r=>{r._displayIndexCache=n.length,n.push(r),r.subRows.length&&r.getIsExpanded?.()&&r.subRows.forEach(l)},"handleRow");return e.forEach(l),n}for(let n=0;n<e.length;n++)e[n]._displayIndexCache=n;return e}o(_a,"table_getRowsInDisplayOrder");function Ca(t,e){if(qe(t._valuesCache,e))return t._valuesCache[e];let n=t.table.getColumn(e);if(n?.accessorFn)return t._valuesCache[e]=n.accessorFn(t.original,t.index),t._valuesCache[e]}o(Ca,"row_getValue");function va(t,e){if(qe(t._uniqueValuesCache,e))return t._uniqueValuesCache[e];let n=t.table.getColumn(e);if(n?.accessorFn)return n.columnDef.getUniqueValues?(t._uniqueValuesCache[e]=n.columnDef.getUniqueValues(t.original,t.index),t._uniqueValuesCache[e]):(t._uniqueValuesCache[e]=[t.getValue(e)],t._uniqueValuesCache[e])}o(va,"row_getUniqueValues");function ya(t,e){return t.getValue(e)??t.table.options.renderFallbackValue}o(ya,"row_renderValue");function Ra(t){return ol(t.subRows,e=>e.subRows)}o(Ra,"row_getLeafRows");function Ia(t){let e=t.getCoreRowModel().flatRows,n=0;for(let l=0;l<e.length;l++)n=Math.max(n,e[l].depth);return n}o(Ia,"table_getMaxSubRowDepth");function Fa(t){if(t.parentId)return t.table.getCoreRowModel().rowsById[t.parentId]??t.table.getRow(t.parentId,!0)}o(Fa,"row_getParentRow");function Ma(t){let e=[],n=t;for(;;){let l=n.getParentRow();if(!l)break;e.push(l),n=l}return e.reverse()}o(Ma,"row_getParentRows");function ka(t){let e=t.table.getAllLeafColumns(),n=t._cellsCache;n||(n=t._cellsCache=new WeakMap);let l=new Array(e.length);for(let r=0;r<e.length;r++){let a=e[r],s=n.get(a);s||(s=xa(a,t,t.table),n.set(a,s)),l[r]=s}return l}o(ka,"row_getAllCells");function Pa(t){let e=$(),n=t.getAllCells();for(let l=0;l<n.length;l++){let r=n[l];e[r.column.id]=r}return e}o(Pa,"row_getAllCellsByColumnId");function Na(t,e,n,l){return e.options.getRowId?.(t,n,l)??(l?`${l.id}.${n}`:String(n))}o(Na,"table_getRowId");function Da(t,e,n){let l=(n?t.getPrePaginatedRowModel():t.getRowModel()).rowsById[e];if(!l&&(l=t.getCoreRowModel().rowsById[e],!l))throw new Error;return l}o(Da,"table_getRow");var Aa={assignRowPrototype:o((t,e)=>{de("coreRowsFeature",t,e,{row_getDisplayIndex:{fn:o(n=>Sa(n),"fn")},row_getAllCellsByColumnId:{fn:o(n=>Pa(n),"fn"),memoDeps:o(n=>[n.getAllCells()],"memoDeps")},row_getAllCells:{fn:o(n=>ka(n),"fn"),memoDeps:o(n=>[n.table.getAllLeafColumns()],"memoDeps")},row_getLeafRows:{fn:o(n=>Ra(n),"fn"),memoDeps:o(n=>[n.subRows],"memoDeps")},row_getParentRow:{fn:o(n=>Fa(n),"fn")},row_getParentRows:{fn:o(n=>Ma(n),"fn")},row_getUniqueValues:{fn:o((n,l)=>va(n,l),"fn")},row_getValue:{fn:o((n,l)=>Ca(n,l),"fn")},row_renderValue:{fn:o((n,l)=>ya(n,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{be("coreRowsFeature",t,{table_getRowsInDisplayOrder:{fn:o(()=>_a(t),"fn"),memoDeps:o(()=>[t.getPrePaginatedRowModel().rows,t.options.paginateExpandedRows,t.options.paginateExpandedRows===!1?t.atoms.expanded?.get():void 0],"memoDeps")},table_getRowId:{fn:o((e,n,l)=>Na(e,t,n,l),"fn")},table_getRow:{fn:o((e,n)=>Da(t,e,n),"fn")},table_getMaxSubRowDepth:{fn:o(()=>Ia(t),"fn"),memoDeps:o(()=>[t.getCoreRowModel()],"memoDeps")}})},"constructTableAPIs")};function Nn(t,e,n=(l,r)=>l===r){let l=e===void 0?t.options.state:e;t._reactivity.batch(()=>{if(l)for(let r in l){let a=t.baseAtoms[r];if(!a)continue;let s=l[r],i=s===void 0?t.initialState[r]:s;n(t._reactivity.untrack(()=>a.get()),i)||a.set(()=>i)}})}o(Nn,"table_syncExternalStateToBaseAtoms");function Dn(t,e,n=(l,r)=>l===r){t._reactivity.batch(()=>{Nn(t,e,n),t._reactivity.commit?.()})}o(Dn,"table_publishExternalState");function To(t){let e=ie(t.initialState);t._reactivity.batch(()=>{let l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];t.baseAtoms[a].set(e[a])}});let n=Object.values(t._features);for(let l=0;l<n.length;l++)n[l].resetTableInstanceData?.(t)}o(To,"table_reset");function Oa(t,e){let{features:n,atoms:l,initialState:r}=t.options;if(!t.options.mergeOptions)return{...t.options,...e,features:n,atoms:l,initialState:r};let a=t.options.mergeOptions(t.options,e),s={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...s,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:l,enumerable:!0,configurable:!0,writable:!0},initialState:{value:r,enumerable:!0,configurable:!0,writable:!0}})}o(Oa,"table_mergeOptions");function Jt(t,e,n){let l=Oa(t,It(e,t.options));t.optionsStore?t.optionsStore.set(()=>l):t.options=l,n?.syncExternalState!==!1&&Dn(t,l.state??null)}o(Jt,"table_setOptions");var Ta={constructTableAPIs:o(t=>{be("coreTablesFeature",t,{table_reset:{fn:o(()=>To(t),"fn")},table_setOptions:{fn:o(e=>Jt(t,e),"fn")}})},"constructTableAPIs")};var Va={coreCellsFeature:il,coreColumnsFeature:El,coreHeadersFeature:ql,coreRowModelsFeature:wa,coreRowsFeature:Aa,coreTablesFeature:Ta};function Ea(t,e={}){return Object.values(t).forEach(n=>{e=n.getInitialState?.(e)??e}),ie(e)}o(Ea,"getInitialTableState");function Vo(t){let e=t.features.coreReactivityFeature,{aggregationFns:n,columnMeta:l,coreRowModel:r,expandedRowModel:a,facetedMinMaxValues:s,facetedRowModel:i,facetedUniqueValues:c,filterFns:u,filterMeta:d,filteredRowModel:g,groupedRowModel:m,paginatedRowModel:h,sortFns:p,sortedRowModel:b,tableMeta:w,..._}=t.features,S={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Va,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:e,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:u,sortFns:p},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(S._features),I={...y.reduce((R,x)=>Object.assign(R,x.getDefaultTableOptions?.(S)),{}),...t};if(e.wrapExternalAtoms&&I.atoms)for(let[R,x]of Object.entries(I.atoms)){let v=x,F=e.createWritableAtom(v.get(),{debugName:`externalAtom/${R}`});I.atoms[R]=F;let N=!1,k=v.subscribe(M=>{N||F.set(M)}),P=F.subscribe(M=>{N=!0,v.set(M),N=!1});e.addSubscription(k),e.addSubscription(P)}e.createOptionsStore?(S.optionsStore=e.createWritableAtom(I,{debugName:"table/optionsStore"}),Object.defineProperty(S,"options",{configurable:!0,enumerable:!0,get(){return S.optionsStore.get()},set(R){S.optionsStore.set(()=>R)}})):S.options=I,S.initialState=Ea(S._features,S.options.initialState);let C=Object.keys(S.initialState);for(let R=0;R<C.length;R++){let x=C[R];S.baseAtoms[x]=e.createWritableAtom(S.initialState[x],{debugName:`table/baseAtoms/${x}`}),S.atoms[x]=e.createReadonlyAtom(()=>{let v=S.options,F=v.atoms?.[x],N=F?F.get():S.baseAtoms[x].get();if(F)return N;let k=v.state;if(k&&qe(k,x)){let P=k[x];return P===void 0?S.initialState[x]:P}return N},{debugName:`table/atoms/${x}`})}Nn(S),S.store=Xr(e.createReadonlyAtom(()=>{let R={};for(let x=0;x<C.length;x++){let v=C[x];R[v]=S.atoms[v].get()}return R},{compare:st,debugName:"table/store"}));for(let R=0;R<y.length;R++){let x=y[R];x.initTableInstanceData?.(S),x.initCellInstanceData&&S._cellInstanceInitFns.push(x.initCellInstanceData.bind(x)),x.initColumnInstanceData&&S._columnInstanceInitFns.push(x.initColumnInstanceData.bind(x)),x.initHeaderGroupInstanceData&&S._headerGroupInstanceInitFns.push(x.initHeaderGroupInstanceData.bind(x)),x.initHeaderInstanceData&&S._headerInstanceInitFns.push(x.initHeaderInstanceData.bind(x)),x.initRowInstanceData&&S._rowInstanceInitFns.push(x.initRowInstanceData.bind(x)),x.constructTableAPIs?.(S)}return S}o(Vo,"constructTable");var Eo={getInitialState:o(t=>({columnOrder:Cl(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onColumnOrderChange:Ke("columnOrder",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{de("columnOrderingFeature",t,e,{column_getIndex:{fn:o((n,l)=>vl(n,l),"fn")},column_getIsFirstColumn:{fn:o((n,l)=>yl(n,l),"fn")},column_getIsLastColumn:{fn:o((n,l)=>Rl(n,l),"fn")}})},"assignColumnPrototype"),constructTableAPIs:o(t=>{be("columnOrderingFeature",t,{table_getColumnIndexes:{fn:o(()=>So(t),"fn"),memoDeps:o(()=>[t.options.columns,t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")},table_setColumnOrder:{fn:o(e=>_o(t,e),"fn")},table_resetColumnOrder:{fn:o(e=>Il(t,e),"fn")},table_getOrderColumnsFn:{fn:o(()=>Gt(t),"fn"),memoDeps:o(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")}})},"constructTableAPIs")};function za(){return $()}o(za,"getDefaultColumnSizingState");function zo(){return{size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER}}o(zo,"getDefaultColumnSizingColumnDef");function kt(t){let e=zo(),n=t.table.atoms.columnSizing?.get(),l=n&&qe(n,t.id)?n[t.id]:void 0;return Math.min(Math.max(t.columnDef.minSize??e.minSize,l??t.columnDef.size??e.size),t.columnDef.maxSize??e.maxSize)}o(kt,"column_getSize");function An(t){let e=$(),n=$(),l=new Array(t.length),r=0;for(let s=0;s<t.length;s++){let i=t[s],c=H(i,"getSize",kt);l[s]=c,e[i.id]=r,r+=c}let a=0;for(let s=t.length-1;s>=0;s--)n[t[s].id]=a,a+=l[s];return{starts:e,afters:n}}o(An,"buildColumnOffsets");function On(t){return{all:An(Ue(t)),center:An(Ue(t,"center")),start:An(Ue(t,"start")),end:An(Ue(t,"end"))}}o(On,"table_getColumnOffsets");function Ha(t){return t==="start"?"start":t==="end"?"end":t==="center"?"center":"all"}o(Ha,"toOffsetsKey");function $a(t,e){return H(t.table,"getColumnOffsets",On)[Ha(e)].starts[t.id]??0}o($a,"column_getStart");function La(t,e){return H(t.table,"getColumnOffsets",On)[Ha(e)].afters[t.id]??0}o(La,"column_getAfter");function ja(t){Pt(t.table,e=>{let n=$(),l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];a!==t.id&&(n[a]=e[a])}return n})}o(ja,"column_resetSize");function Ba(t){if(!t.subHeaders.length)return kt(t.column);let e=0;for(let n=0;n<t.subHeaders.length;n++)e+=Ba(t.subHeaders[n]);return e}o(Ba,"sumHeaderSize");function rt(t){return Ba(t)}o(rt,"header_getSize");function Ho(t){if(t.index>0){let e=t.headerGroup?.headers[t.index-1];if(e)return H(e,"getStart",Ho)+H(e,"getSize",rt)}return 0}o(Ho,"header_getStart");function Pt(t,e){t.options.onColumnSizingChange?.(e)}o(Pt,"table_setColumnSizing");function Ga(t,e){Pt(t,e?$():Object.assign($(),ie(t.initialState.columnSizing??{})))}o(Ga,"table_resetColumnSizing");function qa(t){return t.getHeaderGroups()[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(qa,"table_getTotalSize");function Ka(t){return H(t,"getStartHeaderGroups",cl)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ka,"table_getStartTotalSize");function Ua(t){return H(t,"getCenterHeaderGroups",dl)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ua,"table_getCenterTotalSize");function Ja(t){return H(t,"getEndHeaderGroups",ul)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ja,"table_getEndTotalSize");function Vn(){return{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}}o(Vn,"getDefaultColumnResizingState");function Lo(t){return(t.columnDef.enableResizing??!0)&&(t.table.options.enableColumnResizing??!0)}o(Lo,"column_getCanResize");function Wa(t){return t.table.atoms.columnResizing?.get()?.isResizingColumn===t.id}o(Wa,"column_getIsResizing");function Qa(t,e){let n=t.table.getColumn(t.column.id),l=Lo(n);return r=>{if(!l||$o(r)&&r.touches.length>1)return;let a=rt(t),s=t.getLeafHeaders().map(C=>[C.column.id,kt(C.column)]),i=$o(r)?Math.round(r.touches[0].clientX):r.clientX,c=$(),u=o((C,R)=>{if(typeof R!="number")return;let x=n.table,v=x.options.columnResizeMode==="onChange"||C==="end";x._reactivity.batch(()=>{Nt(x,F=>{let N=x.options.columnResizeDirection==="rtl"?-1:1,k=(R-(F.startOffset??0))*N,P=F.startSize??0,M=Math.max(P>0?k/P:0,-.999999);if(v){let O=F.columnSizingStart;for(let T=0;T<O.length;T++){let A=O[T],E=A[1];c[A[0]]=Math.round(Math.max(E>0?E+E*M:k/O.length,0)*100)/100}}return{...F,deltaOffset:k,deltaPercentage:M}}),v&&Pt(x,F=>Object.assign($(),F,c))})},"updateOffset"),d=null,g=!1,m,h=o(()=>{g?(g=!1,u("move",m),d=requestAnimationFrame(h)):d=null},"flushMove"),p=o(C=>{if(m=C,typeof requestAnimationFrame!="function"){u("move",C);return}if(d!==null){g=!0;return}u("move",C),d=requestAnimationFrame(h)},"onMove"),b=o(C=>{d!==null&&(cancelAnimationFrame(d),d=null,g=!1),n.table._reactivity.batch(()=>{u("end",C??m),Nt(n.table,R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))})},"onEnd"),w=e||(typeof document<"u"?document:null),_={moveHandler:o(C=>p(C.clientX),"moveHandler"),upHandler:o(C=>{w?.removeEventListener("mousemove",_.moveHandler),w?.removeEventListener("mouseup",_.upHandler),b(C.clientX)},"upHandler")},S={moveHandler:o(C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),p(C.touches[0].clientX),!1),"moveHandler"),upHandler:o(C=>{y(),C.cancelable&&(C.preventDefault(),C.stopPropagation()),b(C.touches[0]?.clientX)},"upHandler"),cancelHandler:o(()=>{y(),b()},"cancelHandler")},y=o(()=>{w?.removeEventListener("touchmove",S.moveHandler),w?.removeEventListener("touchend",S.upHandler),w?.removeEventListener("touchcancel",S.cancelHandler)},"removeTouchEvents"),I=lc()?{passive:!1}:!1;$o(r)?(w?.addEventListener("touchmove",S.moveHandler,I),w?.addEventListener("touchend",S.upHandler,I),w?.addEventListener("touchcancel",S.cancelHandler,I)):(w?.addEventListener("mousemove",_.moveHandler,I),w?.addEventListener("mouseup",_.upHandler,I)),Nt(n.table,C=>({...C,startOffset:i,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:n.id}))}}o(Qa,"header_getResizeHandler");function Nt(t,e){t.options.onColumnResizingChange?.(e)}o(Nt,"table_setColumnResizing");function Xa(t,e){Nt(t,e?Vn():ie(t.initialState.columnResizing??Vn()))}o(Xa,"table_resetHeaderSizeInfo");var Tn=null;function lc(){if(typeof Tn=="boolean")return Tn;let t=!1;try{let e={get passive(){return t=!0,!1}},n=o(()=>{},"noop");window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Tn=t,Tn}o(lc,"passiveEventSupported");function $o(t){return t.type==="touchstart"}o($o,"isTouchStartEvent");var jo={getInitialState:o(t=>({columnResizing:Vn(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnResizingChange:Ke("columnResizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{de("columnResizingFeature",t,e,{column_getCanResize:{fn:o(n=>Lo(n),"fn")},column_getIsResizing:{fn:o(n=>Wa(n),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:o((t,e)=>{de("columnResizingFeature",t,e,{header_getResizeHandler:{fn:o((n,l)=>Qa(n,l),"fn")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{be("columnResizingFeature",t,{table_setColumnResizing:{fn:o(e=>Nt(t,e),"fn")},table_resetHeaderSizeInfo:{fn:o(e=>Xa(t,e),"fn")}})},"constructTableAPIs")};var Bo={getInitialState:o(t=>({columnSizing:za(),...t}),"getInitialState"),getDefaultColumnDef:o(()=>zo(),"getDefaultColumnDef"),getDefaultTableOptions:o(t=>({onColumnSizingChange:Ke("columnSizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{de("columnSizingFeature",t,e,{column_getSize:{fn:o(n=>kt(n),"fn"),memoDeps:o(n=>[e.options.columns,e.atoms.columnSizing?.get()?.[n.id]],"memoDeps")},column_getStart:{fn:o((n,l)=>$a(n,l),"fn")},column_getAfter:{fn:o((n,l)=>La(n,l),"fn")},column_resetSize:{fn:o(n=>ja(n),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:o((t,e)=>{de("columnSizingFeature",t,e,{header_getSize:{fn:o(n=>rt(n),"fn"),memoDeps:o(n=>[e.options.columns,n.column.columns.length>0?e.atoms.columnSizing?.get():e.atoms.columnSizing?.get()?.[n.column.id]],"memoDeps")},header_getStart:{fn:o(n=>Ho(n),"fn"),memoDeps:o(()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{be("columnSizingFeature",t,{table_getColumnOffsets:{fn:o(()=>On(t),"fn"),memoDeps:o(()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")},table_setColumnSizing:{fn:o(e=>Pt(t,e),"fn")},table_resetColumnSizing:{fn:o(e=>Ga(t,e),"fn")},table_getTotalSize:{fn:o(()=>qa(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getStartTotalSize:{fn:o(()=>Ka(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getCenterTotalSize:{fn:o(()=>Ua(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getEndTotalSize:{fn:o(()=>Ja(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};var Go={getInitialState:o(t=>({columnVisibility:ml(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onColumnVisibilityChange:Ke("columnVisibility",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{de("columnVisibilityFeature",t,e,{column_getIsVisible:{fn:o(n=>me(n),"fn"),memoDeps:o(n=>[e.options.columns,e.atoms.columnVisibility?.get(),n.columns],"memoDeps")},column_getCanHide:{fn:o(n=>jt(n),"fn")},column_getToggleVisibilityHandler:{fn:o(n=>gl(n),"fn")},column_toggleVisibility:{fn:o((n,l)=>ho(n,l),"fn")}})},"assignColumnPrototype"),assignRowPrototype:o((t,e)=>{de("columnVisibilityFeature",t,e,{row_getVisibleCells:{fn:o(n=>bo(n),"fn"),memoDeps:o(n=>[n.getAllCells(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get()],"memoDeps")},row_getVisibleCellsByColumnId:{fn:o(n=>Rn(n),"fn"),memoDeps:o(n=>[n.getAllCells(),e.atoms.columnVisibility?.get()],"memoDeps")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{be("columnVisibilityFeature",t,{table_getVisibleFlatColumns:{fn:o(()=>fl(t),"fn"),memoDeps:o(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getVisibleLeafColumns:{fn:o(()=>bt(t),"fn"),memoDeps:o(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_setColumnVisibility:{fn:o(e=>Bt(t,e),"fn")},table_resetColumnVisibility:{fn:o(e=>pl(t,e),"fn")},table_toggleAllColumnsVisible:{fn:o(e=>wo(t,e),"fn")},table_getIsAllColumnsVisible:{fn:o(()=>xo(t),"fn")},table_getIsSomeColumnsVisible:{fn:o(()=>bl(t),"fn")},table_getToggleAllColumnsVisibilityHandler:{fn:o(()=>hl(t),"fn")}})},"constructTableAPIs")};function Ya(){return $()}o(Ya,"getDefaultRowSelectionState");function xt(t,e){t.options.onRowSelectionChange?.(e)}o(xt,"table_setRowSelection");function Za(t,e){t._lastSelectedRowId=null,xt(t,e?$():Object.assign($(),ie(t.initialState.rowSelection??{})))}o(Za,"table_resetRowSelection");function qo(t,e,n){t._lastSelectedRowId=null,xt(t,l=>{if(e=typeof e<"u"?e:!H(t,"getIsAllRowsSelected",Jo),n?.deselectAll&&!e)return $();let r=Object.assign($(),l),a=t.getPreGroupedRowModel().flatRows;if(e){let s=new Map;a.forEach(i=>{En(i,s)&&(r[i.id]=!0)})}else a.forEach(s=>{Ye(s)&&delete r[s.id]});return r})}o(qo,"table_toggleAllRowsSelected");function Ko(t,e,n){t._lastSelectedRowId=null,xt(t,l=>{let r=typeof e<"u"?e:!H(t,"getIsAllPageRowsSelected",Wo);if(n?.deselectAll&&!r)return $();let a=Object.assign($(),l);return t.getRowModel().rows.forEach(s=>{$n(a,s.id,r,!0,t,!0)}),a})}o(Ko,"table_toggleAllPageRowsSelected");function es(t){return t.getCoreRowModel()}o(es,"table_getPreSelectedRowModel");function ts(t){let e=t.getCoreRowModel();return H(t,"getIsSomeRowsSelected",Wt)?Yo(e,t):{rows:[],flatRows:[],rowsById:$()}}o(ts,"table_getSelectedRowModel");function ns(t){let e=t.getFilteredRowModel();return H(t,"getIsSomeRowsSelected",Wt)?Yo(e,t):{rows:[],flatRows:[],rowsById:$()}}o(ns,"table_getFilteredSelectedRowModel");function os(t){let e=t.getSortedRowModel();return H(t,"getIsSomeRowsSelected",Wt)?Yo(e,t):{rows:[],flatRows:[],rowsById:$()}}o(os,"table_getGroupedSelectedRowModel");function Uo(t){return Object.keys(t.atoms.rowSelection?.get()??{})}o(Uo,"table_getSelectedRowIds");function Jo(t){let e=t.getFilteredRowModel().flatRows,n=t.atoms.rowSelection?.get()??{},l=!!(e.length&&Object.keys(n).length);if(l){let r=new Map;e.some(a=>!Qt(a,n)&&En(a,r))&&(l=!1)}return l}o(Jo,"table_getIsAllRowsSelected");function Wo(t){let e=t.getPaginatedRowModel().flatRows,n=t.atoms.rowSelection?.get()??{},l=new Map,r=!1;for(let a=0;a<e.length;a++){let s=e[a];if(Qt(s,n))!r&&En(s,l)&&(r=!0);else if(En(s,l))return!1}return r}o(Wo,"table_getIsAllPageRowsSelected");function Wt(t){return H(t,"getSelectedRowIds",Uo).length>0}o(Wt,"table_getIsSomeRowsSelected");function rs(t){return t.getPaginatedRowModel().flatRows.filter(e=>Ye(e)).some(e=>zn(e)||H(e,"getIsSomeSelected",Xo))}o(rs,"table_getIsSomePageRowsSelected");function ls(t){return e=>{qo(t,e.target.checked)}}o(ls,"table_getToggleAllRowsSelectedHandler");function as(t){return e=>{Ko(t,e.target.checked)}}o(as,"table_getToggleAllPageRowsSelectedHandler");function Qo(t,e,n){let l=zn(t);xt(t.table,r=>{e=typeof e<"u"?e:!l;let a=Object.assign($(),r);return $n(a,t.id,e,(n?.selectChildren??!0)&&ct(t),t.table),!e&&n?.deselectParents&&cs(a,t),a})}o(Qo,"row_toggleSelected");function zn(t){return Qt(t,t.table.atoms.rowSelection?.get()??{})}o(zn,"row_getIsSelected");function Xo(t){return Zo(t)==="some"}o(Xo,"row_getIsSomeSelected");function ss(t){return Zo(t)==="all"}o(ss,"row_getIsAllSubRowsSelected");function Ye(t){let e=t.table.options;return typeof e.enableRowSelection=="function"?e.enableRowSelection(t):e.enableRowSelection??!0}o(Ye,"row_getCanSelect");function Hn(t){let e=t.table.options;return typeof e.enableSubRowSelection=="function"?e.enableSubRowSelection(t):e.enableSubRowSelection??!0}o(Hn,"row_getCanSelectSubRows");function ct(t){let e=t.table.options;return typeof e.enableMultiRowSelection=="function"?e.enableMultiRowSelection(t):e.enableMultiRowSelection??!0}o(ct,"row_getCanMultiSelect");function is(t,e){let n=Ye(t);return l=>{if(!n)return;let r=l,a=t.table,s=r.target.checked,i=a._lastSelectedRowId;(!(a.options.enableRowRangeSelection!==!1&&i!==null&&ct(t)&&(a.options.isRowRangeSelectionEvent?.(l)??!1))||!ac(t,i,s,e))&&Qo(t,s,e),a._lastSelectedRowId=t.id}}o(is,"row_getToggleSelectedHandler");function ac(t,e,n,l){let r=l?.selectChildren??!0,a=t.table,s=a.getRowsInDisplayOrder(),i=a.getPrePaginatedRowModel().rowsById[e]??a.getCoreRowModel().rowsById[e];if(!i)return!1;let c=i.getDisplayIndex(),u=t.getDisplayIndex(),d=s[c],g=s[u];if(c<0||u<0||c>=s.length||u>=s.length||d?.id!==i.id||g?.id!==t.id||!ct(i)||!ct(t))return!1;let m=Math.min(c,u),h=Math.max(c,u);return xt(a,p=>{let b=Object.assign($(),p);for(let w=m;w<=h;w++){let _=s[w];!Ye(_)||!ct(_)||($n(b,_.id,n,r,a),!n&&l?.deselectParents&&cs(b,_))}return b}),!0}o(ac,"selectRowRange");function $n(t,e,n,l,r,a){let s=r.getRow(e,!0);n?(ct(s)||Object.keys(t).forEach(i=>delete t[i]),Ye(s)&&(t[e]=!0)):(!a||Ye(s))&&delete t[e],l&&s.subRows.length&&Hn(s)&&s.subRows.forEach(i=>$n(t,i.id,n,l,r,a))}o($n,"mutateRowIsSelected");function En(t,e){if(!Ye(t))return!1;let n=t.table;if(n.options.enableSubRowSelection===!0)return!0;let l=t.parentId;if(l===void 0)return!0;let r=e.get(l);if(r!==void 0)return r;let a=n.getCoreRowModel().rowsById,s=[],i=!0,c=l;for(;c!==void 0;){let u=e.get(c);if(u!==void 0){i=u;break}s.push(c);let d=a[c]??n.getRow(c,!0);if(!Hn(d)){i=!1;break}c=d.parentId}return s.forEach(u=>e.set(u,i)),i}o(En,"isRowSelectableInSelectAll");function cs(t,e){let n=e.table.getCoreRowModel().rowsById,l=e.parentId;for(;l!==void 0;)delete t[l],l=(n[l]??e.table.getRow(l,!0)).parentId}o(cs,"pruneAncestorRowIds");function us(t,e,n,l){let r=[];for(let a=0;a<t.length;a++){let s=t[a],i=Qt(s,e);if(i&&(n.push(s),l[s.id]=s),s.subRows.length){let c=us(s.subRows,e,n,l);if(i){let u=Object.create(Object.getPrototypeOf(s));vn(u,s),u.subRows=c,r.push(u)}}else i&&r.push(s)}return r}o(us,"selectRowsRecursively");function Yo(t,e){let n=[],l=$(),r=e.atoms.rowSelection?.get()??{};return{rows:us(t.rows,r,n,l),flatRows:n,rowsById:l}}o(Yo,"selectRowsFn");function Qt(t,e){return!!(qe(e,t.id)&&e[t.id])}o(Qt,"isRowSelected");function Zo(t){if(!t.subRows.length)return!1;let e=t.table.atoms.rowSelection?.get()??{},n=!1,l=!0,r=!1;for(let a=0;a<t.subRows.length;a++){let s=t.subRows[a];if(n&&!l)break;if(Ye(s)&&(r=!0,Qt(s,e)?n=!0:l=!1),s.subRows.length){let i=Zo(s);i==="all"?(n=!0,r=!0):i==="some"?(n=!0,l=!1,r=!0):l=!1}}return r?l?"all":n?"some":!1:!1}o(Zo,"isSubRowSelected");var er={initTableInstanceData:o(t=>{t._lastSelectedRowId=null},"initTableInstanceData"),resetTableInstanceData:o(t=>{t._lastSelectedRowId=null},"resetTableInstanceData"),getInitialState:o(t=>({rowSelection:Ya(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onRowSelectionChange:Ke("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableRowRangeSelection:!0,enableSubRowSelection:!0,isRowRangeSelectionEvent:o(e=>{let n=e;return!!(n.shiftKey||n.nativeEvent?.shiftKey)},"isRowRangeSelectionEvent")}),"getDefaultTableOptions"),assignRowPrototype:o((t,e)=>{de("rowSelectionFeature",t,e,{row_toggleSelected:{fn:o((n,l,r)=>Qo(n,l,r),"fn")},row_getIsSelected:{fn:o(n=>zn(n),"fn")},row_getIsSomeSelected:{fn:o(n=>Xo(n),"fn"),memoDeps:o(n=>[n.subRows,n.table.atoms.rowSelection?.get(),n.table.options.enableRowSelection],"memoDeps")},row_getIsAllSubRowsSelected:{fn:o(n=>ss(n),"fn"),memoDeps:o(n=>[n.subRows,n.table.atoms.rowSelection?.get(),n.table.options.enableRowSelection],"memoDeps")},row_getCanSelect:{fn:o(n=>Ye(n),"fn")},row_getCanSelectSubRows:{fn:o(n=>Hn(n),"fn")},row_getCanMultiSelect:{fn:o(n=>ct(n),"fn")},row_getToggleSelectedHandler:{fn:o((n,l)=>is(n,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{be("rowSelectionFeature",t,{table_setRowSelection:{fn:o(e=>xt(t,e),"fn")},table_resetRowSelection:{fn:o(e=>Za(t,e),"fn")},table_toggleAllRowsSelected:{fn:o((e,n)=>qo(t,e,n),"fn")},table_toggleAllPageRowsSelected:{fn:o((e,n)=>Ko(t,e,n),"fn")},table_getPreSelectedRowModel:{fn:o(()=>es(t),"fn")},table_getSelectedRowModel:{fn:o(()=>ts(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getCoreRowModel()],"memoDeps")},table_getFilteredSelectedRowModel:{fn:o(()=>ns(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel()],"memoDeps")},table_getGroupedSelectedRowModel:{fn:o(()=>os(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getSortedRowModel()],"memoDeps")},table_getSelectedRowIds:{fn:o(()=>Uo(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsAllRowsSelected:{fn:o(()=>Jo(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsAllPageRowsSelected:{fn:o(()=>Wo(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsSomeRowsSelected:{fn:o(()=>Wt(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsSomePageRowsSelected:{fn:o(()=>rs(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection],"memoDeps")},table_getToggleAllRowsSelectedHandler:{fn:o(()=>ls(t),"fn")},table_getToggleAllPageRowsSelectedHandler:{fn:o(()=>as(t),"fn")}})},"constructTableAPIs")};var tr={getInitialState(t){return{sorting:Zl(),...t}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(t){return{autoResetSorting:!1,onSortingChange:Ke("sorting",t),isMultiSortEvent:o(e=>e.shiftKey,"isMultiSortEvent")}},assignColumnPrototype(t,e){de("rowSortingFeature",t,e,{column_getAutoSortFn:{fn:o(n=>ko(n),"fn")},column_getAutoSortDir:{fn:o(n=>Po(n),"fn")},column_getSortFn:{fn:o(n=>Pn(n),"fn")},column_toggleSorting:{fn:o((n,l,r)=>No(n,l,r),"fn")},column_getFirstSortDir:{fn:o(n=>Do(n),"fn")},column_getNextSortingOrder:{fn:o((n,l)=>Ao(n,l),"fn")},column_getCanSort:{fn:o(n=>Ut(n),"fn")},column_getCanMultiSort:{fn:o(n=>qt(n),"fn")},column_getIsSorted:{fn:o(n=>Oo(n),"fn")},column_getSortIndex:{fn:o(n=>ta(n),"fn")},column_clearSorting:{fn:o(n=>na(n),"fn")},column_getToggleSortingHandler:{fn:o(n=>oa(n),"fn")}})},constructTableAPIs(t){be("rowSortingFeature",t,{table_setSorting:{fn:o(e=>Kt(t,e),"fn")},table_resetSorting:{fn:o(e=>Mo(t,e),"fn")}})}};function nr(){return t=>{let e=t;return Ft({feature:"rowSortingFeature",table:e,fnName:"table.getSortedRowModel",memoDeps:o(()=>[e.atoms.sorting?.get(),e.getPreSortedRowModel()],"memoDeps"),fn:o(()=>sc(e),"fn"),onAfterUpdate:yn(()=>kn(e))})}}o(nr,"createSortedRowModel");function sc(t){let e=t.getPreSortedRowModel(),n=t.atoms.sorting?.get();if(!e.rows.length||!n?.length)return e;let l=[],r=n.filter(c=>{let u=t.getColumn(c.id);return u?Ut(u):!1});if(!r.length)return e;let a=[];for(let c=0;c<r.length;c++){let u=r[c],d=t.getColumn(u.id);d&&a.push({id:u.id,desc:u.desc,sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortFn:Pn(d)})}let s=o((c,u)=>{for(let d=0;d<a.length;d++){let g=a[d],m=g.sortUndefined,h=g.desc,p=0;if(m){let b=c.getValue(g.id),w=u.getValue(g.id),_=b===void 0,S=w===void 0;if(_&&S)continue;if(_||S){if(m==="first")return _?-1:1;if(m==="last")return _?1:-1;p=_?m:-m}}if(p===0&&(p=g.sortFn(c,u,g.id)),p!==0)return h&&(p*=-1),g.invertSorting&&(p*=-1),p}return c.index-u.index},"compareRows"),i=o(c=>{let u=c.slice();u.sort(s);let d=!1;for(let g=0;g<u.length;g++){let m=u[g];m!==c[g]&&(d=!0);let h=l.length;if(l.push(m),m.subRows.length){let p=i(m.subRows);if(p.changed){let b=Object.create(Object.getPrototypeOf(m));vn(b,m),b.subRows=p.rows,u[g]=b,l[h]=b,d=!0}}}return{rows:u,changed:d}},"sortData");return{rows:i(e.rows).rows,flatRows:l,rowsById:e.rowsById}}o(sc,"_createSortedRowModel");var ut=Me(mt(),1);var ic=typeof window>"u"?ut.useEffect:ut.useLayoutEffect;function or(t,e){let[{table:n,rootSource:l}]=(0,ut.useState)(()=>{let c=Vo({...t,features:{coreReactivityFeature:Yr(),...t.features}});return c.Subscribe=(u=>Qr({...u,source:u.source??c.store})),c.FlexRender=mo,{table:c,rootSource:fo(c.store,st)}}),r=n;Jt(r,c=>({...c,...t}),{syncExternalState:!1});let a=r.options.state,s=l.get(),i=rn(l,e,{compare:st});return ic(()=>{l.markCommitted(s),Dn(r,a??null,st)}),(0,ut.useMemo)(()=>({...n,options:t,state:i}),[n,t,i])}o(or,"useTable");var ds=Me(Et(),1),ms=Me(mt(),1);var Ie=Me(zt(),1);var cc=[{label:"=",value:"eq"},{label:"\u2260",value:"ne"},{label:"<",value:"lt"},{label:"\u2264",value:"lte"},{label:">",value:"gt"},{label:"\u2265",value:"gte"},{label:"contains",value:"contains"}],gs=o(t=>{let e=t.trim(),n=Number(e);return e!==""&&Number.isFinite(n)&&String(n)===e?n:t},"E"),uc=o(t=>{let e=t.trim();return(e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):void 0)??(e==="true"||e==="false"?e==="true":gs(t))},"G"),dc=o(t=>t.operator==="has"?uc(t.value):gs(t.value),"I"),mc=o(t=>t.operator==="contains"?t.value==="":t.operator!=="eq"&&t.operator!=="ne"&&t.literal===void 0&&t.value.trim()==="","J"),gc=o(t=>{if(t.pathSegments!==void 0)return t.pathSegments;let e=t.path??"";return e.trim()===""?void 0:e.split(".").map(n=>n.trim())},"L"),Ze=o(t=>t.filter(e=>e.column!==""&&!mc(e)).map(e=>{let n=gc(e),l=n===void 0?{}:{path:n};return e.operator==="contains"?{column:e.column,operator:e.operator,...l,value:e.value}:{column:e.column,operator:e.operator,...l,value:e.literal===void 0?dc(e):e.literal[0]}}),"_"),rr=o((t,e)=>({column:t.column,operator:t.operator,path:t.path,pathSegments:t.pathSegments,value:t.value,...e}),"j"),fs=o(t=>{let e=(0,ds.c)(51),{columns:n,filters:l,onAskAi:r,onFiltersChange:a,onSearchChange:s,search:i}=t,[c,u]=(0,ms.useState)(""),d=ne(),g;e[0]!==n[0]||e[1]!==l||e[2]!==a?(g=o(()=>{a([...l,{column:n[0]??"",operator:"eq",value:""}])},"T"),e[0]=n[0],e[1]=l,e[2]=a,e[3]=g):g=e[3];let m=g,h;e[4]!==l||e[5]!==a?(h=o(M=>{let O=Number(M.currentTarget.dataset.index);a(l.filter((T,A)=>A!==O))},"w"),e[4]=l,e[5]=a,e[6]=h):h=e[6];let p=h,b;e[7]!==l||e[8]!==a?(b=o(M=>{let O=Number(M.currentTarget.dataset.index),T=M.currentTarget.value;a(l.map((A,E)=>E===O?rr(A,{column:T,path:void 0,pathSegments:void 0}):A))},"y"),e[7]=l,e[8]=a,e[9]=b):b=e[9];let w=b,_;e[10]!==l||e[11]!==a?(_=o(M=>{let O=Number(M.currentTarget.dataset.index),T=M.currentTarget.value;a(l.map((A,E)=>E!==O?A:T==="has"?rr(A,{operator:T}):{...A,operator:T}))},"q"),e[10]=l,e[11]=a,e[12]=_):_=e[12];let S=_,y;e[13]!==l||e[14]!==a?(y=o(M=>{let O=Number(M.currentTarget.dataset.index),T=M.currentTarget.value;a(l.map((A,E)=>E===O?{...A,path:T,pathSegments:void 0}:A))},"k"),e[13]=l,e[14]=a,e[15]=y):y=e[15];let I=y,C;e[16]!==l||e[17]!==a?(C=o(M=>{let O=Number(M.currentTarget.dataset.index),T=M.currentTarget.value;a(l.map((A,E)=>E===O?rr(A,{value:T}):A))},"A"),e[16]=l,e[17]=a,e[18]=C):C=e[18];let R=C,x;e[19]!==s||e[20]!==i?(x=(0,Ie.jsx)("input",{"aria-label":"Search rows","data-testid":"db-filter",onChange:s,placeholder:"search table\u2026",value:i}),e[19]=s,e[20]=i,e[21]=x):x=e[21];let v;e[22]!==m?(v=(0,Ie.jsx)("button",{"data-testid":"db-add-filter",onClick:m,type:"button",children:"Add filter"}),e[22]=m,e[23]=v):v=e[23];let F;e[24]!==c||e[25]!==r?(F=r!==void 0&&(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("input",{"aria-label":"Describe a filter","data-testid":"db-ai-prompt",onChange:o(M=>{u(M.target.value)},"onChange"),onKeyDown:o(M=>{M.key==="Enter"&&c.trim()!==""&&(M.preventDefault(),r(c.trim()))},"onKeyDown"),placeholder:"describe a filter\u2026",value:c}),(0,Ie.jsx)("button",{"data-testid":"db-ai-filter",disabled:c.trim()==="",onClick:o(()=>{r(c.trim())},"onClick"),type:"button",children:"Suggest"})]}),e[24]=c,e[25]=r,e[26]=F):F=e[26];let N;e[27]!==x||e[28]!==v||e[29]!==F?(N=(0,Ie.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[x,v,F]}),e[27]=x,e[28]=v,e[29]=F,e[30]=N):N=e[30];let k;if(e[31]!==w||e[32]!==S||e[33]!==I||e[34]!==R||e[35]!==n||e[36]!==l||e[37]!==p||e[38]!==d){let M;e[40]!==w||e[41]!==S||e[42]!==I||e[43]!==R||e[44]!==n||e[45]!==p||e[46]!==d?(M=o((O,T)=>(0,Ie.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-filter-row",children:[(0,Ie.jsx)("select",{"aria-label":"Filter column","data-index":T,"data-testid":"db-filter-column",onChange:w,value:O.column,children:n.map(fc)}),(0,Ie.jsx)("select",{"aria-label":"Filter operator","data-index":T,"data-testid":"db-filter-operator",onChange:S,value:O.operator,children:[...cc,{label:d("has"),value:"has"}].map(pc)}),(0,Ie.jsx)("input",{"aria-label":d("Nested field path"),"data-index":T,"data-testid":"db-filter-path",onChange:I,placeholder:d("nested path, e.g. geo.city"),value:O.path??""}),(0,Ie.jsx)("input",{"aria-label":"Filter value","data-index":T,"data-testid":"db-filter-value",onChange:R,placeholder:O.operator==="has"?d('value ("10" in quotes matches text)'):"value",value:O.value}),(0,Ie.jsx)("button",{"aria-label":"Remove filter","data-index":T,"data-testid":"db-filter-remove",onClick:p,type:"button",children:"\u2715"})]},T),"r"),e[40]=w,e[41]=S,e[42]=I,e[43]=R,e[44]=n,e[45]=p,e[46]=d,e[47]=M):M=e[47],k=l.map(M),e[31]=w,e[32]=S,e[33]=I,e[34]=R,e[35]=n,e[36]=l,e[37]=p,e[38]=d,e[39]=k}else k=e[39];let P;return e[48]!==N||e[49]!==k?(P=(0,Ie.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"db-filters",children:[N,k]}),e[48]=N,e[49]=k,e[50]=P):P=e[50],P},"ee");function fc(t){return(0,Ie.jsx)("option",{value:t,children:t},t)}o(fc,"M");function pc(t){return(0,Ie.jsx)("option",{value:t.value,children:t.label},t.value)}o(pc,"Q");var bc=o(t=>({tables:Object.entries(t).map(([e,n])=>({fields:n.map(l=>l.name),indexes:[],name:e,relations:n.filter(l=>l.ref!==void 0).map(l=>({field:l.name,kind:"one",name:l.name,onDelete:l.onDelete,references:l.ref,table:e}))}))}),"_o"),hc=o(t=>{let e=new Map,n=new Set;for(let l of t.tables)for(let r of l.relations){if(r.kind!=="one"||r.onDelete==="set null")continue;let a=r.references,s=`${a}\0${l.name}\0${r.field}`;if(n.has(s))continue;n.add(s);let i=e.get(a)??[];i.push({...r,table:l.name}),e.set(a,i)}return e},"Ro"),wc=o((t,e)=>{let n=[],l=[t];for(;l.length>0;){let r=l.shift();if(r===void 0)break;e(r)&&n.push(r);for(let a of r.children)l.push(a)}return n},"$o"),ps=o((t,e)=>{let n=[];for(let[l,r]of Object.entries(e))for(let a of r)a.ref===t&&n.push({column:a.name,table:l});return n.sort((l,r)=>l.table.localeCompare(r.table)||l.column.localeCompare(r.column)),n},"Jt"),cr=o(t=>`${t.table}.${t.column}`,"Ot"),xc=o(t=>{let e=(0,q.c)(111),{columns:n,onApply:l,onClose:r,shardKey:a,table:s,total:i,uniqueColumns:c}=t,u=ne(),[d,g]=(0,D.useState)(n[0]??""),[m,h]=(0,D.useState)(""),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=o(fe=>{g(fe.target.value)},"f"),e[0]=p):p=e[0];let b=p,w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=o(fe=>{h(fe.target.value)},"h"),e[1]=w):w=e[1];let _=w,S;e[2]!==m?(S=m.trim(),e[2]=m,e[3]=S):S=e[3];let y=S==="",I,C;if(e[4]!==y||e[5]!==u||e[6]!==m){if(!y)try{C=on(JSON.parse(m))}catch(fe){I=u("Invalid JSON: {message}",{message:fe.message})}e[4]=y,e[5]=u,e[6]=m,e[7]=I,e[8]=C}else I=e[7],C=e[8];let R;e[9]!==d||e[10]!==i||e[11]!==c?(R=c.has(d)&&i>1,e[9]=d,e[10]=i,e[11]=c,e[12]=R):R=e[12];let x=R,v=d!==""&&!y&&I===void 0&&!x,F;e[13]!==v||e[14]!==d||e[15]!==l||e[16]!==r||e[17]!==C?(F=o(()=>{v&&(l({[d]:C}),r())},"T"),e[13]=v,e[14]=d,e[15]=l,e[16]=r,e[17]=C,e[18]=F):F=e[18];let N=F,k;e[19]!==u?(k=u("Set a column on matching rows"),e[19]=u,e[20]=k):k=e[20];let P;e[21]!==u?(P=u("Set a column on matching rows"),e[21]=u,e[22]=P):P=e[22];let M;e[23]!==P?(M=(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"bulk-patch-title",children:P}),e[23]=P,e[24]=M):M=e[24];let O;e[25]!==u||e[26]!==s||e[27]!==i?(O=u("Writes {total} rows of {table} through the schema-aware writer \u2014 validators and indexes apply, exactly like a mutation.",{table:s,total:i.toString()}),e[25]=u,e[26]=s,e[27]=i,e[28]=O):O=e[28];let T;e[29]!==O?(T=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-desc",children:O}),e[29]=O,e[30]=T):T=e[30];let A;e[31]!==a||e[32]!==u?(A=a===""?u("Shard: root"):u("Shard: {shardKey} \u2014 rows in other shards are not touched.",{shardKey:a}),e[31]=a,e[32]=u,e[33]=A):A=e[33];let E;e[34]!==A?(E=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-shard",children:A}),e[34]=A,e[35]=E):E=e[35];let K;e[36]!==T||e[37]!==E||e[38]!==M?(K=(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[M,T,E]}),e[36]=T,e[37]=E,e[38]=M,e[39]=K):K=e[39];let U;e[40]!==u?(U=u("Close"),e[40]=u,e[41]=U):U=e[41];let V;e[42]!==r||e[43]!==U?(V=(0,f.jsx)(sn,{"data-testid":"bulk-patch-close",onClick:r,size:"xs",variant:"ghost",children:U}),e[42]=r,e[43]=U,e[44]=V):V=e[44];let Q;e[45]!==K||e[46]!==V?(Q=(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[K,V]}),e[45]=K,e[46]=V,e[47]=Q):Q=e[47];let J;e[48]!==u?(J=u("Column"),e[48]=u,e[49]=J):J=e[49];let Z;e[50]!==J?(Z=(0,f.jsx)(co,{htmlFor:"bulk-patch-column",children:J}),e[50]=J,e[51]=Z):Z=e[51];let re;e[52]!==u?(re=u("Column"),e[52]=u,e[53]=re):re=e[53];let oe;e[54]!==n?(oe=n.map(Sc),e[54]=n,e[55]=oe):oe=e[55];let ae;e[56]!==d||e[57]!==re||e[58]!==oe?(ae=(0,f.jsx)("select",{"aria-label":re,className:"h-8 rounded-md border border-input bg-transparent px-2 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"bulk-patch-column",id:"bulk-patch-column",onChange:b,value:d,children:oe}),e[56]=d,e[57]=re,e[58]=oe,e[59]=ae):ae=e[59];let ge;e[60]!==u?(ge=u("Value"),e[60]=u,e[61]=ge):ge=e[61];let he;e[62]!==ge?(he=(0,f.jsx)(co,{htmlFor:"bulk-patch-value",children:ge}),e[62]=ge,e[63]=he):he=e[63];let ve;e[64]!==m?(ve=(0,f.jsx)(Rr,{className:"flex-1 font-mono","data-testid":"bulk-patch-value",id:"bulk-patch-value",onChange:_,placeholder:"true",value:m}),e[64]=m,e[65]=ve):ve=e[65];let Se;e[66]!==Z||e[67]!==ae||e[68]!==he||e[69]!==ve?(Se=(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[Z,ae,he,ve]}),e[66]=Z,e[67]=ae,e[68]=he,e[69]=ve,e[70]=Se):Se=e[70];let _e;e[71]!==I?(_e=I!==void 0&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-error",role:"alert",children:I}),e[71]=I,e[72]=_e):_e=e[72];let ye;e[73]!==d||e[74]!==u||e[75]!==i||e[76]!==x?(ye=x&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-unique",role:"alert",children:u("{column} has a unique index \u2014 the same value cannot be set on {total} rows.",{column:d,total:i.toString()})}),e[73]=d,e[74]=u,e[75]=i,e[76]=x,e[77]=ye):ye=e[77];let L;e[78]!==y||e[79]!==u||e[80]!==x?(L=y&&!x&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-hint",children:u('Enter a JSON value \u2014 for example true, 0, null, or "done".')}),e[78]=y,e[79]=u,e[80]=x,e[81]=L):L=e[81];let X;e[82]!==v||e[83]!==d||e[84]!==m?(X=v&&(0,f.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"bulk-patch-preview",children:`${d} = ${m.trim()}`}),e[82]=v,e[83]=d,e[84]=m,e[85]=X):X=e[85];let le;e[86]!==u?(le=u("Cancel"),e[86]=u,e[87]=le):le=e[87];let Fe;e[88]!==r||e[89]!==le?(Fe=(0,f.jsx)(sn,{"data-testid":"bulk-patch-cancel",onClick:r,size:"xs",variant:"outline",children:le}),e[88]=r,e[89]=le,e[90]=Fe):Fe=e[90];let De=!v,se;e[91]!==u||e[92]!==i?(se=u("Set on {total} rows",{total:i.toString()}),e[91]=u,e[92]=i,e[93]=se):se=e[93];let ee;e[94]!==N||e[95]!==De||e[96]!==se?(ee=(0,f.jsx)(sn,{"data-testid":"bulk-patch-apply",disabled:De,onClick:N,size:"xs",children:se}),e[94]=N,e[95]=De,e[96]=se,e[97]=ee):ee=e[97];let G;e[98]!==Fe||e[99]!==ee?(G=(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[Fe,ee]}),e[98]=Fe,e[99]=ee,e[100]=G):G=e[100];let Ae;return e[101]!==r||e[102]!==Q||e[103]!==Se||e[104]!==_e||e[105]!==ye||e[106]!==L||e[107]!==X||e[108]!==G||e[109]!==k?(Ae=(0,f.jsxs)($t,{label:k,onClose:r,panelTestId:"bulk-patch-panel",testId:"bulk-patch-overlay",variant:"dialog",children:[Q,Se,_e,ye,L,X,G]}),e[101]=r,e[102]=Q,e[103]=Se,e[104]=_e,e[105]=ye,e[106]=L,e[107]=X,e[108]=G,e[109]=k,e[110]=Ae):Ae=e[110],Ae},"Do");function Sc(t){return(0,f.jsx)("option",{value:t,children:t},t)}o(Sc,"Ao");var bs=6,jn=100,_c=o(t=>({paddingLeft:t*16}),"Po"),Cc=o(t=>{let e=(0,q.c)(2),{table:n}=t,l=`cascade-restrict-${n}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-destructive/10 px-1 text-destructive","data-testid":l,children:"restrict \u2014 will block delete"}),e[0]=l,e[1]=r):r=e[1],r},"Io"),vc=o(t=>{let e=(0,q.c)(2),{table:n}=t,l=`cascade-cascade-${n}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-warning/10 px-1 text-warning","data-testid":l,children:"cascade"}),e[0]=l,e[1]=r):r=e[1],r},"Oo"),yc=o(t=>{let e=(0,q.c)(2),{table:n}=t,l=`cascade-undeclared-${n}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-muted px-1 text-muted-foreground","data-testid":l,children:"references \u2014 no delete action declared"}),e[0]=l,e[1]=r):r=e[1],r},"Fo"),Rc=o(t=>t.relation===void 0||t.relation.onDelete==="cascade"?(0,f.jsx)(vc,{table:t.table}):t.isRestrict?(0,f.jsx)(Cc,{table:t.table}):(0,f.jsx)(yc,{table:t.table}),"Mo"),Rs=o(t=>{let e=(0,q.c)(35),{depth:n,node:l}=t,r=`cascade-row-${l.table}`,a;e[0]!==n?(a=_c(n),e[0]=n,e[1]=a):a=e[1];let s;e[2]!==n?(s=n>0&&(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2514"}),e[2]=n,e[3]=s):s=e[3];let i;e[4]!==l.table?(i=(0,f.jsx)("span",{className:"font-medium text-foreground",children:l.table}),e[4]=l.table,e[5]=i):i=e[5];let c;e[6]!==l.relation||e[7]!==l.table?(c=l.relation!==void 0&&(0,f.jsxs)("span",{className:"text-muted-foreground","data-testid":`cascade-col-${l.table}-${l.relation.field}`,children:["via ",l.relation.field]}),e[6]=l.relation,e[7]=l.table,e[8]=c):c=e[8];let u;e[9]!==l.rowCount?(u=l.rowCount.toString(),e[9]=l.rowCount,e[10]=u):u=e[10];let d;e[11]!==u?(d=(0,f.jsxs)("span",{className:"text-muted-foreground",children:["(",u," rows)"]}),e[11]=u,e[12]=d):d=e[12];let g;e[13]!==l?(g=Rc(l),e[13]=l,e[14]=g):g=e[14];let m;e[15]!==l.capNote||e[16]!==l.table?(m=l.capNote!==void 0&&(0,f.jsxs)("span",{className:"italic text-muted-foreground","data-testid":`cascade-cap-${l.table}`,children:["(",l.capNote,")"]}),e[15]=l.capNote,e[16]=l.table,e[17]=m):m=e[17];let h;e[18]!==r||e[19]!==a||e[20]!==s||e[21]!==i||e[22]!==c||e[23]!==d||e[24]!==g||e[25]!==m?(h=(0,f.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 py-1 font-mono text-xs","data-testid":r,style:a,children:[s,i,c,d,g,m]}),e[18]=r,e[19]=a,e[20]=s,e[21]=i,e[22]=c,e[23]=d,e[24]=g,e[25]=m,e[26]=h):h=e[26];let p;if(e[27]!==n||e[28]!==l.children){let w;e[30]!==n?(w=o((_,S)=>(0,f.jsx)(Rs,{depth:n+1,node:_},`${_.table}-${_.relation?.field??"root"}-${S.toString()}`),"h"),e[30]=n,e[31]=w):w=e[31],p=l.children.map(w),e[27]=n,e[28]=l.children,e[29]=p}else p=e[29];let b;return e[32]!==h||e[33]!==p?(b=(0,f.jsxs)(f.Fragment,{children:[h,p]}),e[32]=h,e[33]=p,e[34]=b):b=e[34],b},"an"),Ic=o(t=>{let e=t._id??t.id??t.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},"Vo"),Fc=o(async(t,e,n,l)=>{try{let r=await l(t,e,n),a=r.rows.flatMap(i=>Ic(i)||[]).slice(0,jn),s=r.total??0;return{capNote:s>jn?`showing first ${jn.toString()} of ${s.toString()}`:void 0,rowCount:s,rowIds:a}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},"Lo"),Is=o(async(t,e,n,l,r,a,s)=>{let{capNote:i,rowCount:c,rowIds:u}=n===void 0?{capNote:void 0,rowCount:1,rowIds:[e]}:await Fc(t,n.field,e,s),d=n?.onDelete==="restrict",g=[],m=`${t}:${e}`,h=a>=bs;if(!r.has(m)&&!h){r.add(m);let b=l.get(t)??[];for(let w of b)for(let _ of u.slice(0,10)){let S=await Is(w.table,_,w,l,r,a+1,s);(S.rowCount>0||a===0)&&g.push(S)}r.delete(m)}let p=i;if(h){let b=`depth capped at ${bs.toString()}`;p=i===void 0?b:`${i}; ${b}`}return{capNote:p,children:g,isRestrict:d,relation:n,rowCount:c,rowIds:u,table:t}},"cn"),Mc=o(({onClose:t,onConfirm:e,readPage:n,rowId:l,schema:r,table:a})=>{let s=ne(),[i,c]=(0,D.useState)(!0),[u,d]=(0,D.useState)(null),[g,m]=(0,D.useState)(null);(0,D.useEffect)(()=>{let b=!1;return te((async()=>{try{c(!0),m(null);let w=hc(r);if(!((w.get(a)??[]).length>0)){b||(d({capNote:void 0,children:[],isRestrict:!1,relation:void 0,rowCount:1,rowIds:[l],table:a}),c(!1));return}let _=await Is(a,l,void 0,w,new Set,0,n);b||(d(_),c(!1))}catch(w){b||(m(w.message),c(!1))}})()),()=>{b=!0}},[l,a]);let h=u!==null&&wc(u,b=>b.isRestrict).length>0,p=o(()=>{e(),t()},"f");return(0,f.jsxs)($t,{label:"Cascade impact preview",onClose:t,panelTestId:"cascade-panel",testId:"cascade-overlay",variant:"dialog",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"cascade-title",children:s("Cascade impact")}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-desc",children:s("Delete preview \u2014 rows that would cascade or be blocked")})]}),(0,f.jsx)("button",{className:"text-xs text-muted-foreground hover:text-foreground","data-testid":"cascade-close",onClick:t,type:"button",children:s("Close")})]}),i&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-loading",children:s("Loading\u2026")}),g!==null&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"cascade-error",role:"alert",children:g}),!i&&u!==null&&(0,f.jsx)("ul",{className:"flex flex-col","data-testid":"cascade-tree",children:(0,f.jsx)(Rs,{depth:0,node:u})}),!i&&u!==null&&u.children.length===0&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-no-impact",children:s("No related rows found.")}),h&&(0,f.jsx)("p",{className:"text-sm font-medium text-destructive","data-testid":"cascade-blocker-warning",role:"alert",children:s("Restrict relations will block this delete.")}),(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,f.jsx)("button",{className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cascade-cancel",onClick:t,type:"button",children:s("Cancel")}),(0,f.jsx)("button",{className:"rounded-md bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground outline-none transition-colors hover:bg-destructive/90 focus-visible:bg-destructive/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"cascade-confirm",disabled:i,onClick:p,type:"button",children:s("Delete")})]})]})},"Bo"),kc=o((t,e,n,l,r=300)=>{if(l<=0)return{ids:new Set(t.map(g=>g.id)),leadPx:0,tailPx:0};let a=n-r,s=n+l+r,i=new Set,c=0,u=0,d=0;for(let g of t){let m=g.getSize(),h=e.has(g.id),p=c+m>a&&c<s;h||p?i.add(g.id):c<a?u+=m:d+=m,c+=m}return{ids:i,leadPx:u,tailPx:d}},"jo"),Pc=o((t,e)=>{let n=new Map,l=0;for(let r of t)e.has(r.id)&&(n.set(r.id,l),l+=r.getSize());return n},"zo"),Nc={columnOrderingFeature:Eo,columnResizingFeature:jo,columnSizingFeature:Bo,columnVisibilityFeature:Go,rowSelectionFeature:er,rowSortingFeature:tr,sortedRowModel:nr(),sortFns:{alphanumeric:yo,basic:Mt,datetime:Io,text:Ro}},Dc=o(()=>{let t=(0,q.c)(12),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let[n,l]=(0,D.useState)(e),r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=o((b,w,_)=>{l(S=>({...S,[b]:{...S[b],[w]:_}}))},"t"),t[1]=r):r=t[1];let a=r,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=o(()=>{l({})},"l"),t[2]=s):s=t[2];let i=s,c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o((b,w)=>{l(_=>{let S=_[b];if(S===void 0)return _;let y=Object.fromEntries(Object.entries(S).filter(I=>{let[C,R]=I;return!(C in w)||!Object.is(R,w[C])}));return Object.keys(y).length===0?Object.fromEntries(Object.entries(_).filter(I=>{let[C]=I;return C!==b})):{..._,[b]:y}})},"a"),t[3]=c):c=t[3];let u=c,d;t[4]!==n?(d=o((b,w)=>{let _=n[b];return _!==void 0&&w in _?{value:_[w]}:void 0},"u"),t[4]=n,t[5]=d):d=t[5];let g=d,m;t[6]!==n?(m=Object.values(n).reduce(Oc,0),t[6]=n,t[7]=m):m=t[7];let h=m,p;return t[8]!==h||t[9]!==n||t[10]!==g?(p={clear:i,count:h,drop:u,stage:a,staged:n,stagedValue:g},t[8]=h,t[9]=n,t[10]=g,t[11]=p):p=t[11],p},"Ko"),Fs=o((t,e)=>{if(typeof e=="number"){let n=Number(t);return t.trim()===""||Number.isNaN(n)?t:n}if(typeof e=="boolean"){if(t==="true")return!0;if(t==="false")return!1}return t},"dn"),Ac=o(t=>{let e=(0,q.c)(29),{changes:n,committing:l,onCommit:r,onDiscard:a}=t,s=ne(),i;e[0]!==n.length||e[1]!==s?(i=s("{count} pending changes",{count:n.length}),e[0]=n.length,e[1]=s,e[2]=i):i=e[2];let c;e[3]!==i?(c=(0,f.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-warning","data-testid":"db-staged-count",children:i}),e[3]=i,e[4]=c):c=e[4];let u;e[5]!==l||e[6]!==s?(u=s(l?"Committing\u2026":"Commit"),e[5]=l,e[6]=s,e[7]=u):u=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==u?(d=(0,f.jsx)("button",{className:"ms-auto rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-commit",disabled:l,onClick:r,type:"button",children:u}),e[8]=l,e[9]=r,e[10]=u,e[11]=d):d=e[11];let g;e[12]!==s?(g=s("Discard"),e[12]=s,e[13]=g):g=e[13];let m;e[14]!==l||e[15]!==a||e[16]!==g?(m=(0,f.jsx)("button",{className:"rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-discard",disabled:l,onClick:a,type:"button",children:g}),e[14]=l,e[15]=a,e[16]=g,e[17]=m):m=e[17];let h;e[18]!==c||e[19]!==d||e[20]!==m?(h=(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d,m]}),e[18]=c,e[19]=d,e[20]=m,e[21]=h):h=e[21];let p;e[22]!==n?(p=n.map(Tc),e[22]=n,e[23]=p):p=e[23];let b;e[24]!==p?(b=(0,f.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"db-staged-list",children:p}),e[24]=p,e[25]=b):b=e[25];let w;return e[26]!==h||e[27]!==b?(w=(0,f.jsxs)("div",{className:"flex flex-col gap-2 border border-warning/40 bg-warning/5 p-3","data-testid":"db-staged",children:[h,b]}),e[26]=h,e[27]=b,e[28]=w):w=e[28],w},"Go");function Oc(t,e){return t+Object.keys(e).length}o(Oc,"Jo");function Tc(t){return(0,f.jsxs)("li",{className:"flex flex-wrap items-center gap-2 font-mono text-xs",children:[(0,f.jsxs)("span",{className:"text-muted-foreground",children:[t.rowId,".",t.column]}),(0,f.jsx)("span",{className:"text-destructive line-through",children:Ee(t.oldValue)}),(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2192"}),(0,f.jsx)("span",{className:"text-foreground",children:Ee(t.newValue)})]},`${t.rowId}:${t.column}`)}o(Tc,"Wo");var hs=400,Vc=36,Ec={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},zc={width:"100%"},Hc=/\n$/u,$c={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},Lc={display:"flex",width:"100%"},ws={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},jc="2.5rem",Ms={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},ur=o(t=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${t.toString()}px`}),"Ft"),ks=o((t,e)=>({...ur(t),left:`calc(${jc} + ${e.toString()}px)`,position:"sticky",zIndex:2}),"fn"),lr="rounded-md px-2 py-0.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",Bc=o((t,e,n)=>e.enabled&&e.columns.has(n)?void 0:t,"ts"),ir="__back__:",Gc=o(t=>`${ir}${t.table}.${t.column}`,"ns"),qc=o(t=>{let e=(0,q.c)(3),{counts:n,rowId:l}=t;if(n===void 0){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,f.jsx)("span",{className:"text-muted-foreground/50",children:"\u2014"}),e[0]=s):s=e[0],s}let r=n[l]??0,a;return e[1]!==r?(a=(0,f.jsx)("span",{className:"tabular-nums",children:r}),e[1]=r,e[2]=a):a=e[2],a},"os"),et=o(t=>{for(let e of["id","__id__","_id"]){let n=t[e];if(typeof n=="string"||typeof n=="number")return String(n)}return null},"Ie"),Kc=o((t,e)=>{if(e.enumValues!==void 0&&e.enumValues.length>0)return e.enumValues.includes(t)||t===""&&e.nullable===!0?{value:t===""?null:t}:void 0;if(e.type==="boolean")return t==="true"||t==="false"?{value:t==="true"}:void 0;if(e.type==="number"){let n=Number(t);return t.trim()===""||!Number.isFinite(n)?void 0:{value:n}}return{value:t}},"ss"),Uc=o((t,e,n)=>{if(n!==void 0&&n.type!=="any")return Kc(t,n);let l=Fs(t,e);return typeof e=="number"&&typeof l!="number"?void 0:{value:l}},"ls"),Jc=o(({anchor:t,columnIds:e,columnMeta:n,editableColumn:l,rows:r,text:a})=>{let s=a.replaceAll(`\r
3
3
  `,`
4
4
  `).replace(Hc,"").split(`
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-5PEAXTYQ.js";var d=[{headings:["Vocabulary","The mental model","The components","Request lifecycle","The data tiers","Compute tiers","The consistency model","The real-time engine"],id:"architecture",summary:"The full picture \u2014 topology, request lifecycle, the data tiers, the consistency model, and the design decisions behind them.",title:"Architecture"},{headings:["How telemetry reaches the cloud","Traces","Issues","Logs","Metrics","Scoped ingest keys","Bring your own OpenTelemetry","Retention & scale"],id:"cloud/monitoring",summary:"The Lunora cloud is a managed OpenTelemetry backend + control plane \u2014 deploy to it and your traces, logs, metrics, and AI generations flow i",title:"Monitoring"},{headings:["When to use an action vs a mutation","ActionCtx","Calling queries and mutations from an action","Scheduling follow-up work"],id:"concepts/actions",summary:"Non-deterministic functions for external APIs and side effects \u2014 the action builder and its ActionCtx.",title:"Actions"},{headings:["Keep your session authority","Declare ownership once","Call Lunora from your own Worker","Dev proxy: two silent failures","Run both engines during the migration","Test it without a worker","When something is stuck"],id:"concepts/adopt-in-an-existing-app",summary:"Add Lunora to a working product that already has its own auth, Worker, and data layer \u2014 without rewriting either.",title:"Adopt in an existing app"},{headings:["Static lints","Runtime lints","Running advisors"],id:"concepts/advisors",summary:"Splinter-style lints that catch schema, performance, and security problems \u2014 many before you deploy.",title:"Advisors"},{headings:["Agent skills","Agent mode","The docs server","The local server","The MCP server","Keeping generated types honest"],id:"concepts/ai-tooling",summary:"Teach Claude Code, Cursor, and Copilot how to use Lunora \u2014 agent skills, agent-aware dev mode, the docs server, and the MCP server.",title:"AI coding agents"},{headings:["What lands in your project","Wire it up","The cards","Enabling the optional flows","Password rules","Username availability","Being an OAuth provider","Avatar and logo uploads"],id:"concepts/auth-ui",summary:"Copy-in sign-in, settings, and organization screens for React, Vue, Svelte, Solid, and Angular \u2014 the code lands in your project and you own ",title:"Auth UI"},{headings:["ctx.auth inside functions","@lunora/auth on the server","Routing /api/auth/*","The client side","Feeding row-level security","See also"],id:"concepts/authentication",summary:"How ctx.auth threads the signed-in user through queries, mutations, and actions \u2014 and feeds row-level security.",title:"Authentication"},{headings:["Point-in-time recovery","Snapshot backups","Export and import","Streaming data out continuously","Practising a restore"],id:"concepts/backups",summary:"Snapshot a deployment, recover a shard to any moment in the last 30 days, and move data in and out as NDJSON.",title:"Backups, export & import"},{headings:["Schema first","Reads","Writes","Inputs and safety","Scaling","Lean on Advisors"],id:"concepts/best-practices",summary:"The opinionated idioms that keep a Lunora app fast, safe, and reactive.",title:"Best practices"},{headings:["Enabling Workers Cache","Declarative cache headers on httpRoute","Programmatic cache purging","Why only HTTP actions?","Memoizing an expensive action result","Scaffolding cache-aware routes","Best practices"],id:"concepts/caching",summary:"Edge caching with Cloudflare Workers Cache \u2014 declarative headers on HTTP routes and programmatic cache purging from actions.",title:"Caching"},{headings:["The short version","Rows or events?","Live topics, whispers and rooms","Streams","Write a row, then tell the page","Things to know before you rely on a live topic"],id:"concepts/choosing-a-data-channel",summary:"Live query, stream, live topic, whisper, room or socket? Which one to use for which job.",title:"Choosing a data channel"},{headings:["Declaring it","What _commitSeq guarantees","Refreshed on every write","Three things it is not","When to reach for it"],id:"concepts/commit-ordering",summary:"Declare .commitOrdered() so every row carries _commitSeq \u2014 a per-shard sequence that orders commits, and the cursor a changefeed can page on",title:"Commit ordering"},{headings:["Defining one","Installing one","What the namespace guarantees","What a component does NOT get","In the architecture view","Migrations","See also"],id:"concepts/components",summary:"Package backend features \u2014 tables, functions, and context \u2014 as an installable unit that cannot collide with the app that installs it.",title:"Components"},{headings:["Constraint kinds","Unique","Non-null","Foreign-key integrity","Error codes"],id:"concepts/constraints",summary:"Unique, non-null and foreign-key integrity declared on the schema and enforced at write time.",title:"Constraints"},{headings:["What it pins","Pinning auth and voice","Pinning mail","Set it once: changing it strands data","Runbook: moving an app to a new jurisdiction"],id:"concepts/data-residency",summary:"Pin Durable Objects to a Cloudflare jurisdiction with .jurisdiction(), and the export\u2192import runbook for moving regions.",title:"Data residency"},{headings:["The type table","Numbers, bigints, and dates","Optional versus null","Values that JSON cannot carry","Size limits","Types outside the schema"],id:"concepts/data-types",summary:"The value types a Lunora document can hold, how each is stored, and which ones need the wire codec to survive JSON.",title:"Data types"},{headings:["Start with lunora doctor","Catch it before it runs","The error overlay","Structured logging with ctx.log","The Studio","Find the slow or failing function","Watch production","Debugging authentication"],id:"concepts/debugging",summary:"The tools to reach for when something is broken \u2014 doctor, the error overlay, ctx.log, the Studio, insights, and live logs.",title:"Debugging"},{headings:["How ids are minted","Typing a reference with v.id","Reading and following ids","Validating an id that came from outside","Ids in exports and imports"],id:"concepts/document-ids",summary:"Every row carries an _id and a _creationTime \u2014 how they are minted, how v.id types a reference, and what an id does and does not guarantee.",title:"Document IDs"},{headings:["Locally: .dev.vars","In production: secrets and vars","Accessing env inside your app","The rule: never commit secrets"],id:"concepts/environment-variables",summary:"Configure secrets and vars \u2014 .dev.vars locally, wrangler secrets in production, env bindings inside functions.",title:"Environment variables"},{headings:["Multiple environments","Linking a checkout to a deployment","Preview deployments","Moving traffic between versions","Build once, deploy many","Custom domains","Trying a deploy without an account","Who changed what"],id:"concepts/environments",summary:"Running staging next to production, deploying an isolated environment, checking pull requests with a dry run, and rolling traffic back when ",title:"Environments & releases"},{headings:["Throwing from a handler","Expected vs. unexpected","Reading error state on the client","Optimistic updates roll back on rejection","See also"],id:"concepts/error-handling",summary:"Throwing inside handlers, how errors travel to the client, and reading error state without losing optimistic safety.",title:"Error handling"},{headings:["What reaches your tracker","Wire it once, to both halves","Sentry","PostHog","Datadog, Axiom, Better Stack, and the rest","Source maps","Privacy"],id:"concepts/error-tracking",summary:"Send Lunora's failed calls and error logs to Sentry, PostHog, Datadog, or any error tracker, with the thrown error's real stack and nothing ",title:"Error tracking"},{headings:["External provider or @lunora/auth?","The resolver","Client: hand over the token, refresh it","WebSockets and live queries","RLS with org claims","Memoization and revocation","Composing with @lunora/auth or Cloudflare Access","Walkthrough: Clerk"],id:"concepts/external-auth",summary:"Use Clerk, WorkOS AuthKit, Auth0, Supabase or any OIDC JWT issuer as your identity provider \u2014 verify its token at the Worker and feed ctx.au",title:"External auth"},{headings:["Which contexts expose what","Uploading","Serving files","Named buckets","Deleting","See also"],id:"concepts/file-storage",summary:"Typed R2 buckets exposed as ctx.storage \u2014 uploading, serving via signed URLs, and deleting files from your functions.",title:"File storage"},{headings:["Where the work happens","Choosing between them","When a bare filter is fine","How the advisors catch this","Composing","Inside an object column"],id:"concepts/filtering",summary:".filter() is a JavaScript predicate applied after rows are loaded \u2014 when to use it, and when to reach for an index instead.",title:"Filtering"},{headings:["The three context types","Surfaces on every ctx","ctx field matrix","Add-on surfaces (codegen-wired)"],id:"concepts/function-context",summary:"The ctx object passed to every query, mutation, and action \u2014 and what each kind is allowed to do with it.",title:"Function context"},{headings:["api.ts and internal.ts: function references","server.ts: typed helpers","dataModel.ts: Id and Doc","Importing the generated code","lunora/* vs @lunora/* imports","Linting and formatting","Regenerating"],id:"concepts/generated-code",summary:"What @lunora/codegen emits from your schema.ts, and how api / Id / Doc keep server and client in sync.",title:"Generated code"},{headings:["Declaring a point column and a geo index",'"Places near me": near(point, radiusMeters)',"Bounding box: within(box)","Single-shard scope","How the Advisors catch geo mistakes"],id:"concepts/geospatial",summary:'Store lat/lng points with v.geoPoint, index them with .geoIndex, and answer "places near me" and bounding-box reads with withGeoIndex.',title:"Geospatial"},{headings:["httpAction","HttpActionCtx","Typed routes with httpRoute","How routes mount in the worker"],id:"concepts/http-endpoints",summary:"Public HTTP routes with httpAction and the Hono-based httpRouter.",title:"HTTP endpoints"},{headings:["Declaring an index","Querying with withIndex","Why every filtered read should hit an index","How the Advisors catch unindexed reads","Checking a read with explain","Aggregate indexes"],id:"concepts/indexes",summary:"Declare B-tree indexes on tables and query them with withIndex \u2014 every filtered read should hit one.",title:"Indexes"},{headings:["Calling internal functions","Internal functions and scheduling"],id:"concepts/internal-functions",summary:"internalQuery / internalMutation / internalAction \u2014 server-only functions never exposed to the client.",title:"Internal functions"},{headings:["Declare the stream","Publish","Follow a topic in the browser","Authorization","Where delivery stops","Platform support","React Native"],id:"concepts/live-streams",summary:"Publish events to named topics from the server and follow many of them over one SSE connection.",title:"Live topic streams"},{headings:["Turn CDC on first","Why the DO topology fits","Shapes \u2014 partial replication","The poke diff protocol","Custom mutators \u2014 optimistic, server-authoritative","The client store","Cross-shard joins \u2014 the one limit"],id:"concepts/local-first",summary:"Shapes, the poke diff protocol, and custom mutators \u2014 the Zero-class sync engine.",title:"Local-first sync"},{headings:["Strategies","Roles and bypass","What's masked, what isn't","Sensitive arguments","Tooling","See also"],id:"concepts/masking",summary:"Column-level redaction on the read path \u2014 the companion to row-level security.",title:"Data masking"},{headings:["The lifetime","Rebuilding: onShardInit","What .memory() buys, and what it does not","Restrictions","Choosing between .memory() and .ttl()"],id:"concepts/memory-tables",summary:"Declare .memory() for state the shard rebuilds rather than remembers \u2014 presence, cursors, live counters \u2014 and onShardInit to bring it back a",title:"Memory tables"},{headings:["Attaching middleware","Augmenting ctx","Composing concerns"],id:"concepts/middleware",summary:"Compose cross-cutting concerns \u2014 auth checks, rate limiting, logging \u2014 and augment ctx for downstream handlers.",title:"Middleware"},{headings:["The deploy gate tells you when you need one","Schema migrations (global tables)","Data migrations (sharded tables)","Inspecting run-state in the Studio","One-off data edits without a deploy","Resetting local state"],id:"concepts/migrations",summary:"Schema-change SQL for global tables and online, resumable data migrations.",title:"Migrations"},{headings:["Queues and topics","What you get","Table ownership","Installed components"],id:"concepts/modules",summary:"Group lunora/ folders into modules and get a module catalog and an architecture diagram from codegen.",title:"Modules"},{headings:["Running as one node in a dev graph","Deploying from external IaC","Consuming the generated API from a sibling package","Calling the backend from a sibling Worker"],id:"concepts/monorepos-and-iac",summary:"Running the Lunora worker as one node in a larger dev graph, deploying it from Terraform/Pulumi/Alchemy, and consuming its generated API fro",title:"Monorepos and external IaC"},{headings:["The output is pinned to your CLI version","Wiring it into your project","What you get, and what you don't","Conformance"],id:"concepts/non-js-sdks",summary:"Generate a typed, self-contained Lunora client for Python, Go, Ruby, Rust, Swift, Java, Kotlin or Dart/Flutter \u2014 vendored into your project ",title:"Non-JS SDKs"},{headings:["Configure defineNotify","VAPID / FCM config via .dev.vars","Register a browser push subscription","Send from an action","Queue-backed fan-out"],id:"concepts/notifications",summary:"Configure defineNotify in lunora/notify.ts for Web Push + FCM, register browser subscriptions, and send via ctx.notify / ctx.push from an ac",title:"Push notifications"},{headings:["Sinks","Structured logging with ctx.log","Tracing sub-operations with ctx.trace","Database telemetry (ctx.db and ctx.sql)","Trace sampling","Source maps","Application metrics with ctx.metrics","Container telemetry"],id:"concepts/observability",summary:"Ship Lunora's logs, traces, and metrics to any OTLP collector \u2014 the otlpSink worker option, ctx.log/ctx.trace/ctx.metrics, the zero-config c",title:"Observability"},{headings:["Mutations are serialized, not retried","Where conflicts still happen","Handling a conflict on the client","Diagnosing a persistent conflict","Atomicity across shards",".global() tables"],id:"concepts/occ",summary:"Why mutations in one shard are serialized rather than retried, where optimistic-concurrency conflicts still arise, and what atomicity means ",title:"OCC & atomicity"},{headings:["Passing the adapters explicitly","What gets persisted","Surviving a breaking deploy","Multiple tabs","Sync status","Connection status UI","Boot with no network (the app shell)","The reconciliation model"],id:"concepts/offline-first",summary:"Persist reads and writes to disk so the app boots, renders, and accepts edits with no network.",title:"Offline-first"},{headings:["PaginationOptions","PaginationResult","Paging through a query","Ordering rows that hold NULL","Load more / infinite lists on the client",'Total count ("42 of 1,203")'],id:"concepts/pagination",summary:"Keyset pagination with .paginate(options) \u2014 page through a query and build an infinite list on the client.",title:"Pagination"},{headings:["ctx.db","ctx.auth","ctx.scheduler"],id:"concepts/queries-mutations",summary:"query / mutation / action \u2014 what each is for and how ctx is shaped.",title:"Queries & mutations"},{headings:["How this differs from a trigger","The convergence contract","What the handler receives","Execution and identity","Reads that should not wake you","Watching them work"],id:"concepts/reactors",summary:"Declare onQueryChange to run server logic when a query's result changes \u2014 the actor pattern, with no client on the other end and nothing pol",title:"Reactors (server-side reactivity)"},{headings:["Where a shard is created","Replica reads","Sockets near the client"],id:"concepts/read-replicas",summary:"Serve one-shot queries from a copy of the shard in the caller's region, pin where a shard is created, and terminate sockets near the client.",title:"Read replicas & placement"},{headings:["Hibernation","How an update reaches a subscriber","Reconnect","When WebSockets are blocked","Durable streams","Whispers (ephemeral peer messages)","Why no MQTT / Pub/Sub"],id:"concepts/realtime",summary:"How subscriptions, deltas, and hibernation fit together.",title:"Real-time"},{headings:["Using items","The manifest","Validation","Building the catalog","Distributing"],id:"concepts/registry-items",summary:"Package a reusable capability \u2014 schema, functions, bindings and env vars \u2014 as a registry item others install with one command.",title:"Authoring registry items"},{headings:["A worked example","The edge set","Directions","Depth, limit and score","Cycles and paging","It is an ordinary read","Fusing the graph into retrieval","From an AI agent"],id:"concepts/relation-graph",summary:"Traverse the foreign-key graph your schema already declares with ctx.db.related \u2014 depth-bounded, cycle-safe, scored by proximity, and fusabl",title:"Relation graph"},{headings:["The descriptors","Many-to-many","Index your foreign keys","Querying across a relation","Writing through a relation","Relations vs the relation graph"],id:"concepts/relations",summary:"Modeling many-to-one, one-to-many and many-to-many relationships with the one / many relation descriptors, foreign-key columns, join tables ",title:"Relations"},{headings:["Default-closed","URLs and methods","Arguments","Choosing a shard","Authentication","Rate limiting","Caching","OpenAPI"],id:"concepts/rest-api",summary:"Publish a query, mutation, or action as a plain REST endpoint with .expose({ rest: true }) \u2014 default-closed, routed through the procedure so",title:"Public REST API"},{headings:["Policies","Permissions and roles","Relation predicates","What's covered, what isn't","Testing policies","See also"],id:"concepts/rls",summary:"Server-side authorization that decides which rows a procedure can read or write.",title:"Row-level security"},{headings:["Node compatibility","Where the constraints bite","Bundling","The worker entry","Build once, deploy many"],id:"concepts/runtime",summary:"Everything runs on the Workers runtime \u2014 what that means for Node APIs, dependencies, and the 64 MiB bundle you have to fit into.",title:"Runtime & bundling"},{headings:["Deferring a function","Recurring jobs (Cron Triggers)","How dispatch works","See also"],id:"concepts/scheduling",summary:"Defer follow-up work with ctx.scheduler.runAfter / runAt, and run recurring jobs via Cron Triggers.",title:"Scheduling"},{headings:["Validators","Tier modifiers","Indexes"],id:"concepts/schema",summary:"Declarative tables, validators, indexes and sharding.",title:"Schema"},{headings:["Declaring a search index","Language","Running a search query","Matching rules","Filter fields","Relevance ordering, .take(n) and pagination","Limits","Backfill and staged"],id:"concepts/search",summary:"Declare a search index on a table and run relevance-ordered full-text queries.",title:"Full-text search"},{headings:["The HTTP edge","Auth, cookies, and secrets","Protecting public procedures","Securing sharded access","Advisor catalog","Config-time validation"],id:"concepts/security",summary:"Lunora's secure-by-default posture \u2014 the protections you get for free, how to opt out, and the advisor lints that catch the gaps.",title:"Security"},{headings:["From an SSR loader","From a script","From the terminal","From Python","From any language, over HTTP","Writing a new SDK"],id:"concepts/server-clients",summary:"Calling a Lunora deployment without a live subscription \u2014 from SSR loaders, scripts, other languages, or plain HTTP.",title:"Server-side & non-reactive clients"},{headings:["Declare a service","Call it from an action","What Lunora wires","Test an action that calls one","Make the service private","Smart Placement","Platforms","Migrating from URLs and HMAC"],id:"concepts/services",summary:"Call sibling Cloudflare Workers from actions over typed service bindings, run them in one dev session, and deploy them before the app.",title:"Services"},{headings:["When to shard","Migrating a populated table","What stays in the root DO","Going global","Cross-shard reads","The shard registry","Securing shard access"],id:"concepts/sharding",summary:"Default __root__ DO, opt-in .shardBy(), and .global() escape hatch.",title:"Sharding"},{headings:["The one caveat that matters","The read surface","_scheduled_functions","_storage"],id:"concepts/system-tables",summary:"Read pending scheduled jobs and stored file metadata through ctx.db.system \u2014 a read-only, eventually consistent view outside the mutation sn",title:"System tables"},{headings:["Install","Configure","Write a test","Run in CI"],id:"concepts/testing-ai-features",summary:"Drive a Lunora app's AI flows in a real browser with the e2e runner, and judge non-deterministic model output with natural-language assertio",title:"Testing AI features end to end"},{headings:["The in-memory harness","Asserting reactive results","Mail-catcher helpers (E2E)","Running in CI"],id:"concepts/testing",summary:"Unit-test queries, mutations, and actions in memory with lunoraTest \u2014 no worker, no network.",title:"Testing"},{headings:["Declaring a TTL","Sweep semantics: coarse, batched, bounded","Not on .global() tables","Interaction with soft delete","How the Advisors catch TTL mistakes"],id:"concepts/ttl",summary:"Declare a table-level .ttl() so a DO alarm sweep auto-deletes expired rows \u2014 sessions, OTPs, and other ephemeral data.",title:"TTL & auto-expiry"},{headings:["Where types come from","Do not restate what is inferred","Reach for Doc and Id","Pin the client contract with .output()","Optional versus null in types","Bringing your own validators","Project configuration","Keeping types honest in CI"],id:"concepts/typescript",summary:"Getting the most out of Lunora's end-to-end types \u2014 where types come from, what to annotate, and what to let inference do.",title:"TypeScript"},{headings:["Job 1: column types in defineTable","Job 2: argument and return validation","Return-type inference to the client","Common validators","Coming from zod","ValidationError"],id:"concepts/validation",summary:"The v.* validators that type your columns and parse query / mutation / action inputs and outputs end to end.",title:"Validation"},{headings:["Declaring an index","Automatic write sync","ctx.vectors","RAG with @lunora/ai","Binding & config wiring"],id:"concepts/vector-search",summary:"Typed Vectorize indexes on ctx.vectors \u2014 automatic write sync, similarity search, and RAG with embeddings.",title:"Vector search"},{headings:["The specification","Conformance fixtures","SDKs built on it"],id:"concepts/wire-protocol",summary:"The language-independent Lunora client\u2194server wire protocol and the golden fixtures every SDK is tested against.",title:"Wire protocol"},{headings:["wrangler.jsonc","lunora.config.ts","Secrets","Containers","Deploy","Durable Object class limit","Worker size","Streaming logs"],id:"deployment",summary:"Wrangler bindings, secrets, and the deploy flow.",title:"Deployment"},{headings:["Redacted codes","Build-time errors","Throwing your own","Error codes"],id:"errors",summary:"Every well-known Lunora error code \u2014 its HTTP status, what it means, and what to do about it.",title:"Errors & warnings reference"},{headings:["Branching on one","The same number, in the document","Where the numbers come from","From your own code"],id:"exit-codes",summary:"The exit code every lunora command terminates with \u2014 what each number means, and how it is derived from the error catalog.",title:"CLI exit codes"},{headings:["Install","Provide the client","Live queries","Mutations","Connection status","Reactive loaders"],id:"frameworks/angular",summary:"Use Lunora with Angular \u2014 provideLunora in your app config, signal-based liveQuery, imperative mutate, and a connectionStatus signal.",title:"Angular"},{headings:["Install","Exports","The integration","Single-worker composition with withLunora","Reactive-loader server helpers","Deploy"],id:"frameworks/astro",summary:"Compose Astro's @astrojs/cloudflare worker with Lunora realtime, plus reactive-loader server helpers for .astro frontmatter.",title:"Astro"},{headings:["One worker, two dispatch flows","Mount Lunora inside your framework","The per-framework matrix","Client adapters","Scaffolding","Vite composition"],id:"frameworks/bring-your-framework",summary:"Compose any meta-framework's SSR with Lunora realtime in one Cloudflare Worker.",title:"Bring your framework"},{headings:["One worker, two dispatch flows","Class A: Lunora owns the worker entry","Class B: the framework owns the CF adapter","Class C: SPA / SSR-less","Wrangler reconciliation"],id:"frameworks/deploy",summary:"One worker, one deploy \u2014 how a composed Lunora + meta-framework app ships to Cloudflare.",title:"Deploy your framework"},{headings:["Why two workers","Wiring them together","Client and server entry points","Loading data in a Server Component","Providing the client","Developing","Deploying"],id:"frameworks/nextjs",summary:"Run Lunora alongside Next.js on Cloudflare with the two-worker split \u2014 RSC loaders that hydrate into live subscriptions.",title:"Next.js"},{headings:["Install","Setup","How it works","Provide the client","Reactive loaders","Feature flags","Verify before deploy","Alternative: two-worker split"],id:"frameworks/nuxt",summary:"Run Lunora and Nuxt as one Cloudflare Worker \u2014 the @lunora/nuxt module mounts /_lunora/** into Nitro, plus reactive-loader server helpers.",title:"Nuxt"},{headings:["Scaffold a new app","Install","Create the client","Provide it","Live queries and mutations","HTTP streams","Local-first (shapes, custom mutators, TanStack DB)","Authentication (better-auth + Expo)"],id:"frameworks/react-native",summary:"Use Lunora in a React Native / Expo app \u2014 the same live hooks, plus an AsyncStorage-backed client and a better-auth Expo bridge.",title:"React Native / Expo"},{headings:["Install","Provide the client","Live queries","Mutations","Auth","Reactive loaders","One worker, one deploy"],id:"frameworks/react",summary:"Use Lunora with React \u2014 a provider, live useQuery/useMutation hooks, and the SSR-seed \u2192 live reactive-loader handoff.",title:"React"},{headings:["The problem with static loaders","The handoff","Why there's no flash","Identity continuity (SSR \u2192 client)","Sharding carries through","Status"],id:"frameworks/reactive-loaders",summary:"Your loaders are live \u2014 SSR data that hydrates into a real-time subscription with no flash.",title:"Reactive loaders"},{headings:["Install","Solid 1.x and Solid 2.0","Provide the client","Live queries","Mutations","Reactive loaders"],id:"frameworks/solid",summary:"Use Lunora with SolidJS \u2014 a provider, live createQuery/createMutation primitives, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Solid"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","One worker, one deploy"],id:"frameworks/svelte",summary:"Use Lunora with Svelte 5 / SvelteKit \u2014 context-provided client, live query/mutation stores, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Svelte"},{headings:["What you're proving","1. Scaffold","2. Dev","3. Prove SSR preload (curl the raw HTML)","4. Prove the live subscription attaches","5. Prove live update (two tabs)","Identity check (optional, with auth)",'What "pass" looks like'],id:"frameworks/verify-live-loaders",summary:"How to actually prove live loaders work \u2014 scaffold, SSR-curl the preloaded value, two-tab live update.",title:"Manual end-to-end verification"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","Worker composition"],id:"frameworks/vue",summary:"Use Lunora with Vue 3 \u2014 a client plugin, live useQuery/useMutation composables, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Vue"},{headings:["Requirements"],id:"getting-started",summary:"Scaffold a Lunora app and run the dev loop in under a minute.",title:"Getting started"},{headings:["Durable Objects","Statement limits (Durable Objects **and** D1)","D1","R2","Workers","Worker startup (error 10021)","Queues","Pipelines"],id:"limits",summary:"Cloudflare ceilings you should keep in your head.",title:"Limits"},{headings:["Two translations, not one","Schema: transposing the relation graph","Procedures: the shape deltas","Writes: .returning() does not survive","Components decompose by hand"],id:"migrating/from-a-convex-toolkit",summary:"The second translation step a Drizzle-style schema DSL and a tRPC-style procedure builder add on top of the raw Convex mapping.",title:"Migrating from a Convex toolkit"},{headings:["Bump strategy","Breaking changes already landed","Recommended (non-breaking) follow-ups","See also"],id:"migrating/from-alpha",summary:"How a 1.0.0-alpha.* app moves to stable \u2014 dependency bumps plus every breaking change already landed on the road to 1.0.",title:"Upgrading from alpha to 1.0"},{headings:["At a glance","Schema","Queries, mutations, actions","React","Auth","Scheduler","File storage","Subscriptions"],id:"migrating/from-convex",summary:"Side-by-side mapping \u2014 schema, queries, mutations, actions, React hooks.",title:"Migrating from Convex"},{headings:["At a glance","Schema","Reads: onSnapshot \u2192 useQuery","Writes: setDoc \u2192 mutation","Cloud Functions \u2192 actions","Auth","File storage","Scheduled work"],id:"migrating/from-firebase",summary:"Side-by-side mapping \u2014 Firestore, Cloud Functions, Auth, Storage, and real-time listeners.",title:"Migrating from Firebase"},{headings:["At a glance","Schema","Reads: supabase.from(...).select() \u2192 useQuery","Writes: .insert() \u2192 mutation","Row-level security","Edge Functions \u2192 actions","Auth","File storage"],id:"migrating/from-supabase",summary:"Side-by-side mapping \u2014 Postgres tables, RLS, Edge Functions, Auth, Storage, and Realtime.",title:"Migrating from Supabase"},{headings:["No arbitrary external SQL or ad-hoc cross-dataset joins","RPC-first, not REST-first","Cross-shard writes are eventual, not atomic","No data warehouse hosting in the framework","No managed control plane as a hard dependency","Also deliberately absent","See also"],id:"non-goals",summary:"The things Lunora deliberately does not do \u2014 each with the reason it's a boundary and the escape hatch when you need past it.",title:"Design boundaries"},{headings:["Why Lunora","Own it, or let us run it","How Lunora compares","Where it's rough","What ships in v1.0.0-alpha.1","Start building"],id:"overview",summary:"The Convex-style real-time backend that runs on your own Cloudflare account \u2014 typed end to end, live by default, ~$0 at idle.",title:"Overview"},{headings:["Bindings and wrangler config","Secrets","LUNORA_ADMIN_TOKEN and the admin plane","Rate limiting and abuse","Auth and row-level security","Migrations","Observability","Health and readiness endpoint"],id:"production-checklist",summary:"Everything to verify before a Lunora app takes real traffic \u2014 bindings, secrets, admin tokens, rate limits, RLS, migrations, observability.",title:"Production checklist"},{headings:["Pick a starting point","Adding Lunora to an app you already have","What you get either way","Next steps"],id:"quickstarts",summary:"Every starting point Lunora scaffolds \u2014 pick your framework, run one command, and get a live backend wired to it.",title:"Quickstarts"},{headings:["1. See where you stand","2. Create the usage alerts","3. Add the budget alert by hand","4. Check delivery","In CI"],id:"runaway-bill",summary:"Set Cloudflare usage alerts well above normal with `lunora cloudflare alerts`, add the budget alert the API cannot, and check what actually ",title:"Protect yourself from a runaway bill"},{headings:["Why startup grows with the app","Measure it locally","The fix: load function modules on demand","Keep heavy packages off the startup path"],id:"startup-cpu-limit",summary:'Why a large app fails to deploy with "Script startup exceeded CPU time limit", how to measure it, and how lazy function loading and lighter ',title:"Worker startup CPU limit (error 10021)"},{headings:["1. Scaffold","2. Model the data","3. Generate the migration","4. Write the query","5. Write the mutation","6. Wire the React app","7. Run the dev loop","8. Deploy"],id:"tutorial/realtime-chat",summary:"End-to-end Lunora walkthrough \u2014 schema, query, mutation, subscription, React, sharding.",title:"Build a real-time chat app in 15 minutes"},{headings:["Know when to act","Step 1: shard the messages","Step 2: put identities in a global table","Step 3: keep fan-out off the hot path","Step 4: lock down shard access","Step 5: migrate the data you already have","Checking your work","What you learned"],id:"tutorial/scaling",summary:"Take the chat app from one Durable Object to many \u2014 shard by channel, put identities in a global table, and keep cross-shard reads off the h",title:"Tutorial: scaling the chat app"},{headings:["Release channels","What SemVer means here","Stability tiers",'What "experimental" means',"See also"],id:"versioning",summary:"What SemVer means for Lunora packages \u2014 release channels, stability tiers, and the experimental surface.",title:"Versioning & stability"}],l="https://lunora.sh/docs/",u=4,m=3,g=200,p=4,y=3,f=2,w=1,v=r(t=>t.slice(0,g).toLowerCase().split(/[^a-z0-9.]+/u).filter(a=>a.length>=m),"w"),b=r((t,a)=>{let i=t.id.toLowerCase(),e=t.title.toLowerCase(),s=t.summary.toLowerCase(),c=t.headings.map(n=>n.toLowerCase()),o=0;for(let n of a)i.includes(n)&&(o+=p),e.includes(n)&&(o+=y),c.some(h=>h.includes(n))&&(o+=f),s.includes(n)&&(o+=w);return o},"v"),k=r(t=>{let a=v(typeof t=="string"?t:""),i=a.length===0?[]:d.map(e=>({candidate:e,rank:b(e,a)})).filter(e=>e.rank>0).sort((e,s)=>s.rank-e.rank).slice(0,u).map(e=>({...e.candidate,url:`${l}${e.candidate.id}`}));return{entries:i.length===0?d.map(e=>e.id):i}},"b"),S=r(t=>{let{entries:a}=k(t);return a.every(i=>typeof i=="string")?[`Documentation pages under ${l}: ${a.join(", ")}`]:a.map(i=>{let e=i;return`${e.title} (${e.url}): ${e.summary} Sections: ${e.headings.join(", ")}`})},"k");export{S as knowledgeExcerpts};
@@ -1,4 +1,4 @@
1
- import{a as et,b as tt}from"./chunk-CSLKRY64.js";import"./chunk-QH3HSOII.js";import"./chunk-WL3MWYDB.js";import{d as Ze}from"./chunk-3SKL6OEA.js";import"./chunk-GZWXXJKZ.js";import{a as Ae}from"./chunk-CVSIFPI5.js";import{a as Ye}from"./chunk-26Z7L3NM.js";import"./chunk-Y2YLTUMD.js";import"./chunk-BOBQQR2H.js";import"./chunk-UBX5ZPLV.js";import"./chunk-VNH4OBJS.js";import{a as Je}from"./chunk-2DT3QG6Q.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import"./chunk-BG2CJOVS.js";import{a as Ve}from"./chunk-YESQLEOG.js";import{b as Ge}from"./chunk-3D67ZJRW.js";import"./chunk-HZK2UJ3K.js";import{c as Ue,d as we,e as Ne,f as Ee,g as Me}from"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import{i as ye}from"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import"./chunk-YUVGMKHG.js";import{a as Xe}from"./chunk-36PLWIHK.js";import"./chunk-ZYXDE5GW.js";import{b as Ke}from"./chunk-TRYQANZO.js";import{a as ve}from"./chunk-2W4UO5BC.js";import"./chunk-C4IDZOYU.js";import{m as Ce}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as J,h as ge,i as xe,j as Fe,r as Qe,s as se,x as ie}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as wt}from"./chunk-GWNGVKLG.js";import{a as yt,b as St}from"./chunk-6G3E4PJ2.js";import{a as d,d as De}from"./chunk-5PEAXTYQ.js";var X=De(wt(),1),H=De(yt(),1);var u=De(St(),1);var Se=class{static{d(this,"Diff")}diff(e,n,t={}){let o;typeof t=="function"?(o=t,t={}):"callback"in t&&(o=t.callback);let r=this.castInput(e,t),l=this.castInput(n,t),i=this.removeEmpty(this.tokenize(r,t)),a=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(i,a,t,o)}diffWithOptionsObj(e,n,t,o){var r;let l=d(h=>{if(h=this.postProcess(h,t),o){setTimeout(function(){o(h)},0);return}else return h},"done"),i=n.length,a=e.length,c=1,m=i+a;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let p=(r=t.timeout)!==null&&r!==void 0?r:1/0,f=Date.now()+p,b=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(b[0],n,e,0,t);if(b[0].oldPos+1>=a&&g+1>=i)return l(this.buildValues(b[0].lastComponent,n,e));let k=-1/0,q=1/0,N=d(()=>{for(let h=Math.max(k,-c);h<=Math.min(q,c);h+=2){let S,x=b[h-1],v=b[h+1];x&&(b[h-1]=void 0);let y=!1;if(v){let E=v.oldPos-h;y=v&&0<=E&&E<i}let w=x&&x.oldPos+1<a;if(!y&&!w){b[h]=void 0;continue}if(!w||y&&x.oldPos<v.oldPos?S=this.addToPath(v,!0,!1,0,t):S=this.addToPath(x,!1,!0,1,t),g=this.extractCommon(S,n,e,h,t),S.oldPos+1>=a&&g+1>=i)return l(this.buildValues(S.lastComponent,n,e))||!0;b[h]=S,S.oldPos+1>=a&&(q=Math.min(q,h-1)),g+1>=i&&(k=Math.max(k,h+1))}c++},"execEditLength");if(o)d(function h(){setTimeout(function(){if(c>m||Date.now()>f)return o(void 0);N()||h()},0)},"exec")();else for(;c<=m&&Date.now()<=f;){let h=N();if(h)return h}}addToPath(e,n,t,o,r){let l=e.lastComponent;return l&&!r.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,o,r){let l=n.length,i=t.length,a=e.oldPos,c=a-o,m=0;for(;c+1<l&&a+1<i&&this.equals(t[a+1],n[c+1],r);)c++,a++,m++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!r.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,c}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let o=[],r;for(;e;)o.push(e),r=e.previousComponent,delete e.previousComponent,e=r;o.reverse();let l=o.length,i=0,a=0,c=0;for(;i<l;i++){let m=o[i];if(m.removed)m.value=this.join(t.slice(c,c+m.count)),c+=m.count;else{if(!m.added&&this.useLongestToken){let p=n.slice(a,a+m.count);p=p.map(function(f,b){let g=t[c+b];return g.length>f.length?g:f}),m.value=this.join(p)}else m.value=this.join(n.slice(a,a+m.count));a+=m.count,m.added||(c+=m.count)}}return o}};var Pe=class extends Se{static{d(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=qt}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
1
+ import{a as et,b as tt}from"./chunk-CSLKRY64.js";import"./chunk-QH3HSOII.js";import"./chunk-WL3MWYDB.js";import{d as Ze}from"./chunk-3SKL6OEA.js";import"./chunk-GZWXXJKZ.js";import{a as Ae}from"./chunk-CVSIFPI5.js";import{a as Ye}from"./chunk-Y4QFNP4R.js";import"./chunk-Y2YLTUMD.js";import"./chunk-BOBQQR2H.js";import"./chunk-UBX5ZPLV.js";import"./chunk-VNH4OBJS.js";import{a as Je}from"./chunk-2DT3QG6Q.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import"./chunk-BG2CJOVS.js";import{a as Ve}from"./chunk-YESQLEOG.js";import{b as Ge}from"./chunk-3D67ZJRW.js";import"./chunk-HZK2UJ3K.js";import{c as Ue,d as we,e as Ne,f as Ee,g as Me}from"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import{i as ye}from"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import"./chunk-YUVGMKHG.js";import{a as Xe}from"./chunk-36PLWIHK.js";import"./chunk-ZYXDE5GW.js";import{b as Ke}from"./chunk-TRYQANZO.js";import{a as ve}from"./chunk-2W4UO5BC.js";import"./chunk-C4IDZOYU.js";import{m as Ce}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as J,h as ge,i as xe,j as Fe,r as Qe,s as se,x as ie}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as wt}from"./chunk-GWNGVKLG.js";import{a as yt,b as St}from"./chunk-6G3E4PJ2.js";import{a as d,d as De}from"./chunk-5PEAXTYQ.js";var X=De(wt(),1),H=De(yt(),1);var u=De(St(),1);var Se=class{static{d(this,"Diff")}diff(e,n,t={}){let o;typeof t=="function"?(o=t,t={}):"callback"in t&&(o=t.callback);let r=this.castInput(e,t),l=this.castInput(n,t),i=this.removeEmpty(this.tokenize(r,t)),a=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(i,a,t,o)}diffWithOptionsObj(e,n,t,o){var r;let l=d(h=>{if(h=this.postProcess(h,t),o){setTimeout(function(){o(h)},0);return}else return h},"done"),i=n.length,a=e.length,c=1,m=i+a;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let p=(r=t.timeout)!==null&&r!==void 0?r:1/0,f=Date.now()+p,b=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(b[0],n,e,0,t);if(b[0].oldPos+1>=a&&g+1>=i)return l(this.buildValues(b[0].lastComponent,n,e));let k=-1/0,q=1/0,N=d(()=>{for(let h=Math.max(k,-c);h<=Math.min(q,c);h+=2){let S,x=b[h-1],v=b[h+1];x&&(b[h-1]=void 0);let y=!1;if(v){let E=v.oldPos-h;y=v&&0<=E&&E<i}let w=x&&x.oldPos+1<a;if(!y&&!w){b[h]=void 0;continue}if(!w||y&&x.oldPos<v.oldPos?S=this.addToPath(v,!0,!1,0,t):S=this.addToPath(x,!1,!0,1,t),g=this.extractCommon(S,n,e,h,t),S.oldPos+1>=a&&g+1>=i)return l(this.buildValues(S.lastComponent,n,e))||!0;b[h]=S,S.oldPos+1>=a&&(q=Math.min(q,h-1)),g+1>=i&&(k=Math.max(k,h+1))}c++},"execEditLength");if(o)d(function h(){setTimeout(function(){if(c>m||Date.now()>f)return o(void 0);N()||h()},0)},"exec")();else for(;c<=m&&Date.now()<=f;){let h=N();if(h)return h}}addToPath(e,n,t,o,r){let l=e.lastComponent;return l&&!r.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,o,r){let l=n.length,i=t.length,a=e.oldPos,c=a-o,m=0;for(;c+1<l&&a+1<i&&this.equals(t[a+1],n[c+1],r);)c++,a++,m++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!r.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,c}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let o=[],r;for(;e;)o.push(e),r=e.previousComponent,delete e.previousComponent,e=r;o.reverse();let l=o.length,i=0,a=0,c=0;for(;i<l;i++){let m=o[i];if(m.removed)m.value=this.join(t.slice(c,c+m.count)),c+=m.count;else{if(!m.added&&this.useLongestToken){let p=n.slice(a,a+m.count);p=p.map(function(f,b){let g=t[c+b];return g.length>f.length?g:f}),m.value=this.join(p)}else m.value=this.join(n.slice(a,a+m.count));a+=m.count,m.added||(c+=m.count)}}return o}};var Pe=class extends Se{static{d(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=qt}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
2
2
  `))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
3
3
  `))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
4
4
  `)&&(e=e.slice(0,-1)),n.endsWith(`