@lunora/studio 1.0.0-alpha.244 → 1.0.0-alpha.246

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.
Files changed (134) hide show
  1. package/dist/index.d.mts +2 -2
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.mjs +1 -1
  5. package/dist/packem_chunks/ApiTab.mjs +1 -1
  6. package/dist/packem_chunks/SchemaViewer.mjs +1 -1
  7. package/dist/packem_chunks/architecture-panel.mjs +1 -0
  8. package/dist/packem_chunks/kv-browser.mjs +1 -1
  9. package/dist/packem_chunks/migrations-route.mjs +1 -1
  10. package/dist/packem_chunks/queues-panel.mjs +1 -1
  11. package/dist/packem_shared/ApiReferencePanel-nAf8tNRr.mjs +1 -0
  12. package/dist/packem_shared/OpenRpcReferencePanel-BxEr49D9.mjs +1 -0
  13. package/dist/packem_shared/{Studio-qyqfHiQ3.mjs → Studio-BboteWG5.mjs} +1 -1
  14. package/dist/packem_shared/{StudioApp-BwOFVJBy.mjs → StudioApp-DkjIpaM2.mjs} +1 -1
  15. package/dist/packem_shared/diagram-export-panel-D5CVNJkp.mjs +2 -0
  16. package/dist/packem_shared/reference-view-CIHyURU6.mjs +13 -0
  17. package/dist/packem_shared/schema-diagram-C5oilX7l.mjs +2 -0
  18. package/dist/packem_shared/studio-CrypdTyE.mjs +2 -0
  19. package/dist/packem_shared/use-admin-spec-Bir7V68L.mjs +1 -0
  20. package/dist/standalone/{chunk-VTMPJ7GE.js → chunk-2BHVS5B6.js} +1 -1
  21. package/dist/standalone/chunk-2T4EFQNZ.js +1 -0
  22. package/dist/standalone/{chunk-BKGZMIF3.js → chunk-2TRJ53XJ.js} +1 -1
  23. package/dist/standalone/{chunk-PQWCYQGZ.js → chunk-2ZNM4ZPA.js} +1 -1
  24. package/dist/standalone/{chunk-DKTDJOYC.js → chunk-3G24A35Q.js} +1 -1
  25. package/dist/standalone/chunk-3QXSLIE4.js +1 -0
  26. package/dist/standalone/{chunk-SI6U7NIE.js → chunk-3UA5CP3H.js} +1 -1
  27. package/dist/standalone/chunk-4HQZTO56.js +1 -0
  28. package/dist/standalone/{chunk-2M6HDLZL.js → chunk-4KSBB2YH.js} +1 -1
  29. package/dist/standalone/{chunk-AVRH4ZBT.js → chunk-5CFKIQLP.js} +1 -1
  30. package/dist/standalone/{chunk-435IWCIW.js → chunk-5YKKSHIB.js} +1 -1
  31. package/dist/standalone/chunk-6QA34EWC.js +3 -0
  32. package/dist/standalone/{chunk-WB5OMGYR.js → chunk-AHNZKXCL.js} +1 -1
  33. package/dist/standalone/chunk-AQR5KUL6.js +1 -0
  34. package/dist/standalone/chunk-ATGO7XFL.js +1 -0
  35. package/dist/standalone/{chunk-GZT3A3DF.js → chunk-BBM53HFU.js} +1 -1
  36. package/dist/standalone/{chunk-KQQVI6ZS.js → chunk-BKARD4NH.js} +1 -1
  37. package/dist/standalone/chunk-BRIYEPXI.js +1 -0
  38. package/dist/standalone/{chunk-TESQ5ZIA.js → chunk-CZXBYHCA.js} +1 -1
  39. package/dist/standalone/{chunk-XNRRHFOY.js → chunk-EDCFVXZF.js} +1 -1
  40. package/dist/standalone/chunk-EEEEYLT7.js +1 -0
  41. package/dist/standalone/{chunk-CAHTJYC5.js → chunk-EOXUWPOY.js} +1 -1
  42. package/dist/standalone/{chunk-QROMT56V.js → chunk-F6SM55KU.js} +1 -1
  43. package/dist/standalone/chunk-FW6WOY3S.js +1 -0
  44. package/dist/standalone/chunk-GPFBLWA7.js +1 -0
  45. package/dist/standalone/chunk-GX2YM7MB.js +1 -0
  46. package/dist/standalone/chunk-H44HW3WV.js +1 -0
  47. package/dist/standalone/chunk-H6LZ3QM4.js +1 -0
  48. package/dist/standalone/chunk-HKWL6IY3.js +2 -0
  49. package/dist/standalone/chunk-HLTKKVDQ.js +1 -0
  50. package/dist/standalone/{chunk-2URQKGWU.js → chunk-HPFN7S7N.js} +1 -1
  51. package/dist/standalone/{chunk-GMS77BZD.js → chunk-IFJOYAEZ.js} +1 -1
  52. package/dist/standalone/chunk-JDAWPJ7U.js +1 -0
  53. package/dist/standalone/chunk-JF7BK6MO.js +1 -0
  54. package/dist/standalone/{chunk-OGFQ4LUG.js → chunk-JJB2KGI2.js} +1 -1
  55. package/dist/standalone/{chunk-OSOMPF2M.js → chunk-JUSVEJIQ.js} +1 -1
  56. package/dist/standalone/chunk-KTHHXUCF.js +1 -0
  57. package/dist/standalone/chunk-L4DT5US3.js +1 -0
  58. package/dist/standalone/{chunk-N3DFLRGG.js → chunk-LDEGPYES.js} +1 -1
  59. package/dist/standalone/{chunk-EJSI4PMU.js → chunk-LIOUCOP2.js} +1 -1
  60. package/dist/standalone/{chunk-FBPF5WYL.js → chunk-LNDCZ3M2.js} +1 -1
  61. package/dist/standalone/{chunk-ZIE7D6ZS.js → chunk-M45TEYKZ.js} +1 -1
  62. package/dist/standalone/chunk-MDUETXVR.js +1 -0
  63. package/dist/standalone/{chunk-RFNGDE33.js → chunk-NESDGS7F.js} +1 -1
  64. package/dist/standalone/{chunk-DEDFT62S.js → chunk-NPRI4BCN.js} +1 -1
  65. package/dist/standalone/{chunk-WZI2ZAPQ.js → chunk-OCUJO2PM.js} +1 -1
  66. package/dist/standalone/chunk-OVPFGNR6.js +1 -0
  67. package/dist/standalone/{chunk-GUD3ZG3Z.js → chunk-PRHWNGXX.js} +2 -2
  68. package/dist/standalone/{chunk-ZDPY27UY.js → chunk-Q7GZKFBT.js} +1 -1
  69. package/dist/standalone/{chunk-AAXLEHDI.js → chunk-QA6CZASY.js} +1 -1
  70. package/dist/standalone/chunk-R65X5YQK.js +1 -0
  71. package/dist/standalone/chunk-RG6VUBGP.js +1 -0
  72. package/dist/standalone/chunk-RJJ5J24X.js +1 -0
  73. package/dist/standalone/{chunk-AANB526D.js → chunk-T6JDEFHN.js} +1 -1
  74. package/dist/standalone/chunk-TDXV3OT5.js +1 -0
  75. package/dist/standalone/{chunk-GMHY2XTC.js → chunk-TYT4DBMD.js} +1 -1
  76. package/dist/standalone/chunk-U4EW2BWO.js +1 -0
  77. package/dist/standalone/chunk-U7WLCN6P.js +1 -0
  78. package/dist/standalone/{chunk-MEV2FUUD.js → chunk-V5EINW4G.js} +1 -1
  79. package/dist/standalone/chunk-VIFOIB6M.js +1 -0
  80. package/dist/standalone/chunk-VMXD6LRC.js +14 -0
  81. package/dist/standalone/chunk-WA3ZZ65C.js +1 -0
  82. package/dist/standalone/chunk-WIIQAPHM.js +1 -0
  83. package/dist/standalone/chunk-WX4HPONC.js +1 -0
  84. package/dist/standalone/{chunk-KVSSLKGK.js → chunk-XB6LUZP2.js} +1 -1
  85. package/dist/standalone/chunk-XLAJX4GC.js +1 -0
  86. package/dist/standalone/chunk-XXTB46YA.js +1 -0
  87. package/dist/standalone/{chunk-V3CZW3JB.js → chunk-XXVOKVXV.js} +1 -1
  88. package/dist/standalone/{chunk-IVKVGV4Y.js → chunk-Y4N7CB4T.js} +1 -1
  89. package/dist/standalone/{chunk-NPT4MKTL.js → chunk-YSVZF4HX.js} +1 -1
  90. package/dist/standalone/chunk-YZ2QZG3W.js +1 -0
  91. package/dist/standalone/chunk-ZEYT2NT5.js +1 -0
  92. package/dist/standalone/chunk-ZMF7QLKI.js +8 -0
  93. package/dist/standalone/{chunk-5AAHUEQD.js → chunk-ZSM5GPHG.js} +1 -1
  94. package/dist/standalone/studio.js +1 -1
  95. package/dist/styles.css +1 -1
  96. package/package.json +5 -5
  97. package/dist/packem_shared/ApiReferencePanel-CHoHM5ME.mjs +0 -1
  98. package/dist/packem_shared/OpenRpcReferencePanel-C8ctFJVm.mjs +0 -1
  99. package/dist/packem_shared/reference-view-DSeKRrUU.mjs +0 -13
  100. package/dist/packem_shared/schema-diagram-CQ4vn0CN.mjs +0 -2
  101. package/dist/packem_shared/studio-CwC7cOyC.mjs +0 -2
  102. package/dist/standalone/chunk-2XPVONGN.js +0 -1
  103. package/dist/standalone/chunk-3FBLWUXD.js +0 -1
  104. package/dist/standalone/chunk-4E6W2IDP.js +0 -14
  105. package/dist/standalone/chunk-5MGCPNPF.js +0 -1
  106. package/dist/standalone/chunk-5XPSGVCH.js +0 -1
  107. package/dist/standalone/chunk-6QPTJCQA.js +0 -1
  108. package/dist/standalone/chunk-6XKPY5RJ.js +0 -1
  109. package/dist/standalone/chunk-AHV5ROA3.js +0 -1
  110. package/dist/standalone/chunk-ATOGOQKD.js +0 -1
  111. package/dist/standalone/chunk-B5NQHH5M.js +0 -1
  112. package/dist/standalone/chunk-C3M6CCOV.js +0 -1
  113. package/dist/standalone/chunk-EUEWGG46.js +0 -1
  114. package/dist/standalone/chunk-HHUH2AEG.js +0 -1
  115. package/dist/standalone/chunk-HW33JZQP.js +0 -2
  116. package/dist/standalone/chunk-IHMGCHAA.js +0 -1
  117. package/dist/standalone/chunk-IVQFP5JU.js +0 -1
  118. package/dist/standalone/chunk-JNAZOBTV.js +0 -1
  119. package/dist/standalone/chunk-JSPFPDQ6.js +0 -1
  120. package/dist/standalone/chunk-KMLJSWTP.js +0 -1
  121. package/dist/standalone/chunk-KU7LFBUD.js +0 -1
  122. package/dist/standalone/chunk-KZ7UVPF6.js +0 -1
  123. package/dist/standalone/chunk-LB4Y3C7N.js +0 -1
  124. package/dist/standalone/chunk-MLFPYQNL.js +0 -1
  125. package/dist/standalone/chunk-NSCZ3RJ3.js +0 -1
  126. package/dist/standalone/chunk-OD7E3QLZ.js +0 -1
  127. package/dist/standalone/chunk-PLHA3OWK.js +0 -3
  128. package/dist/standalone/chunk-TDD2TZCN.js +0 -1
  129. package/dist/standalone/chunk-WMD6QHHD.js +0 -8
  130. package/dist/standalone/chunk-XIL7BLJ5.js +0 -1
  131. package/dist/standalone/chunk-Y5KK6IM3.js +0 -1
  132. package/dist/standalone/chunk-YPRQLCKF.js +0 -1
  133. package/dist/standalone/chunk-ZZ24NI6P.js +0 -1
  134. package/dist/standalone/chunk-ZZJE2GV3.js +0 -1
@@ -1,13 +0,0 @@
1
- import{c as P}from"react/compiler-runtime";import{useState as L,useEffectEvent as U,useEffect as ae,createContext as le,use as de}from"react";import{b as z,g as Y,f as ce,l as ue,c as fe,d as me,j as pe}from"./internal-Df43vQI0.mjs";import{SentIcon as he,Copy01Icon as ge,Search01Icon as xe}from"@hugeicons/core-free-icons";import{HugeiconsIcon as W}from"@hugeicons/react";import{I as be}from"./input-CXhxesPC.mjs";import{useT as J}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{B as q}from"./button-q0UYSmrn.mjs";import{jsx as i,jsxs as N,Fragment as ye}from"react/jsx-runtime";import{B as ve}from"./badge-r_5B4LHP.mjs";import{ShardInput as Ne}from"./ShardInput-C6mjgAh4.mjs";import{L as V}from"./label-DKFzyHq6.mjs";import{T as Se}from"./textarea--40GKAyz.mjs";import{LunoraError as we}from"@lunora/errors";import{useLunora as ke}from"@lunora/react";import{c as Q}from"./utils-bhneXptQ.mjs";const Ot=function(t,e,s){const r=P(15);let n;r[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},r[0]=n):n=r[0];const[o,l]=L(n);let a;r[1]!==e?(a=async()=>e(),r[1]=e,r[2]=a):a=r[2];const g=U(a);let d;r[3]!==s?(d=f=>s(f),r[3]=s,r[4]=d):d=r[4];const c=U(d);let u;r[5]!==c||r[6]!==g||r[7]!==t?(u=()=>{if(t!==void 0)return;let f=!1;return g().then(m=>(f||l(c(m)),m)).catch(m=>{f||l({kind:"error",message:z(m)})}),()=>{f=!0}},r[5]=c,r[6]=g,r[7]=t,r[8]=u):u=r[8];let h;r[9]!==t?(h=[t],r[9]=t,r[10]=h):h=r[10],ae(u,h);let p;return r[11]!==s||r[12]!==o||r[13]!==t?(p=t===void 0?o:s(t),r[11]=s,r[12]=o,r[13]=t,r[14]=p):p=r[14],p},Oe=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",Z=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},F=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>F(e)).join(" | "):t.type==="array"?`array<${F(t.items)}>`:t.type??"any",$e=t=>{const e=Z(t);return e!==void 0?t.type??Oe(e[0]):F(t)},Te=t=>{const e=Z(t);return e===void 0?void 0:e.map(s=>JSON.stringify(s)).join(" | ")},Ee=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const s=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const r=e.length>(s?2:1);return s||r?e.join(" "):void 0},Ce=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},D=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return D(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[s,r]of Object.entries(t.properties??{}))e[s]=D(r);return e}case"string":return"";default:return null}},K=t=>{const e=P(7),{label:s,value:r}=t;let n;e[0]!==s?(n=i("span",{className:"text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let o;e[2]!==r?(o=i("span",{className:"text-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==n||e[5]!==o?(l=N("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,o]}),e[4]=n,e[5]=o,e[6]=l):l=e[6],l},Ae=t=>{const e=P(40),{name:s,required:r,schema:n}=t,o=J();let l;e[0]!==n?(l=Ee(n),e[0]=n,e[1]=l):l=e[1];const a=l;let g;e[2]!==n?(g=Te(n),e[2]=n,e[3]=g):g=e[3];const d=g,c=n["x-lunora-table"],u=n.format!==void 0||a!==void 0||d!==void 0||c!==void 0;let h;e[4]!==n?(h=Ce(n),e[4]=n,e[5]=h):h=e[5];const p=h,f=r?"*":"?";let m;e[6]!==f?(m=i("span",{className:"text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let v;e[8]!==s||e[9]!==m?(v=N("span",{className:"font-mono text-foreground",children:[s,m]}),e[8]=s,e[9]=m,e[10]=v):v=e[10];let w;e[11]!==n?(w=$e(n),e[11]=n,e[12]=w):w=e[12];let x;e[13]!==w?(x=i("span",{className:"font-mono text-muted-foreground",children:w}),e[13]=w,e[14]=x):x=e[14];let b;e[15]!==v||e[16]!==x?(b=N("div",{className:"flex items-baseline gap-2",children:[v,x]}),e[15]=v,e[16]=x,e[17]=b):b=e[17];let y;e[18]!==n.description?(y=n.description!==void 0&&i("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=y):y=e[19];let S;e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==n.format||e[24]!==o||e[25]!==d?(S=u&&N("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&i(K,{label:o("Format"),value:n.format}),a!==void 0&&i(K,{label:o("Range"),value:a}),d!==void 0&&i(K,{label:o("Value in"),value:d}),c!==void 0&&i(K,{label:o("relation"),value:c})]}),e[20]=u,e[21]=a,e[22]=c,e[23]=n.format,e[24]=o,e[25]=d,e[26]=S):S=e[26];let O;e[27]!==y||e[28]!==S||e[29]!==b?(O=N("div",{className:"flex flex-col gap-1 py-2",children:[b,y,S]}),e[27]=y,e[28]=S,e[29]=b,e[30]=O):O=e[30];const k=O;if(p===void 0){let $;return e[31]!==k?($=i("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=$):$=e[32],$}let T;e[33]!==k?(T=i("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=T):T=e[34];let A;e[35]!==p?(A=i("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:i(ee,{schema:p})}),e[35]=p,e[36]=A):A=e[36];let E;return e[37]!==T||e[38]!==A?(E=N("details",{className:"border-b border-border/50 last:border-b-0",children:[T,A]}),e[37]=T,e[38]=A,e[39]=E):E=e[39],E},ee=t=>{const e=P(7),{schema:s}=t;let r;e[0]!==s.required?(r=new Set(s.required),e[0]=s.required,e[1]=r):r=e[1];const n=r;let o;e[2]!==s.properties?(o=Object.entries(s.properties??{}),e[2]=s.properties,e[3]=o):o=e[3];const l=o;let a;return e[4]!==n||e[5]!==l?(a=i("div",{className:"flex flex-col",children:l.map(g=>{const[d,c]=g;return i(Ae,{name:d,required:n.has(d),schema:c},d)})}),e[4]=n,e[5]=l,e[6]=a):a=e[6],a},G=t=>{const e=P(10),{schema:s,testId:r}=t;if(s?.type!=="object"||Object.keys(s.properties??{}).length===0){let l;e[0]!==s?(l=F(s),e[0]=s,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==r?(a=i("p",{className:"font-mono text-xs text-muted-foreground","data-testid":r,children:l}),e[2]=l,e[3]=r,e[4]=a):a=e[4],a}let n;e[5]!==s?(n=i(ee,{schema:s}),e[5]=s,e[6]=n):n=e[6];let o;return e[7]!==n||e[8]!==r?(o=i("div",{className:"text-xs","data-testid":r,children:n}),e[7]=n,e[8]=r,e[9]=o):o=e[9],o},Re=["curl","javascript","lunora"],je={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Ie=t=>`api.${t.replaceAll(/[/:]/g,".")}`,Pe=t=>{const e=D(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Le=(t,e,s)=>{const r=`${s}${e.httpPath}`,n=JSON.stringify(Pe(e),void 0,2),o=JSON.stringify(D(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const l=e.method!=="GET"&&e.method!=="HEAD",a=[`curl -X ${e.method} ${JSON.stringify(r)}`];return l&&a.push(' -H "Content-Type: application/json"',` -d '${n}'`),a.join(` \\
2
- `)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
3
- import { api } from "./_generated/api";
4
-
5
- const client = useLunora();
6
- await client.${e.kind??"query"}(${Ie(e.functionPath)}, ${o});`;default:{const a=e.method!=="GET"&&e.method!=="HEAD"?`{
7
- method: ${JSON.stringify(e.method)},
8
- headers: { "Content-Type": "application/json" },
9
- body: JSON.stringify(${n}),
10
- }`:`{ method: ${JSON.stringify(e.method)} }`;return`const response = await fetch(${JSON.stringify(r)}, ${a});
11
- const data = await response.json();`}}},_e=t=>{const e=P(24),{operation:s,server:r}=t,n=J(),[o,l]=L("curl");let a;e[0]!==s||e[1]!==o||e[2]!==r?(a=Le(o,s,r),e[0]=s,e[1]=o,e[2]=r,e[3]=a):a=e[3];const g=a;let d;e[4]!==g?(d=()=>{Y(g)},e[4]=g,e[5]=d):d=e[5];const c=d;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{l(y.currentTarget.dataset.sample)},e[6]=u):u=e[6];const h=u;let p;e[7]!==o?(p=Re.map(y=>i("button",{"aria-selected":o===y,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":y,"data-testid":`api-sample-${y}`,onClick:h,role:"tab",type:"button",children:je[y]},y)),e[7]=o,e[8]=p):p=e[8];let f;e[9]!==p?(f=i("div",{className:"flex gap-1",role:"tablist",children:p}),e[9]=p,e[10]=f):f=e[10];let m;e[11]!==n?(m=n("Copy"),e[11]=n,e[12]=m):m=e[12];let v;e[13]!==c||e[14]!==m?(v=i(q,{"data-testid":"api-sample-copy",onClick:c,size:"xs",type:"button",variant:"ghost",children:m}),e[13]=c,e[14]=m,e[15]=v):v=e[15];let w;e[16]!==f||e[17]!==v?(w=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[f,v]}),e[16]=f,e[17]=v,e[18]=w):w=e[18];let x;e[19]!==g?(x=i("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:g}),e[19]=g,e[20]=x):x=e[20];let b;return e[21]!==w||e[22]!==x?(b=N("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[w,x]}),e[21]=w,e[22]=x,e[23]=b):b=e[23],b},Be={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},Me=t=>{switch(t.toUpperCase()){case"DELETE":return"red";case"GET":return"emerald";case"PATCH":return"orange";case"POST":return"blue";case"PUT":return"orange";default:return"neutral"}},Je=t=>{switch(t){case"action":return"violet";case"mutation":return"orange";case"query":return"emerald";default:return"neutral"}},H=t=>{const e=P(7),{kind:s,method:r,testId:n}=t;let o;e[0]!==s||e[1]!==r?(o=s??r.toUpperCase(),e[0]=s,e[1]=r,e[2]=o):o=e[2];const l=o,a=s===void 0?Me(r):Je(s),g=`${Be[a]} font-mono text-[10px] tracking-wide uppercase`;let d;return e[3]!==l||e[4]!==g||e[5]!==n?(d=i(ve,{className:g,"data-testid":n,variant:"ghost",children:l}),e[3]=l,e[4]=g,e[5]=n,e[6]=d):d=e[6],d},te=t=>t.startsWith("2")?"text-emerald-600 dark:text-emerald-400":t==="default"||t.startsWith("4")||t.startsWith("5")?"text-red-600 dark:text-red-400":"text-muted-foreground",re=t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground",De=new Set([" ",`
12
- `,"\r"]),X=" ",Ke=t=>{let e="";for(const n of t)De.has(n)||(e+=n);let s=0,r=e.length;for(;s<r&&(e[s]??"")<=X;)s+=1;for(;r>s&&(e[r-1]??"")<=X;)r-=1;return e.slice(s,r)},Fe=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,ze=(t,e)=>{const s=globalThis.location?.origin??"",r=e===""?s:e,n=Ke(t);if(r===""){if(Fe.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}const o=new URL(n,r);if(o.origin!==new URL(r).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${o.origin} is not ${r})`);return o.toString()},We=async(t,e,s,r)=>{const n=t.method!=="GET"&&t.method!=="HEAD",o=ze(t.httpPath,s),a=await(await fetch(o,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...r===null||r===""?{}:{authorization:`Bearer ${r}`}},method:t.method})).text();try{return JSON.parse(a)}catch{return a}},qe=t=>JSON.stringify(D(t.argsSchema)??{},void 0,2),se=le(null),ne=()=>{const t=de(se);if(t===null)throw new we("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},He=({children:t,operation:e})=>{const s=J(),r=ke(),[n,o]=L(()=>qe(e)),[l,a]=L(""),[g,d]=L("idle"),[c,u]=L(void 0),[h,p]=L(null),[f,m]=L(null),v=async()=>{let b;try{b=n.trim()===""?{}:JSON.parse(n)}catch(S){d("error"),u(void 0),m(null),p(s("Invalid JSON args: {message}",{message:z(S)}));return}d("running"),p(null);const y=performance.now();try{const S=await(e.functionPath===void 0?We(e,b,r.url,r.getAuthToken()):ue(r,e.kind,fe(e.functionPath),b,me(l)));u(S),m(Math.round(performance.now()-y)),d("success")}catch(S){u(void 0),m(Math.round(performance.now()-y)),p(z(S)),d("error")}};return i(se,{value:{argsText:n,durationMs:f,error:h,operation:e,response:c,send:()=>{ce(v())},setArgsText:o,setShardKey:a,shardKey:l,status:g},children:t})},Ue=()=>{const t=P(48),e=J(),{argsText:s,operation:r,send:n,setArgsText:o,setShardKey:l,shardKey:a,status:g}=ne();let d;t[0]!==o?(d=C=>{o(C.target.value)},t[0]=o,t[1]=d):d=t[1];const c=d;let u;t[2]!==n?(u=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),n())},t[2]=n,t[3]=u):u=t[3];const h=u,p=g==="running";let f;t[4]!==r.kind||t[5]!==r.method?(f=i(H,{kind:r.kind,method:r.method,testId:"api-try-method"}),t[4]=r.kind,t[5]=r.method,t[6]=f):f=t[6];const m=r.functionPath??r.httpPath;let v;t[7]!==m?(v=i("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:m}),t[7]=m,t[8]=v):v=t[8];const w=p?"animate-pulse":void 0;let x;t[9]!==w?(x=i(W,{className:w,icon:he,strokeWidth:2}),t[9]=w,t[10]=x):x=t[10];let b;t[11]!==p||t[12]!==e?(b=e(p?"Sending…":"Send"),t[11]=p,t[12]=e,t[13]=b):b=t[13];let y;t[14]!==p||t[15]!==n||t[16]!==x||t[17]!==b?(y=N(q,{"data-testid":"api-try-send",disabled:p,onClick:n,size:"sm",type:"button",children:[x,b]}),t[14]=p,t[15]=n,t[16]=x,t[17]=b,t[18]=y):y=t[18];let S;t[19]!==f||t[20]!==v||t[21]!==y?(S=N("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[f,v,y]}),t[19]=f,t[20]=v,t[21]=y,t[22]=S):S=t[22];let O;t[23]!==e?(O=e("Arguments (JSON)"),t[23]=e,t[24]=O):O=t[24];let k;t[25]!==O?(k=i(V,{htmlFor:"api-try-args",children:O}),t[25]=O,t[26]=k):k=t[26];let T;t[27]!==s?(T=s.split(`
13
- `),t[27]=s,t[28]=T):T=t[28];const A=Math.min(12,Math.max(3,T.length));let E;t[29]!==s||t[30]!==c||t[31]!==h||t[32]!==A?(E=i(Se,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:c,onKeyDown:h,rows:A,spellCheck:!1,value:s}),t[29]=s,t[30]=c,t[31]=h,t[32]=A,t[33]=E):E=t[33];let $;t[34]!==k||t[35]!==E?($=N("div",{className:"flex flex-col gap-1.5",children:[k,E]}),t[34]=k,t[35]=E,t[36]=$):$=t[36];let R;t[37]!==r.functionPath||t[38]!==l||t[39]!==a||t[40]!==e?(R=r.functionPath!==void 0&&N("div",{className:"flex flex-col gap-1.5",children:[i(V,{htmlFor:"shard-input",children:e("Shard key (optional)")}),i(Ne,{id:"shard-input",onChange:l,testId:"shard-input",value:a})]}),t[37]=r.functionPath,t[38]=l,t[39]=a,t[40]=e,t[41]=R):R=t[41];let j;t[42]!==$||t[43]!==R?(j=N("div",{className:"flex flex-col gap-3 p-3",children:[$,R]}),t[42]=$,t[43]=R,t[44]=j):j=t[44];let I;return t[45]!==j||t[46]!==S?(I=N("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[S,j]}),t[45]=j,t[46]=S,t[47]=I):I=t[47],I},Ve=t=>{const e=P(51),{operation:s}=t,r=J(),n=`api-operation-${s.operationId}`,o=s.key;let l;e[0]!==s.kind||e[1]!==s.method?(l=i(H,{kind:s.kind,method:s.method,testId:"api-operation-method"}),e[0]=s.kind,e[1]=s.method,e[2]=l):l=e[2];const a=s.functionPath??s.httpPath;let g;e[3]!==a?(g=i("code",{className:"truncate font-mono text-xs text-muted-foreground",children:a}),e[3]=a,e[4]=g):g=e[4];let d;e[5]!==l||e[6]!==g?(d=N("div",{className:"flex items-center gap-2",children:[l,g]}),e[5]=l,e[6]=g,e[7]=d):d=e[7];let c;e[8]!==s.title?(c=i("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:s.title}),e[8]=s.title,e[9]=c):c=e[9];let u;e[10]!==s.description?(u=s.description!==void 0&&i("p",{className:"text-sm text-muted-foreground",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==d||e[13]!==c||e[14]!==u?(h=N("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[d,c,u]}),e[12]=d,e[13]=c,e[14]=u,e[15]=h):h=e[15];let p;e[16]!==r?(p=r("Try it"),e[16]=r,e[17]=p):p=e[17];let f;e[18]!==p?(f=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:p}),e[18]=p,e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i(Ue,{}),e[20]=m):m=e[20];let v;e[21]!==f?(v=N("section",{className:"flex flex-col gap-2",children:[f,m]}),e[21]=f,e[22]=v):v=e[22];let w;e[23]!==r?(w=r("Request arguments"),e[23]=r,e[24]=w):w=e[24];let x;e[25]!==w?(x=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[25]=w,e[26]=x):x=e[26];let b;e[27]!==s.argsSchema?(b=i(G,{schema:s.argsSchema,testId:"api-operation-args"}),e[27]=s.argsSchema,e[28]=b):b=e[28];let y;e[29]!==x||e[30]!==b?(y=N("section",{className:"flex flex-col gap-2",children:[x,b]}),e[29]=x,e[30]=b,e[31]=y):y=e[31];let S;e[32]!==r?(S=r("Response body"),e[32]=r,e[33]=S):S=e[33];let O;e[34]!==S?(O=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:S}),e[34]=S,e[35]=O):O=e[35];let k;if(e[36]!==s.responses||e[37]!==r){let E;e[39]!==r?(E=$=>N("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[N("div",{className:"flex items-center justify-between gap-2",children:[N("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${te($.status)}`,children:[i("span",{className:`size-1.5 rounded-full ${re($.status)}`}),$.status]}),$.schema!==void 0&&i("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r("application/json")})]}),$.description!==void 0&&i("p",{className:"text-xs text-muted-foreground",children:$.description}),$.schema!==void 0&&i(G,{schema:$.schema,testId:`api-response-${$.status}`})]},$.status),e[39]=r,e[40]=E):E=e[40],k=s.responses.map(E),e[36]=s.responses,e[37]=r,e[38]=k}else k=e[38];let T;e[41]!==O||e[42]!==k?(T=N("section",{className:"flex flex-col gap-3",children:[O,k]}),e[41]=O,e[42]=k,e[43]=T):T=e[43];let A;return e[44]!==s.key||e[45]!==n||e[46]!==v||e[47]!==y||e[48]!==T||e[49]!==h?(A=N("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[h,v,y,T]},o),e[44]=s.key,e[45]=n,e[46]=v,e[47]=y,e[48]=T,e[49]=h,e[50]=A):A=e[50],A},Ge={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Xe=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Ye=/^\s*:/,Qe=(t,e,s)=>s.startsWith('"')?Ye.test(t.slice(e))?"key":"string":s==="true"||s==="false"||s==="null"?"boolean":"number",Ze=t=>{const e=[];let s=0;for(const r of t.matchAll(Xe)){const{index:n}=r,o=r[0],l=n+o.length;n>s&&e.push({kind:"plain",start:s,text:t.slice(s,n)}),e.push({kind:Qe(t,l,o),start:n,text:o}),s=l}return s<t.length&&e.push({kind:"plain",start:s,text:t.slice(s)}),e},et=t=>{const e=P(4),{code:s}=t;let r;e[0]!==s?(r=Ze(s).map(tt),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=i(ye,{children:r}),e[2]=r,e[3]=n):n=e[3],n};function tt(t){return i("span",{className:Ge[t.kind],children:t.text},t.start)}const oe="__live__",rt=t=>t.schema===void 0?"":JSON.stringify(D(t.schema),void 0,2),st=(t,e,s)=>s?t??"":e===void 0?"":JSON.stringify(e,pe,2),nt=t=>{const e=P(18),{active:s,running:r,showError:n}=t,o=J();if(r){let u;e[0]!==o?(u=o("Sending…"),e[0]=o,e[1]=u):u=e[1];let h;return e[2]!==u?(h=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:u}),e[2]=u,e[3]=h):h=e[3],h}if(s===void 0||s.body===""){let u;e[4]!==s?.live||e[5]!==o?(u=s?.live===!0?o("Send a request to see the response."):o("No example for this response."),e[4]=s?.live,e[5]=o,e[6]=u):u=e[6];let h;return e[7]!==u?(h=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:u}),e[7]=u,e[8]=h):h=e[8],h}const l=n&&"text-destructive";let a;e[9]!==l?(a=Q("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",l),e[9]=l,e[10]=a):a=e[10];const g=n?"api-response-error":"api-response-body";let d;e[11]!==s.body||e[12]!==n?(d=n?s.body:i(et,{code:s.body}),e[11]=s.body,e[12]=n,e[13]=d):d=e[13];let c;return e[14]!==a||e[15]!==g||e[16]!==d?(c=i("pre",{className:a,"data-testid":g,children:d}),e[14]=a,e[15]=g,e[16]=d,e[17]=c):c=e[17],c},ot=({durationMs:t,error:e,failed:s,operation:r,ran:n,response:o,t:l})=>{const a=r.responses.map(d=>({body:rt(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:st(e,o,s),durationMs:t,id:oe,label:l("Live"),live:!0,status:s?"error":"200"},...a]:a},it=()=>{const t=P(19),e=J(),{durationMs:s,error:r,operation:n,response:o,status:l}=ne(),a=l==="running",g=l==="error",d=l==="success"||g,c=ot({durationMs:s,error:r,failed:g,operation:n,ran:d,response:o,t:e}),u=d?oe:c.find(at)?.id??c[0]?.id??"",[h,p]=L(null),f=c.find(C=>C.id===(h??u))??c[0];let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=C=>{const{id:_}=C.currentTarget.dataset;_!==void 0&&p(_)},t[0]=m):m=t[0];const v=m,w=()=>{f!==void 0&&Y(f.body)},x=f?.live===!0?f.durationMs:null,b=f?.live===!0&&f.status==="error",y="flex min-h-0 flex-col rounded-xl border border-border bg-card",S="api-response-panel";let O;t[1]!==e?(O=e("Response"),t[1]=e,t[2]=O):O=t[2];let k;t[3]!==O?(k=i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O}),t[3]=O,t[4]=k):k=t[4];const T=x!==null&&i("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:x})}),A=f!==void 0&&f.body!==""&&i(q,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:w,size:"icon-xs",type:"button",variant:"ghost",children:i(W,{icon:ge,strokeWidth:2})});let E;t[5]!==T||t[6]!==A?(E=N("div",{className:"flex items-center gap-2",children:[T,A]}),t[5]=T,t[6]=A,t[7]=E):E=t[7];let $;t[8]!==k||t[9]!==E?($=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,E]}),t[8]=k,t[9]=E,t[10]=$):$=t[10];const R=c.length>0&&i("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:c.map(C=>{const _=C.id===f?.id;return N("button",{"aria-selected":_,className:Q("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",_?te(C.status):"text-muted-foreground"),"data-id":C.id,"data-testid":C.live?"api-response-tab-live":`api-response-tab-${C.status}`,onClick:v,role:"tab",type:"button",children:[i("span",{className:`size-1.5 rounded-full ${re(C.status)}`}),C.label]},C.id)})});let j;t[11]!==f||t[12]!==a||t[13]!==b?(j=i(nt,{active:f,running:a,showError:b}),t[11]=f,t[12]=a,t[13]=b,t[14]=j):j=t[14];let I;return t[15]!==j||t[16]!==$||t[17]!==R?(I=N("div",{className:y,"data-testid":S,children:[$,R,j]}),t[15]=j,t[16]=$,t[17]=R,t[18]=I):I=t[18],I};function at(t){return t.status.startsWith("2")}const lt=(t,e)=>{const s=e.trim().toLowerCase();return s===""?t:t.map(r=>({...r,operations:r.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(s))})).filter(r=>r.operations.length>0)},$t=t=>{const e=P(53),{model:s}=t,r=J(),n=s.groups[0]?.operations[0]?.key??"",[o,l]=L(n),[a,g]=L("");let d;e[0]!==n||e[1]!==s.operationByKey||e[2]!==o?(d=s.operationByKey.get(o)??s.operationByKey.get(n),e[0]=n,e[1]=s.operationByKey,e[2]=o,e[3]=d):d=e[3];const c=d;let u,h,p,f,m,v,w,x,b,y;if(e[4]!==a||e[5]!==s.groups||e[6]!==s.server||e[7]!==c?.key||e[8]!==r){u=lt(s.groups,a);let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=M=>{const{key:B}=M.currentTarget.dataset;B!==void 0&&l(B)},e[19]=E):E=e[19];const $=E;let R;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=M=>{g(M.target.value)},e[20]=R):R=e[20];const j=R;h=s.server??"",b="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",y="api-reference",e[21]!==r?(m=r("API operations"),e[21]=r,e[22]=m):m=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",w="api-reference-nav";let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=i(W,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:xe,strokeWidth:2}),e[23]=I):I=e[23];let C;e[24]!==r?(C=r("Filter operations"),e[24]=r,e[25]=C):C=e[25],e[26]!==a||e[27]!==C?(x=i("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:N("div",{className:"relative",children:[I,i(be,{className:"h-7 pl-7","data-testid":"api-filter",onChange:j,placeholder:C,value:a})]})}),e[26]=a,e[27]=C,e[28]=x):x=e[28],p="flex flex-col gap-4 p-2";let _;e[29]!==c?.key||e[30]!==r?(_=M=>N("div",{className:"flex flex-col gap-1",children:[N("div",{className:"flex items-center justify-between px-2",children:[i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M.name||r("(root)")}),i("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:M.operations.length})]}),M.operations.map(B=>{const ie=B.key===c?.key;return N("button",{"aria-current":ie?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":B.key,"data-testid":`api-nav-${B.operationId}`,onClick:$,type:"button",children:[i("span",{className:"truncate",children:B.summary}),i(H,{kind:B.kind,method:B.method})]},B.key)})]},M.name),e[29]=c?.key,e[30]=r,e[31]=_):_=e[31],f=u.map(_),e[4]=a,e[5]=s.groups,e[6]=s.server,e[7]=c?.key,e[8]=r,e[9]=u,e[10]=h,e[11]=p,e[12]=f,e[13]=m,e[14]=v,e[15]=w,e[16]=x,e[17]=b,e[18]=y}else u=e[9],h=e[10],p=e[11],f=e[12],m=e[13],v=e[14],w=e[15],x=e[16],b=e[17],y=e[18];let S;e[32]!==u.length||e[33]!==r?(S=u.length===0&&i("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:r("No operations match your filter.")}),e[32]=u.length,e[33]=r,e[34]=S):S=e[34];let O;e[35]!==S||e[36]!==p||e[37]!==f?(O=N("div",{className:p,children:[f,S]}),e[35]=S,e[36]=p,e[37]=f,e[38]=O):O=e[38];let k;e[39]!==O||e[40]!==m||e[41]!==v||e[42]!==w||e[43]!==x?(k=N("nav",{"aria-label":m,className:v,"data-testid":w,children:[x,O]}),e[39]=O,e[40]=m,e[41]=v,e[42]=w,e[43]=x,e[44]=k):k=e[44];let T;e[45]!==c||e[46]!==h?(T=c===void 0?i("div",{className:"lg:col-span-2"}):N(He,{operation:c,children:[i("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:i(Ve,{operation:c})}),N("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[i(_e,{operation:c,server:h}),i(it,{})]})]},c.key),e[45]=c,e[46]=h,e[47]=T):T=e[47];let A;return e[48]!==k||e[49]!==T||e[50]!==b||e[51]!==y?(A=N("div",{className:b,"data-testid":y,children:[k,T]}),e[48]=k,e[49]=T,e[50]=b,e[51]=y,e[52]=A):A=e[52],A};export{$t as R,Ot as u};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- import{c as v}from"react/compiler-runtime";import{Download01Icon as ne}from"@hugeicons/core-free-icons";import{HugeiconsIcon as se}from"@hugeicons/react";import{Handle as B,Position as G,getNodesBounds as re,getViewportForBounds as ae,useNodesState as le,useEdgesState as ie,ReactFlow as ce,Background as de,Panel as M,Controls as me,MiniMap as pe,useNodes as ue,useReactFlow as U,useNodesInitialized as fe}from"@xyflow/react";import{useState as k,useMemo as _,useRef as ge,useEffect as D}from"react";import{S as he,T as N}from"./storage-tier-C2mKwYRj.mjs";import{B as S}from"./badge-r_5B4LHP.mjs";import{B as j}from"./button-q0UYSmrn.mjs";import{d as be,D as xe,c as Ne,b as C}from"./dropdown-menu-jLZenfWH.mjs";import{I as ye}from"./input-CXhxesPC.mjs";import{useT as T}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{f as L}from"./internal-Df43vQI0.mjs";import{c as y}from"./utils-bhneXptQ.mjs";import{jsx as i,jsxs as f}from"react/jsx-runtime";import{LunoraError as ve}from"@lunora/errors";import{toBlob as we,toSvg as Se}from"html-to-image";function Ee(o){const e=v(10);let t,a,s;e[0]!==o?({className:t,selected:s,...a}=o,e[0]=o,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const r=s===!0?"":void 0;let n;e[4]!==t?(n=y("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=n):n=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l=i("div",{"data-slot":"base-node","data-selected":r,className:n,...a}),e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],l}function Te(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}function $e(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex flex-col",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}const F=o=>{const e=o.ref===void 0?o.type:`${o.type} → ${o.ref}`;return o.optional===!0?`${e}?`:e},_e=o=>{const e=v(22),{data:t,selected:a}=o,s=T();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==s?(r=t.loadError===!0?i("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:s("Columns unavailable")}):i("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=s,e[3]=r):r=e[3];const n=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=i("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=i("span",{className:"ms-auto",children:i(he,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let c;e[8]!==d||e[9]!==m?(c=f(Te,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=c):c=e[10];let p;e[11]!==t.columns||e[12]!==t.label||e[13]!==n?(p=t.columns.length===0?n:t.columns.map(g=>f("div",{className:y("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",g.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${g.name}`,children:[i(B,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Left,type:"target"}),i("span",{className:"truncate font-mono",title:g.name,children:g.name}),g.pk===!0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),g.ref!==void 0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),i("span",{className:"ms-auto truncate text-muted-foreground",title:F(g),children:F(g)}),i(B,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Right,type:"source"})]},g.name)),e[11]=t.columns,e[12]=t.label,e[13]=n,e[14]=p):p=e[14];let u;e[15]!==p?(u=i($e,{children:p}),e[15]=p,e[16]=u):u=e[16];let b;return e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=f(Ee,{className:"w-64 overflow-hidden","data-testid":l,selected:a,children:[c,u]}),e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],b},x=1920,E=1080,K=32,R=(o,e)=>{const t=globalThis.document.createElement("a");t.href=o,t.download=e,globalThis.document.body.append(t),t.click(),t.remove()},Ce=(o,e,t="schema-diagram.json")=>{const a={edges:e,exportedAt:new Date().toISOString(),nodes:o},s=JSON.stringify(a,void 0,2),r=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));R(r,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(r)},0)},P=(o,e,t,a)=>{const s=re(o),{x:r,y:n,zoom:l}=ae(s,e,t,.1,2,a);return{transform:[r,n,l],zoom:l}},Me=async(o,e,t="schema-diagram.png")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await we(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});if(l===null)throw new ve("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(l);R(d,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},ke=async(o,e,t="schema-diagram.svg")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await Se(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});R(l,t)},W=256,q=112,I=36,w=24,De=480,Le=1.4,Re=o=>{const e=Math.max(1,Math.round(Math.sqrt(Le*o/(W+q))));return Math.max(De,o/e)},Ae=38,Oe=28,z=o=>Ae+Math.max(1,o)*Oe,He=(o,e)=>{const t=new Map;for(const n of o)t.set(n,[]);for(const n of e)n.to!==n.from&&t.has(n.from)&&t.has(n.to)&&t.get(n.from)?.push(n.to);const a=new Map,s=new Set,r=n=>{const l=a.get(n);if(l!==void 0)return l;if(s.has(n))return 0;s.add(n);let d=0;for(const m of t.get(n)??[])d=Math.max(d,r(m)+1);return s.delete(n),a.set(n,d),d};for(const n of o)r(n);return a},Be=(o,e,t)=>{const a=He(o,e),s=new Map;for(const m of o){const c=a.get(m)??0,p=s.get(c);p===void 0?s.set(c,[m]):p.push(m)}const r=o.reduce((m,c)=>m+z(t.get(c)??0)+I,0),n=Re(r),l=[];let d=0;for(const m of[...s.keys()].toSorted((c,p)=>c-p)){let c=0,p=w;for(const u of s.get(m)??[]){const b=z(t.get(u)??0);p>w&&p+b>n&&(c+=1,p=w),l.push({name:u,x:w+(d+c)*(W+q),y:p}),p+=b+I}d+=c+1}return l},Ge={databaseSchema:_e},J={backgroundColor:N.shard.color},V={backgroundColor:N.global.color},je={global:!0,shard:!0},Fe={},Ie=o=>{const e=o.find(t=>t.pk===!0)?.name;return e!==void 0?e:o.some(t=>t.name==="_id")?"_id":o.some(t=>t.name==="id")?"id":o[0]?.name??"_id"},Y=o=>o.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),ze=(o,e,t)=>{const a=o.map(l=>l.name),s=new Map(o.map(l=>[l.name,l.columns.length])),r=Be(a,Y(o),s),n=new Map(o.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const c=n.get(l);return c===void 0?[]:[{className:t[l],data:{columns:c.columns,label:l,loadError:e,tier:c.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Ue=o=>{const e=new Map(o.map(t=>[t.name,t.columns]));return Y(o).flatMap(t=>{const a=e.get(t.to)??[],s=e.get(t.from)??[],r=Ie(a);return!a.some(n=>n.name===r)||!s.some(n=>n.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ke=()=>{const o=v(15),e=T();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),o[0]=t):t=o[0];let a;o[1]===Symbol.for("react.memo_cache_sentinel")?(a=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]}),o[1]=a):a=o[1];let s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),o[2]=s):s=o[2];let r;o[3]!==e?(r=e("Primary key"),o[3]=e,o[4]=r):r=o[4];let n;o[5]!==r?(n=f("span",{className:"flex items-center gap-1",children:[s,r]}),o[5]=r,o[6]=n):n=o[6];let l;o[7]===Symbol.for("react.memo_cache_sentinel")?(l=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),o[7]=l):l=o[7];let d;o[8]!==e?(d=e("Foreign key"),o[8]=e,o[9]=d):d=o[9];let m;o[10]!==d?(m=f("span",{className:"flex items-center gap-1",children:[l,d]}),o[10]=d,o[11]=m):m=o[11];let c;return o[12]!==n||o[13]!==m?(c=f("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,a,n,m]}),o[12]=n,o[13]=m,o[14]=c):c=o[14],c},Pe=12,We=o=>{const e=v(9),{containerRef:t,seedKey:a}=o,s=fe(),{fitView:r}=U();let n;e[0]!==t||e[1]!==r||e[2]!==s?(n=()=>{if(!s)return;const d=()=>{L(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const c=new ResizeObserver(()=>{d()});return c.observe(m),()=>{c.disconnect()}},e[0]=t,e[1]=r,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==s||e[7]!==a?(l=[t,r,s,a],e[4]=t,e[5]=r,e[6]=s,e[7]=a,e[8]=l):l=e[8],D(n,l),null},qe=({containerRef:o,testIdPrefix:e})=>{const t=T(),a=ue(),{getEdges:s}=U(),[r,n]=k(null),l=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("png");try{await Me(u,a,`${e}-schema-diagram.png`)}finally{n(null)}}},d=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("svg");try{await ke(u,a,`${e}-schema-diagram.svg`)}finally{n(null)}}},m=()=>{n("json");try{Ce(a,s(),`${e}-schema-diagram.json`)}finally{n(null)}},c=()=>{L(l())},p=()=>{L(d())};return i(M,{position:"top-right",children:f(be,{children:[f(xe,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${e}-export-trigger`,disabled:r!==null,children:[i(se,{className:"size-3.5",icon:ne,strokeWidth:2}),t("Export")]}),f(Ne,{align:"end",children:[i(C,{"data-testid":`${e}-export-png`,disabled:r!==null,onClick:c,children:t("PNG")}),i(C,{"data-testid":`${e}-export-svg`,disabled:r!==null,onClick:p,children:t("SVG")}),i(C,{"data-testid":`${e}-export-json`,disabled:r!==null,onClick:m,children:t("JSON")})]})]})})},dt=({columnsError:o,fill:e=!1,nodeClasses:t,tables:a,testIdPrefix:s})=>{const r=T(),[n,l]=k(je),[d,m]=k(""),c=_(()=>{const h=d.trim().toLowerCase();return a.filter(H=>n[H.tier]&&H.name.toLowerCase().includes(h))},[a,n,d]),p=_(()=>ze(c,o??!1,t??Fe),[c,o,t]),u=_(()=>Ue(c),[c]),b=c.map(h=>h.name).join(","),[g,A,Q]=le(p),[Z,O,X]=ie(u),$=ge(null);D(()=>{A(p)},[p,A]),D(()=>{O(u)},[u,O]);const ee=h=>{m(h.target.value)},te=()=>{l(h=>({...h,shard:!h.shard}))},oe=()=>{l(h=>({...h,global:!h.global}))};return a.length===0?i("section",{className:"flex flex-col gap-2","data-testid":`${s}-section`,children:i("p",{className:"text-sm text-muted-foreground","data-testid":`${s}-empty`,children:r("No tables to graph.")})}):i("section",{className:y("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${s}-section`,children:i("div",{className:y("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${s}-canvas`,ref:$,children:f(ce,{edges:Z,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:g,nodesConnectable:!1,nodeTypes:Ge,onEdgesChange:X,onNodesChange:Q,children:[i(de,{}),i(M,{position:"top-left",children:f("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[i(ye,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${s}-find`,onChange:ee,placeholder:r("Find table…"),value:d}),f("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[f(j,{"aria-pressed":n.shard,className:"gap-1.5","data-testid":`${s}-tier-shard`,onClick:te,size:"xs",type:"button",variant:n.shard?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),f(j,{"aria-pressed":n.global,className:"gap-1.5","data-testid":`${s}-tier-global`,onClick:oe,size:"xs",type:"button",variant:n.global?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]})]})]})}),i(M,{position:"bottom-center",children:i(Ke,{})}),i(me,{showInteractive:!1}),c.length>Pe&&i(pe,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),i(qe,{containerRef:$,testIdPrefix:s}),i(We,{containerRef:$,seedKey:b})]})})})};export{dt as S};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- import{c as M}from"react/compiler-runtime";import{createRootRoute as ns,createRoute as Lt,createBrowserHistory as rs,createMemoryHistory as is,createRouter as ls,useNavigate as Ht,useSearch as ds,RouterProvider as cs,useRouterState as us,Outlet as fs}from"@tanstack/react-router";import*as lt from"react";import{use as Pt,createContext as Bt,useState as ut,useEffect as dt,useSyncExternalStore as ms,lazy as A,Suspense as hs}from"react";import{c as _}from"./utils-bhneXptQ.mjs";import{jsx as n,jsxs as w,Fragment as Vt}from"react/jsx-runtime";import{ErrorBoundary as ps}from"./ErrorBoundary-BWNF98VF.mjs";import{O as gs,u as bs}from"./operation-console-provider-DoloEvon.mjs";import{useT as se}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{LunoraError as zt}from"@lunora/errors";import{B as ft}from"./badge-r_5B4LHP.mjs";import{I as Dt}from"./input-CXhxesPC.mjs";import{Popover as ct}from"@base-ui/react/popover";import{Cancel01Icon as vs,SidebarLeftIcon as xs}from"@hugeicons/core-free-icons";import{HugeiconsIcon as Ot}from"@hugeicons/react";import{mergeProps as Zt}from"@base-ui/react/merge-props";import{useRender as Ft}from"@base-ui/react/use-render";import{cva as ys}from"class-variance-authority";import{B as qt}from"./button-q0UYSmrn.mjs";import{Dialog as oe}from"@base-ui/react/dialog";import{Tooltip as ae}from"@base-ui/react/tooltip";import{S as kt}from"./skeleton-DX1gfixl.mjs";import{H as ws,u as ks}from"./home-panel-DIaVZra4.mjs";import{g as Ms,f as St}from"./internal-Df43vQI0.mjs";import{o as bt}from"./use-admin-query-tlBof8Yg.mjs";import{StudioI18nProvider as Ns}from"./StudioI18nProvider-fVsCSs5L.mjs";import{v as Ss,a as Cs}from"./data-view-params-DhYmAkcj.mjs";import{CommandPalette as Ps,openCommandPalette as _s}from"./CommandPalette-D9ZY-qQd.mjs";import{motion as Ts}from"motion/react";import{E as Ls}from"./empty-state-D7jEML_T.mjs";import{u as As}from"./shortcuts-B9gDaXmw.mjs";const Wt="(prefers-color-scheme: dark)",Ut=()=>{try{return globalThis.localStorage}catch{return}},Is=t=>t==="system"||t==="light"||t==="dark",jt=()=>globalThis.matchMedia,Gt="lunora-studio-theme",Mt=["system","light","dark"],Rs=(t="system")=>{try{const e=Ut()?.getItem(Gt);return Is(e)?e:t}catch{return t}},At=t=>{const e=Ut();if(e!==void 0)try{e.setItem(Gt,t)}catch{}},Es=()=>{try{return jt()?.(Wt).matches?"dark":"light"}catch{return"light"}},$s=(t,e)=>t==="system"?e:t,Hs=t=>{let e;try{e=jt()?.(Wt)}catch{e=void 0}if(e===void 0)return()=>{};const s=a=>{t(a.matches?"dark":"light")};return e.addEventListener("change",s),()=>{e.removeEventListener("change",s)}},_t=Bt(null),Bs=({children:t,defaultTheme:e="system"})=>{const[s,a]=ut(()=>Rs(e)),[o,r]=ut(()=>Es());dt(()=>Hs(r),[]);const i=u=>{At(u),a(u)},d={cycleTheme:()=>{a(u=>{const c=Mt[(Mt.indexOf(u)+1)%Mt.length]??u;return At(c),c})},resolvedTheme:$s(s,o),setTheme:i,systemTheme:o,theme:s};return n(_t,{value:d,children:t})},Vs=t=>{const e=M(3),{children:s}=t,a=Pt(_t);let o;return e[0]!==s||e[1]!==a?(o=a===null?n(Bs,{children:s}):s,e[0]=s,e[1]=a,e[2]=o):o=e[2],o},zs=()=>{const t=Pt(_t);if(t===null)throw new zt("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function Ln({delay:t=0,...e}){return n(ae.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function Ds(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(ae.Root,{"data-slot":"tooltip",...s}),e[2]=s,e[3]=a):a=e[3],a}function Os(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(ae.Trigger,{"data-slot":"tooltip-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Zs({className:t,side:e="top",sideOffset:s=4,align:a="center",alignOffset:o=0,children:r,...i}){return n(ae.Portal,{children:n(ae.Positioner,{align:a,alignOffset:o,side:e,sideOffset:s,className:"isolate z-50",children:w(ae.Popup,{"data-slot":"tooltip-content",className:_("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...i,children:[r,n(ae.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Fs=t=>{const e=M(5),{className:s}=t;let a;e[0]!==s?(a=_("h-full w-full text-foreground",s),e[0]=s,e[1]=a):a=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=n("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"}),e[2]=o):o=e[2];let r;return e[3]!==a?(r=n("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 543 446",children:o}),e[3]=a,e[4]=r):r=e[4],r},Kt="lunora.studio.rulesBannerDismissed",qs=()=>{try{return globalThis.localStorage.getItem(Kt)==="1"}catch{return!1}},Ws=()=>{try{globalThis.localStorage.setItem(Kt,"1")}catch{}},Us=()=>{const t=M(18),e=se(),[s,a]=ut(js);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{a(!0),Ws()},t[0]=o):o=t[0];const r=o;if(s)return null;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),t[1]=i):i=t[1];let l;t[2]!==e?(l=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=l):l=t[3];let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=n("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=d):d=t[4];let u;t[5]!==e?(u=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==l||t[8]!==u?(c=w("span",{children:[l," ",d," ",u]}),t[7]=l,t[8]=u,t[9]=c):c=t[9];let m;t[10]!==e?(m=e("Dismiss"),t[10]=e,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=n("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:n("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=h):h=t[12];let f;t[13]!==m?(f=n("button",{"aria-label":m,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:r,type:"button",children:h}),t[13]=m,t[14]=f):f=t[14];let g;return t[15]!==c||t[16]!==f?(g=w("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[i,c,f]}),t[15]=c,t[16]=f,t[17]=g):g=t[17],g};function js(){return qs()}function Qt(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(ct.Root,{"data-slot":"popover",...s}),e[2]=s,e[3]=a):a=e[3],a}function Yt(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(ct.Trigger,{"data-slot":"popover-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Jt({align:t="end",alignOffset:e=0,className:s,keepMounted:a=!1,side:o="bottom",sideOffset:r=6,...i}){return n(ct.Portal,{keepMounted:a,children:n(ct.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:o,sideOffset:r,children:n(ct.Popup,{className:_("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",s),"data-slot":"popover-content",...i})})})}const Nt=768;function Gs(){const t=M(2),[e,s]=ut(void 0);let a,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const r=globalThis.matchMedia(`(max-width: ${Nt-1}px)`),i=()=>{s(globalThis.innerWidth<Nt)};return r.addEventListener("change",i),s(globalThis.innerWidth<Nt),()=>{r.removeEventListener("change",i)}},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),dt(a,o),!!e}function Ks(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(oe.Root,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function Qs(t){const e=M(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n(oe.Portal,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ys(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n(oe.Backdrop,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function Js({className:t,children:e,side:s="right",showCloseButton:a=!0,...o}){return w(Qs,{children:[n(Ys,{}),w(oe.Popup,{"data-slot":"sheet-content","data-side":s,className:_("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...o,children:[e,a&&w(oe.Close,{"data-slot":"sheet-close",render:n(qt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[n(Ot,{icon:vs,strokeWidth:2}),n("span",{className:"sr-only",children:"Close"})]})]})]})}function Xs(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex flex-col gap-0.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ea(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("text-sm font-medium text-foreground",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n(oe.Title,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ta(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("text-xs/relaxed text-muted-foreground",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n(oe.Description,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}const sa="sidebar_state",aa=3600*24*7,oa="16rem",na="18rem",ra="3rem",ia="b",Xt=lt.createContext(null);function vt(){const t=lt.useContext(Xt);if(!t)throw new zt("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function la({defaultOpen:t=!0,open:e,onOpenChange:s,className:a,style:o,children:r,...i}){const l=Gs(),[d,u]=lt.useState(!1),[c,m]=lt.useState(t),h=e??c,f=p=>{const x=typeof p=="function"?p(h):p;s?s(x):m(x),document.cookie=`${sa}=${x}; path=/; max-age=${aa}`},g=()=>l?u(p=>!p):f(p=>!p),v=lt.useEffectEvent(()=>{g()});lt.useEffect(()=>{const p=x=>{x.key===ia&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),v())};return globalThis.addEventListener("keydown",p),()=>globalThis.removeEventListener("keydown",p)},[]);const b={state:h?"expanded":"collapsed",open:h,setOpen:f,isMobile:l,openMobile:d,setOpenMobile:u,toggleSidebar:g};return n(Xt.Provider,{value:b,children:n("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":oa,"--sidebar-width-icon":ra,...o},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...i,children:r})})}function da({side:t="left",variant:e="sidebar",collapsible:s="offcanvas",className:a,children:o,dir:r,...i}){const{isMobile:l,state:d,openMobile:u,setOpenMobile:c}=vt();return s==="none"?n("div",{"data-slot":"sidebar",className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...i,children:o}):l?n(Ks,{open:u,onOpenChange:c,...i,children:w(Js,{dir:r,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":na},side:t,children:[w(Xs,{className:"sr-only",children:[n(ea,{children:"Sidebar"}),n(ta,{children:"Displays the mobile sidebar."})]}),n("div",{className:"flex h-full w-full flex-col",children:o})]})}):w("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?s:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[n("div",{"data-slot":"sidebar-gap",className:_("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),n("div",{"data-slot":"sidebar-container","data-side":t,className:_("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",a),...i,children:n("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:o})})]})}function ca(t){const e=M(15);let s,a,o;e[0]!==t?({className:s,onClick:a,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);const{toggleSidebar:r}=vt();let i;e[4]!==s?(i=_(s),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==a||e[7]!==r?(l=m=>{a?.(m),r()},e[6]=a,e[7]=r,e[8]=l):l=e[8];let d,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=n(Ot,{icon:xs,strokeWidth:2,className:"rtl:rotate-180"}),u=n("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=d,e[10]=u):(d=e[9],u=e[10]);let c;return e[11]!==o||e[12]!==i||e[13]!==l?(c=w(qt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:i,onClick:l,...o,children:[d,u]}),e[11]=o,e[12]=i,e[13]=l,e[14]=c):c=e[14],c}function ua(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function fa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ma(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ha(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function pa(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("relative flex w-full min-w-0 flex-col p-2",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ga(t){const e=M(10);let s,a,o,r;if(e[0]!==t){const{className:d,render:u,...c}=t;s=u,r=Ft,a="div",o=Zt({className:_("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",d)},c),e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=r}else s=e[1],a=e[2],o=e[3],r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==a||e[8]!==o?(l={defaultTagName:a,props:o,render:s,state:i},e[6]=s,e[7]=a,e[8]=o,e[9]=l):l=e[9],r(l)}function ba(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("w-full text-xs",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function It(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("flex w-full min-w-0 flex-col gap-0",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function Rt(t){const e=M(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=_("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==a||e[6]!==o?(r=n("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=r):r=e[7],r}const va=ys("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function es({render:t,isActive:e=!1,variant:s="default",size:a="default",tooltip:o,className:r,...i}){const{isMobile:l,state:d}=vt(),u=Ft({defaultTagName:"button",props:Zt({className:_(va({variant:s,size:a}),r)},i),render:o?n(Os,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:e}});return o?(typeof o=="string"&&(o={children:o}),w(Ds,{children:[u,n(Zs,{side:"right",align:"center",hidden:d!=="collapsed"||l,...o})]})):u}const xa=t=>t.replace("__lunora_admin__:",""),ya=()=>ms(bt.subscribe,bt.getSnapshot,bt.getSnapshot),wa=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",ka=t=>{const e=M(56),{entry:s,focused:a}=t,o=se();let r;e[0]!==a?(r=O=>{O!==null&&a&&O.scrollIntoView({block:"nearest"})},e[0]=a,e[1]=r):r=e[1];const i=r;let l;e[2]!==s.functionPath||e[3]!==s.shardKey||e[4]!==s.summary?(l=()=>{Ms(`${s.functionPath} ${s.summary}${s.shardKey===""?"":` (shard ${s.shardKey})`}`)},e[2]=s.functionPath,e[3]=s.shardKey,e[4]=s.summary,e[5]=l):l=e[5];const d=l,u=a&&"bg-accent ring-1 ring-inset ring-primary/40";let c;e[6]!==u?(c=_("border-b border-border/60 last:border-b-0",u),e[6]=u,e[7]=c):c=e[7];let m;e[8]!==s.status?(m=wa(s.status),e[8]=s.status,e[9]=m):m=e[9];const h=s.status==="pending"?"…":s.status;let f;e[10]!==m||e[11]!==h?(f=n(ft,{className:"mt-px shrink-0",variant:m,children:h}),e[10]=m,e[11]=h,e[12]=f):f=e[12];let g;e[13]!==s.functionPath?(g=xa(s.functionPath),e[13]=s.functionPath,e[14]=g):g=e[14];let v;e[15]!==g?(v=n("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:g}),e[15]=g,e[16]=v):v=e[16];let y;e[17]!==s.kind||e[18]!==o?(y=s.kind==="subscription"&&n(ft,{className:"shrink-0",variant:"outline",children:o("live")}),e[17]=s.kind,e[18]=o,e[19]=y):y=e[19];let b;e[20]!==s.summary?(b=s.summary!==""&&n("span",{className:"min-w-0 truncate text-muted-foreground",children:s.summary}),e[20]=s.summary,e[21]=b):b=e[21];let p;e[22]!==s.shardKey?(p=s.shardKey!==""&&n("span",{className:"font-mono",children:s.shardKey}),e[22]=s.shardKey,e[23]=p):p=e[23];let x;e[24]!==s.resultCount||e[25]!==o?(x=s.resultCount!==void 0&&n("span",{children:o("{count} rows",{count:s.resultCount})}),e[24]=s.resultCount,e[25]=o,e[26]=x):x=e[26];let k;e[27]!==s.pushes||e[28]!==o?(k=s.pushes!==void 0&&s.pushes>0&&n("span",{children:o("{count} pushes",{count:s.pushes})}),e[27]=s.pushes,e[28]=o,e[29]=k):k=e[29];let P;e[30]!==s.durationMs?(P=s.durationMs!==void 0&&w("span",{children:[s.durationMs,"ms"]}),e[30]=s.durationMs,e[31]=P):P=e[31];let C;e[32]!==o?(C=o("Copy"),e[32]=o,e[33]=C):C=e[33];let S;e[34]!==d||e[35]!==C?(S=n("button",{"aria-label":C,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:d,type:"button",children:"⧉"}),e[34]=d,e[35]=C,e[36]=S):S=e[36];let N;e[37]!==p||e[38]!==x||e[39]!==k||e[40]!==P||e[41]!==S?(N=w("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[p,x,k,P,S]}),e[37]=p,e[38]=x,e[39]=k,e[40]=P,e[41]=S,e[42]=N):N=e[42];let T;e[43]!==y||e[44]!==b||e[45]!==N||e[46]!==f||e[47]!==v?(T=w("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[f,v,y,b,N]}),e[43]=y,e[44]=b,e[45]=N,e[46]=f,e[47]=v,e[48]=T):T=e[48];let L;e[49]!==s.error?(L=s.error!==void 0&&n("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:s.error}),e[49]=s.error,e[50]=L):L=e[50];let I;return e[51]!==i||e[52]!==T||e[53]!==L||e[54]!==c?(I=w("li",{className:c,"data-testid":"oc-row",ref:i,children:[T,L]}),e[51]=i,e[52]=T,e[53]=L,e[54]=c,e[55]=I):I=e[55],I},Ma=t=>{const e=M(62),{focusSeq:s,onClose:a,onShownChange:o,shown:r}=t,i=se(),l=ya(),[d,u]=ut("");let c;if(e[0]!==l||e[1]!==s||e[2]!==d||e[3]!==a||e[4]!==o||e[5]!==r||e[6]!==i){const m=d.trim().toLowerCase(),h=l.filter(E=>(r==="errors"?E.status==="error":!0)&&(m===""||`${E.functionPath} ${E.summary} ${E.shardKey}`.toLowerCase().includes(m))).toReversed();let f;e[8]!==l?(f=l.filter(Na),e[8]=l,e[9]=f):f=e[9];const g=f.length;let v;e[10]!==i?(v=i("Operation console"),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==i?(y=i("Operation console"),e[12]=i,e[13]=y):y=e[13];let b;e[14]!==y?(b=n("span",{className:"text-xs font-medium",children:y}),e[14]=y,e[15]=b):b=e[15];let p;e[16]!==l.length||e[17]!==i?(p=i("{count} calls",{count:l.length}),e[16]=l.length,e[17]=i,e[18]=p):p=e[18];let x;e[19]!==p?(x=n(ft,{variant:"secondary",children:p}),e[19]=p,e[20]=x):x=e[20];let k;e[21]!==g||e[22]!==i?(k=g>0&&n(ft,{variant:"destructive",children:i("{count} failed",{count:g})}),e[21]=g,e[22]=i,e[23]=k):k=e[23];const P=r==="errors",C=r==="errors"&&"bg-accent";let S;e[24]!==C?(S=_("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",C),e[24]=C,e[25]=S):S=e[25];let N;e[26]!==o||e[27]!==r?(N=()=>{o(r==="errors"?"all":"errors")},e[26]=o,e[27]=r,e[28]=N):N=e[28];let T;e[29]!==i?(T=i("Errors"),e[29]=i,e[30]=T):T=e[30];let L;e[31]!==S||e[32]!==N||e[33]!==T||e[34]!==P?(L=n("button",{"aria-pressed":P,className:S,"data-testid":"oc-filter-errors",onClick:N,type:"button",children:T}),e[31]=S,e[32]=N,e[33]=T,e[34]=P,e[35]=L):L=e[35];let I;e[36]!==i?(I=i("Filter"),e[36]=i,e[37]=I):I=e[37];let O;e[38]===Symbol.for("react.memo_cache_sentinel")?(O=E=>{u(E.target.value)},e[38]=O):O=e[38];let B;e[39]!==i?(B=i("Filter"),e[39]=i,e[40]=B):B=e[40];let V;e[41]!==d||e[42]!==I||e[43]!==B?(V=n(Dt,{"aria-label":I,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:O,placeholder:B,value:d}),e[41]=d,e[42]=I,e[43]=B,e[44]=V):V=e[44];let z;e[45]!==i?(z=i("Clear"),e[45]=i,e[46]=z):z=e[46];let $;e[47]!==z?($=n("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:Sa,type:"button",children:z}),e[47]=z,e[48]=$):$=e[48];let H;e[49]!==i?(H=i("Hide"),e[49]=i,e[50]=H):H=e[50];let D;e[51]!==a||e[52]!==H?(D=n("button",{"aria-label":H,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:a,type:"button",children:"✕"}),e[51]=a,e[52]=H,e[53]=D):D=e[53];let Z;e[54]!==L||e[55]!==V||e[56]!==$||e[57]!==D||e[58]!==b||e[59]!==x||e[60]!==k?(Z=w("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[b,x,k,L,V,$,D]}),e[54]=L,e[55]=V,e[56]=$,e[57]=D,e[58]=b,e[59]=x,e[60]=k,e[61]=Z):Z=e[61],c=w("section",{"aria-label":v,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[Z,h.length===0?n("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:i("Every admin call this studio makes is recorded here.")}):n("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:h.map(E=>n(ka,{entry:E,focused:E.seq===s},E.seq))})]}),e[0]=l,e[1]=s,e[2]=d,e[3]=a,e[4]=o,e[5]=r,e[6]=i,e[7]=c}else c=e[7];return c};function Na(t){return t.status==="error"}function Sa(){bt.clear()}const Ca=()=>{const t=M(322),e=se();let s;t[0]!==e?(s=e("Health score"),t[0]=e,t[1]=s):s=t[1];let a;t[2]!==e?(a=e("Agents"),t[2]=e,t[3]=a):a=t[3];let o;t[4]!==e?(o=e("Evals"),t[4]=e,t[5]=o):o=t[5];let r;t[6]!==e?(r=e("AI usage"),t[6]=e,t[7]=r):r=t[7];let i;t[8]!==e?(i=e("Analytics"),t[8]=e,t[9]=i):i=t[9];let l;t[10]!==e?(l=e("API"),t[10]=e,t[11]=l):l=t[11];let d;t[12]!==e?(d=e("Audit"),t[12]=e,t[13]=d):d=t[13];let u;t[14]!==e?(u=e("Auth audit"),t[14]=e,t[15]=u):u=t[15];let c;t[16]!==e?(c=e("Configuration"),t[16]=e,t[17]=c):c=t[17];let m;t[18]!==e?(m=e("Sessions"),t[18]=e,t[19]=m):m=t[19];let h;t[20]!==e?(h=e("Containers"),t[20]=e,t[21]=h):h=t[21];let f;t[22]!==e?(f=e("Dashboards"),t[22]=e,t[23]=f):f=t[23];let g;t[24]!==e?(g=e("Data"),t[24]=e,t[25]=g):g=t[25];let v;t[26]!==e?(v=e("Deployment health"),t[26]=e,t[27]=v):v=t[27];let y;t[28]!==e?(y=e("Log drains"),t[28]=e,t[29]=y):y=t[29];let b;t[30]!==e?(b=e("Export / Import"),t[30]=e,t[31]=b):b=t[31];let p;t[32]!==e?(p=e("Fan-out"),t[32]=e,t[33]=p):p=t[33];let x;t[34]!==e?(x=e("Files"),t[34]=e,t[35]=x):x=t[35];let k;t[36]!==e?(k=e("Flags"),t[36]=e,t[37]=k):k=t[37];let P;t[38]!==e?(P=e("Functions"),t[38]=e,t[39]=P):P=t[39];let C;t[40]!==e?(C=e("Health"),t[40]=e,t[41]=C):C=t[41];let S;t[42]!==e?(S=e("Home"),t[42]=e,t[43]=S):S=t[43];let N;t[44]!==e?(N=e("Performance"),t[44]=e,t[45]=N):N=t[45];let T;t[46]!==e?(T=e("Issues"),t[46]=e,t[47]=T):T=t[47];let L;t[48]!==e?(L=e("KV"),t[48]=e,t[49]=L):L=t[49];let I;t[50]!==e?(I=e("Logs"),t[50]=e,t[51]=I):I=t[51];let O;t[52]!==e?(O=e("Metrics"),t[52]=e,t[53]=O):O=t[53];let B;t[54]!==e?(B=e("Migrations"),t[54]=e,t[55]=B):B=t[55];let V;t[56]!==e?(V=e("Notifications"),t[56]=e,t[57]=V):V=t[57];let z;t[58]!==e?(z=e("Organizations"),t[58]=e,t[59]=z):z=t[59];let $;t[60]!==e?($=e("Time Travel"),t[60]=e,t[61]=$):$=t[61];let H;t[62]!==e?(H=e("Mail"),t[62]=e,t[63]=H):H=t[63];let D;t[64]!==e?(D=e("Payments"),t[64]=e,t[65]=D):D=t[65];let Z;t[66]!==e?(Z=e("Permissions"),t[66]=e,t[67]=Z):Z=t[67];let E;t[68]!==e?(E=e("Queues"),t[68]=e,t[69]=E):E=t[69];let F;t[70]!==e?(F=e("Reactors"),t[70]=e,t[71]=F):F=t[71];let ee;t[72]!==e?(ee=e("Realtime"),t[72]=e,t[73]=ee):ee=t[73];let q;t[74]!==e?(q=e("RLS Policies"),t[74]=e,t[75]=q):q=t[75];let Y;t[76]!==e?(Y=e("Scheduled"),t[76]=e,t[77]=Y):Y=t[77];let te;t[78]!==e?(te=e("Schema"),t[78]=e,t[79]=te):te=t[79];let W;t[80]!==e?(W=e("Security"),t[80]=e,t[81]=W):W=t[81];let U;t[82]!==e?(U=e("Settings"),t[82]=e,t[83]=U):U=t[83];let j;t[84]!==e?(j=e("SQL editor"),t[84]=e,t[85]=j):j=t[85];let G;t[86]!==e?(G=e("Traces"),t[86]=e,t[87]=G):G=t[87];let K;t[88]!==e?(K=e("Access Rules"),t[88]=e,t[89]=K):K=t[89];let J;t[90]!==e?(J=e("Users"),t[90]=e,t[91]=J):J=t[91];let Q;t[92]!==e?(Q=e("Vectors"),t[92]=e,t[93]=Q):Q=t[93];let X;t[94]!==e?(X=e("Workflows"),t[94]=e,t[95]=X):X=t[95];let mt;t[96]!==s||t[97]!==a||t[98]!==h||t[99]!==f||t[100]!==g||t[101]!==v||t[102]!==y||t[103]!==b||t[104]!==p||t[105]!==x||t[106]!==k||t[107]!==P||t[108]!==o||t[109]!==C||t[110]!==S||t[111]!==N||t[112]!==T||t[113]!==L||t[114]!==I||t[115]!==O||t[116]!==B||t[117]!==V||t[118]!==z||t[119]!==r||t[120]!==$||t[121]!==H||t[122]!==D||t[123]!==Z||t[124]!==E||t[125]!==F||t[126]!==ee||t[127]!==q||t[128]!==Y||t[129]!==te||t[130]!==i||t[131]!==W||t[132]!==U||t[133]!==j||t[134]!==G||t[135]!==K||t[136]!==J||t[137]!==Q||t[138]!==X||t[139]!==l||t[140]!==d||t[141]!==u||t[142]!==c||t[143]!==m?(mt={advisorHealth:s,agents:a,evals:o,aiUsage:r,analytics:i,api:l,audit:d,authAudit:u,authConfig:c,authSessions:m,containers:h,dashboards:f,data:g,deploymentHealth:v,drains:y,export:b,fanout:p,files:x,flags:k,functions:P,health:C,home:S,insights:N,issues:T,kv:L,logs:I,metrics:O,migrations:B,notifications:V,organizations:z,pitr:$,mail:H,payments:D,permissions:Z,queues:E,reactors:F,realtime:ee,rls:q,schedule:Y,schema:te,security:W,settings:U,sql:j,traces:G,storageRules:K,users:J,vectors:Q,workflows:X},t[96]=s,t[97]=a,t[98]=h,t[99]=f,t[100]=g,t[101]=v,t[102]=y,t[103]=b,t[104]=p,t[105]=x,t[106]=k,t[107]=P,t[108]=o,t[109]=C,t[110]=S,t[111]=N,t[112]=T,t[113]=L,t[114]=I,t[115]=O,t[116]=B,t[117]=V,t[118]=z,t[119]=r,t[120]=$,t[121]=H,t[122]=D,t[123]=Z,t[124]=E,t[125]=F,t[126]=ee,t[127]=q,t[128]=Y,t[129]=te,t[130]=i,t[131]=W,t[132]=U,t[133]=j,t[134]=G,t[135]=K,t[136]=J,t[137]=Q,t[138]=X,t[139]=l,t[140]=d,t[141]=u,t[142]=c,t[143]=m,t[144]=mt):mt=t[144];const xt=mt;let ne;t[145]!==e?(ne=e("Advisors"),t[145]=e,t[146]=ne):ne=t[146];let re;t[147]!==e?(re=e("Auth"),t[147]=e,t[148]=re):re=t[148];let ie;t[149]!==e?(ie=e("Database"),t[149]=e,t[150]=ie):ie=t[150];let le;t[151]!==e?(le=e("Functions"),t[151]=e,t[152]=le):le=t[152];let de;t[153]!==e?(de=e("Observability"),t[153]=e,t[154]=de):de=t[154];let ce;t[155]!==e?(ce=e("Operations"),t[155]=e,t[156]=ce):ce=t[156];let ue;t[157]!==e?(ue=e("Overview"),t[157]=e,t[158]=ue):ue=t[158];let fe;t[159]!==e?(fe=e("Settings"),t[159]=e,t[160]=fe):fe=t[160];let me;t[161]!==e?(me=e("Storage"),t[161]=e,t[162]=me):me=t[162];let ht;t[163]!==ne||t[164]!==re||t[165]!==ie||t[166]!==le||t[167]!==de||t[168]!==ce||t[169]!==ue||t[170]!==fe||t[171]!==me?(ht={advisors:ne,auth:re,database:ie,functions:le,observability:de,operations:ce,overview:ue,settings:fe,storage:me},t[163]=ne,t[164]=re,t[165]=ie,t[166]=le,t[167]=de,t[168]=ce,t[169]=ue,t[170]=fe,t[171]=me,t[172]=ht):ht=t[172];const yt=ht;let he;t[173]!==e?(he=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[173]=e,t[174]=he):he=t[174];let pe;t[175]!==e?(pe=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[175]=e,t[176]=pe):pe=t[176];let ge;t[177]!==e?(ge=e("Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it."),t[177]=e,t[178]=ge):ge=t[178];let be;t[179]!==e?(be=e("Tokens and spend from ctx.ai.model calls — totals, per function and per model, and the recent calls behind them."),t[179]=e,t[180]=be):be=t[180];let ve;t[181]!==e?(ve=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[181]=e,t[182]=ve):ve=t[182];let xe;t[183]!==e?(xe=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[183]=e,t[184]=xe):xe=t[184];let ye;t[185]!==e?(ye=e("A durable log of admin state-changing operations."),t[185]=e,t[186]=ye):ye=t[186];let we;t[187]!==e?(we=e("Authentication and security events — sign-ins, MFA, and session changes."),t[187]=e,t[188]=we):we=t[188];let ke;t[189]!==e?(ke=e("Enabled plugins and session config (read-only)."),t[189]=e,t[190]=ke):ke=t[190];let Me;t[191]!==e?(Me=e("Browse and revoke active sessions across all users."),t[191]=e,t[192]=Me):Me=t[192];let Ne;t[193]!==e?(Ne=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[193]=e,t[194]=Ne):Ne=t[194];let Se;t[195]!==e?(Se=e("Chart widgets backed by saved read-only SQL queries."),t[195]=e,t[196]=Se):Se=t[196];let Ce;t[197]!==e?(Ce=e("Browse and edit rows across your shard and global tables."),t[197]=e,t[198]=Ce):Ce=t[198];let Pe;t[199]!==e?(Pe=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[199]=e,t[200]=Pe):Pe=t[200];let _e;t[201]!==e?(_e=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[201]=e,t[202]=_e):_e=t[202];let Te;t[203]!==e?(Te=e("Export a shard to NDJSON, or import rows from it."),t[203]=e,t[204]=Te):Te=t[204];let Le;t[205]!==e?(Le=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[205]=e,t[206]=Le):Le=t[206];let Ae;t[207]!==e?(Ae=e("Browse objects in your R2 storage buckets."),t[207]=e,t[208]=Ae):Ae=t[208];let Ie;t[209]!==e?(Ie=e("Inspect feature flags and their live evaluation under a targeting context."),t[209]=e,t[210]=Ie):Ie=t[210];let Re;t[211]!==e?(Re=e("Run registered queries, mutations, and actions."),t[211]=e,t[212]=Re):Re=t[212];let Ee;t[213]!==e?(Ee=e("At-a-glance connection, error, and shard signals."),t[213]=e,t[214]=Ee):Ee=t[214];let $e;t[215]!==e?($e=e("Connection, health, and advisor summary for your deployment."),t[215]=e,t[216]=$e):$e=t[216];let He;t[217]!==e?(He=e("Surface slow functions, error spikes, and cache problems."),t[217]=e,t[218]=He):He=t[218];let Be;t[219]!==e?(Be=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[219]=e,t[220]=Be):Be=t[220];let Ve;t[221]!==e?(Ve=e("A live stream of recent function logs."),t[221]=e,t[222]=Ve):Ve=t[222];let ze;t[223]!==e?(ze=e("Per-shard health and aggregate metrics."),t[223]=e,t[224]=ze):ze=t[224];let De;t[225]!==e?(De=e("Review migration status and run them."),t[225]=e,t[226]=De):De=t[226];let Oe;t[227]!==e?(Oe=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[227]=e,t[228]=Oe):Oe=t[228];let Ze;t[229]!==e?(Ze=e("Browse and manage organizations, members, and invitations."),t[229]=e,t[230]=Ze):Ze=t[230];let Fe;t[231]!==e?(Fe=e("Restore a shard to a point in the last 30 days."),t[231]=e,t[232]=Fe):Fe=t[232];let qe;t[233]!==e?(qe=e("Email your app sent, captured in dev."),t[233]=e,t[234]=qe):qe=t[234];let We;t[235]!==e?(We=e("Synced customers, subscriptions, and webhook events."),t[235]=e,t[236]=We):We=t[236];let Ue;t[237]!==e?(Ue=e("Inspect access policies per table, and probe a function as any identity."),t[237]=e,t[238]=Ue):Ue=t[238];let je;t[239]!==e?(je=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[239]=e,t[240]=je):je=t[240];let Ge;t[241]!==e?(Ge=e("Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing."),t[241]=e,t[242]=Ge):Ge=t[242];let Ke;t[243]!==e?(Ke=e("Active WebSocket subscriptions on this shard."),t[243]=e,t[244]=Ke):Ke=t[244];let Qe;t[245]!==e?(Qe=e("Inspect row-level-security policies and roles, per table."),t[245]=e,t[246]=Qe):Qe=t[246];let Ye;t[247]!==e?(Ye=e("Inspect and cancel scheduled jobs."),t[247]=e,t[248]=Ye):Ye=t[248];let Je;t[249]!==e?(Je=e("Inspect each table and its columns."),t[249]=e,t[250]=Je):Je=t[250];let Xe;t[251]!==e?(Xe=e("Review admin gates, credentials, and log redaction."),t[251]=e,t[252]=Xe):Xe=t[252];let et;t[253]!==e?(et=e("Read-only deployment config — vars, secrets, and bindings."),t[253]=e,t[254]=et):et=t[254];let tt;t[255]!==e?(tt=e("Run read-only SQL against a shard."),t[255]=e,t[256]=tt):tt=t[256];let st;t[257]!==e?(st=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[257]=e,t[258]=st):st=t[258];let at;t[259]!==e?(at=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[259]=e,t[260]=at):at=t[260];let ot;t[261]!==e?(ot=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[261]=e,t[262]=ot):ot=t[262];let nt;t[263]!==e?(nt=e("Manage auth users — roles, bans, sessions, and identity."),t[263]=e,t[264]=nt):nt=t[264];let rt;t[265]!==e?(rt=e("Browse Vectorize indexes and run similarity searches."),t[265]=e,t[266]=rt):rt=t[266];let it;t[267]!==e?(it=e("Inspect declared Cloudflare Workflows and their bindings."),t[267]=e,t[268]=it):it=t[268];let pt;t[269]!==tt||t[270]!==st||t[271]!==at||t[272]!==ot||t[273]!==nt||t[274]!==rt||t[275]!==it||t[276]!==he||t[277]!==pe||t[278]!==ge||t[279]!==be||t[280]!==ve||t[281]!==xe||t[282]!==ye||t[283]!==we||t[284]!==ke||t[285]!==Me||t[286]!==Ne||t[287]!==Se||t[288]!==Ce||t[289]!==Pe||t[290]!==_e||t[291]!==Te||t[292]!==Le||t[293]!==Ae||t[294]!==Ie||t[295]!==Re||t[296]!==Ee||t[297]!==$e||t[298]!==He||t[299]!==Be||t[300]!==Ve||t[301]!==ze||t[302]!==De||t[303]!==Oe||t[304]!==Ze||t[305]!==Fe||t[306]!==qe||t[307]!==We||t[308]!==Ue||t[309]!==je||t[310]!==Ge||t[311]!==Ke||t[312]!==Qe||t[313]!==Ye||t[314]!==Je||t[315]!==Xe||t[316]!==et?(pt={advisorHealth:he,agents:pe,evals:ge,aiUsage:be,analytics:ve,api:xe,audit:ye,authAudit:we,authConfig:ke,authSessions:Me,containers:Ne,dashboards:Se,data:Ce,deploymentHealth:Pe,drains:_e,export:Te,fanout:Le,files:Ae,flags:Ie,functions:Re,health:Ee,home:$e,insights:He,issues:Be,logs:Ve,metrics:ze,migrations:De,notifications:Oe,organizations:Ze,pitr:Fe,mail:qe,payments:We,permissions:Ue,queues:je,reactors:Ge,realtime:Ke,rls:Qe,schedule:Ye,schema:Je,security:Xe,settings:et,sql:tt,kv:st,storageRules:at,traces:ot,users:nt,vectors:rt,workflows:it},t[269]=tt,t[270]=st,t[271]=at,t[272]=ot,t[273]=nt,t[274]=rt,t[275]=it,t[276]=he,t[277]=pe,t[278]=ge,t[279]=be,t[280]=ve,t[281]=xe,t[282]=ye,t[283]=we,t[284]=ke,t[285]=Me,t[286]=Ne,t[287]=Se,t[288]=Ce,t[289]=Pe,t[290]=_e,t[291]=Te,t[292]=Le,t[293]=Ae,t[294]=Ie,t[295]=Re,t[296]=Ee,t[297]=$e,t[298]=He,t[299]=Be,t[300]=Ve,t[301]=ze,t[302]=De,t[303]=Oe,t[304]=Ze,t[305]=Fe,t[306]=qe,t[307]=We,t[308]=Ue,t[309]=je,t[310]=Ge,t[311]=Ke,t[312]=Qe,t[313]=Ye,t[314]=Je,t[315]=Xe,t[316]=et,t[317]=pt):pt=t[317];const wt=pt;let gt;return t[318]!==yt||t[319]!==wt||t[320]!==xt?(gt={groupLabel:yt,tabDescription:wt,tabLabel:xt},t[318]=yt,t[319]=wt,t[320]=xt,t[321]=gt):gt=t[321],gt},Pa=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[n("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),n("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},_a=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[n("circle",{cx:"12",cy:"12",r:"4"}),n("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),t[0]=e):e=t[0],e},Ta=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:n("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},La=[{Icon:Pa,value:"system"},{Icon:_a,value:"light"},{Icon:Ta,value:"dark"}],Aa=()=>{const t=M(19),{theme:e,setTheme:s}=zs(),a=se();let o;t[0]!==a?(o=a("Dark theme"),t[0]=a,t[1]=o):o=t[1];let r;t[2]!==a?(r=a("Light theme"),t[2]=a,t[3]=r):r=t[3];let i;t[4]!==a?(i=a("System theme"),t[4]=a,t[5]=i):i=t[5];let l;t[6]!==o||t[7]!==r||t[8]!==i?(l={dark:o,light:r,system:i},t[6]=o,t[7]=r,t[8]=i,t[9]=l):l=t[9];const d=l;let u;t[10]!==a?(u=a("Theme"),t[10]=a,t[11]=u):u=t[11];let c;t[12]!==d||t[13]!==s||t[14]!==e?(c=La.map(h=>{const{Icon:f,value:g}=h,v=e===g;return w("button",{"aria-checked":v,"aria-label":d[g],className:_("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",v?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${g}`,onClick:()=>{s(g)},role:"radio",title:d[g],type:"button",children:[v&&n(Ts.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}}),n("span",{className:"relative",children:n(f,{})})]},g)}),t[12]=d,t[13]=s,t[14]=e,t[15]=c):c=t[15];let m;return t[16]!==u||t[17]!==c?(m=n("div",{"aria-label":u,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:c}),t[16]=u,t[17]=c,t[18]=m):m=t[18],m},Ia=t=>{const e=M(23),{domain:s,onOpenCommandPalette:a,page:o}=t,r=se();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n(ca,{className:"-ms-1"}),e[0]=i):i=e[0];let l;e[1]!==r?(l=r("Breadcrumb"),e[1]=r,e[2]=l):l=e[2];let d;e[3]!==s?(d=n("span",{className:"text-muted-foreground",children:s}),e[3]=s,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=n("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:n("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=u):u=e[5];let c;e[6]!==o?(c=n("span",{className:"font-medium text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let m;e[8]!==l||e[9]!==d||e[10]!==c?(m=w("nav",{"aria-label":l,className:"flex items-center gap-1.5 text-[13px]",children:[d,u,c]}),e[8]=l,e[9]=d,e[10]=c,e[11]=m):m=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[n("circle",{cx:"11",cy:"11",r:"7"}),n("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=h):h=e[12];let f;e[13]!==r?(f=r("Search…"),e[13]=r,e[14]=f):f=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=g):g=e[15];let v;e[16]!==a||e[17]!==f?(v=w("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:a,type:"button",children:[h,f,g]}),e[16]=a,e[17]=f,e[18]=v):v=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:n(Aa,{})}),e[19]=y):y=e[19];let b;return e[20]!==v||e[21]!==m?(b=w("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[i,m,v,y]}),e[20]=v,e[21]=m,e[22]=b):b=e[22],b},Ra={agents:{capability:"agents"},analytics:{capability:"analytics",feature:"analytics"},authAudit:{feature:"auth"},authConfig:{feature:"auth"},authSessions:{feature:"auth"},containers:{capability:"containers",feature:"containers"},fanout:{capability:"crossShardFanout"},files:{capability:"objectStorage",feature:"storage"},flags:{feature:"flags"},kv:{capability:"keyValueStore",feature:"kv"},mail:{capability:"mail",feature:"mail"},notifications:{feature:"notifications"},organizations:{feature:"auth"},payments:{feature:"payments"},pitr:{capability:"pointInTimeRecovery"},queues:{capability:"queues",feature:"queues"},reactors:{capability:"serverReactors"},schedule:{capability:"scheduler",feature:"scheduler"},storageRules:{feature:"storage"},users:{feature:"auth"},vectors:{capability:"vectorStore",feature:"vectors"},workflows:{capability:"workflows",feature:"workflows"}},Ea={agents:"Durable agents",analytics:"Analytics",containers:"Containers",crossShardFanout:"Cross-shard fan-out",keyValueStore:"Key-value storage",mail:"Mail delivery",objectStorage:"Object storage",pointInTimeRecovery:"Point-in-time recovery",queues:"Queues",scheduler:"Scheduling",serverReactors:"Server reactors",vectorStore:"Vector search",workflows:"Workflows"},$a={kind:"hidden"},Et={kind:"ok"},Ha={kind:"pending"},ts=(t,e,s)=>{const a=Ra[t];return a?.feature!==void 0&&!e[a.feature]?$a:a?.capability===void 0?Et:e.settled?e.platform?.unsupported.includes(a.capability)===!0?{kind:"unavailable",reason:s("{capability} is not supported on {platform}.",{capability:s(Ea[a.capability]),platform:e.platform.name})}:Et:Ha},Ba=(t,e,s)=>{const a={},o=[];for(const r of t){const i=[];for(const l of r.tabs){const d=ts(l,e,s);d.kind!=="hidden"&&i.push(l),d.kind==="unavailable"&&(a[l]=d.reason)}i.length>0&&o.push({...r,tabs:i})}return{unavailable:a,visibleGroups:o}},Va=t=>{const e=M(3),{reason:s,title:a}=t;let o;return e[0]!==s||e[1]!==a?(o=n(Ls,{description:s,testId:"dash-unsupported",title:a}),e[0]=s,e[1]=a,e[2]=o):o=e[2],o},za=t=>{const e=M(4),{console:s}=As();let a,o;e[0]!==s||e[1]!==t?(a=()=>{if(t===void 0)return;const r=i=>{if(!i.ctrlKey||i.metaKey||i.altKey||i.shiftKey||i.repeat||i.key.toLowerCase()!==s)return;const{target:l}=i;l instanceof HTMLElement&&(l.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(l.tagName))||(i.preventDefault(),t())};return globalThis.addEventListener("keydown",r),()=>{globalThis.removeEventListener("keydown",r)}},o=[s,t],e[0]=s,e[1]=t,e[2]=a,e[3]=o):(a=e[2],o=e[3]),dt(a,o)},R=(t,e)=>A(()=>t().then(s=>({default:s[e]}))),Da=R(()=>import("../packem_chunks/InsightsPanel.mjs"),"InsightsPanel"),Oa=A(()=>import("../packem_chunks/rls-panel.mjs")),Za=A(()=>import("../packem_chunks/AdvisorHealthPanel.mjs")),Fa=A(()=>import("../packem_chunks/SecurityAdvisorPanel.mjs")),qa=A(()=>import("../packem_chunks/agents-panel.mjs")),Wa=R(()=>import("../packem_chunks/analytics-panel.mjs"),"AnalyticsPanel"),Ua=A(()=>import("../packem_chunks/ApiTab.mjs")),ja=A(()=>import("../packem_chunks/auth-audit-panel.mjs")),Ga=A(()=>import("../packem_chunks/auth-config-panel.mjs")),Ka=A(()=>import("../packem_chunks/auth-sessions-panel.mjs")),Qa=A(()=>import("../packem_chunks/organizations-panel.mjs")),Ya=R(()=>import("../packem_chunks/users-panel.mjs"),"UsersPanel"),Ja=A(()=>import("../packem_chunks/containers-panel.mjs")),Xa=R(()=>import("../packem_chunks/DeploymentHealthPanel.mjs"),"DeploymentHealthPanel"),eo=R(()=>import("../packem_chunks/TableEditor.mjs"),"TableEditor"),to=R(()=>import("../packem_chunks/ExportImportPanel.mjs"),"ExportImportPanel"),so=A(()=>import("../packem_chunks/migrations-route.mjs")),ao={data:Cs,migrations:Ss},oo=R(()=>import("../packem_chunks/PitrPanel.mjs"),"PitrPanel"),no=A(()=>import("../packem_chunks/flags-panel.mjs")),ro=A(()=>import("../packem_chunks/reactors-panel.mjs")),io=R(()=>import("../packem_chunks/FunctionRunner.mjs"),"FunctionRunner"),lo=R(()=>import("../packem_chunks/FunctionStatsPanel.mjs"),"FunctionStatsPanel"),co=A(()=>import("../packem_chunks/issues-panel.mjs")),uo=R(()=>import("../packem_chunks/AuditPanel.mjs"),"AuditPanel"),fo=A(()=>import("../packem_chunks/log-drains-panel.mjs")),mo=A(()=>import("../packem_chunks/LogsPanel.mjs").then(t=>({default:t.LogsPanel}))),ho=R(()=>import("../packem_chunks/MailPanel.mjs"),"MailPanel"),po=R(()=>import("../packem_chunks/schedule-panel.mjs"),"SchedulePanel"),go=A(()=>import("../packem_chunks/subscriptions-panel.mjs")),bo=A(()=>import("../packem_chunks/sync-client-panel.mjs")),vo=R(()=>import("../packem_chunks/kv-browser.mjs"),"KvBrowser"),xo=A(()=>import("../packem_chunks/NotificationsPanel.mjs")),yo=R(()=>import("../packem_chunks/payments-panel.mjs"),"PaymentsPanel"),wo=R(()=>import("../packem_chunks/permissions-panel.mjs"),"PermissionsPanel"),ko=A(()=>import("../packem_chunks/queues-panel.mjs")),Mo=A(()=>import("../packem_chunks/dashboards-panel.mjs")),No=A(()=>import("../packem_chunks/fanout-panel.mjs")),So=R(()=>import("../packem_chunks/HealthPanel.mjs"),"HealthPanel"),Co=R(()=>import("../packem_chunks/MetricsPanel.mjs"),"MetricsPanel"),Po=R(()=>import("../packem_chunks/SchemaViewer.mjs"),"SchemaViewer"),_o=R(()=>import("../packem_chunks/SettingsPanel.mjs"),"SettingsPanel"),To=R(()=>import("../packem_chunks/SqlEditorPanel.mjs"),"SqlEditorPanel"),Lo=R(()=>import("../packem_chunks/FileBrowser.mjs"),"FileBrowser"),Ao=A(()=>import("../packem_chunks/storage-rules-panel.mjs")),Io=A(()=>import("../packem_chunks/traces-panel.mjs")),Ro=A(()=>import("../packem_chunks/evals-panel.mjs")),Eo=A(()=>import("../packem_chunks/ai-usage-panel.mjs")),$o=R(()=>import("../packem_chunks/vector-browser.mjs"),"VectorBrowser"),Ho=A(()=>import("../packem_chunks/workflows-panel.mjs")),ss=Bt(null),Bo={analytics:n("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:n("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:n("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"}),authAudit:n("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:n("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),agents:n("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:n("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:n("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:n("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:n("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2 3 4-5"}),drains:n("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:n("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"}),export:n("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:n("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"}),files:n("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"}),flags:n("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:n("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:n("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),aiUsage:n("path",{d:"M12 3v3m0 12v3M5.6 5.6l2.1 2.1m8.6 8.6 2.1 2.1M3 12h3m12 0h3M5.6 18.4l2.1-2.1m8.6-8.6 2.1-2.1M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z"}),health:n("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:n("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:n("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"}),issues:n("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:n("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:n("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:n("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:n("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:n("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:n("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"}),notifications:n("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:n("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:n("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"}),pitr:n("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:n("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),reactors:n("path",{d:"M4 4v6h6M20 20v-6h-6M20 9a8 8 0 0 0-14.7-3M4 15a8 8 0 0 0 14.7 3"}),realtime:n("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),rls:n("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"}),schedule:n("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:n("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:n("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:n("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"}),advisorHealth:n("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:n("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"}),traces:n("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:n("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),users:n("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"}),vectors:n("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:n("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},$t=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","evals","aiUsage","audit","realtime","reactors","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags"]},{key:"settings",tabs:["settings"]}],Ct=t=>{const e=M(2),{tab:s}=t,a=Bo[s];let o;return e[0]!==a?(o=n("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:a}),e[0]=a,e[1]=o):o=e[1],o},Vo=t=>t,as=Vo(["home","data","sql","functions","api","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","evals","aiUsage","reactors","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),zo=new Set(["api","data","migrations","sql"]),Do=t=>{const e=t.split("/").findLast(Boolean)??"";return as.includes(e)?e:"home"},Oo=t=>{const e=M(19),{chrome:s,connected:a}=t,o=se();let r;e[0]!==o?(r=o("admin token"),e[0]=o,e[1]=r):r=e[1];let i;e[2]!==r?(i=n("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:r}),e[2]=r,e[3]=i):i=e[3];let l;e[4]!==s.onTokenChange||e[5]!==s.token?(l=n(Dt,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:s.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:s.token}),e[4]=s.onTokenChange,e[5]=s.token,e[6]=l):l=e[6];let d;e[7]!==a||e[8]!==o?(d=a&&w("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[n("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),o("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=a,e[8]=o,e[9]=d):d=e[9];let u;e[10]!==s.clearToken||e[11]!==a||e[12]!==o?(u=a&&n("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:s.clearToken,type:"button",children:o("Clear")}),e[10]=s.clearToken,e[11]=a,e[12]=o,e[13]=u):u=e[13];let c;return e[14]!==i||e[15]!==l||e[16]!==d||e[17]!==u?(c=w("div",{className:"flex flex-col gap-2",children:[i,l,d,u]}),e[14]=i,e[15]=l,e[16]=d,e[17]=u,e[18]=c):c=e[18],c},os="opacity-50",Zo=t=>{const e=M(27),{current:s,group:a,groupLabel:o,selectTab:r,tabDescription:i,tabLabel:l,unavailable:d}=t,u=a.tabs.includes(s)?"page":void 0,c=o[a.key],m=a.tabs[0];let h;e[0]!==m?(h=n(Ct,{tab:m}),e[0]=m,e[1]=h):h=e[1];let f;e[2]!==u||e[3]!==c||e[4]!==h?(f=n(Yt,{"aria-current":u,"aria-label":c,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:h}),e[2]=u,e[3]=c,e[4]=h,e[5]=f):f=e[5];const g=o[a.key];let v;e[6]!==g?(v=n("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:g}),e[6]=g,e[7]=v):v=e[7];let y;if(e[8]!==s||e[9]!==a.tabs||e[10]!==r||e[11]!==i||e[12]!==l||e[13]!==d){let x;e[15]!==s||e[16]!==r||e[17]!==i||e[18]!==l||e[19]!==d?(x=k=>w("button",{"aria-current":s===k?"page":void 0,className:_("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100",d[k]!==void 0&&os),"data-tab":k,"data-testid":`dash-tab-${k}`,"data-unsupported":d[k]===void 0?void 0:"true",onClick:r,title:i[k],type:"button",children:[n(Ct,{tab:k}),n("span",{children:l[k]})]},k),e[15]=s,e[16]=r,e[17]=i,e[18]=l,e[19]=d,e[20]=x):x=e[20],y=a.tabs.map(x),e[8]=s,e[9]=a.tabs,e[10]=r,e[11]=i,e[12]=l,e[13]=d,e[14]=y}else y=e[14];let b;e[21]!==v||e[22]!==y?(b=w(Jt,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[v,y]}),e[21]=v,e[22]=y,e[23]=b):b=e[23];let p;return e[24]!==f||e[25]!==b?(p=w(Qt,{children:[f,b]}),e[24]=f,e[25]=b,e[26]=p):p=e[26],p},Fo=t=>{const e=M(45),{chrome:s,collapsed:a,connected:o}=t,r=se();if(s===null){let x;e[0]!==r?(x=r("Admin"),e[0]=r,e[1]=x):x=e[1];let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=n("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=k):k=e[2];let P;e[3]!==r?(P=r("Admin"),e[3]=r,e[4]=P):P=e[4];let C;e[5]!==P?(C=n("span",{className:"truncate text-[13px] font-medium",children:P}),e[5]=P,e[6]=C):C=e[6];let S;e[7]!==r?(S=r("Studio"),e[7]=r,e[8]=S):S=e[8];let N;e[9]!==S?(N=n("span",{className:"truncate text-[11px] text-muted-foreground",children:S}),e[9]=S,e[10]=N):N=e[10];let T;e[11]!==C||e[12]!==N?(T=w("span",{className:"grid flex-1 text-start leading-tight",children:[C,N]}),e[11]=C,e[12]=N,e[13]=T):T=e[13];let L;return e[14]!==x||e[15]!==T?(L=w(es,{className:"data-active:bg-transparent",size:"lg",tooltip:x,children:[k,T]}),e[14]=x,e[15]=T,e[16]=L):L=e[16],L}const i=a?"mx-auto size-8 justify-center":"w-full p-2";let l;e[17]!==i?(l=_("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",i),e[17]=i,e[18]=l):l=e[18];let d;e[19]!==o||e[20]!==r?(d=r(o?"Connected":"Not connected"),e[19]=o,e[20]=r,e[21]=d):d=e[21];const u=o?"bg-success":"bg-muted-foreground/50";let c;e[22]!==u?(c=_("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",u),e[22]=u,e[23]=c):c=e[23];let m;e[24]!==c?(m=w("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",n("span",{"aria-hidden":"true",className:c})]}),e[24]=c,e[25]=m):m=e[25];let h;e[26]!==a||e[27]!==o||e[28]!==r?(h=!a&&w(Vt,{children:[w("span",{className:"grid flex-1 text-start leading-tight",children:[n("span",{className:"truncate text-[13px] font-medium",children:r("Admin")}),n("span",{className:"truncate text-[11px] text-muted-foreground",children:r(o?"Connected":"Not connected")})]}),n("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:n("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=a,e[27]=o,e[28]=r,e[29]=h):h=e[29];let f;e[30]!==l||e[31]!==d||e[32]!==m||e[33]!==h?(f=w(Yt,{className:l,"data-testid":"dash-app-connect",title:d,children:[m,h]}),e[30]=l,e[31]=d,e[32]=m,e[33]=h,e[34]=f):f=e[34];const g=a?"end":"start",v=a?"right":"top";let y;e[35]!==s||e[36]!==o?(y=n(Oo,{chrome:s,connected:o}),e[35]=s,e[36]=o,e[37]=y):y=e[37];let b;e[38]!==v||e[39]!==y||e[40]!==g?(b=n(Jt,{align:g,keepMounted:!0,side:v,children:y}),e[38]=v,e[39]=y,e[40]=g,e[41]=b):b=e[41];let p;return e[42]!==b||e[43]!==f?(p=w(Qt,{children:[f,b]}),e[42]=b,e[43]=f,e[44]=p):p=e[44],p},qo=t=>{const e=M(29),{chrome:s,connected:a,current:o,groupLabel:r,groups:i,selectTab:l,tabDescription:d,tabLabel:u,unavailable:c}=t,m=se(),{state:h}=vt(),f=h==="collapsed",g=f&&"justify-center px-0";let v;e[0]!==g?(v=_("flex items-center gap-2.5 px-1.5 py-1",g),e[0]=g,e[1]=v):v=e[1];let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=n(Fs,{className:"size-9 shrink-0 text-foreground"}),e[2]=y):y=e[2];let b;e[3]!==f||e[4]!==a||e[5]!==m?(b=!f&&w(Vt,{children:[w("span",{className:"grid flex-1 leading-tight",children:[n("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),n("span",{className:"truncate text-[11px] text-muted-foreground",children:m("Studio")})]}),n(ft,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:m(a?"Live":"Local")})]}),e[3]=f,e[4]=a,e[5]=m,e[6]=b):b=e[6];let p;e[7]!==v||e[8]!==b?(p=n(fa,{children:w("div",{className:v,children:[y,b]})}),e[7]=v,e[8]=b,e[9]=p):p=e[9];let x;e[10]!==f||e[11]!==o||e[12]!==r||e[13]!==i||e[14]!==l||e[15]!==d||e[16]!==u||e[17]!==c?(x=f?i.map(S=>n(Zo,{current:o,group:S,groupLabel:r,selectTab:l,tabDescription:d,tabLabel:u,unavailable:c},S.key)):i.map(S=>w(pa,{children:[n(ga,{className:"text-[11px] font-medium tracking-wider uppercase",children:r[S.key]}),n(ba,{children:n(It,{children:S.tabs.map(N=>n(Rt,{children:w(es,{className:_("data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",c[N]!==void 0&&os),"data-tab":N,"data-testid":`dash-tab-${N}`,"data-unsupported":c[N]===void 0?void 0:"true",isActive:o===N,onClick:l,title:d[N],tooltip:d[N],children:[n(Ct,{tab:N}),n("span",{children:u[N]})]})},N))})})]},S.key)),e[10]=f,e[11]=o,e[12]=r,e[13]=i,e[14]=l,e[15]=d,e[16]=u,e[17]=c,e[18]=x):x=e[18];let k;e[19]!==x?(k=n(ha,{children:x}),e[19]=x,e[20]=k):k=e[20];let P;e[21]!==s||e[22]!==f||e[23]!==a?(P=n(ma,{children:n(It,{children:n(Rt,{children:n(Fo,{chrome:s,collapsed:f,connected:a})})})}),e[21]=s,e[22]=f,e[23]=a,e[24]=P):P=e[24];let C;return e[25]!==p||e[26]!==k||e[27]!==P?(C=w(da,{collapsible:"icon",variant:"inset",children:[p,k,P]}),e[25]=p,e[26]=k,e[27]=P,e[28]=C):C=e[28],C},Tt=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[w("div",{className:"flex items-center gap-2",children:[n(kt,{className:"h-8 w-40"}),n(kt,{className:"h-8 w-24"})]}),n(kt,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},Wo=t=>{const e=M(5),{title:s,verdict:a}=t;if(a.kind==="pending"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n(Tt,{}),e[0]=r):r=e[0],r}if(a.kind==="unavailable"){let r;return e[1]!==s||e[2]!==a.reason?(r=n(Va,{reason:a.reason,title:s}),e[1]=s,e[2]=a.reason,e[3]=r):r=e[3],r}let o;return e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n(fs,{}),e[4]=o):o=e[4],o},Uo=()=>{const t=M(46),e=se(),s=Ht();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:Jo},t[0]=a):a=t[0];const o=us(a),r=Do(o),i=zo.has(r),l=bs(),d=l?.toggle;za(d);const u=ks(),{groupLabel:c,tabDescription:m,tabLabel:h}=Ca(),{unavailable:f,visibleGroups:g}=Ba($t,u,e),v={...m,...f},y=ts(r,u,e),b=y.kind==="hidden";let p,x;t[1]!==b||t[2]!==s?(p=()=>{b&&St(s({replace:!0,to:"/home"}))},x=[b,s],t[1]=b,t[2]=s,t[3]=p,t[4]=x):(p=t[3],x=t[4]),dt(p,x);let k;t[5]!==s?(k=Q=>{St(s({to:`/${Q.currentTarget.dataset.tab??""}`}))},t[5]=s,t[6]=k):k=t[6];const P=k;let C,S;t[7]!==r||t[8]!==h?(C=()=>{typeof document<"u"&&(document.title=`${h[r]} · lunora`)},S=[r,h],t[7]=r,t[8]=h,t[9]=C,t[10]=S):(C=t[9],S=t[10]),dt(C,S);const N=g.find(Q=>Q.tabs.includes(r))??$t[0],T=g.flatMap(Q=>Q.tabs.filter(X=>f[X]===void 0).map(X=>({group:c[Q.key],label:h[X],to:`/${X}`}))),L=d===void 0?T:[...T,{group:e("Operations"),label:e("Toggle operation console"),run:d}],I=Pt(ss),O=I!==null&&I.token!=="";let B;t[11]!==L?(B=n(Ps,{items:L}),t[11]=L,t[12]=B):B=t[12];const V=c[N.key],z=h[r];let $;t[13]!==V||t[14]!==z?($=n(Ia,{domain:V,onOpenCommandPalette:_s,page:z}),t[13]=V,t[14]=z,t[15]=$):$=t[15];let H;t[16]!==I?.rulesInstalled?(H=I?.rulesInstalled===!1&&n(Us,{}),t[16]=I?.rulesInstalled,t[17]=H):H=t[17];const D=`dash-tab-${r}`,Z=i?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",E=h[r];let F;t[18]!==e||t[19]!==E?(F=e("{title} failed",{title:E}),t[18]=e,t[19]=E,t[20]=F):F=t[20];const ee=h[r];let q;t[21]!==e?(q=e("Try again"),t[21]=e,t[22]=q):q=t[22];let Y;t[23]===Symbol.for("react.memo_cache_sentinel")?(Y=n(Tt,{}),t[23]=Y):Y=t[23];const te=h[r];let W;t[24]!==te||t[25]!==y?(W=n(hs,{fallback:Y,children:n(Wo,{title:te,verdict:y})}),t[24]=te,t[25]=y,t[26]=W):W=t[26];let U;t[27]!==r||t[28]!==F||t[29]!==ee||t[30]!==q||t[31]!==W?(U=n(ps,{fallbackTitle:F,label:ee,retryLabel:q,children:W},r),t[27]=r,t[28]=F,t[29]=ee,t[30]=q,t[31]=W,t[32]=U):U=t[32];let j;t[33]!==Z||t[34]!==U?(j=n("div",{className:Z,children:U}),t[33]=Z,t[34]=U,t[35]=j):j=t[35];let G;t[36]!==l?(G=l?.open===!0&&n(Ma,{focusSeq:l.focusSeq,onClose:l.close,onShownChange:l.setShown,shown:l.shown}),t[36]=l,t[37]=G):G=t[37];let K;t[38]!==D||t[39]!==j||t[40]!==G?(K=w("div",{"aria-labelledby":D,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[j,G]}),t[38]=D,t[39]=j,t[40]=G,t[41]=K):K=t[41];let J;return t[42]!==H||t[43]!==K||t[44]!==$?(J=w(ua,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[$,H,K]}),t[42]=H,t[43]=K,t[44]=$,t[45]=J):J=t[45],w(la,{className:"min-h-0 flex-1","data-platform":u.platform?.id,"data-testid":"lunora-studio",children:[B,n(qo,{chrome:I,connected:O,current:r,groupLabel:c,groups:g,selectTab:P,tabDescription:v,tabLabel:h,unavailable:f}),J]})},jo=()=>{const t=M(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n(gs,{children:n(Uo,{})}),t[0]=e):e=t[0],e},Go=t=>{const e=M(5),{initialShardKey:s,schemaEditable:a}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=ds(o),{table:i}=r,l=typeof i=="string"?i:void 0;let d;return e[1]!==s||e[2]!==l||e[3]!==a?(d=n(Po,{initialShardKey:s,initialTable:l,schemaEditable:a}),e[1]=s,e[2]=l,e[3]=a,e[4]=d):d=e[4],d},Ko=()=>{const t=M(3),e=Ht();let s,a;return t[0]!==e?(s=()=>{St(e({replace:!0,to:"/home"}))},a=[e],t[0]=e,t[1]=s,t[2]=a):(s=t[1],a=t[2]),dt(s,a),null},Qo=({analyticsQuery:t,basePath:e,dataEditable:s=!1,functions:a,initialShardKey:o,openApiSpec:r,openRpcSpec:i,runAsIdentity:l=!1,schemaEditable:d=!1,scheduledCancel:u,scheduledCron:c,scheduledLoad:m})=>{const h=ns({component:jo}),f={agents:n(qa,{initialShardKey:o}),analytics:n(Wa,{runQuery:t}),api:n(Ua,{functions:a,initialShardKey:o,openApiSpec:r,openRpcSpec:i}),audit:n(uo,{initialShardKey:o}),authAudit:n(ja,{}),authConfig:n(Ga,{}),authSessions:n(Ka,{}),containers:n(Ja,{}),dashboards:n(Mo,{initialShardKey:o}),data:n(eo,{canGenerateRows:s&&d,editable:s,initialShardKey:o}),deploymentHealth:n(Xa,{}),drains:n(fo,{}),export:n(to,{initialShardKey:o}),fanout:n(No,{initialShardKey:o}),files:n(Lo,{}),kv:n(vo,{}),flags:n(no,{initialShardKey:o}),reactors:n(ro,{initialShardKey:o}),functions:w("div",{className:"flex flex-col gap-8",children:[n(lo,{functions:a,initialShardKey:o}),n(io,{functions:a,runAsIdentity:l})]}),health:n(So,{initialShardKey:o}),home:n(ws,{initialShardKey:o}),insights:n(Da,{initialShardKey:o}),issues:n(co,{initialShardKey:o}),logs:n(mo,{initialShardKey:o}),traces:n(Io,{initialShardKey:o}),evals:n(Ro,{initialShardKey:o}),aiUsage:n(Eo,{initialShardKey:o}),metrics:n(Co,{initialShardKey:o}),migrations:n(so,{initialShardKey:o}),notifications:n(xo,{}),organizations:n(Qa,{}),permissions:n(wo,{functions:a,runAsIdentity:l,schemaEditable:d}),pitr:n(oo,{initialShardKey:o}),mail:n(ho,{}),payments:n(yo,{}),queues:n(ko,{}),realtime:w("div",{className:"flex flex-col gap-8",children:[n(go,{initialShardKey:o}),n(bo,{})]}),rls:n(Oa,{}),schedule:n(po,{loadCronJobs:c,scheduledCancel:u,scheduledLoad:m}),schema:n(Go,{initialShardKey:o,schemaEditable:d}),advisorHealth:n(Za,{}),security:n(Fa,{}),settings:n(_o,{initialShardKey:o}),sql:n(To,{initialShardKey:o}),storageRules:n(Ao,{}),users:n(Ya,{}),vectors:n($o,{}),workflows:n(Ho,{})},g=Lt({component:()=>f.home,getParentRoute:()=>h,path:"/"}),v=as.map(p=>Lt({component:()=>f[p],getParentRoute:()=>h,path:`/${p}`,validateSearch:ao[p]})),y=h.addChildren([g,...v]),b="window"in globalThis?rs():is({initialEntries:["/home"]});return ls({...e===void 0||e==="/"?{}:{basepath:e},defaultNotFoundComponent:Ko,defaultPendingComponent:Tt,defaultPendingMinMs:0,defaultPendingMs:0,history:b,routeTree:y})},Yo=t=>{const e=M(18),{analyticsQuery:s,basePath:a,chrome:o,dataEditable:r,functions:i,initialShardKey:l,openApiSpec:d,openRpcSpec:u,runAsIdentity:c,schemaEditable:m,scheduledCancel:h,scheduledCron:f,scheduledLoad:g}=t;let v;e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==i||e[4]!==l||e[5]!==d||e[6]!==u||e[7]!==c||e[8]!==h||e[9]!==f||e[10]!==g||e[11]!==m?(v=Qo({analyticsQuery:s,basePath:a,dataEditable:r,functions:i,initialShardKey:l,openApiSpec:d,openRpcSpec:u,runAsIdentity:c,schemaEditable:m,scheduledCancel:h,scheduledCron:f,scheduledLoad:g}),e[0]=s,e[1]=a,e[2]=r,e[3]=i,e[4]=l,e[5]=d,e[6]=u,e[7]=c,e[8]=h,e[9]=f,e[10]=g,e[11]=m,e[12]=v):v=e[12];const y=v,b=o??null;let p;e[13]!==y?(p=n(cs,{router:y}),e[13]=y,e[14]=p):p=e[14];let x;return e[15]!==b||e[16]!==p?(x=n(ss,{value:b,children:p}),e[15]=b,e[16]=p,e[17]=x):x=e[17],x},An=t=>{const e=M(10);let s,a,o;e[0]!==t?({i18n:s,locale:a,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o):(s=e[1],a=e[2],o=e[3]);let r;e[4]!==o?(r=n(Vs,{children:n(Yo,{...o})}),e[4]=o,e[5]=r):r=e[5];const i=r;if(s===void 0&&a===void 0)return i;let l;return e[6]!==s||e[7]!==a||e[8]!==i?(l=n(Ns,{i18n:s,locale:a,children:i}),e[6]=s,e[7]=a,e[8]=i,e[9]=l):l=e[9],l};function Jo(t){return t.location.pathname}export{Fs as B,An as S,Bs as T,Ln as a,Ks as b,Js as c,Xs as d,ea as e,zs as u};
@@ -1 +0,0 @@
1
- import{a as Xe}from"./chunk-2URQKGWU.js";import"./chunk-4JLGLPWV.js";import{a as Ke}from"./chunk-EA2JKR5D.js";import{a as Ve}from"./chunk-66UGPQVC.js";import"./chunk-3Q2P62UR.js";import{a as He}from"./chunk-NFS7FTAR.js";import{W as We}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as le}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as de}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as Ge}from"./chunk-AVRH4ZBT.js";import{a as Pe}from"./chunk-ULIQFBZU.js";import"./chunk-GMHY2XTC.js";import"./chunk-35DM4JJG.js";import{a as j}from"./chunk-4ZEL6BYL.js";import{c as Me}from"./chunk-ZDPY27UY.js";import{f as Fe}from"./chunk-GUD3ZG3Z.js";import"./chunk-FSRSK4LY.js";import"./chunk-PUGHZTBL.js";import{a as ie}from"./chunk-FKVZRPV5.js";import{a as _e,b as Be,c as ke,d as G,e as C,f as w}from"./chunk-HEAQVSNS.js";import{a as Te,e as De}from"./chunk-N6NMLJ6R.js";import{d as $,f as ue,g as ce,h as me,m as ze,p as he,t as Ue}from"./chunk-PTZD7RUZ.js";import{a as h,d as Ee,e as nt,f as ot,g as dt}from"./chunk-YKXDMIHQ.js";var F=Ee(ot(),1);var A=Ee(nt(),1);var t=Ee(dt(),1);var lt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),i=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),d=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:d,queuesWithoutDlq:i,showReliabilityWarning:i.length>0||d>0}},"nt"),it=200,ut=ue(j.sendQueueMessage),ct=ue(j.replayQueueMessage),mt=ue(j.clearQueueMessages),Ye=96,ht=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n,ze)}catch{return"[unserializable]"}},"ct"),pt=h(n=>n.length>Ye?`${n.slice(0,Ye)}\u2026`:n,"ut"),gt=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","mt"),ft=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"ft"),xt=h(n=>{let e=(0,F.c)(11),{loaded:a,queues:i}=n,d=$(),s;e[0]!==d?(s=d("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[0]=d,e[1]=s):s=e[1];let o;e[2]!==s?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i||e[6]!==d?(r=a&&i.length===0?(0,t.jsx)(ie,{description:d("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:d("No queues defined")}):(0,t.jsx)(Te,{className:"overflow-hidden py-0",children:(0,t.jsx)(De,{className:"px-0",children:(0,t.jsxs)(_e,{"data-testid":"queues-table",children:[(0,t.jsx)(Be,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:d("Export")}),(0,t.jsx)(C,{children:d("Queue")}),(0,t.jsx)(C,{children:d("Mode")}),(0,t.jsx)(C,{children:d("Binding")}),(0,t.jsx)(C,{children:d("Dead-letter")})]})}),(0,t.jsx)(ke,{children:i.map(qt)})]})})}),e[4]=a,e[5]=i,e[6]=d,e[7]=r):r=e[7];let p;return e[8]!==o||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[o,r]}),e[8]=o,e[9]=r,e[10]=p):p=e[10],p},"ht"),yt=h(n=>{let e=(0,F.c)(67),{message:a,onReplay:i,replayingId:d}=n,s=$(),o,r,p,c,x,N,y,l,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let W=ht(a.body);r=G,N=`queues-message-${a.id}`;let z=a.exportName??a.queue;e[19]!==z?(y=(0,t.jsx)(w,{className:"font-mono text-xs",children:z}),e[19]=z,e[20]=y):y=e[20],e[21]!==a.messageId?(l=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=l):l=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let T=`queues-outcome-${a.id}`,D;e[25]!==a.outcome?(D=gt(a.outcome),e[25]=a.outcome,e[26]=D):D=e[26];let I;e[27]!==a.outcome||e[28]!==T||e[29]!==D?(I=(0,t.jsx)(de,{"data-testid":T,variant:D,children:a.outcome}),e[27]=a.outcome,e[28]=T,e[29]=D,e[30]=I):I=e[30];let M;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(M=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=M):M=e[34],e[35]!==I||e[36]!==M?(f=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,M]})}),e[35]=I,e[36]=M,e[37]=f):f=e[37],o=w,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",c=W,x=pt(W),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=o,e[10]=r,e[11]=p,e[12]=c,e[13]=x,e[14]=N,e[15]=y,e[16]=l,e[17]=m,e[18]=f}else o=e[9],r=e[10],p=e[11],c=e[12],x=e[13],N=e[14],y=e[15],l=e[16],m=e[17],f=e[18];let g;e[38]!==o||e[39]!==p||e[40]!==c||e[41]!==x?(g=(0,t.jsx)(o,{className:p,title:c,children:x}),e[38]=o,e[39]=p,e[40]=c,e[41]=x,e[42]=g):g=e[42];let q;e[43]!==a.capturedAt?(q=Ue(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,E=d!==null,Q;e[47]!==a.id||e[48]!==d||e[49]!==s?(Q=d===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=d,e[49]=s,e[50]=Q):Q=e[50];let L;e[51]!==a.id||e[52]!==i||e[53]!==S||e[54]!==E||e[55]!==Q?(L=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":S,disabled:E,onClick:i,size:"xs",type:"button",variant:"outline",children:Q})}),e[51]=a.id,e[52]=i,e[53]=S,e[54]=E,e[55]=Q,e[56]=L):L=e[56];let _;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==N||e[61]!==y||e[62]!==l||e[63]!==m||e[64]!==f||e[65]!==g?(_=(0,t.jsxs)(r,{"data-testid":N,children:[y,l,m,f,g,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=N,e[61]=y,e[62]=l,e[63]=m,e[64]=f,e[65]=g,e[66]=_):_=e[66],_},"pt"),Nt=h(n=>{let e=(0,F.c)(29),{hasError:a,messages:i,onClear:d,onReplay:s,replayingId:o}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let c;e[2]!==p?(c=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=c):c=e[3];let x;e[4]!==r?(x=r("Clear the whole message log?"),e[4]=r,e[5]=x):x=e[5];let N=i.length===0,y;e[6]!==r?(y=r("Clear log"),e[6]=r,e[7]=y):y=e[7];let l;e[8]!==d||e[9]!==x||e[10]!==N||e[11]!==y?(l=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(He,{confirmLabel:x,disabled:N,onConfirm:d,testId:"queues-clear",children:y})}),e[8]=d,e[9]=x,e[10]=N,e[11]=y,e[12]=l):l=e[12];let m;e[13]!==i.length||e[14]!==r?(m=i.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:i.length})}),e[13]=i.length,e[14]=r,e[15]=m):m=e[15];let f;e[16]!==c||e[17]!==l||e[18]!==m?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,l,m]}),e[16]=c,e[17]=l,e[18]=m,e[19]=f):f=e[19];let g;e[20]!==a||e[21]!==i||e[22]!==s||e[23]!==o||e[24]!==r?(g=!a&&i.length===0?(0,t.jsx)(ie,{description:r("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:r("No consumed messages yet.")}):(0,t.jsx)(Te,{className:"overflow-hidden py-0",children:(0,t.jsx)(De,{className:"px-0",children:(0,t.jsx)(Xe,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(_e,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(Be,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Message")}),(0,t.jsx)(C,{children:r("Attempts")}),(0,t.jsx)(C,{children:r("Outcome")}),(0,t.jsx)(C,{children:r("Body")}),(0,t.jsx)(C,{children:r("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(ke,{children:i.map(b=>(0,t.jsx)(yt,{message:b,onReplay:s,replayingId:o},b.id))})]})})})}),e[20]=a,e[21]=i,e[22]=s,e[23]=o,e[24]=r,e[25]=g):g=e[25];let q;return e[26]!==f||e[27]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[f,g]}),e[26]=f,e[27]=g,e[28]=q):q=e[28],q},"gt"),bt=h(n=>{let e=(0,F.c)(20),{batchMode:a,bodyText:i,delayText:d,onBatchModeChange:s,onBodyChange:o,onDelayChange:r,onSelectExport:p,onSend:c,queues:x,selectedExportName:N,sending:y}=n,l=$(),m;e[0]!==l?(m=l("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=l,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a||e[5]!==i||e[6]!==d||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==p||e[11]!==c||e[12]!==x||e[13]!==N||e[14]!==y||e[15]!==l?(g=x.length===0?(0,t.jsx)(ie,{description:l("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:l("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":l("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:p,value:N,children:x.map(vt)}),(0,t.jsx)(We,{"aria-label":l("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:l("Delay (s)"),type:"number",value:d}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),l("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||N==="",onClick:c,type:"button",children:l(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(Ke,{"aria-label":l("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:o,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:i})]}),e[4]=a,e[5]=i,e[6]=d,e[7]=s,e[8]=o,e[9]=r,e[10]=p,e[11]=c,e[12]=x,e[13]=N,e[14]=y,e[15]=l,e[16]=g):g=e[16];let q;return e[17]!==f||e[18]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,g]}),e[17]=f,e[18]=g,e[19]=q):q=e[19],q},"xt"),Ft=h(n=>{let e=(0,F.c)(59),{limit:a}=n,i=a??it,d=Fe(),s=$(),[o,r]=(0,A.useState)("declared"),[p,c]=(0,A.useState)(null),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let{data:N,error:y,errorSource:l}=Me(j.listQueues,x),m;e[1]!==i?(m={limit:i},e[1]=i,e[2]=m):m=e[2];let{data:f,error:g,errorSource:q,refetch:b}=Me(j.getQueueMessages,m),S=Array.isArray(N?.queues)?[...N.queues].toSorted(St):[],E=f?.entries??[],{deadLetteredCount:Q,queuesWithoutDlq:L,showReliabilityWarning:_}=lt(S,E),[W,z]=(0,A.useState)(""),[T,D]=(0,A.useState)(""),[I,M]=(0,A.useState)(""),[U,Ze]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(u=>u.exportName===W)?W:S[0]?.exportName??"",Je=o==="messages"?g:y,et=o==="messages"?q:l,fe=Je??p,xe=Je===null?p:et,K;e[3]!==b?(K=h(()=>{b()},"H"),e[3]=b,e[4]=K):K=e[4],Ve(K,o==="messages");let ye=h(async()=>{c(null);let u=H;if(u==="")return;let v=null,$e=T.trim();if($e!=="")try{v=JSON.parse($e)}catch{c(s("Body must be valid JSON."));return}let Ae,je=I.trim();if(je!==""){let P=Number(je);if(!Number.isFinite(P)||P<0){c(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(U&&!Array.isArray(v)){c(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let rt=U?{batch:v,delaySeconds:Ae,exportName:u}:{body:v,delaySeconds:Ae,exportName:u};try{await d.query(ut,rt,ce("")),b()}catch(P){c(me(P))}Oe(!1)},"ue"),V;e[5]!==d||e[6]!==b?(V=h(async u=>{c(null),Re(u);try{await d.query(ct,{id:u},ce("")),b()}catch(v){c(me(v))}Re(null)},"V"),e[5]=d,e[6]=b,e[7]=V):V=e[7];let Ne=V,X;e[8]!==d||e[9]!==b?(X=h(async()=>{c(null);try{await d.query(mt,{},ce("")),b()}catch(u){c(me(u))}},"Y"),e[8]=d,e[9]=b,e[10]=X):X=e[10];let be=X,Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=h(u=>{let v=u.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Y):Y=e[11];let tt=Y,Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=h(u=>{z(u.currentTarget.value)},"K"),e[12]=Z):Z=e[12];let qe=Z,ee;e[13]===Symbol.for("react.memo_cache_sentinel")?(ee=h(u=>{D(u.currentTarget.value)},"Z"),e[13]=ee):ee=e[13];let ve=ee,te;e[14]===Symbol.for("react.memo_cache_sentinel")?(te=h(u=>{M(u.currentTarget.value)},"ee"),e[14]=te):te=e[14];let Se=te,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=h(u=>{Ze(u.currentTarget.checked)},"te"),e[15]=ae):ae=e[15];let Ce=ae,se;e[16]!==ye?(se=h(()=>{he(ye())},"se"),e[16]=ye,e[17]=se):se=e[17];let we=se,re;e[18]!==Ne?(re=h(u=>{let{id:v}=u.currentTarget.dataset;v!==void 0&&he(Ne(v))},"ae"),e[18]=Ne,e[19]=re):re=e[19];let Ie=re,ne;e[20]!==be?(ne=h(()=>{he(be())},"re"),e[20]=be,e[21]=ne):ne=e[21];let Qe=ne,at="flex flex-col gap-6",st="lunora-queues-panel",B;e[22]!==s||e[23]!==o?(B=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(u=>(0,t.jsx)(le,{"aria-selected":o===u,"data-tab":u,"data-testid":`queues-tab-${u}`,onClick:tt,role:"tab",size:"sm",type:"button",variant:o===u?"secondary":"ghost",children:ft(u,s)},u))}),e[22]=s,e[23]=o,e[24]=B):B=e[24];let k;e[25]!==fe||e[26]!==xe?(k=fe!==null&&(0,t.jsx)(Ge,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=k):k=e[27];let Le=_&&(0,t.jsx)(Pe,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(Ct).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),Q>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:Q===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:Q})})]})}),O;e[28]!==S||e[29]!==N||e[30]!==o?(O=o==="declared"&&(0,t.jsx)(xt,{loaded:N!==void 0,queues:S}),e[28]=S,e[29]=N,e[30]=o,e[31]=O):O=e[31];let R;e[32]!==E||e[33]!==g||e[34]!==Qe||e[35]!==Ie||e[36]!==ge||e[37]!==o?(R=o==="messages"&&(0,t.jsx)(Nt,{hasError:g!==null,messages:E,onClear:Qe,onReplay:Ie,replayingId:ge}),e[32]=E,e[33]=g,e[34]=Qe,e[35]=Ie,e[36]=ge,e[37]=o,e[38]=R):R=e[38];let J;e[39]!==U||e[40]!==T||e[41]!==I||e[42]!==Ce||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==we||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==o?(J=o==="send"&&(0,t.jsx)(bt,{batchMode:U,bodyText:T,delayText:I,onBatchModeChange:Ce,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:we,queues:S,selectedExportName:H,sending:pe}),e[39]=U,e[40]=T,e[41]=I,e[42]=Ce,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=we,e[47]=S,e[48]=H,e[49]=pe,e[50]=o,e[51]=J):J=e[51];let oe;return e[52]!==B||e[53]!==k||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:at,"data-testid":st,children:[B,k,Le,O,R,J]}),e[52]=B,e[53]=k,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"jt");function qt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(w,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(qt,"yt");function vt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(vt,"bt");function St(n,e){return n.exportName.localeCompare(e.exportName)}h(St,"Nt");function Ct(n){return n.name}h(Ct,"qt");export{Ft as default};
@@ -1 +0,0 @@
1
- import{a as Oe,b as _e}from"./chunk-AWHXPIXU.js";import{i as je,k as He}from"./chunk-V3VJAA4D.js";import{K as Be,P as Ae,Q as Me,R as Se,S as Ve,T as Le,U as Fe,V as Te,a as Re,b as ye,c as Ie,e as U,f as Ee,g as Pe,q as De}from"./chunk-PLHA3OWK.js";import{b as we,c as Ge}from"./chunk-IS6LVJ6L.js";import{a as M,e as Ne}from"./chunk-AAVLPU5Q.js";import{a as Ce,c as ke,e as ge,i as ve,j as H}from"./chunk-225VJ77I.js";import{a as i,c as It,d as C,e as A,f as Et,g as xe,i as he}from"./chunk-YKXDMIHQ.js";var Qe=C(Et(),1);var V={};It(V,{Indicator:()=>$e,Root:()=>Ye});var l=C(A(),1);function Ue(o){if(!o)return null;for(let e of o.elements){let r=e.tagName;if(r==="BUTTON"||r==="INPUT"){let a=e;if(a.type==="submit")return a}}return null}i(Ue,"getDefaultFormSubmitter");var qe="data-checked",We="data-unchecked";function q(o){return{checked(e){return o.indeterminate?{}:e?{[qe]:""}:{[We]:""}},...Re}}i(q,"getCheckboxStateAttributesMapping");var ze=C(A(),1);function Ke(o,e,r,a=!0,s){let[f,p]=ze.useState(),P=U(s?`${s}-label`:void 0),b=o??e??f;return M(()=>{let x=o||e||!a?void 0:Nt(r.current,P);f!==x&&p(x)}),b}i(Ke,"useAriaLabelledBy");function Nt(o,e){let r=Dt(o);if(r)return!r.id&&e&&(r.id=e),r.id||void 0}i(Nt,"getAriaLabelledBy");function Dt(o){if(!o)return;let e=o.parentElement;if(e&&e.tagName==="LABEL")return e;let r=o.id;if(r){let s=o.nextElementSibling;if(s&&s.htmlFor===r)return s}let a=o.labels;return a&&a[0]}i(Dt,"findAssociatedLabel");var W=C(A(),1);var Bt=W.createContext(void 0);function Je(){return W.useContext(Bt)}i(Je,"useCheckboxGroupContext");var z=C(A(),1);var ie=z.createContext(void 0);function Xe(){let o=z.useContext(ie);if(o===void 0)throw new Error(ke(14));return o}i(Xe,"useCheckboxRootContext");var S=C(xe(),1);var At="data-parent",Ye=l.forwardRef(i(function(e,r){let{checked:a,className:s,defaultChecked:f=!1,"aria-labelledby":p,disabled:P=!1,form:b,id:x,indeterminate:N=!1,inputRef:X,name:L,onCheckedChange:F,parent:u=!1,readOnly:y=!1,render:ae,required:I=!1,uncheckedValue:T,value:O,nativeButton:_=!1,style:Mt,...Ze}=e,{clearErrors:et}=Ie(),{disabled:tt,name:ot,setDirty:rt,setFilled:se,setFocused:de,setTouched:nt,state:ce,validationMode:it,validityData:at,validation:st}=ye(),dt=Be(),{labelId:ct,registerControlId:ut,getDescriptionProps:ue}=Ee(),n=Je(),k=n?.allValues===void 0?void 0:n.parent,w=k!==void 0,c=tt||dt.disabled||n?.disabled||P,E=ot??L,d=O??E,le=U(),lt=n?.registerControlId!==ut,Y=Pe({id:x||void 0,enabled:lt}),ft=_?Y:le,$={};w&&(u?$=k.getParentProps():d!==void 0&&($=k.getChildProps(d)));let{checked:fe=a,indeterminate:pt=N,onCheckedChange:mt,...bt}=$,Q=n?.value,G=l.useRef(null),{getButtonProps:xt,buttonRef:ht}=Ge({disabled:c,native:_}),D=n?.validation??st,[m,Ct]=Se({controlled:d!==void 0&&Q!==void 0&&!u?Q.includes(d):fe,default:f,name:"Checkbox",state:"checked"}),Z=w?!!fe:m,B=w&&pt||N;Ve(G,le,m,void 0,!n&&!c,L);let ee=k?.registerChildId,g=l.useRef(null),pe=D.registerInput,me=n?d:void 0,kt=l.useCallback(t=>pe(t,{controlRef:G,value:me}),[pe,me]),gt=ge(X,g,u?void 0:kt),vt=Ke(p,ct,g,!_,Y);M(()=>{g.current&&(g.current.indeterminate=B),n||se(m)},[m,B,n,se]),Le(m,()=>{n||(et(E),rt(m!==at.initialValue),D.change(m))});let Rt=Ce({checked:m,disabled:c,form:b,name:u?void 0:E,id:_?void 0:Y,required:I,ref:gt,style:E?_e:Oe,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(t){if(t.nativeEvent.defaultPrevented)return;if(y){t.preventDefault();return}let h=t.currentTarget.checked,v=Te(Fe.none,t.nativeEvent);if(F?.(h,v),!v.isCanceled&&(mt?.(h,v),!v.isCanceled&&(Ct(h),d!==void 0&&n!==void 0&&!u&&!w))){let R=h?[...n.value,d]:n.value.filter(j=>j!==d);n.setValue(R,v)}},onClick(t){t.stopPropagation()},onFocus(){G.current?.focus()}},O!==void 0?{value:(n?m&&O:O)||""}:ve,ue,t=>D.getValidationProps(c,t));l.useEffect(()=>{if(!k||d===void 0)return;let t=k.disabledStatesRef.current;return t.set(d,c),()=>{t.delete(d)}},[k,c,d]);let te=l.useMemo(()=>({...ce,checked:Z,disabled:c,readOnly:y,required:I,indeterminate:B}),[ce,Z,c,y,I,B]),yt=q(te),be=H("span",e,{state:te,ref:[ht,G,r],props:[{id:ft,role:"checkbox","aria-checked":B?"mixed":Z,"aria-readonly":y||void 0,"aria-required":I||void 0,"aria-labelledby":vt,[At]:u?"":void 0,onFocus(){c||de(!0)},onBlur(){let t=g.current;t&&(nt(!0),de(!1),it==="onBlur"&&D.commit(n?Q:t.checked))},onKeyDown(t){if(t.key!=="Enter"||(t.preventBaseUIHandler(),t.defaultPrevented))return;let h=g.current?.form??null,v=t.currentTarget,R=t.nativeEvent,j=t.preventDefault,re=R.preventDefault,ne=!1;t.preventDefault=()=>{ne=!0,j.call(t)},R.preventDefault=()=>{ne=!0,re.call(R)},re.call(R),Ne(v).queueMicrotask(()=>{t.preventDefault=j,R.preventDefault=re,ne||Ue(h)?.click()})},onClick(t){if(y||c)return;t.preventDefault();let h=g.current;h&&we(h,t)}},Ze,bt,xt,ue,t=>D.getValidationProps(c,t)],stateAttributesMapping:yt}),oe=be.props.id;return M(()=>{if(!(!ee||u||d===void 0||oe===void 0))return ee(d,oe)},[ee,u,d,oe]),(0,S.jsxs)(ie.Provider,{value:te,children:[be,!m&&!n&&E&&!u&&T!==void 0&&(0,S.jsx)("input",{type:"hidden",form:b,name:E,value:T,disabled:c}),(0,S.jsx)("input",{...Rt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));var K=C(A(),1);var $e=K.forwardRef(i(function(e,r){let{render:a,className:s,style:f,keepMounted:p=!1,...P}=e,b=Xe(),x=b.checked||b.indeterminate,{mounted:N,transitionStatus:X,setMounted:L}=Me(x),F=K.useRef(null),u={...b,transitionStatus:X};Ae({batch:!0,enabled:!x,open:x,ref:F,onComplete(){x||L(!1)}});let ae={...q(b),...De},I=p||N,T=H("span",e,{ref:[r,F],state:u,stateAttributesMapping:ae,props:P});return I?T:null},"CheckboxIndicator"));var J=C(xe(),1);function Fo(o){let e=(0,Qe.c)(9),r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let s;e[3]!==r?(s=he("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",r),e[3]=r,e[4]=s):s=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,J.jsx)(V.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,J.jsx)(He,{icon:je,strokeWidth:2})}),e[5]=f):f=e[5];let p;return e[6]!==a||e[7]!==s?(p=(0,J.jsx)(V.Root,{"data-slot":"checkbox",className:s,...a,children:f}),e[6]=a,e[7]=s,e[8]=p):p=e[8],p}i(Fo,"v");export{Fo as a};
@@ -1,14 +0,0 @@
1
- import{a as je}from"./chunk-EA2JKR5D.js";import{a as he}from"./chunk-IMOHEGMV.js";import{d as Ne,f as ke,g as we,k as oe}from"./chunk-V3VJAA4D.js";import{a as V}from"./chunk-5WJXVZMZ.js";import{a as Pe}from"./chunk-EJSI4PMU.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as ye}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as B}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ve}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as $e}from"./chunk-4ZEL6BYL.js";import{f as F}from"./chunk-GUD3ZG3Z.js";import"./chunk-FSRSK4LY.js";import{d as be}from"./chunk-PUGHZTBL.js";import{a as U}from"./chunk-FKVZRPV5.js";import{d as M,e as Se,f as se,g as ie,h as le,m as Ie,p as Oe,s as ae}from"./chunk-PTZD7RUZ.js";import{a as u,d as z,e as ue,f as te,g as re,i as fe}from"./chunk-YKXDMIHQ.js";var Ge=z(te(),1),xe=z(ue(),1);var Y=z(te(),1);var X=z(ue(),1);var C=z(re(),1);var Ve=se($e.listTables),Xe=["react","client","cli"],Ye={action:"action",mutation:"mutation",query:"query"},Te=u(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"Q"),Ze=u(({file:t,fn:e,kind:a})=>`await client.${Ye[a]}(api.${t}.${e}, { /* args */ });`,"ie"),et=u(t=>{let e=`api.${t.file}.${t.fn}`;switch(t.kind){case"action":return`const { call: ${t.fn} } = useAction(${e});`;case"mutation":return`const ${t.fn} = useMutation(${e});`;default:return`const data = useQuery(${e}, { /* args */ });`}},"se"),tt=u(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"oe"),rt=u(t=>["// Read rows",`const rows = await ctx.db.query("${t}").collect();`,"","// Insert a row",`const id = await ctx.db.insert("${t}", { /* fields */ });`,"","// Generated types",`type Row = Doc<"${t}">;`,`type RowId = Id<"${t}">;`].join(`
2
- `),"ce"),at=u((t,e)=>{switch(t){case"cli":return tt(e);case"client":return Ze(e);default:return et(e)}},"re"),Ce=u(t=>{let e=(0,Y.c)(19),{code:a,label:r,testId:n}=t,s=M(),o;e[0]!==a?(o=u(()=>{ae(a)},"c"),e[0]=a,e[1]=o):o=e[1];let i=o,d;e[2]!==r?(d=(0,C.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let m=`${n}-copy`,l;e[4]!==s?(l=s("Copy"),e[4]=s,e[5]=l):l=e[5];let c;e[6]!==i||e[7]!==m||e[8]!==l?(c=(0,C.jsx)(B,{"data-testid":m,onClick:i,size:"xs",type:"button",variant:"ghost",children:l}),e[6]=i,e[7]=m,e[8]=l,e[9]=c):c=e[9];let f;e[10]!==d||e[11]!==c?(f=(0,C.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[d,c]}),e[10]=d,e[11]=c,e[12]=f):f=e[12];let h;e[13]!==a||e[14]!==n?(h=(0,C.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":n,children:a}),e[13]=a,e[14]=n,e[15]=h):h=e[15];let g;return e[16]!==f||e[17]!==h?(g=(0,C.jsxs)("div",{className:"flex flex-col gap-1.5",children:[f,h]}),e[16]=f,e[17]=h,e[18]=g):g=e[18],g},"U"),nt=u(t=>{let e=(0,Y.c)(46),{file:a,fn:r,kind:n}=t,s=M(),[o,i]=(0,X.useState)("react"),d,m,l;if(e[0]!==a||e[1]!==r||e[2]!==n||e[3]!==s||e[4]!==o){let w={file:a,fn:r,kind:n},j;e[8]!==s?(j=s("CLI"),e[8]=s,e[9]=j):j=e[9];let O;e[10]!==s?(O=s("Client"),e[10]=s,e[11]=O):O=e[11];let S;e[12]!==s?(S=s("React"),e[12]=s,e[13]=S):S=e[13];let T;e[14]!==j||e[15]!==O||e[16]!==S?(T={cli:j,client:O,react:S},e[14]=j,e[15]=O,e[16]=S,e[17]=T):T=e[17],l=T;let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=u(R=>{i(R.currentTarget.dataset.tab)},"B"),e[18]=A):A=e[18],d=A,m=at(o,w),e[0]=a,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=d,e[6]=m,e[7]=l}else d=e[5],m=e[6],l=e[7];let c=m,f=`api.${a}.${r}`,h;e[19]!==f?(h=(0,C.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-fn-title",children:f}),e[19]=f,e[20]=h):h=e[20];let g;e[21]!==n||e[22]!==s?(g=s("Call this {kind} from your app.",{kind:n}),e[21]=n,e[22]=s,e[23]=g):g=e[23];let x;e[24]!==g?(x=(0,C.jsx)("p",{className:"text-xs text-muted-foreground",children:g}),e[24]=g,e[25]=x):x=e[25];let y;e[26]!==h||e[27]!==x?(y=(0,C.jsxs)("div",{children:[h,x]}),e[26]=h,e[27]=x,e[28]=y):y=e[28];let N;e[29]!==s?(N=s("Snippet flavour"),e[29]=s,e[30]=N):N=e[30];let v;e[31]!==d||e[32]!==o||e[33]!==l?(v=Xe.map(w=>(0,C.jsx)(B,{"aria-selected":o===w,"data-tab":w,"data-testid":`api-tab-${w}`,onClick:d,role:"tab",size:"xs",type:"button",variant:o===w?"default":"outline",children:l[w]},w)),e[31]=d,e[32]=o,e[33]=l,e[34]=v):v=e[34];let b;e[35]!==N||e[36]!==v?(b=(0,C.jsx)("div",{"aria-label":N,className:"flex gap-1.5","data-testid":"api-tabs",role:"tablist",children:v}),e[35]=N,e[36]=v,e[37]=b):b=e[37];let I=l[o],P=`api-snippet-${o}`,$;e[38]!==c||e[39]!==I||e[40]!==P?($=(0,C.jsx)(Ce,{code:c,label:I,testId:P}),e[38]=c,e[39]=I,e[40]=P,e[41]=$):$=e[41];let k;return e[42]!==$||e[43]!==y||e[44]!==b?(k=(0,C.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-fn-doc",children:[y,b,$]}),e[42]=$,e[43]=y,e[44]=b,e[45]=k):k=e[45],k},"de"),ot=u(t=>{let e=(0,Y.c)(19),{name:a}=t,r=M(),n;e[0]!==a?(n=rt(a),e[0]=a,e[1]=n):n=e[1];let s=n,o;e[2]!==a?(o=(0,C.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-table-title",children:a}),e[2]=a,e[3]=o):o=e[3];let i;e[4]!==r?(i=r("Read and write this table through the typed data model."),e[4]=r,e[5]=i):i=e[5];let d;e[6]!==i?(d=(0,C.jsx)("p",{className:"text-xs text-muted-foreground",children:i}),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==o||e[9]!==d?(m=(0,C.jsxs)("div",{children:[o,d]}),e[8]=o,e[9]=d,e[10]=m):m=e[10];let l;e[11]!==r?(l=r("Data model"),e[11]=r,e[12]=l):l=e[12];let c;e[13]!==s||e[14]!==l?(c=(0,C.jsx)(Ce,{code:s,label:l,testId:"api-snippet-table"}),e[13]=s,e[14]=l,e[15]=c):c=e[15];let f;return e[16]!==m||e[17]!==c?(f=(0,C.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-table-doc",children:[m,c]}),e[16]=m,e[17]=c,e[18]=f):f=e[18],f},"fe"),_e=u(t=>{let e=(0,Y.c)(8),{active:a,label:r,onSelect:n,testId:s,value:o}=t,i;e[0]!==n||e[1]!==o?(i=u(()=>{n(o)},"m"),e[0]=n,e[1]=o,e[2]=i):i=e[2];let d=i,m=a?"page":void 0,l;return e[3]!==r||e[4]!==d||e[5]!==m||e[6]!==s?(l=(0,C.jsx)("button",{"aria-current":m,className:"w-full truncate rounded-md px-2 py-1 text-start font-mono text-xs text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-testid":s,onClick:d,type:"button",children:r}),e[3]=r,e[4]=d,e[5]=m,e[6]=s,e[7]=l):l=e[7],l},"G"),st=u(t=>{let e=new Map;for(let a of t){let{file:r,fn:n}=Te(a.path),s=e.get(r)??[];s.push({fn:n,kind:a.kind,path:a.path}),e.set(r,s)}return[...e.entries()].map(([a,r])=>({file:a,items:r.toSorted((n,s)=>n.fn.localeCompare(s.fn))})).toSorted((a,r)=>a.file.localeCompare(r.file))},"pe"),Ae=u(t=>{let e=(0,Y.c)(58),{functions:a,initialShardKey:r}=t,n=M(),s=F(),[o,i]=(0,X.useState)(null),[d,m]=(0,X.useState)(null),l,c;e[0]!==s||e[1]!==r?(l=u(()=>{let R=!1;return s.query(Ve,{},ie(r??"")).then(_=>(R||i(_),_)).catch(()=>{R||i([])}),()=>{R=!0}},"o"),c=[s,r],e[0]=s,e[1]=r,e[2]=l,e[3]=c):(l=e[2],c=e[3]),(0,X.useEffect)(l,c);let f,h,g,x,y,N,v,b,I,P;if(e[4]!==a||e[5]!==d||e[6]!==n||e[7]!==o){let R=a??[],_=st(R),L=(o??[]).map(it).toSorted(lt),E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=u(q=>{m({kind:"fn",path:q})},"P"),e[18]=E):E=e[18];let W=E,Q;e[19]===Symbol.for("react.memo_cache_sentinel")?(Q=u(q=>{m({kind:"table",name:q})},"j"),e[19]=Q):Q=e[19];let Qe=Q;h=d?.kind==="fn"?R.find(q=>q.path===d.path):void 0,f=R.length>0||L.length>0,g=h===void 0?void 0:Te(h.path),I="grid min-h-0 gap-6 md:grid-cols-[16rem_minmax(0,1fr)]",P="lunora-api-docs",e[20]!==n?(x=n("API resources"),e[20]=n,e[21]=x):x=e[21],y="flex flex-col gap-4 overflow-y-auto",N="api-rail";let ne;e[22]!==d||e[23]!==n?(ne=u(q=>(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:q.file||n("(root)")}),q.items.map(ee=>(0,C.jsx)(_e,{active:d?.kind==="fn"&&d.path===ee.path,label:ee.fn,onSelect:W,testId:`api-rail-fn-${ee.path}`,value:ee.path},ee.path))]},q.file),"q"),e[22]=d,e[23]=n,e[24]=ne):ne=e[24],v=_.map(ne),b=L.length>0&&(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Tables")}),L.map(q=>(0,C.jsx)(_e,{active:d?.kind==="table"&&d.name===q,label:q,onSelect:Qe,testId:`api-rail-table-${q}`,value:q},q))]}),e[4]=a,e[5]=d,e[6]=n,e[7]=o,e[8]=f,e[9]=h,e[10]=g,e[11]=x,e[12]=y,e[13]=N,e[14]=v,e[15]=b,e[16]=I,e[17]=P}else f=e[8],h=e[9],g=e[10],x=e[11],y=e[12],N=e[13],v=e[14],b=e[15],I=e[16],P=e[17];let $;e[25]!==f||e[26]!==n?($=!f&&(0,C.jsx)("p",{className:"px-2 text-xs text-muted-foreground","data-testid":"api-rail-empty",children:n("No functions or tables to document yet.")}),e[25]=f,e[26]=n,e[27]=$):$=e[27];let k;e[28]!==$||e[29]!==x||e[30]!==y||e[31]!==N||e[32]!==v||e[33]!==b?(k=(0,C.jsxs)("nav",{"aria-label":x,className:y,"data-testid":N,children:[v,b,$]}),e[28]=$,e[29]=x,e[30]=y,e[31]=N,e[32]=v,e[33]=b,e[34]=k):k=e[34];let w;e[35]!==d||e[36]!==n?(w=d===null&&(0,C.jsx)(U,{description:n("Select a function or table to see how to call it from your app."),testId:"api-empty",title:n("API usage snippets")}),e[35]=d,e[36]=n,e[37]=w):w=e[37];let j;e[38]!==d?.kind||e[39]!==h||e[40]!==g?(j=d?.kind==="fn"&&h!==void 0&&g!==void 0&&(0,C.jsx)(nt,{file:g.file,fn:g.fn,kind:h.kind},h.path),e[38]=d?.kind,e[39]=h,e[40]=g,e[41]=j):j=e[41];let O;e[42]!==d?.kind||e[43]!==h||e[44]!==n?(O=d?.kind==="fn"&&h===void 0&&(0,C.jsx)(U,{testId:"api-empty",title:n("API usage snippets")}),e[42]=d?.kind,e[43]=h,e[44]=n,e[45]=O):O=e[45];let S;e[46]!==d?(S=d?.kind==="table"&&(0,C.jsx)(ot,{name:d.name}),e[46]=d,e[47]=S):S=e[47];let T;e[48]!==w||e[49]!==j||e[50]!==O||e[51]!==S?(T=(0,C.jsxs)("div",{className:"min-w-0",children:[w,j,O,S]}),e[48]=w,e[49]=j,e[50]=O,e[51]=S,e[52]=T):T=e[52];let A;return e[53]!==k||e[54]!==T||e[55]!==I||e[56]!==P?(A=(0,C.jsxs)("div",{className:I,"data-testid":P,children:[k,T]}),e[53]=k,e[54]=T,e[55]=I,e[56]=P,e[57]=A):A=e[57],A},"ke");function it(t){return t.name}u(it,"ue");function lt(t,e){return t.localeCompare(e)}u(lt,"me");var We=z(te(),1);var K=z(te(),1),J=z(ue(),1);var p=z(re(),1);var pe=u(function(t,e,a){let r=(0,K.c)(15),n;r[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},r[0]=n):n=r[0];let[s,o]=(0,J.useState)(n),i;r[1]!==e?(i=u(async()=>e(),"a"),r[1]=e,r[2]=i):i=r[2];let d=(0,J.useEffectEvent)(i),m;r[3]!==a?(m=u(g=>a(g),"d"),r[3]=a,r[4]=m):m=r[4];let l=(0,J.useEffectEvent)(m),c;r[5]!==l||r[6]!==d||r[7]!==t?(c=u(()=>{if(t!==void 0)return;let g=!1;return d().then(x=>(g||o(l(x)),x)).catch(x=>{g||o({kind:"error",message:le(x)})}),()=>{g=!0}},"u"),r[5]=l,r[6]=d,r[7]=t,r[8]=c):c=r[8];let f;r[9]!==t?(f=[t],r[9]=t,r[10]=f):f=r[10],(0,J.useEffect)(c,f);let h;return r[11]!==a||r[12]!==s||r[13]!==t?(h=t===void 0?s:a(t),r[11]=a,r[12]=s,r[13]=t,r[14]=h):h=r[14],h},"Ot"),dt=u(t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string","Oe"),Je=u(t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},"Z"),ce=u(t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>ce(e)).join(" | "):t.type==="array"?`array<${ce(t.items)}>`:t.type??"any","F"),ct=u(t=>{let e=Je(t);return e!==void 0?t.type??dt(e[0]):ce(t)},"$e"),pt=u(t=>{let e=Je(t);return e===void 0?void 0:e.map(a=>JSON.stringify(a)).join(" | ")},"Te"),mt=u(t=>{let e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} \u2264`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);let a=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`\u2264 ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);let r=e.length>(a?2:1);return a||r?e.join(" "):void 0},"Ee"),ut=u(t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},"Ce"),Z=u(t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return Z(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{let e={};for(let[a,r]of Object.entries(t.properties??{}))e[a]=Z(r);return e}case"string":return"";default:return null}},"D"),de=u(t=>{let e=(0,K.c)(7),{label:a,value:r}=t,n;e[0]!==a?(n=(0,p.jsx)("span",{className:"text-muted-foreground",children:a}),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==r?(s=(0,p.jsx)("span",{className:"text-foreground",children:r}),e[2]=r,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,p.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"K"),ft=u(t=>{let e=(0,K.c)(40),{name:a,required:r,schema:n}=t,s=M(),o;e[0]!==n?(o=mt(n),e[0]=n,e[1]=o):o=e[1];let i=o,d;e[2]!==n?(d=pt(n),e[2]=n,e[3]=d):d=e[3];let m=d,l=n["x-lunora-table"],c=n.format!==void 0||i!==void 0||m!==void 0||l!==void 0,f;e[4]!==n?(f=ut(n),e[4]=n,e[5]=f):f=e[5];let h=f,g=r?"*":"?",x;e[6]!==g?(x=(0,p.jsx)("span",{className:"text-muted-foreground",children:g}),e[6]=g,e[7]=x):x=e[7];let y;e[8]!==a||e[9]!==x?(y=(0,p.jsxs)("span",{className:"font-mono text-foreground",children:[a,x]}),e[8]=a,e[9]=x,e[10]=y):y=e[10];let N;e[11]!==n?(N=ct(n),e[11]=n,e[12]=N):N=e[12];let v;e[13]!==N?(v=(0,p.jsx)("span",{className:"font-mono text-muted-foreground",children:N}),e[13]=N,e[14]=v):v=e[14];let b;e[15]!==y||e[16]!==v?(b=(0,p.jsxs)("div",{className:"flex items-baseline gap-2",children:[y,v]}),e[15]=y,e[16]=v,e[17]=b):b=e[17];let I;e[18]!==n.description?(I=n.description!==void 0&&(0,p.jsx)("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=I):I=e[19];let P;e[20]!==c||e[21]!==i||e[22]!==l||e[23]!==n.format||e[24]!==s||e[25]!==m?(P=c&&(0,p.jsxs)("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&(0,p.jsx)(de,{label:s("Format"),value:n.format}),i!==void 0&&(0,p.jsx)(de,{label:s("Range"),value:i}),m!==void 0&&(0,p.jsx)(de,{label:s("Value in"),value:m}),l!==void 0&&(0,p.jsx)(de,{label:s("relation"),value:l})]}),e[20]=c,e[21]=i,e[22]=l,e[23]=n.format,e[24]=s,e[25]=m,e[26]=P):P=e[26];let $;e[27]!==I||e[28]!==P||e[29]!==b?($=(0,p.jsxs)("div",{className:"flex flex-col gap-1 py-2",children:[b,I,P]}),e[27]=I,e[28]=P,e[29]=b,e[30]=$):$=e[30];let k=$;if(h===void 0){let S;return e[31]!==k?(S=(0,p.jsx)("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=S):S=e[32],S}let w;e[33]!==k?(w=(0,p.jsx)("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=w):w=e[34];let j;e[35]!==h?(j=(0,p.jsx)("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:(0,p.jsx)(Me,{schema:h})}),e[35]=h,e[36]=j):j=e[36];let O;return e[37]!==w||e[38]!==j?(O=(0,p.jsxs)("details",{className:"border-b border-border/50 last:border-b-0",children:[w,j]}),e[37]=w,e[38]=j,e[39]=O):O=e[39],O},"Ae"),Me=u(t=>{let e=(0,K.c)(7),{schema:a}=t,r;e[0]!==a.required?(r=new Set(a.required),e[0]=a.required,e[1]=r):r=e[1];let n=r,s;e[2]!==a.properties?(s=Object.entries(a.properties??{}),e[2]=a.properties,e[3]=s):s=e[3];let o=s,i;return e[4]!==n||e[5]!==o?(i=(0,p.jsx)("div",{className:"flex flex-col",children:o.map(d=>{let[m,l]=d;return(0,p.jsx)(ft,{name:m,required:n.has(m),schema:l},m)})}),e[4]=n,e[5]=o,e[6]=i):i=e[6],i},"ee"),Re=u(t=>{let e=(0,K.c)(10),{schema:a,testId:r}=t;if(a?.type!=="object"||Object.keys(a.properties??{}).length===0){let o;e[0]!==a?(o=ce(a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==o||e[3]!==r?(i=(0,p.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":r,children:o}),e[2]=o,e[3]=r,e[4]=i):i=e[4],i}let n;e[5]!==a?(n=(0,p.jsx)(Me,{schema:a}),e[5]=a,e[6]=n):n=e[6];let s;return e[7]!==n||e[8]!==r?(s=(0,p.jsx)("div",{className:"text-xs","data-testid":r,children:n}),e[7]=n,e[8]=r,e[9]=s):s=e[9],s},"G"),ht=["curl","javascript","lunora"],gt={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},xt=u(t=>`api.${t.replaceAll(/[/:]/g,".")}`,"Ie"),bt=u(t=>{let e=Z(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},"Pe"),vt=u((t,e,a)=>{let r=`${a}${e.httpPath}`,n=JSON.stringify(bt(e),void 0,2),s=JSON.stringify(Z(e.argsSchema)??{},void 0,2);switch(t){case"curl":{let o=e.method!=="GET"&&e.method!=="HEAD",i=[`curl -X ${e.method} ${JSON.stringify(r)}`];return o&&i.push(' -H "Content-Type: application/json"',` -d '${n}'`),i.join(` \\
3
- `)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
4
- import { api } from "./_generated/api";
5
-
6
- const client = useLunora();
7
- await client.${e.kind??"query"}(${xt(e.functionPath)}, ${s});`;default:{let o=e.method!=="GET"&&e.method!=="HEAD"?`{
8
- method: ${JSON.stringify(e.method)},
9
- headers: { "Content-Type": "application/json" },
10
- body: JSON.stringify(${n}),
11
- }`:`{ method: ${JSON.stringify(e.method)} }`;return`const response = await fetch(${JSON.stringify(r)}, ${o});
12
- const data = await response.json();`}}},"Le"),yt=u(t=>{let e=(0,K.c)(24),{operation:a,server:r}=t,n=M(),[s,o]=(0,J.useState)("curl"),i;e[0]!==a||e[1]!==s||e[2]!==r?(i=vt(s,a,r),e[0]=a,e[1]=s,e[2]=r,e[3]=i):i=e[3];let d=i,m;e[4]!==d?(m=u(()=>{ae(d)},"d"),e[4]=d,e[5]=m):m=e[5];let l=m,c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=u(I=>{o(I.currentTarget.dataset.sample)},"u"),e[6]=c):c=e[6];let f=c,h;e[7]!==s?(h=ht.map(I=>(0,p.jsx)("button",{"aria-selected":s===I,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":I,"data-testid":`api-sample-${I}`,onClick:f,role:"tab",type:"button",children:gt[I]},I)),e[7]=s,e[8]=h):h=e[8];let g;e[9]!==h?(g=(0,p.jsx)("div",{className:"flex gap-1",role:"tablist",children:h}),e[9]=h,e[10]=g):g=e[10];let x;e[11]!==n?(x=n("Copy"),e[11]=n,e[12]=x):x=e[12];let y;e[13]!==l||e[14]!==x?(y=(0,p.jsx)(B,{"data-testid":"api-sample-copy",onClick:l,size:"xs",type:"button",variant:"ghost",children:x}),e[13]=l,e[14]=x,e[15]=y):y=e[15];let N;e[16]!==g||e[17]!==y?(N=(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[g,y]}),e[16]=g,e[17]=y,e[18]=N):N=e[18];let v;e[19]!==d?(v=(0,p.jsx)("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:d}),e[19]=d,e[20]=v):v=e[20];let b;return e[21]!==N||e[22]!==v?(b=(0,p.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[N,v]}),e[21]=N,e[22]=v,e[23]=b):b=e[23],b},"_e"),Nt={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},kt=u(t=>{switch(t.toUpperCase()){case"DELETE":return"red";case"GET":return"emerald";case"PATCH":return"orange";case"POST":return"blue";case"PUT":return"orange";default:return"neutral"}},"Me"),wt=u(t=>{switch(t){case"action":return"violet";case"mutation":return"orange";case"query":return"emerald";default:return"neutral"}},"Je"),ge=u(t=>{let e=(0,K.c)(7),{kind:a,method:r,testId:n}=t,s;e[0]!==a||e[1]!==r?(s=a??r.toUpperCase(),e[0]=a,e[1]=r,e[2]=s):s=e[2];let o=s,i=a===void 0?kt(r):wt(a),d=`${Nt[i]} font-mono text-[10px] tracking-wide uppercase`,m;return e[3]!==o||e[4]!==d||e[5]!==n?(m=(0,p.jsx)(ve,{className:d,"data-testid":n,variant:"ghost",children:o}),e[3]=o,e[4]=d,e[5]=n,e[6]=m):m=e[6],m},"H"),Le=u(t=>t.startsWith("2")?"text-emerald-600 dark:text-emerald-400":t==="default"||t.startsWith("4")||t.startsWith("5")?"text-red-600 dark:text-red-400":"text-muted-foreground","te"),qe=u(t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground","re"),St=new Set([" ",`
13
- `,"\r"]),Ee=" ",It=u(t=>{let e="";for(let n of t)St.has(n)||(e+=n);let a=0,r=e.length;for(;a<r&&(e[a]??"")<=Ee;)a+=1;for(;r>a&&(e[r-1]??"")<=Ee;)r-=1;return e.slice(a,r)},"Ke"),Ot=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,$t=u((t,e)=>{let a=globalThis.location?.origin??"",r=e===""?a:e,n=It(t);if(r===""){if(Ot.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}let s=new URL(n,r);if(s.origin!==new URL(r).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${s.origin} is not ${r})`);return s.toString()},"ze"),Pt=u(async(t,e,a,r)=>{let n=t.method!=="GET"&&t.method!=="HEAD",s=$t(t.httpPath,a),o=await(await fetch(s,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...r===null||r===""?{}:{authorization:`Bearer ${r}`}},method:t.method})).text();try{return JSON.parse(o)}catch{return o}},"We"),jt=u(t=>JSON.stringify(Z(t.argsSchema)??{},void 0,2),"qe"),Ke=(0,J.createContext)(null),ze=u(()=>{let t=(0,J.use)(Ke);if(t===null)throw new be("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},"ne"),_t=u(({children:t,operation:e})=>{let a=M(),r=F(),[n,s]=(0,J.useState)(()=>jt(e)),[o,i]=(0,J.useState)(""),[d,m]=(0,J.useState)("idle"),[l,c]=(0,J.useState)(void 0),[f,h]=(0,J.useState)(null),[g,x]=(0,J.useState)(null),y=u(async()=>{let N;try{N=n.trim()===""?{}:JSON.parse(n)}catch(b){m("error"),c(void 0),x(null),h(a("Invalid JSON args: {message}",{message:le(b)}));return}m("running"),h(null);let v=performance.now();try{let b=await(e.functionPath===void 0?Pt(e,N,r.url,r.getAuthToken()):Se(r,e.kind,se(e.functionPath),N,ie(o)));c(b),x(Math.round(performance.now()-v)),m("success")}catch(b){c(void 0),x(Math.round(performance.now()-v)),h(le(b)),m("error")}},"v");return(0,p.jsx)(Ke,{value:{argsText:n,durationMs:g,error:f,operation:e,response:l,send:u(()=>{Oe(y())},"send"),setArgsText:s,setShardKey:i,shardKey:o,status:d},children:t})},"He"),Tt=u(()=>{let t=(0,K.c)(48),e=M(),{argsText:a,operation:r,send:n,setArgsText:s,setShardKey:o,shardKey:i,status:d}=ze(),m;t[0]!==s?(m=u(_=>{s(_.target.value)},"d"),t[0]=s,t[1]=m):m=t[1];let l=m,c;t[2]!==n?(c=u(_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),n())},"u"),t[2]=n,t[3]=c):c=t[3];let f=c,h=d==="running",g;t[4]!==r.kind||t[5]!==r.method?(g=(0,p.jsx)(ge,{kind:r.kind,method:r.method,testId:"api-try-method"}),t[4]=r.kind,t[5]=r.method,t[6]=g):g=t[6];let x=r.functionPath??r.httpPath,y;t[7]!==x?(y=(0,p.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:x}),t[7]=x,t[8]=y):y=t[8];let N=h?"animate-pulse":void 0,v;t[9]!==N?(v=(0,p.jsx)(oe,{className:N,icon:we,strokeWidth:2}),t[9]=N,t[10]=v):v=t[10];let b;t[11]!==h||t[12]!==e?(b=e(h?"Sending\u2026":"Send"),t[11]=h,t[12]=e,t[13]=b):b=t[13];let I;t[14]!==h||t[15]!==n||t[16]!==v||t[17]!==b?(I=(0,p.jsxs)(B,{"data-testid":"api-try-send",disabled:h,onClick:n,size:"sm",type:"button",children:[v,b]}),t[14]=h,t[15]=n,t[16]=v,t[17]=b,t[18]=I):I=t[18];let P;t[19]!==g||t[20]!==y||t[21]!==I?(P=(0,p.jsxs)("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[g,y,I]}),t[19]=g,t[20]=y,t[21]=I,t[22]=P):P=t[22];let $;t[23]!==e?($=e("Arguments (JSON)"),t[23]=e,t[24]=$):$=t[24];let k;t[25]!==$?(k=(0,p.jsx)(he,{htmlFor:"api-try-args",children:$}),t[25]=$,t[26]=k):k=t[26];let w;t[27]!==a?(w=a.split(`
14
- `),t[27]=a,t[28]=w):w=t[28];let j=Math.min(12,Math.max(3,w.length)),O;t[29]!==a||t[30]!==l||t[31]!==f||t[32]!==j?(O=(0,p.jsx)(je,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:l,onKeyDown:f,rows:j,spellCheck:!1,value:a}),t[29]=a,t[30]=l,t[31]=f,t[32]=j,t[33]=O):O=t[33];let S;t[34]!==k||t[35]!==O?(S=(0,p.jsxs)("div",{className:"flex flex-col gap-1.5",children:[k,O]}),t[34]=k,t[35]=O,t[36]=S):S=t[36];let T;t[37]!==r.functionPath||t[38]!==o||t[39]!==i||t[40]!==e?(T=r.functionPath!==void 0&&(0,p.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,p.jsx)(he,{htmlFor:"shard-input",children:e("Shard key (optional)")}),(0,p.jsx)(Pe,{id:"shard-input",onChange:o,testId:"shard-input",value:i})]}),t[37]=r.functionPath,t[38]=o,t[39]=i,t[40]=e,t[41]=T):T=t[41];let A;t[42]!==S||t[43]!==T?(A=(0,p.jsxs)("div",{className:"flex flex-col gap-3 p-3",children:[S,T]}),t[42]=S,t[43]=T,t[44]=A):A=t[44];let R;return t[45]!==A||t[46]!==P?(R=(0,p.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[P,A]}),t[45]=A,t[46]=P,t[47]=R):R=t[47],R},"Ue"),Ct=u(t=>{let e=(0,K.c)(51),{operation:a}=t,r=M(),n=`api-operation-${a.operationId}`,s=a.key,o;e[0]!==a.kind||e[1]!==a.method?(o=(0,p.jsx)(ge,{kind:a.kind,method:a.method,testId:"api-operation-method"}),e[0]=a.kind,e[1]=a.method,e[2]=o):o=e[2];let i=a.functionPath??a.httpPath,d;e[3]!==i?(d=(0,p.jsx)("code",{className:"truncate font-mono text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=d):d=e[4];let m;e[5]!==o||e[6]!==d?(m=(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[o,d]}),e[5]=o,e[6]=d,e[7]=m):m=e[7];let l;e[8]!==a.title?(l=(0,p.jsx)("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:a.title}),e[8]=a.title,e[9]=l):l=e[9];let c;e[10]!==a.description?(c=a.description!==void 0&&(0,p.jsx)("p",{className:"text-sm text-muted-foreground",children:a.description}),e[10]=a.description,e[11]=c):c=e[11];let f;e[12]!==m||e[13]!==l||e[14]!==c?(f=(0,p.jsxs)("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[m,l,c]}),e[12]=m,e[13]=l,e[14]=c,e[15]=f):f=e[15];let h;e[16]!==r?(h=r("Try it"),e[16]=r,e[17]=h):h=e[17];let g;e[18]!==h?(g=(0,p.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[18]=h,e[19]=g):g=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=(0,p.jsx)(Tt,{}),e[20]=x):x=e[20];let y;e[21]!==g?(y=(0,p.jsxs)("section",{className:"flex flex-col gap-2",children:[g,x]}),e[21]=g,e[22]=y):y=e[22];let N;e[23]!==r?(N=r("Request arguments"),e[23]=r,e[24]=N):N=e[24];let v;e[25]!==N?(v=(0,p.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:N}),e[25]=N,e[26]=v):v=e[26];let b;e[27]!==a.argsSchema?(b=(0,p.jsx)(Re,{schema:a.argsSchema,testId:"api-operation-args"}),e[27]=a.argsSchema,e[28]=b):b=e[28];let I;e[29]!==v||e[30]!==b?(I=(0,p.jsxs)("section",{className:"flex flex-col gap-2",children:[v,b]}),e[29]=v,e[30]=b,e[31]=I):I=e[31];let P;e[32]!==r?(P=r("Response body"),e[32]=r,e[33]=P):P=e[33];let $;e[34]!==P?($=(0,p.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:P}),e[34]=P,e[35]=$):$=e[35];let k;if(e[36]!==a.responses||e[37]!==r){let O;e[39]!==r?(O=u(S=>(0,p.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,p.jsxs)("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${Le(S.status)}`,children:[(0,p.jsx)("span",{className:`size-1.5 rounded-full ${qe(S.status)}`}),S.status]}),S.schema!==void 0&&(0,p.jsx)("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r("application/json")})]}),S.description!==void 0&&(0,p.jsx)("p",{className:"text-xs text-muted-foreground",children:S.description}),S.schema!==void 0&&(0,p.jsx)(Re,{schema:S.schema,testId:`api-response-${S.status}`})]},S.status),"E"),e[39]=r,e[40]=O):O=e[40],k=a.responses.map(O),e[36]=a.responses,e[37]=r,e[38]=k}else k=e[38];let w;e[41]!==$||e[42]!==k?(w=(0,p.jsxs)("section",{className:"flex flex-col gap-3",children:[$,k]}),e[41]=$,e[42]=k,e[43]=w):w=e[43];let j;return e[44]!==a.key||e[45]!==n||e[46]!==y||e[47]!==I||e[48]!==w||e[49]!==f?(j=(0,p.jsxs)("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[f,y,I,w]},s),e[44]=a.key,e[45]=n,e[46]=y,e[47]=I,e[48]=w,e[49]=f,e[50]=j):j=e[50],j},"Ve"),At={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Rt=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Et=/^\s*:/,Jt=u((t,e,a)=>a.startsWith('"')?Et.test(t.slice(e))?"key":"string":a==="true"||a==="false"||a==="null"?"boolean":"number","Qe"),Mt=u(t=>{let e=[],a=0;for(let r of t.matchAll(Rt)){let{index:n}=r,s=r[0],o=n+s.length;n>a&&e.push({kind:"plain",start:a,text:t.slice(a,n)}),e.push({kind:Jt(t,o,s),start:n,text:s}),a=o}return a<t.length&&e.push({kind:"plain",start:a,text:t.slice(a)}),e},"Ze"),Lt=u(t=>{let e=(0,K.c)(4),{code:a}=t,r;e[0]!==a?(r=Mt(a).map(qt),e[0]=a,e[1]=r):r=e[1];let n;return e[2]!==r?(n=(0,p.jsx)(p.Fragment,{children:r}),e[2]=r,e[3]=n):n=e[3],n},"et");function qt(t){return(0,p.jsx)("span",{className:At[t.kind],children:t.text},t.start)}u(qt,"tt");var De="__live__",Kt=u(t=>t.schema===void 0?"":JSON.stringify(Z(t.schema),void 0,2),"rt"),zt=u((t,e,a)=>a?t??"":e===void 0?"":JSON.stringify(e,Ie,2),"st"),Dt=u(t=>{let e=(0,K.c)(18),{active:a,running:r,showError:n}=t,s=M();if(r){let c;e[0]!==s?(c=s("Sending\u2026"),e[0]=s,e[1]=c):c=e[1];let f;return e[2]!==c?(f=(0,p.jsx)("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:c}),e[2]=c,e[3]=f):f=e[3],f}if(a===void 0||a.body===""){let c;e[4]!==a?.live||e[5]!==s?(c=a?.live===!0?s("Send a request to see the response."):s("No example for this response."),e[4]=a?.live,e[5]=s,e[6]=c):c=e[6];let f;return e[7]!==c?(f=(0,p.jsx)("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:c}),e[7]=c,e[8]=f):f=e[8],f}let o=n&&"text-destructive",i;e[9]!==o?(i=fe("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",o),e[9]=o,e[10]=i):i=e[10];let d=n?"api-response-error":"api-response-body",m;e[11]!==a.body||e[12]!==n?(m=n?a.body:(0,p.jsx)(Lt,{code:a.body}),e[11]=a.body,e[12]=n,e[13]=m):m=e[13];let l;return e[14]!==i||e[15]!==d||e[16]!==m?(l=(0,p.jsx)("pre",{className:i,"data-testid":d,children:m}),e[14]=i,e[15]=d,e[16]=m,e[17]=l):l=e[17],l},"nt"),Wt=u(({durationMs:t,error:e,failed:a,operation:r,ran:n,response:s,t:o})=>{let i=r.responses.map(d=>({body:Kt(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:zt(e,s,a),durationMs:t,id:De,label:o("Live"),live:!0,status:a?"error":"200"},...i]:i},"ot"),Bt=u(()=>{let t=(0,K.c)(19),e=M(),{durationMs:a,error:r,operation:n,response:s,status:o}=ze(),i=o==="running",d=o==="error",m=o==="success"||d,l=Wt({durationMs:a,error:r,failed:d,operation:n,ran:m,response:s,t:e}),c=m?De:l.find(Ut)?.id??l[0]?.id??"",[f,h]=(0,J.useState)(null),g=l.find(_=>_.id===(f??c))??l[0],x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=u(_=>{let{id:L}=_.currentTarget.dataset;L!==void 0&&h(L)},"m"),t[0]=x):x=t[0];let y=x,N=u(()=>{g!==void 0&&ae(g.body)},"w"),v=g?.live===!0?g.durationMs:null,b=g?.live===!0&&g.status==="error",I="flex min-h-0 flex-col rounded-xl border border-border bg-card",P="api-response-panel",$;t[1]!==e?($=e("Response"),t[1]=e,t[2]=$):$=t[2];let k;t[3]!==$?(k=(0,p.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:$}),t[3]=$,t[4]=k):k=t[4];let w=v!==null&&(0,p.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:v})}),j=g!==void 0&&g.body!==""&&(0,p.jsx)(B,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:N,size:"icon-xs",type:"button",variant:"ghost",children:(0,p.jsx)(oe,{icon:Ne,strokeWidth:2})}),O;t[5]!==w||t[6]!==j?(O=(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[w,j]}),t[5]=w,t[6]=j,t[7]=O):O=t[7];let S;t[8]!==k||t[9]!==O?(S=(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,O]}),t[8]=k,t[9]=O,t[10]=S):S=t[10];let T=l.length>0&&(0,p.jsx)("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:l.map(_=>{let L=_.id===g?.id;return(0,p.jsxs)("button",{"aria-selected":L,className:fe("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",L?Le(_.status):"text-muted-foreground"),"data-id":_.id,"data-testid":_.live?"api-response-tab-live":`api-response-tab-${_.status}`,onClick:y,role:"tab",type:"button",children:[(0,p.jsx)("span",{className:`size-1.5 rounded-full ${qe(_.status)}`}),_.label]},_.id)})}),A;t[11]!==g||t[12]!==i||t[13]!==b?(A=(0,p.jsx)(Dt,{active:g,running:i,showError:b}),t[11]=g,t[12]=i,t[13]=b,t[14]=A):A=t[14];let R;return t[15]!==A||t[16]!==S||t[17]!==T?(R=(0,p.jsxs)("div",{className:I,"data-testid":P,children:[S,T,A]}),t[15]=A,t[16]=S,t[17]=T,t[18]=R):R=t[18],R},"it");function Ut(t){return t.status.startsWith("2")}u(Ut,"at");var Ft=u((t,e)=>{let a=e.trim().toLowerCase();return a===""?t:t.map(r=>({...r,operations:r.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(a))})).filter(r=>r.operations.length>0)},"lt"),me=u(t=>{let e=(0,K.c)(53),{model:a}=t,r=M(),n=a.groups[0]?.operations[0]?.key??"",[s,o]=(0,J.useState)(n),[i,d]=(0,J.useState)(""),m;e[0]!==n||e[1]!==a.operationByKey||e[2]!==s?(m=a.operationByKey.get(s)??a.operationByKey.get(n),e[0]=n,e[1]=a.operationByKey,e[2]=s,e[3]=m):m=e[3];let l=m,c,f,h,g,x,y,N,v,b,I;if(e[4]!==i||e[5]!==a.groups||e[6]!==a.server||e[7]!==l?.key||e[8]!==r){c=Ft(a.groups,i);let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=u(E=>{let{key:W}=E.currentTarget.dataset;W!==void 0&&o(W)},"E"),e[19]=O):O=e[19];let S=O,T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=u(E=>{d(E.target.value)},"R"),e[20]=T):T=e[20];let A=T;f=a.server??"",b="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",I="api-reference",e[21]!==r?(x=r("API operations"),e[21]=r,e[22]=x):x=e[22],y="flex min-h-0 flex-col overflow-y-auto border-r border-border",N="api-reference-nav";let R;e[23]===Symbol.for("react.memo_cache_sentinel")?(R=(0,p.jsx)(oe,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:ke,strokeWidth:2}),e[23]=R):R=e[23];let _;e[24]!==r?(_=r("Filter operations"),e[24]=r,e[25]=_):_=e[25],e[26]!==i||e[27]!==_?(v=(0,p.jsx)("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:(0,p.jsxs)("div",{className:"relative",children:[R,(0,p.jsx)(ye,{className:"h-7 pl-7","data-testid":"api-filter",onChange:A,placeholder:_,value:i})]})}),e[26]=i,e[27]=_,e[28]=v):v=e[28],h="flex flex-col gap-4 p-2";let L;e[29]!==l?.key||e[30]!==r?(L=u(E=>(0,p.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,p.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:E.name||r("(root)")}),(0,p.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:E.operations.length})]}),E.operations.map(W=>{let Q=W.key===l?.key;return(0,p.jsxs)("button",{"aria-current":Q?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":W.key,"data-testid":`api-nav-${W.operationId}`,onClick:S,type:"button",children:[(0,p.jsx)("span",{className:"truncate",children:W.summary}),(0,p.jsx)(ge,{kind:W.kind,method:W.method})]},W.key)})]},E.name),"_"),e[29]=l?.key,e[30]=r,e[31]=L):L=e[31],g=c.map(L),e[4]=i,e[5]=a.groups,e[6]=a.server,e[7]=l?.key,e[8]=r,e[9]=c,e[10]=f,e[11]=h,e[12]=g,e[13]=x,e[14]=y,e[15]=N,e[16]=v,e[17]=b,e[18]=I}else c=e[9],f=e[10],h=e[11],g=e[12],x=e[13],y=e[14],N=e[15],v=e[16],b=e[17],I=e[18];let P;e[32]!==c.length||e[33]!==r?(P=c.length===0&&(0,p.jsx)("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:r("No operations match your filter.")}),e[32]=c.length,e[33]=r,e[34]=P):P=e[34];let $;e[35]!==P||e[36]!==h||e[37]!==g?($=(0,p.jsxs)("div",{className:h,children:[g,P]}),e[35]=P,e[36]=h,e[37]=g,e[38]=$):$=e[38];let k;e[39]!==$||e[40]!==x||e[41]!==y||e[42]!==N||e[43]!==v?(k=(0,p.jsxs)("nav",{"aria-label":x,className:y,"data-testid":N,children:[v,$]}),e[39]=$,e[40]=x,e[41]=y,e[42]=N,e[43]=v,e[44]=k):k=e[44];let w;e[45]!==l||e[46]!==f?(w=l===void 0?(0,p.jsx)("div",{className:"lg:col-span-2"}):(0,p.jsxs)(_t,{operation:l,children:[(0,p.jsx)("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:(0,p.jsx)(Ct,{operation:l})}),(0,p.jsxs)("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[(0,p.jsx)(yt,{operation:l,server:f}),(0,p.jsx)(Bt,{})]})]},l.key),e[45]=l,e[46]=f,e[47]=w):w=e[47];let j;return e[48]!==k||e[49]!==w||e[50]!==b||e[51]!==I?(j=(0,p.jsxs)("div",{className:b,"data-testid":I,children:[k,w]}),e[48]=k,e[49]=w,e[50]=b,e[51]=I,e[52]=j):j=e[52],j},"$t");var H=z(re(),1);var Ht=["get","post","put","patch","delete","head","options","trace"],Be=u(t=>t?.content?.["application/json"]?.schema,"y"),Gt=u((t,e)=>Object.entries(t.responses??{}).map(([a,r])=>{let n=r.$ref?.replace("#/components/responses/",""),s=n===void 0?r:e.components?.responses?.[n]??r;return{description:s.description,schema:Be(s),status:a}}),"j"),Qt=u((t,e,a,r,n)=>{let s=Be(r.requestBody),o=s?.properties?.functionPath?.const,i=typeof o=="string"?o:void 0,d=i===void 0?s:s?.properties?.args,m=r.operationId??`${a} ${e}`;return{argsSchema:d,description:r.description,functionPath:i,httpPath:e,key:t,kind:r["x-lunora-function-kind"],method:a.toUpperCase(),operationId:m,requestSchema:s,responses:Gt(r,n),summary:r.summary??m,tags:r.tags??[],title:r.summary??m}},"b"),Vt=u(t=>{let e=[];for(let[a,r]of Object.entries(t.paths??{})){let n=a.includes("#")?a.slice(0,a.indexOf("#")):a;for(let s of Ht){let o=r[s];o!==void 0&&e.push(Qt(a,n,s,o,t))}}return e},"x"),Xt=u(t=>{let e=t??{},a=Vt(e),r=new Map((e.tags??[]).map(i=>[i.name,i.description])),n=new Set,s=[],o=u(i=>{if(n.has(i))return;n.add(i);let d=a.filter(m=>(m.tags[0]??"")===i);d.length>0&&s.push({description:r.get(i),name:i,operations:d})},"l");for(let i of e.tags??[])o(i.name);for(let i of a)o(i.tags[0]??"");return{groups:s,operationByKey:new Map(a.map(i=>[i.key,i])),server:e.servers?.[0]?.url,title:e.info?.title??"API reference",version:e.info?.version}},"w"),Yt=u(t=>{let{paths:e}=t;return e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0},"R"),Zt=u(t=>{let e=t;return Yt(e)?{kind:"empty"}:{kind:"ready",spec:e}},"T"),Ue=u(t=>{let e=(0,We.c)(23),{spec:a}=t,r=M(),n=F(),s;e[0]!==n?(s=u(()=>n.fetchOpenApi(),"n"),e[0]=n,e[1]=s):s=e[1];let o=pe(a,s,Zt),i;e[2]!==o.kind||e[3]!==o.spec?(i=o.kind==="ready"?Xt(o.spec):void 0,e[2]=o.kind,e[3]=o.spec,e[4]=i):i=e[4];let d=i;if(o.kind==="loading"){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,H.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"api-reference-loading",children:[(0,H.jsx)(V,{className:"h-8 w-48"}),(0,H.jsx)(V,{className:"h-64 w-full"})]}),e[5]=l):l=e[5],l}if(o.kind==="error"){let l;e[6]!==o.message||e[7]!==r?(l=r("Couldn't load the OpenAPI spec: {message}",{message:o.message}),e[6]=o.message,e[7]=r,e[8]=l):l=e[8];let c;e[9]!==r?(c=r("API reference unavailable"),e[9]=r,e[10]=c):c=e[10];let f;return e[11]!==l||e[12]!==c?(f=(0,H.jsx)(U,{description:l,testId:"api-reference-error",title:c}),e[11]=l,e[12]=c,e[13]=f):f=e[13],f}if(o.kind==="empty"||d===void 0){let l;e[14]!==r?(l=r("Run `lunora codegen` and wire `_generated/openapi.json` to the worker to render the API reference here."),e[14]=r,e[15]=l):l=e[15];let c;e[16]!==r?(c=r("No OpenAPI spec configured"),e[16]=r,e[17]=c):c=e[17];let f;return e[18]!==l||e[19]!==c?(f=(0,H.jsx)(U,{description:l,testId:"api-reference-empty",title:c}),e[18]=l,e[19]=c,e[20]=f):f=e[20],f}let m;return e[21]!==d?(m=(0,H.jsx)(me,{model:d}),e[21]=d,e[22]=m):m=e[22],m},"B");var Fe=z(te(),1);var G=z(re(),1);var er=u(t=>(t.params??[]).find(e=>e.name==="args")??(t.params??[])[0],"x"),tr=u(t=>t["x-tags"]?.[0]?.name??(t.name.includes(":")?t.name.slice(0,t.name.indexOf(":")):""),"v"),rr=u(t=>{let e=er(t)?.schema;return{argsSchema:e,description:t.description,functionPath:t.name,httpPath:"/_lunora/rpc",key:t.name,kind:t["x-lunora-function-kind"],method:"POST",operationId:t.name,requestSchema:e,responses:[{description:t.result?.name,schema:t.result?.schema,status:"200"}],summary:t.summary??t.name,tags:[tr(t)],title:t.summary??t.name}},"w"),ar=u(t=>{let e=t??{},a=(e.methods??[]).map(n=>rr(n)),r=new Map;for(let n of a){let s=n.tags[0]??"",o=r.get(s)??[];o.push(n),r.set(s,o)}return{groups:[...r.entries()].map(([n,s])=>({name:n,operations:s.toSorted((o,i)=>o.operationId.localeCompare(i.operationId))})).toSorted((n,s)=>n.name.localeCompare(s.name)),operationByKey:new Map(a.map(n=>[n.key,n])),title:e.info?.title??"API reference",version:e.info?.version}},"I"),nr=u(t=>t.methods===void 0||t.methods.length===0,"C"),or=u(t=>{let e=t;return nr(e)?{kind:"empty"}:{kind:"ready",spec:e}},"N"),He=u(t=>{let e=(0,Fe.c)(23),{spec:a}=t,r=M(),n=F(),s;e[0]!==n?(s=u(()=>n.fetchOpenRpc(),"a"),e[0]=n,e[1]=s):s=e[1];let o=pe(a,s,or),i;e[2]!==o.kind||e[3]!==o.spec?(i=o.kind==="ready"?ar(o.spec):void 0,e[2]=o.kind,e[3]=o.spec,e[4]=i):i=e[4];let d=i;if(o.kind==="loading"){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,G.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"openrpc-reference-loading",children:[(0,G.jsx)(V,{className:"h-8 w-48"}),(0,G.jsx)(V,{className:"h-64 w-full"})]}),e[5]=l):l=e[5],l}if(o.kind==="error"){let l;e[6]!==o.message||e[7]!==r?(l=r("Couldn't load the OpenRPC spec: {message}",{message:o.message}),e[6]=o.message,e[7]=r,e[8]=l):l=e[8];let c;e[9]!==r?(c=r("API reference unavailable"),e[9]=r,e[10]=c):c=e[10];let f;return e[11]!==l||e[12]!==c?(f=(0,G.jsx)(U,{description:l,testId:"openrpc-reference-error",title:c}),e[11]=l,e[12]=c,e[13]=f):f=e[13],f}if(o.kind==="empty"||d===void 0){let l;e[14]!==r?(l=r("Run `lunora codegen --api-spec openrpc` and wire `_generated/openrpc.json` to the worker to render the OpenRPC reference here."),e[14]=r,e[15]=l):l=e[15];let c;e[16]!==r?(c=r("No OpenRPC spec configured"),e[16]=r,e[17]=c):c=e[17];let f;return e[18]!==l||e[19]!==c?(f=(0,G.jsx)(U,{description:l,testId:"openrpc-reference-empty",title:c}),e[18]=l,e[19]=c,e[20]=f):f=e[20],f}let m;return e[21]!==d?(m=(0,G.jsx)(me,{model:d}),e[21]=d,e[22]=m):m=e[22],m},"T");var D=z(re(),1);var sr=["reference","snippets"],ir=["openapi","openrpc"],Vr=u(t=>{let e=(0,Ge.c)(51),{functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:s}=t,o=M(),[i,d]=(0,xe.useState)("reference"),[m,l]=(0,xe.useState)("openapi"),c;e[0]!==o?(c=o("Reference"),e[0]=o,e[1]=c):c=e[1];let f;e[2]!==o?(f=o("Snippets"),e[2]=o,e[3]=f):f=e[3];let h;e[4]!==c||e[5]!==f?(h={reference:c,snippets:f},e[4]=c,e[5]=f,e[6]=h):h=e[6];let g=h,x;e[7]!==o?(x=o("OpenAPI"),e[7]=o,e[8]=x):x=e[8];let y;e[9]!==o?(y=o("OpenRPC"),e[9]=o,e[10]=y):y=e[10];let N;e[11]!==x||e[12]!==y?(N={openapi:x,openrpc:y},e[11]=x,e[12]=y,e[13]=N):N=e[13];let v=N,b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=u(E=>{d(E.currentTarget.dataset.view)},"S"),e[14]=b):b=e[14];let I=b,P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=u(E=>{l(E.currentTarget.dataset.format)},"A"),e[15]=P):P=e[15];let $=P,k;e[16]!==o?(k=o("API view"),e[16]=o,e[17]=k):k=e[17];let w;e[18]!==i||e[19]!==g?(w=sr.map(E=>(0,D.jsx)(B,{"aria-selected":i===E,"data-testid":`api-view-${E}`,"data-view":E,onClick:I,role:"tab",size:"sm",type:"button",variant:i===E?"default":"outline",children:g[E]},E)),e[18]=i,e[19]=g,e[20]=w):w=e[20];let j;e[21]!==w||e[22]!==k?(j=(0,D.jsx)("div",{"aria-label":k,className:"flex gap-1.5","data-testid":"api-view-toggle",role:"tablist",children:w}),e[21]=w,e[22]=k,e[23]=j):j=e[23];let O;e[24]!==m||e[25]!==v||e[26]!==o||e[27]!==i?(O=i==="reference"&&(0,D.jsx)("div",{"aria-label":o("API spec format"),className:"flex gap-1.5","data-testid":"api-format-toggle",role:"tablist",children:ir.map(E=>(0,D.jsx)(B,{"aria-selected":m===E,"data-format":E,"data-testid":`api-format-${E}`,onClick:$,role:"tab",size:"sm",type:"button",variant:m===E?"default":"outline",children:v[E]},E))}),e[24]=m,e[25]=v,e[26]=o,e[27]=i,e[28]=O):O=e[28];let S;e[29]!==j||e[30]!==O?(S=(0,D.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-3 border-b border-border px-6 py-3",children:[j,O]}),e[29]=j,e[30]=O,e[31]=S):S=e[31];let T;e[32]!==a||e[33]!==r||e[34]!==i?(T=i==="snippets"&&(0,D.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:(0,D.jsx)(Ae,{functions:a,initialShardKey:r})}),e[32]=a,e[33]=r,e[34]=i,e[35]=T):T=e[35];let A;e[36]!==m||e[37]!==n||e[38]!==i?(A=i==="reference"&&m==="openapi"&&(0,D.jsx)(Ue,{spec:n}),e[36]=m,e[37]=n,e[38]=i,e[39]=A):A=e[39];let R;e[40]!==m||e[41]!==s||e[42]!==i?(R=i==="reference"&&m==="openrpc"&&(0,D.jsx)(He,{spec:s}),e[40]=m,e[41]=s,e[42]=i,e[43]=R):R=e[43];let _;e[44]!==T||e[45]!==A||e[46]!==R?(_=(0,D.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[T,A,R]}),e[44]=T,e[45]=A,e[46]=R,e[47]=_):_=e[47];let L;return e[48]!==S||e[49]!==_?(L=(0,D.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"lunora-api-tab",children:[S,_]}),e[48]=S,e[49]=_,e[50]=L):L=e[50],L},"k");export{Vr as default};