@lunora/studio 1.0.0-alpha.49 → 1.0.0-alpha.50

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 (85) hide show
  1. package/dist/index.d.ts +10 -5
  2. package/dist/index.js +6 -6
  3. package/dist/mount.d.ts +1 -1
  4. package/dist/mount.js +1 -1
  5. package/dist/packem_chunks/ApiTab.js +1 -1
  6. package/dist/packem_chunks/AuditPanel.js +1 -1
  7. package/dist/packem_chunks/ExportImportPanel.js +1 -1
  8. package/dist/packem_chunks/FileBrowser.js +1 -1
  9. package/dist/packem_chunks/FunctionRunner.js +1 -1
  10. package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
  11. package/dist/packem_chunks/HealthPanel.js +1 -1
  12. package/dist/packem_chunks/InsightsPanel.js +1 -1
  13. package/dist/packem_chunks/LogsPanel.js +1 -1
  14. package/dist/packem_chunks/MailPanel.js +1 -1
  15. package/dist/packem_chunks/MetricsPanel.js +1 -1
  16. package/dist/packem_chunks/MigrationsPanel.js +1 -1
  17. package/dist/packem_chunks/PitrPanel.js +1 -1
  18. package/dist/packem_chunks/SchemaViewer.js +1 -1
  19. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
  20. package/dist/packem_chunks/SettingsPanel.js +1 -1
  21. package/dist/packem_chunks/SqlEditorPanel.js +1 -1
  22. package/dist/packem_chunks/TableEditor.js +1 -1
  23. package/dist/packem_chunks/agents-panel.js +1 -1
  24. package/dist/packem_chunks/containers-panel.js +21 -7
  25. package/dist/packem_chunks/dashboards-panel.js +1 -1
  26. package/dist/packem_chunks/fanout-panel.js +1 -1
  27. package/dist/packem_chunks/flags-panel.js +1 -1
  28. package/dist/packem_chunks/issues-panel.js +188 -0
  29. package/dist/packem_chunks/kv-browser.js +1 -1
  30. package/dist/packem_chunks/payments-panel.js +1 -1
  31. package/dist/packem_chunks/permissions-panel.js +1 -1
  32. package/dist/packem_chunks/queues-panel.js +1 -1
  33. package/dist/packem_chunks/rls-panel.js +1 -1
  34. package/dist/packem_chunks/storage-rules-panel.js +1 -1
  35. package/dist/packem_chunks/subscriptions-panel.js +1 -1
  36. package/dist/packem_chunks/workflows-panel.js +1 -1
  37. package/dist/packem_shared/{ADMIN_FUNCTIONS-BHHJi3Gb.js → ADMIN_FUNCTIONS-DNeyYtUN.js} +1 -0
  38. package/dist/packem_shared/{ApiDocsPanel-B2Rc7nOF.js → ApiDocsPanel-_aEZxAMX.js} +1 -1
  39. package/dist/packem_shared/{DataBrowser-Cc197zke.js → DataBrowser-C8hejnub.js} +1 -1
  40. package/dist/packem_shared/{HomePanel-CjDlJzzs.js → HomePanel-Ye8PaqQL.js} +2 -2
  41. package/dist/packem_shared/{Studio-MB2VTLwI.js → Studio-xJLTlLpf.js} +2 -2
  42. package/dist/packem_shared/{StudioApp-Ds6u0iY5.js → StudioApp-oCQholCL.js} +1 -1
  43. package/dist/packem_shared/{app.d-Bly6zmWK.d.ts → app.d-CGdOmLTm.d.ts} +1 -1
  44. package/dist/packem_shared/{home-panel-BohxdqDb.js → home-panel-D62G8108.js} +1 -1
  45. package/dist/packem_shared/{studio-Bv27fj7n.js → studio-WZUOecDv.js} +578 -551
  46. package/dist/standalone/{chunk-2JUOJEKE.js → chunk-2JTPX3CV.js} +1 -1
  47. package/dist/standalone/{chunk-2O4BHAHA.js → chunk-3CPQ5IQU.js} +1 -1
  48. package/dist/standalone/{chunk-BTODL6SI.js → chunk-4AXW2ECS.js} +1 -1
  49. package/dist/standalone/chunk-4BVRLBEW.js +1 -0
  50. package/dist/standalone/{chunk-QCW4BAH5.js → chunk-6RREMPQX.js} +1 -1
  51. package/dist/standalone/{chunk-AHDVD4KF.js → chunk-6ZBU3JWR.js} +1 -1
  52. package/dist/standalone/chunk-A2DBMISD.js +1 -0
  53. package/dist/standalone/{chunk-Q7HPS6TW.js → chunk-A66LI6OV.js} +1 -1
  54. package/dist/standalone/{chunk-CDHEMVIY.js → chunk-CJXJIRSN.js} +1 -1
  55. package/dist/standalone/{chunk-R6H6DUPU.js → chunk-DR6LGPXE.js} +1 -1
  56. package/dist/standalone/{chunk-CTOOUWO4.js → chunk-FAUN4Z72.js} +1 -1
  57. package/dist/standalone/chunk-G7ZBM54M.js +1 -0
  58. package/dist/standalone/{chunk-5YPIP3G7.js → chunk-HAJSYWFT.js} +1 -1
  59. package/dist/standalone/{chunk-6U45TJXA.js → chunk-HQM6MBPS.js} +1 -1
  60. package/dist/standalone/{chunk-ECJPFPHR.js → chunk-HTQNZXDT.js} +1 -1
  61. package/dist/standalone/{chunk-W5BAQMIE.js → chunk-IO2XEI6T.js} +1 -1
  62. package/dist/standalone/{chunk-WK7VHQTQ.js → chunk-K4S652EQ.js} +1 -1
  63. package/dist/standalone/{chunk-L4UCG6XZ.js → chunk-KJFFID72.js} +1 -1
  64. package/dist/standalone/{chunk-R2HA2NVX.js → chunk-LJAAZNQ6.js} +1 -1
  65. package/dist/standalone/{chunk-UWSLX56Q.js → chunk-LX7KONE3.js} +1 -1
  66. package/dist/standalone/{chunk-XGPFWZPJ.js → chunk-NW6SZZ5O.js} +1 -1
  67. package/dist/standalone/{chunk-NH4FSHFO.js → chunk-P2ERTKMB.js} +1 -1
  68. package/dist/standalone/{chunk-N4TGVH2R.js → chunk-PS3XCCZD.js} +1 -1
  69. package/dist/standalone/{chunk-ALTQC4S5.js → chunk-RS7S7XVP.js} +1 -1
  70. package/dist/standalone/{chunk-GA6K5WS5.js → chunk-S7AB7Y75.js} +1 -1
  71. package/dist/standalone/{chunk-FFCUV3TZ.js → chunk-SHJUAHC6.js} +1 -1
  72. package/dist/standalone/{chunk-RE4LLVPN.js → chunk-TYN6SQ73.js} +1 -1
  73. package/dist/standalone/{chunk-XPLUSBKA.js → chunk-U26QNHMO.js} +1 -1
  74. package/dist/standalone/{chunk-Q6356GAQ.js → chunk-VL6HOZHF.js} +1 -1
  75. package/dist/standalone/{chunk-RYF5EUQA.js → chunk-X2TQRMQV.js} +1 -1
  76. package/dist/standalone/{chunk-ZANX3V5B.js → chunk-X4676IX6.js} +1 -1
  77. package/dist/standalone/{chunk-3JXKA6BH.js → chunk-XJU5SRNL.js} +1 -1
  78. package/dist/standalone/chunk-XWPZBZSZ.js +3 -0
  79. package/dist/standalone/{chunk-CCRVGYTN.js → chunk-YLHDKM2P.js} +1 -1
  80. package/dist/standalone/studio.js +1 -1
  81. package/dist/styles.css +1 -1
  82. package/package.json +1 -1
  83. package/dist/standalone/chunk-4TV6S6AO.js +0 -3
  84. package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
  85. package/dist/standalone/chunk-ZVLQVBTM.js +0 -1
@@ -1 +1 @@
1
- import{a as C}from"./chunk-J6J54MBP.js";import{a as E}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as y}from"./chunk-W666BB6V.js";import{a as x,b as I,c as N,d as u,e as l,f as o}from"./chunk-GTM65MVX.js";import{a as m,e as h}from"./chunk-SEU5V7I6.js";import{b as v}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as g}from"./chunk-BOXSWNXZ.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as A}from"./chunk-TAD43CG5.js";import{d as S,p as b}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as c,e as Q,h as V}from"./chunk-RRCPZMC2.js";var e=Q(V(),1);var P=new Set(["active","trialing"]),D=new Set(["past_due","unpaid"]),a=c((t,s)=>{if(t[s]!==void 0)return t[s];let d=t.__doc__;if(typeof d=="string")try{let n=JSON.parse(d);if(n!==null&&typeof n=="object"&&!Array.isArray(n))return n[s]}catch{}},"readField"),i=c(t=>typeof t=="string"?t:typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"?String(t):"","text"),F=c(t=>P.has(t)?"default":D.has(t)?"destructive":"outline","badgeVariant"),K=c(({limit:t=100})=>{let s=S(),d=y(g.readTablePage,{filters:[],limit:t,offset:0,orderBy:[],search:"",table:"subscriptions"}),n=y(g.readTablePage,{filters:[],limit:25,offset:0,orderBy:[],search:"",table:"events"});C(()=>{d.refetch(),n.refetch()},!0);let f=d.data?.rows??[],R=n.data?.rows??[],B=d.error??n.error,w=d.error===null?n.errorSource:d.errorSource,T=f.filter(r=>P.has(i(a(r,"state")))).length,j=R.toSorted((r,p)=>Number(a(p,"processedAt")??0)-Number(a(r,"processedAt")??0));return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsxDEV)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxDEV)(m,{className:"justify-between gap-0 py-0",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Subscriptions")},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,e.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T},void 0,!1),(0,e.jsxDEV)(v,{variant:"default",children:s("{count} active",{count:T})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s("{total} total",{total:f.length})},void 0,!1)]},void 0,!0)},void 0,!1),B===null?void 0:(0,e.jsxDEV)(E,{error:w},void 0,!1),f.length===0&&!d.isLoading?(0,e.jsxDEV)(A,{testId:"payments-empty",title:s("No subscriptions yet")},void 0,!1):(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:[(0,e.jsxDEV)(I,{children:(0,e.jsxDEV)(u,{children:[(0,e.jsxDEV)(l,{children:s("Provider")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Reference")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Plan")},void 0,!1),(0,e.jsxDEV)(l,{children:s("State")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Renews")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(N,{children:f.map(r=>{let p=i(a(r,"state"));return(0,e.jsxDEV)(u,{"data-testid":"payment-subscription-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"referenceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"priceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:(0,e.jsxDEV)(v,{variant:F(p),children:p},void 0,!1)},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"currentPeriodEnd"))},void 0,!1)]},i(a(r,"providerSubscriptionId")),!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Recent webhook events")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:(0,e.jsxDEV)(N,{children:j.map(r=>(0,e.jsxDEV)(u,{"data-testid":"payment-event-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{className:"font-medium",children:i(a(r,"type"))},void 0,!1),(0,e.jsxDEV)(o,{className:"text-muted-foreground",children:i(a(r,"providerEventId"))},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"processedAt"))},void 0,!1)]},i(a(r,"providerEventId")),!0))},void 0,!1)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"PaymentsPanel");export{K as PaymentsPanel};
1
+ import{a as C}from"./chunk-J6J54MBP.js";import{a as E}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as y}from"./chunk-W666BB6V.js";import{a as x,b as I,c as N,d as u,e as l,f as o}from"./chunk-GTM65MVX.js";import{a as m,e as h}from"./chunk-SEU5V7I6.js";import{b as v}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as g}from"./chunk-G7ZBM54M.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as A}from"./chunk-TAD43CG5.js";import{d as S,p as b}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as c,e as Q,h as V}from"./chunk-RRCPZMC2.js";var e=Q(V(),1);var P=new Set(["active","trialing"]),D=new Set(["past_due","unpaid"]),a=c((t,s)=>{if(t[s]!==void 0)return t[s];let d=t.__doc__;if(typeof d=="string")try{let n=JSON.parse(d);if(n!==null&&typeof n=="object"&&!Array.isArray(n))return n[s]}catch{}},"readField"),i=c(t=>typeof t=="string"?t:typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"?String(t):"","text"),F=c(t=>P.has(t)?"default":D.has(t)?"destructive":"outline","badgeVariant"),K=c(({limit:t=100})=>{let s=S(),d=y(g.readTablePage,{filters:[],limit:t,offset:0,orderBy:[],search:"",table:"subscriptions"}),n=y(g.readTablePage,{filters:[],limit:25,offset:0,orderBy:[],search:"",table:"events"});C(()=>{d.refetch(),n.refetch()},!0);let f=d.data?.rows??[],R=n.data?.rows??[],B=d.error??n.error,w=d.error===null?n.errorSource:d.errorSource,T=f.filter(r=>P.has(i(a(r,"state")))).length,j=R.toSorted((r,p)=>Number(a(p,"processedAt")??0)-Number(a(r,"processedAt")??0));return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsxDEV)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxDEV)(m,{className:"justify-between gap-0 py-0",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Subscriptions")},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,e.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T},void 0,!1),(0,e.jsxDEV)(v,{variant:"default",children:s("{count} active",{count:T})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s("{total} total",{total:f.length})},void 0,!1)]},void 0,!0)},void 0,!1),B===null?void 0:(0,e.jsxDEV)(E,{error:w},void 0,!1),f.length===0&&!d.isLoading?(0,e.jsxDEV)(A,{testId:"payments-empty",title:s("No subscriptions yet")},void 0,!1):(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:[(0,e.jsxDEV)(I,{children:(0,e.jsxDEV)(u,{children:[(0,e.jsxDEV)(l,{children:s("Provider")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Reference")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Plan")},void 0,!1),(0,e.jsxDEV)(l,{children:s("State")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Renews")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(N,{children:f.map(r=>{let p=i(a(r,"state"));return(0,e.jsxDEV)(u,{"data-testid":"payment-subscription-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"referenceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"priceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:(0,e.jsxDEV)(v,{variant:F(p),children:p},void 0,!1)},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"currentPeriodEnd"))},void 0,!1)]},i(a(r,"providerSubscriptionId")),!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Recent webhook events")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:(0,e.jsxDEV)(N,{children:j.map(r=>(0,e.jsxDEV)(u,{"data-testid":"payment-event-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{className:"font-medium",children:i(a(r,"type"))},void 0,!1),(0,e.jsxDEV)(o,{className:"text-muted-foreground",children:i(a(r,"providerEventId"))},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"processedAt"))},void 0,!1)]},i(a(r,"providerEventId")),!0))},void 0,!1)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"PaymentsPanel");export{K as PaymentsPanel};
@@ -1 +1 @@
1
- import{b as $}from"./chunk-TQ36RWOP.js";import{a as M}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-W666BB6V.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as K,e as O}from"./chunk-SEU5V7I6.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as j}from"./chunk-BOXSWNXZ.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(a=>{let e=(0,q.c)(68),{initialShardKey:z}=a,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let i;e[12]!==s.workerUrl||e[13]!==l?(i={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=i):i=e[14],o.push(i)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let i;e[17]!==s.environment||e[18]!==l?(i={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=i):i=e[19],o.push(i)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let i;e[22]!==s.deploymentId||e[23]!==l?(i={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=i):i=e[24],o.push(i)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let i;e[27]!==s.versionTag||e[28]!==l?(i={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=i):i=e[29],o.push(i)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(a){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:a.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:a.value,children:a.value},void 0,!1)]},a.label,!0)}U(Z,"_temp");function ee(a){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:a.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[a.kind],children:a.bindingType??a.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:a.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
1
+ import{b as $}from"./chunk-TQ36RWOP.js";import{a as M}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-W666BB6V.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as K,e as O}from"./chunk-SEU5V7I6.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as j}from"./chunk-G7ZBM54M.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(a=>{let e=(0,q.c)(68),{initialShardKey:z}=a,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let i;e[12]!==s.workerUrl||e[13]!==l?(i={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=i):i=e[14],o.push(i)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let i;e[17]!==s.environment||e[18]!==l?(i={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=i):i=e[19],o.push(i)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let i;e[22]!==s.deploymentId||e[23]!==l?(i={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=i):i=e[24],o.push(i)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let i;e[27]!==s.versionTag||e[28]!==l?(i={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=i):i=e[29],o.push(i)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(a){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:a.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:a.value,children:a.value},void 0,!1)]},a.label,!0)}U(Z,"_temp");function ee(a){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:a.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[a.kind],children:a.bindingType??a.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:a.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
@@ -1,4 +1,4 @@
1
- import{a as Pe}from"./chunk-VLXV72QE.js";import{a as xe}from"./chunk-JSEXCW5Q.js";import{a as X}from"./chunk-KZ6INM5M.js";import{d as we,f as Oe,g as $e,k as ae}from"./chunk-4QHKBC77.js";import{a as Ae}from"./chunk-LUP4YTBS.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as ke}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as H}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as Se}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as Ce}from"./chunk-BOXSWNXZ.js";import{f as G}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as W}from"./chunk-TAD43CG5.js";import{d as M,e as Ie,f as le,g as de,h as ce,l as Te,n as re}from"./chunk-ITQKVEP7.js";import{b as Ne}from"./chunk-22C6COGE.js";import{a as p,e as q,f as he,g as oe,h as ne,j as ge}from"./chunk-RRCPZMC2.js";var Ye=q(oe(),1),ye=q(he(),1);var ee=q(oe(),1);var Z=q(he(),1);var B=q(ne(),1);var Qe=le(Ce.listTables),Xe=["react","client","cli"],Ze=!1,et={action:"action",mutation:"mutation",query:"query"},Re=p(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"splitPath"),_e=p(({file:t,fn:e,kind:o})=>`await client.${et[o]}(api.${t}.${e}, { /* args */ });`,"buildClientSnippet"),tt=p(t=>{let e=`api.${t.file}.${t.fn}`;switch(t.kind){case"action":return _e(t);case"mutation":return`const ${t.fn} = useMutation(${e});`;default:return`const data = useQuery(${e}, { /* args */ });`}},"buildReactSnippet"),st=p(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"buildCliSnippet"),ot=p(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(`
1
+ import{a as Pe}from"./chunk-VLXV72QE.js";import{a as xe}from"./chunk-JSEXCW5Q.js";import{a as X}from"./chunk-KZ6INM5M.js";import{d as we,f as Oe,g as $e,k as ae}from"./chunk-4QHKBC77.js";import{a as Ae}from"./chunk-LUP4YTBS.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as ke}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as H}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as Se}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as Ce}from"./chunk-G7ZBM54M.js";import{f as G}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as W}from"./chunk-TAD43CG5.js";import{d as M,e as Ie,f as le,g as de,h as ce,l as Te,n as re}from"./chunk-ITQKVEP7.js";import{b as Ne}from"./chunk-22C6COGE.js";import{a as p,e as q,f as he,g as oe,h as ne,j as ge}from"./chunk-RRCPZMC2.js";var Ye=q(oe(),1),ye=q(he(),1);var ee=q(oe(),1);var Z=q(he(),1);var B=q(ne(),1);var Qe=le(Ce.listTables),Xe=["react","client","cli"],Ze=!1,et={action:"action",mutation:"mutation",query:"query"},Re=p(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"splitPath"),_e=p(({file:t,fn:e,kind:o})=>`await client.${et[o]}(api.${t}.${e}, { /* args */ });`,"buildClientSnippet"),tt=p(t=>{let e=`api.${t.file}.${t.fn}`;switch(t.kind){case"action":return _e(t);case"mutation":return`const ${t.fn} = useMutation(${e});`;default:return`const data = useQuery(${e}, { /* args */ });`}},"buildReactSnippet"),st=p(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"buildCliSnippet"),ot=p(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
2
  `),"buildTableSnippet"),nt=p((t,e)=>{switch(t){case"cli":return st(e);case"client":return _e(e);default:return tt(e)}},"snippetForTab"),je=p(t=>{let e=(0,ee.c)(19),{code:o,label:s,testId:n}=t,r=M(),l;e[0]!==o?(l=p(()=>{re(o)},"t1"),e[0]=o,e[1]=l):l=e[1];let i=l,d;e[2]!==s?(d=(0,B.jsxDEV)("span",{className:"text-xs font-medium text-muted-foreground",children:s},void 0,!1),e[2]=s,e[3]=d):d=e[3];let c=`${n}-copy`,m;e[4]!==r?(m=r("Copy"),e[4]=r,e[5]=m):m=e[5];let a;e[6]!==i||e[7]!==c||e[8]!==m?(a=(0,B.jsxDEV)(H,{"data-testid":c,onClick:i,size:"xs",type:"button",variant:"ghost",children:m},void 0,!1),e[6]=i,e[7]=c,e[8]=m,e[9]=a):a=e[9];let u;e[10]!==d||e[11]!==a?(u=(0,B.jsxDEV)("div",{className:"flex items-center justify-between gap-2",children:[d,a]},void 0,!0),e[10]=d,e[11]=a,e[12]=u):u=e[12];let v;e[13]!==o||e[14]!==n?(v=(0,B.jsxDEV)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":n,children:o},void 0,!1),e[13]=o,e[14]=n,e[15]=v):v=e[15];let S;return e[16]!==u||e[17]!==v?(S=(0,B.jsxDEV)("div",{className:"flex flex-col gap-1.5",children:[u,v]},void 0,!0),e[16]=u,e[17]=v,e[18]=S):S=e[18],S},"SnippetBlock"),rt=p(t=>{let e=(0,ee.c)(50),{file:o,fn:s,kind:n}=t,r=M(),[l,i]=(0,Z.useState)("react"),d,c,m;if(e[0]!==o||e[1]!==s||e[2]!==n||e[3]!==r||e[4]!==l){let I={file:o,fn:s,kind:n},$;e[8]!==r?($=r("CLI"),e[8]=r,e[9]=$):$=e[9];let P;e[10]!==r?(P=r("Client"),e[10]=r,e[11]=P):P=e[11];let E;e[12]!==r?(E=r("React"),e[12]=r,e[13]=E):E=e[13];let j;e[14]!==$||e[15]!==P||e[16]!==E?(j={cli:$,client:P,react:E},e[14]=$,e[15]=P,e[16]=E,e[17]=j):j=e[17],m=j;let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=p(L=>{i(L.currentTarget.dataset.tab)},"t62"),e[18]=R):R=e[18],d=R,c=nt(l,I),e[0]=o,e[1]=s,e[2]=n,e[3]=r,e[4]=l,e[5]=d,e[6]=c,e[7]=m}else d=e[5],c=e[6],m=e[7];let a=c,u=n==="action"&&l==="react"&&!Ze,v=`api.${o}.${s}`,S;e[19]!==v?(S=(0,B.jsxDEV)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-fn-title",children:v},void 0,!1),e[19]=v,e[20]=S):S=e[20];let O;e[21]!==n||e[22]!==r?(O=r("Call this {kind} from your app.",{kind:n}),e[21]=n,e[22]=r,e[23]=O):O=e[23];let h;e[24]!==O?(h=(0,B.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:O},void 0,!1),e[24]=O,e[25]=h):h=e[25];let g;e[26]!==S||e[27]!==h?(g=(0,B.jsxDEV)("div",{children:[S,h]},void 0,!0),e[26]=S,e[27]=h,e[28]=g):g=e[28];let x;e[29]!==r?(x=r("Snippet flavour"),e[29]=r,e[30]=x):x=e[30];let b;e[31]!==d||e[32]!==l||e[33]!==m?(b=Xe.map(I=>(0,B.jsxDEV)(H,{"aria-selected":l===I,"data-tab":I,"data-testid":`api-tab-${I}`,onClick:d,role:"tab",size:"xs",type:"button",variant:l===I?"default":"outline",children:m[I]},I,!1)),e[31]=d,e[32]=l,e[33]=m,e[34]=b):b=e[34];let y;e[35]!==x||e[36]!==b?(y=(0,B.jsxDEV)("div",{"aria-label":x,className:"flex gap-1.5","data-testid":"api-tabs",role:"tablist",children:b},void 0,!1),e[35]=x,e[36]=b,e[37]=y):y=e[37];let N=m[l],T=`api-snippet-${l}`,k;e[38]!==a||e[39]!==N||e[40]!==T?(k=(0,B.jsxDEV)(je,{code:a,label:N,testId:T},void 0,!1),e[38]=a,e[39]=N,e[40]=T,e[41]=k):k=e[41];let w;e[42]!==u||e[43]!==r?(w=u&&(0,B.jsxDEV)("p",{className:"text-xs text-muted-foreground","data-testid":"api-action-note",children:r("Actions have no React hook \u2014 call them through the client.")},void 0,!1),e[42]=u,e[43]=r,e[44]=w):w=e[44];let C;return e[45]!==k||e[46]!==w||e[47]!==g||e[48]!==y?(C=(0,B.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"api-fn-doc",children:[g,y,k,w]},void 0,!0),e[45]=k,e[46]=w,e[47]=g,e[48]=y,e[49]=C):C=e[49],C},"FunctionDoc"),it=p(t=>{let e=(0,ee.c)(19),{name:o}=t,s=M(),n;e[0]!==o?(n=ot(o),e[0]=o,e[1]=n):n=e[1];let r=n,l;e[2]!==o?(l=(0,B.jsxDEV)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-table-title",children:o},void 0,!1),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==s?(i=s("Read and write this table through the typed data model."),e[4]=s,e[5]=i):i=e[5];let d;e[6]!==i?(d=(0,B.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:i},void 0,!1),e[6]=i,e[7]=d):d=e[7];let c;e[8]!==l||e[9]!==d?(c=(0,B.jsxDEV)("div",{children:[l,d]},void 0,!0),e[8]=l,e[9]=d,e[10]=c):c=e[10];let m;e[11]!==s?(m=s("Data model"),e[11]=s,e[12]=m):m=e[12];let a;e[13]!==r||e[14]!==m?(a=(0,B.jsxDEV)(je,{code:r,label:m,testId:"api-snippet-table"},void 0,!1),e[13]=r,e[14]=m,e[15]=a):a=e[15];let u;return e[16]!==c||e[17]!==a?(u=(0,B.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"api-table-doc",children:[c,a]},void 0,!0),e[16]=c,e[17]=a,e[18]=u):u=e[18],u},"TableDoc"),Ee=p(t=>{let e=(0,ee.c)(8),{active:o,label:s,onSelect:n,testId:r,value:l}=t,i;e[0]!==n||e[1]!==l?(i=p(()=>{n(l)},"t1"),e[0]=n,e[1]=l,e[2]=i):i=e[2];let d=i,c=o?"page":void 0,m;return e[3]!==s||e[4]!==d||e[5]!==c||e[6]!==r?(m=(0,B.jsxDEV)("button",{"aria-current":c,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":r,onClick:d,type:"button",children:s},void 0,!1),e[3]=s,e[4]=d,e[5]=c,e[6]=r,e[7]=m):m=e[7],m},"RailButton"),Le=p(t=>{let e=(0,ee.c)(67),{functions:o,initialShardKey:s}=t,n=M(),r=G(),[l,i]=(0,Z.useState)(null),[d,c]=(0,Z.useState)(null),m,a;e[0]!==r||e[1]!==s?(m=p(()=>{let _=!1;return r.query(Qe,{},de(s??"")).then(D=>(_||i(D),D)).catch(()=>{_||i([])}),()=>{_=!0}},"t1"),a=[r,s],e[0]=r,e[1]=s,e[2]=m,e[3]=a):(m=e[2],a=e[3]),(0,Z.useEffect)(m,a);let u;e[4]!==o?(u=o??[],e[4]=o,e[5]=u):u=e[5];let v=u,S;if(e[6]!==v){let _=new Map;for(let D of v){let{file:V,fn:U}=Re(D.path),ie=_.get(V)??[];ie.push({fn:U,kind:D.kind,path:D.path}),_.set(V,ie)}S=[..._.entries()].map(lt).toSorted(dt),e[6]=v,e[7]=S}else S=e[7];let O=S,h,g,x,b,y,N,T,k,w,C;if(e[8]!==v||e[9]!==O||e[10]!==d||e[11]!==n||e[12]!==l){let _=(l??[]).map(ct).toSorted(ft),D;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=p(F=>{c({kind:"fn",path:F})},"t122"),e[23]=D):D=e[23];let V=D,U;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=p(F=>{c({kind:"table",name:F})},"t132"),e[24]=U):U=e[24];let ie=U;if(g=d?.kind==="fn"?v.find(F=>F.path===d.path):void 0,h=v.length>0||_.length>0,x=g===void 0?void 0:Re(g.path),b="grid min-h-0 gap-6 md:grid-cols-[16rem_minmax(0,1fr)]",y="lunora-api-docs",e[25]!==n?(N=n("API resources"),e[25]=n,e[26]=N):N=e[26],T="flex flex-col gap-4 overflow-y-auto",k="api-rail",e[27]!==O||e[28]!==d||e[29]!==n){let F;e[31]!==d||e[32]!==n?(F=p(ve=>(0,B.jsxDEV)("div",{className:"flex flex-col gap-1",children:[(0,B.jsxDEV)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:ve.file||n("(root)")},void 0,!1),ve.items.map(se=>(0,B.jsxDEV)(Ee,{active:d?.kind==="fn"&&d.path===se.path,label:se.fn,onSelect:V,testId:`api-rail-fn-${se.path}`,value:se.path},se.path,!1))]},ve.file,!0),"t142"),e[31]=d,e[32]=n,e[33]=F):F=e[33],w=O.map(F),e[27]=O,e[28]=d,e[29]=n,e[30]=w}else w=e[30];C=_.length>0&&(0,B.jsxDEV)("div",{className:"flex flex-col gap-1",children:[(0,B.jsxDEV)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Tables")},void 0,!1),_.map(F=>(0,B.jsxDEV)(Ee,{active:d?.kind==="table"&&d.name===F,label:F,onSelect:ie,testId:`api-rail-table-${F}`,value:F},F,!1))]},void 0,!0),e[8]=v,e[9]=O,e[10]=d,e[11]=n,e[12]=l,e[13]=h,e[14]=g,e[15]=x,e[16]=b,e[17]=y,e[18]=N,e[19]=T,e[20]=k,e[21]=w,e[22]=C}else h=e[13],g=e[14],x=e[15],b=e[16],y=e[17],N=e[18],T=e[19],k=e[20],w=e[21],C=e[22];let I;e[34]!==h||e[35]!==n?(I=!h&&(0,B.jsxDEV)("p",{className:"px-2 text-xs text-muted-foreground","data-testid":"api-rail-empty",children:n("No functions or tables to document yet.")},void 0,!1),e[34]=h,e[35]=n,e[36]=I):I=e[36];let $;e[37]!==I||e[38]!==N||e[39]!==T||e[40]!==k||e[41]!==w||e[42]!==C?($=(0,B.jsxDEV)("nav",{"aria-label":N,className:T,"data-testid":k,children:[w,C,I]},void 0,!0),e[37]=I,e[38]=N,e[39]=T,e[40]=k,e[41]=w,e[42]=C,e[43]=$):$=e[43];let P;e[44]!==d||e[45]!==n?(P=d===null&&(0,B.jsxDEV)(W,{description:n("Select a function or table to see how to call it from your app."),testId:"api-empty",title:n("API usage snippets")},void 0,!1),e[44]=d,e[45]=n,e[46]=P):P=e[46];let E;e[47]!==d?.kind||e[48]!==g||e[49]!==x?(E=d?.kind==="fn"&&g!==void 0&&x!==void 0&&(0,B.jsxDEV)(rt,{file:x.file,fn:x.fn,kind:g.kind},g.path,!1),e[47]=d?.kind,e[48]=g,e[49]=x,e[50]=E):E=e[50];let j;e[51]!==d?.kind||e[52]!==g||e[53]!==n?(j=d?.kind==="fn"&&g===void 0&&(0,B.jsxDEV)(W,{testId:"api-empty",title:n("API usage snippets")},void 0,!1),e[51]=d?.kind,e[52]=g,e[53]=n,e[54]=j):j=e[54];let R;e[55]!==d?(R=d?.kind==="table"&&(0,B.jsxDEV)(it,{name:d.name},void 0,!1),e[55]=d,e[56]=R):R=e[56];let L;e[57]!==P||e[58]!==E||e[59]!==j||e[60]!==R?(L=(0,B.jsxDEV)("div",{className:"min-w-0",children:[P,E,j,R]},void 0,!0),e[57]=P,e[58]=E,e[59]=j,e[60]=R,e[61]=L):L=e[61];let A;return e[62]!==b||e[63]!==y||e[64]!==$||e[65]!==L?(A=(0,B.jsxDEV)("div",{className:b,"data-testid":y,children:[$,L]},void 0,!0),e[62]=b,e[63]=y,e[64]=$,e[65]=L,e[66]=A):A=e[66],A},"ApiDocsPanel");function at(t,e){return t.fn.localeCompare(e.fn)}p(at,"_temp");function lt(t){let[e,o]=t;return{file:e,items:o.toSorted(at)}}p(lt,"_temp2");function dt(t,e){return t.file.localeCompare(e.file)}p(dt,"_temp3");function ct(t){return t.name}p(ct,"_temp4");function ft(t,e){return t.localeCompare(e)}p(ft,"_temp5");var ze=q(oe(),1);var J=q(oe(),1),K=q(he(),1);var f=q(ne(),1);var ue=p(function(t,e,o){let s=(0,J.c)(10),n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},s[0]=n):n=s[0];let[r,l]=(0,K.useState)(n),i,d;s[1]!==o||s[2]!==e||s[3]!==t?(i=p(()=>{if(t!==void 0)return;let m=!1;return e().then(a=>(m||l(o(a)),a)).catch(a=>{m||l({kind:"error",message:ce(a)})}),()=>{m=!0}},"t1"),d=[o,e,t],s[1]=o,s[2]=e,s[3]=t,s[4]=i,s[5]=d):(i=s[4],d=s[5]),(0,K.useEffect)(i,d);let c;return s[6]!==o||s[7]!==r||s[8]!==t?(c=t===void 0?r:o(t),s[6]=o,s[7]=r,s[8]=t,s[9]=c):c=s[9],c},"useAdminSpec"),pt=p(t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string","scalarOf"),Me=p(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)},"enumValues"),pe=p(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=>pe(e)).join(" | "):t.type==="array"?`array<${pe(t.items)}>`:t.type??"any","typeLabel"),ut=p(t=>{let e=Me(t);return e!==void 0?t.type??pt(e[0]):pe(t)},"fieldTypeLabel"),mt=p(t=>{let e=Me(t);return e===void 0?void 0:e.map(o=>JSON.stringify(o)).join(" | ")},"valueInText"),vt=p(t=>{let e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} \u2264`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);let o=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 s=e.length>(o?2:1);return o||s?e.join(" "):void 0},"rangeText"),ht=p(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},"childObject"),te=p(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 te(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{let e={};for(let[o,s]of Object.entries(t.properties??{}))e[o]=te(s);return e}case"string":return"";default:return null}},"exampleForSchema"),fe=p(t=>{let e=(0,J.c)(7),{label:o,value:s}=t,n;e[0]!==o?(n=(0,f.jsxDEV)("span",{className:"text-muted-foreground",children:o},void 0,!1),e[0]=o,e[1]=n):n=e[1];let r;e[2]!==s?(r=(0,f.jsxDEV)("span",{className:"text-foreground",children:s},void 0,!1),e[2]=s,e[3]=r):r=e[3];let l;return e[4]!==n||e[5]!==r?(l=(0,f.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,r]},void 0,!0),e[4]=n,e[5]=r,e[6]=l):l=e[6],l},"Badge"),gt=p(t=>{let e=(0,J.c)(40),{name:o,required:s,schema:n}=t,r=M(),l;e[0]!==n?(l=vt(n),e[0]=n,e[1]=l):l=e[1];let i=l,d;e[2]!==n?(d=mt(n),e[2]=n,e[3]=d):d=e[3];let c=d,m=n["x-lunora-table"],a=n.format!==void 0||i!==void 0||c!==void 0||m!==void 0,u;e[4]!==n?(u=ht(n),e[4]=n,e[5]=u):u=e[5];let v=u,S=s?"*":"?",O;e[6]!==S?(O=(0,f.jsxDEV)("span",{className:"text-muted-foreground",children:S},void 0,!1),e[6]=S,e[7]=O):O=e[7];let h;e[8]!==o||e[9]!==O?(h=(0,f.jsxDEV)("span",{className:"font-mono text-foreground",children:[o,O]},void 0,!0),e[8]=o,e[9]=O,e[10]=h):h=e[10];let g;e[11]!==n?(g=ut(n),e[11]=n,e[12]=g):g=e[12];let x;e[13]!==g?(x=(0,f.jsxDEV)("span",{className:"font-mono text-muted-foreground",children:g},void 0,!1),e[13]=g,e[14]=x):x=e[14];let b;e[15]!==h||e[16]!==x?(b=(0,f.jsxDEV)("div",{className:"flex items-baseline gap-2",children:[h,x]},void 0,!0),e[15]=h,e[16]=x,e[17]=b):b=e[17];let y;e[18]!==n.description?(y=n.description!==void 0&&(0,f.jsxDEV)("p",{className:"max-w-prose text-muted-foreground",children:n.description},void 0,!1),e[18]=n.description,e[19]=y):y=e[19];let N;e[20]!==a||e[21]!==i||e[22]!==m||e[23]!==n.format||e[24]!==r||e[25]!==c?(N=a&&(0,f.jsxDEV)("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&(0,f.jsxDEV)(fe,{label:r("Format"),value:n.format},void 0,!1),i!==void 0&&(0,f.jsxDEV)(fe,{label:r("Range"),value:i},void 0,!1),c!==void 0&&(0,f.jsxDEV)(fe,{label:r("Value in"),value:c},void 0,!1),m!==void 0&&(0,f.jsxDEV)(fe,{label:r("relation"),value:m},void 0,!1)]},void 0,!0),e[20]=a,e[21]=i,e[22]=m,e[23]=n.format,e[24]=r,e[25]=c,e[26]=N):N=e[26];let T;e[27]!==y||e[28]!==N||e[29]!==b?(T=(0,f.jsxDEV)("div",{className:"flex flex-col gap-1 py-2",children:[b,y,N]},void 0,!0),e[27]=y,e[28]=N,e[29]=b,e[30]=T):T=e[30];let k=T;if(v===void 0){let $;return e[31]!==k?($=(0,f.jsxDEV)("div",{className:"border-b border-border/50 last:border-b-0",children:k},void 0,!1),e[31]=k,e[32]=$):$=e[32],$}let w;e[33]!==k?(w=(0,f.jsxDEV)("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k},void 0,!1),e[33]=k,e[34]=w):w=e[34];let C;e[35]!==v?(C=(0,f.jsxDEV)("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:(0,f.jsxDEV)(Ke,{schema:v},void 0,!1)},void 0,!1),e[35]=v,e[36]=C):C=e[36];let I;return e[37]!==w||e[38]!==C?(I=(0,f.jsxDEV)("details",{className:"border-b border-border/50 last:border-b-0",children:[w,C]},void 0,!0),e[37]=w,e[38]=C,e[39]=I):I=e[39],I},"FieldRow"),Ke=p(t=>{let e=(0,J.c)(7),{schema:o}=t,s;e[0]!==o.required?(s=new Set(o.required),e[0]=o.required,e[1]=s):s=e[1];let n=s,r;e[2]!==o.properties?(r=Object.entries(o.properties??{}),e[2]=o.properties,e[3]=r):r=e[3];let l=r,i;return e[4]!==n||e[5]!==l?(i=(0,f.jsxDEV)("div",{className:"flex flex-col",children:l.map(d=>{let[c,m]=d;return(0,f.jsxDEV)(gt,{name:c,required:n.has(c),schema:m},c,!1)})},void 0,!1),e[4]=n,e[5]=l,e[6]=i):i=e[6],i},"SchemaFields"),Be=p(t=>{let e=(0,J.c)(10),{schema:o,testId:s}=t;if(o?.type!=="object"||Object.keys(o.properties??{}).length===0){let l;e[0]!==o?(l=pe(o),e[0]=o,e[1]=l):l=e[1];let i;return e[2]!==l||e[3]!==s?(i=(0,f.jsxDEV)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":s,children:l},void 0,!1),e[2]=l,e[3]=s,e[4]=i):i=e[4],i}let n;e[5]!==o?(n=(0,f.jsxDEV)(Ke,{schema:o},void 0,!1),e[5]=o,e[6]=n):n=e[6];let r;return e[7]!==n||e[8]!==s?(r=(0,f.jsxDEV)("div",{className:"text-xs","data-testid":s,children:n},void 0,!1),e[7]=n,e[8]=s,e[9]=r):r=e[9],r},"SchemaTable"),xt=["curl","javascript","lunora"],bt={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},yt=p(t=>`api.${t.replaceAll(/[/:]/g,".")}`,"apiReferenceOf"),Nt=p(t=>{let e=te(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},"requestBody"),St=p((t,e,o)=>{let s=`${o}${e.httpPath}`,n=JSON.stringify(Nt(e),void 0,2),r=JSON.stringify(te(e.argsSchema)??{},void 0,2);switch(t){case"curl":{let l=e.method!=="GET"&&e.method!=="HEAD",i=[`curl -X ${e.method} ${JSON.stringify(s)}`];return l&&i.push(' -H "Content-Type: application/json"',` -d '${n}'`),i.join(` \\
3
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
4
  import { api } from "./_generated/api";
@@ -0,0 +1 @@
1
+ import{a as D}from"./chunk-AITOCPML.js";import{b as _}from"./chunk-W666BB6V.js";import{a as O,b as $,c as k,d as T,e as r,f as o}from"./chunk-GTM65MVX.js";import{a as A,e as I}from"./chunk-SEU5V7I6.js";import{b}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as L}from"./chunk-G7ZBM54M.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as S}from"./chunk-TAD43CG5.js";import{d as E}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as x,e as C,f as M,g as P,h as V}from"./chunk-RRCPZMC2.js";var B=C(P(),1),K=C(M(),1);var t=C(V(),1);var R="container:",F={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},H=x(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let s=e.slice(n+1).trim(),a=e.slice(0,n).trim();return s===""?{event:a}:{detail:s,event:a}},"parseContainerMessage"),W=x(e=>{let n=new Map;for(let s of e){let a=s.functionPath??"";if(!a.startsWith(R))continue;let i=a.slice(R.length);if(i==="")continue;let l=JSON.stringify([i,s.instance??""]),d=n.get(l);if(d!==void 0&&d.timestamp>=s.timestamp)continue;let{detail:N,event:c}=H(s.message);n.set(l,{detail:N,event:c,exitCode:s.exitCode,instance:s.instance,level:s.level,name:i,state:F[c]??"unknown",timestamp:s.timestamp})}return[...n.values()].toSorted((s,a)=>s.name.localeCompare(a.name)||(s.instance??"").localeCompare(a.instance??""))},"foldContainerInstances"),j={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},G=x(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"entriesOf"),ee=x(()=>{let e=(0,B.c)(23),n=E(),s,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={},a={live:!0,shardKey:""},e[0]=s,e[1]=a):(s=e[0],a=e[1]);let{data:i,error:l,liveError:d}=_(L.getLogs,s,a),N=i!==void 0,c;e[2]!==i?(c=W(G(i)),e[2]=i,e[3]=c):c=e[3];let g=c,m;e[4]!==l?(m=l!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:l},void 0,!1),e[4]=l,e[5]=m):m=e[5];let f;e[6]!==n?(f=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[6]=n,e[7]=f):f=e[7];let u;e[8]!==f?(u=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:f},void 0,!1),e[8]=f,e[9]=u):u=e[9];let p;e[10]!==d?(p=(0,t.jsxDEV)(D,{message:d,prefix:"containers"},void 0,!1),e[10]=d,e[11]=p):p=e[11];let v;e[12]!==u||e[13]!==p?(v=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[u,p]},void 0,!0),e[12]=u,e[13]=p,e[14]=v):v=e[14];let h;e[15]!==N||e[16]!==g||e[17]!==n?(h=N&&g.length===0?(0,t.jsxDEV)(S,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")},void 0,!1):(0,t.jsxDEV)(A,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(I,{className:"px-0",children:(0,t.jsxDEV)(O,{"data-testid":"containers-table",children:[(0,t.jsxDEV)($,{children:(0,t.jsxDEV)(T,{children:[(0,t.jsxDEV)(r,{children:n("Container")},void 0,!1),(0,t.jsxDEV)(r,{children:n("Instance")},void 0,!1),(0,t.jsxDEV)(r,{children:n("State")},void 0,!1),(0,t.jsxDEV)(r,{children:n("Last event")},void 0,!1),(0,t.jsxDEV)(r,{children:n("Detail")},void 0,!1),(0,t.jsxDEV)(r,{children:n("Exit")},void 0,!1),(0,t.jsxDEV)(r,{children:n("When")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(k,{children:g.map(J)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[15]=N,e[16]=g,e[17]=n,e[18]=h):h=e[18];let y;return e[19]!==m||e[20]!==v||e[21]!==h?(y=(0,t.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[m,v,h]},void 0,!0),e[19]=m,e[20]=v,e[21]=h,e[22]=y):y=e[22],y},"ContainersPanel");function J(e){return(0,t.jsxDEV)(T,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsxDEV)(o,{className:"font-mono text-xs",children:e.name},void 0,!1),(0,t.jsxDEV)(o,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"},void 0,!1),(0,t.jsxDEV)(o,{children:(0,t.jsxDEV)(b,{variant:j[e.state],children:e.state},void 0,!1)},void 0,!1),(0,t.jsxDEV)(o,{className:"font-mono text-xs text-muted-foreground",children:e.event},void 0,!1),(0,t.jsxDEV)(o,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"},void 0,!1),(0,t.jsxDEV)(o,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"},void 0,!1),(0,t.jsxDEV)(o,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()},void 0,!1)]},`${e.name}/${e.instance??""}`,!0)}x(J,"_temp");export{ee as ContainersPanel};
@@ -1,2 +1,2 @@
1
- import{a as q}from"./chunk-EOE5NDMK.js";import"./chunk-DWDILV2E.js";import{a as T}from"./chunk-QAFAJBAW.js";import{a as H}from"./chunk-J6J54MBP.js";import"./chunk-5OIBXYZM.js";import{a as D}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as B}from"./chunk-W666BB6V.js";import{R as F}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as P}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as p}from"./chunk-BOXSWNXZ.js";import{f as j}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as O}from"./chunk-TAD43CG5.js";import{d as $,f as g,g as N,h as w,l as y,n as R,p as C}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as o,e as M,f as oe,h as se,j as z}from"./chunk-RRCPZMC2.js";var d=M(oe(),1);var e=M(se(),1);function de({className:r,orientation:m="horizontal",...a}){return(0,e.jsxDEV)(T,{"data-slot":"separator",orientation:m,className:z("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",r),...a},void 0,!1)}o(de,"Separator");var le=g(p.clearCapturedMail),ne=g(p.sendTestMail),ce=/https?:\/\/[^\s"'<>)]+/i,_=o(r=>r===void 0?void 0:ce.exec(r)?.[0],"firstLink"),me=o(r=>{if(r!==void 0)return _(r.html)??_(r.text)},"selectedLink"),ue=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,fe=o(r=>`${ue}${r}`,"withPreviewCsp"),v=o(r=>r===void 0?"":Array.isArray(r)?r.join(", "):r,"recipientText"),Ie=o(({limit:r=100})=>{let m=j(),a=$(),{data:S,error:k,errorSource:U,isLoading:V,refetch:x}=B(p.getCapturedMail,{limit:r}),[E,h]=(0,d.useState)(null),[A,L]=(0,d.useState)(null),[u,W]=(0,d.useState)("html"),[b,K]=(0,d.useState)(""),l=(0,d.useMemo)(()=>S?.entries??[],[S]),I=k??E,Q=k===null?E:U,G=o(async()=>{h(null);try{await m.query(le,{},N("")),L(null),x()}catch(t){h(w(t))}},"clearInbox"),J=o(async()=>{h(null);try{await m.query(ne,{},N("")),x()}catch(t){h(w(t))}},"sendTest");H(()=>{x()},!0);let X=o(()=>{y(G())},"onClear"),Y=o(()=>{y(J())},"onSendTest"),Z=o(t=>{K(t.currentTarget.value)},"onFilterChange"),ee=o(t=>{let{id:s}=t.currentTarget.dataset;s!==void 0&&L(s)},"onSelectMessage"),te=o(t=>{let s=t.currentTarget.dataset.tab;(s==="headers"||s==="html"||s==="text")&&W(s)},"onSelectTab"),ae=o(t=>a(t==="html"?"HTML":t==="text"?"Plain text":"Headers"),"tabTitle"),f=(0,d.useMemo)(()=>{let t=b.trim().toLowerCase();return t===""?l:l.filter(s=>`${s.subject} ${v(s.to)}`.toLowerCase().includes(t))},[l,b]),i=(0,d.useMemo)(()=>{if(f.length!==0)return f.find(t=>t.id===A)??f[0]},[f,A]),n=me(i),re=o(()=>{n!==void 0&&R(n)},"onCopyLink"),ie=o(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"onOpenLink");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(c,{"data-testid":"mail-send-test",onClick:Y,size:"sm",type:"button",variant:"outline",children:a("Send test")},void 0,!1),(0,e.jsxDEV)(c,{"data-testid":"mail-clear",disabled:l.length===0,onClick:X,size:"sm",type:"button",variant:"outline",children:a("Clear inbox")},void 0,!1),l.length>0&&(0,e.jsxDEV)(P,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:a("{count} messages",{count:l.length})},void 0,!1)]},void 0,!0),I!==null&&(0,e.jsxDEV)(D,{error:Q,testId:"mail-error"},void 0,!1),I===null&&!V&&l.length===0&&(0,e.jsxDEV)(O,{description:a("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,e.jsxDEV)("path",{d:"M4 5h16v14H4z"},void 0,!1),(0,e.jsxDEV)("path",{d:"m4 6 8 6 8-6"},void 0,!1)]},void 0,!0),testId:"mail-empty",title:a("No captured email.")},void 0,!1),l.length>0&&(0,e.jsxDEV)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxDEV)(F,{"aria-label":a("Search messages"),"data-testid":"mail-search",onChange:Z,placeholder:a("Filter messages"),type:"search",value:b},void 0,!1),(0,e.jsxDEV)(q,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,e.jsxDEV)("ul",{className:"divide-y",children:f.map(t=>{let s=t.id===i?.id;return(0,e.jsxDEV)("li",{children:(0,e.jsxDEV)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${s?"bg-muted":""}`,"data-active":s,"data-id":t.id,"data-testid":"mail-list-item",onClick:ee,type:"button",children:[(0,e.jsxDEV)("span",{className:"w-full truncate font-medium",children:t.subject||a("(no subject)")},void 0,!1),(0,e.jsxDEV)("span",{className:"w-full truncate text-xs text-muted-foreground",children:v(t.to)},void 0,!1),(0,e.jsxDEV)("span",{className:"text-xs text-muted-foreground tabular-nums",children:C(t.capturedAt,"\u2014")},void 0,!1)]},void 0,!0)},t.id,!1)})},void 0,!1)},void 0,!1)]},void 0,!0),i!==void 0&&(0,e.jsxDEV)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxDEV)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||a("(no subject)")},void 0,!1),(0,e.jsxDEV)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,e.jsxDEV)("dt",{children:a("From")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:i.from??"\u2014"},void 0,!1),(0,e.jsxDEV)("dt",{children:a("To")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:v(i.to)},void 0,!1),i.cc!==void 0&&i.cc.length>0&&(0,e.jsxDEV)(e.Fragment,{children:[(0,e.jsxDEV)("dt",{children:a("Cc")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:v(i.cc)},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("dt",{children:a("Sent")},void 0,!1),(0,e.jsxDEV)("dd",{className:"tabular-nums",children:C(i.capturedAt,"\u2014")},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,e.jsxDEV)(c,{"data-testid":"mail-copy-link",disabled:n===void 0,onClick:re,size:"sm",type:"button",variant:"outline",children:a("Copy link")},void 0,!1),(0,e.jsxDEV)(c,{"data-testid":"mail-open-link",disabled:n===void 0,onClick:ie,size:"sm",type:"button",variant:"outline",children:a("Open in new tab")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(de,{},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(t=>(0,e.jsxDEV)(c,{"aria-selected":u===t,"data-tab":t,"data-testid":`mail-tab-${t}`,onClick:te,role:"tab",size:"sm",type:"button",variant:u===t?"secondary":"ghost",children:ae(t)},t,!1))},void 0,!1),(0,e.jsxDEV)("div",{className:"min-h-[12rem]",children:[u==="html"&&(i.html===void 0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No HTML body.")},void 0,!1):(0,e.jsxDEV)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:fe(i.html),title:a("Email preview")},void 0,!1)),u==="text"&&(i.text===void 0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No text body.")},void 0,!1):(0,e.jsxDEV)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:i.text},void 0,!1)),u==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No headers.")},void 0,!1):(0,e.jsxDEV)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(i.headers).map(([t,s])=>`${t}: ${s}`).join(`
1
+ import{a as q}from"./chunk-EOE5NDMK.js";import"./chunk-DWDILV2E.js";import{a as T}from"./chunk-QAFAJBAW.js";import{a as H}from"./chunk-J6J54MBP.js";import"./chunk-5OIBXYZM.js";import{a as D}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as B}from"./chunk-W666BB6V.js";import{R as F}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as P}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as p}from"./chunk-G7ZBM54M.js";import{f as j}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as O}from"./chunk-TAD43CG5.js";import{d as $,f as g,g as N,h as w,l as y,n as R,p as C}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as o,e as M,f as oe,h as se,j as z}from"./chunk-RRCPZMC2.js";var d=M(oe(),1);var e=M(se(),1);function de({className:r,orientation:m="horizontal",...a}){return(0,e.jsxDEV)(T,{"data-slot":"separator",orientation:m,className:z("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",r),...a},void 0,!1)}o(de,"Separator");var le=g(p.clearCapturedMail),ne=g(p.sendTestMail),ce=/https?:\/\/[^\s"'<>)]+/i,_=o(r=>r===void 0?void 0:ce.exec(r)?.[0],"firstLink"),me=o(r=>{if(r!==void 0)return _(r.html)??_(r.text)},"selectedLink"),ue=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,fe=o(r=>`${ue}${r}`,"withPreviewCsp"),v=o(r=>r===void 0?"":Array.isArray(r)?r.join(", "):r,"recipientText"),Ie=o(({limit:r=100})=>{let m=j(),a=$(),{data:S,error:k,errorSource:U,isLoading:V,refetch:x}=B(p.getCapturedMail,{limit:r}),[E,h]=(0,d.useState)(null),[A,L]=(0,d.useState)(null),[u,W]=(0,d.useState)("html"),[b,K]=(0,d.useState)(""),l=(0,d.useMemo)(()=>S?.entries??[],[S]),I=k??E,Q=k===null?E:U,G=o(async()=>{h(null);try{await m.query(le,{},N("")),L(null),x()}catch(t){h(w(t))}},"clearInbox"),J=o(async()=>{h(null);try{await m.query(ne,{},N("")),x()}catch(t){h(w(t))}},"sendTest");H(()=>{x()},!0);let X=o(()=>{y(G())},"onClear"),Y=o(()=>{y(J())},"onSendTest"),Z=o(t=>{K(t.currentTarget.value)},"onFilterChange"),ee=o(t=>{let{id:s}=t.currentTarget.dataset;s!==void 0&&L(s)},"onSelectMessage"),te=o(t=>{let s=t.currentTarget.dataset.tab;(s==="headers"||s==="html"||s==="text")&&W(s)},"onSelectTab"),ae=o(t=>a(t==="html"?"HTML":t==="text"?"Plain text":"Headers"),"tabTitle"),f=(0,d.useMemo)(()=>{let t=b.trim().toLowerCase();return t===""?l:l.filter(s=>`${s.subject} ${v(s.to)}`.toLowerCase().includes(t))},[l,b]),i=(0,d.useMemo)(()=>{if(f.length!==0)return f.find(t=>t.id===A)??f[0]},[f,A]),n=me(i),re=o(()=>{n!==void 0&&R(n)},"onCopyLink"),ie=o(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"onOpenLink");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(c,{"data-testid":"mail-send-test",onClick:Y,size:"sm",type:"button",variant:"outline",children:a("Send test")},void 0,!1),(0,e.jsxDEV)(c,{"data-testid":"mail-clear",disabled:l.length===0,onClick:X,size:"sm",type:"button",variant:"outline",children:a("Clear inbox")},void 0,!1),l.length>0&&(0,e.jsxDEV)(P,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:a("{count} messages",{count:l.length})},void 0,!1)]},void 0,!0),I!==null&&(0,e.jsxDEV)(D,{error:Q,testId:"mail-error"},void 0,!1),I===null&&!V&&l.length===0&&(0,e.jsxDEV)(O,{description:a("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,e.jsxDEV)("path",{d:"M4 5h16v14H4z"},void 0,!1),(0,e.jsxDEV)("path",{d:"m4 6 8 6 8-6"},void 0,!1)]},void 0,!0),testId:"mail-empty",title:a("No captured email.")},void 0,!1),l.length>0&&(0,e.jsxDEV)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxDEV)(F,{"aria-label":a("Search messages"),"data-testid":"mail-search",onChange:Z,placeholder:a("Filter messages"),type:"search",value:b},void 0,!1),(0,e.jsxDEV)(q,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,e.jsxDEV)("ul",{className:"divide-y",children:f.map(t=>{let s=t.id===i?.id;return(0,e.jsxDEV)("li",{children:(0,e.jsxDEV)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${s?"bg-muted":""}`,"data-active":s,"data-id":t.id,"data-testid":"mail-list-item",onClick:ee,type:"button",children:[(0,e.jsxDEV)("span",{className:"w-full truncate font-medium",children:t.subject||a("(no subject)")},void 0,!1),(0,e.jsxDEV)("span",{className:"w-full truncate text-xs text-muted-foreground",children:v(t.to)},void 0,!1),(0,e.jsxDEV)("span",{className:"text-xs text-muted-foreground tabular-nums",children:C(t.capturedAt,"\u2014")},void 0,!1)]},void 0,!0)},t.id,!1)})},void 0,!1)},void 0,!1)]},void 0,!0),i!==void 0&&(0,e.jsxDEV)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxDEV)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||a("(no subject)")},void 0,!1),(0,e.jsxDEV)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,e.jsxDEV)("dt",{children:a("From")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:i.from??"\u2014"},void 0,!1),(0,e.jsxDEV)("dt",{children:a("To")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:v(i.to)},void 0,!1),i.cc!==void 0&&i.cc.length>0&&(0,e.jsxDEV)(e.Fragment,{children:[(0,e.jsxDEV)("dt",{children:a("Cc")},void 0,!1),(0,e.jsxDEV)("dd",{className:"truncate font-mono",children:v(i.cc)},void 0,!1)]},void 0,!0),(0,e.jsxDEV)("dt",{children:a("Sent")},void 0,!1),(0,e.jsxDEV)("dd",{className:"tabular-nums",children:C(i.capturedAt,"\u2014")},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,e.jsxDEV)(c,{"data-testid":"mail-copy-link",disabled:n===void 0,onClick:re,size:"sm",type:"button",variant:"outline",children:a("Copy link")},void 0,!1),(0,e.jsxDEV)(c,{"data-testid":"mail-open-link",disabled:n===void 0,onClick:ie,size:"sm",type:"button",variant:"outline",children:a("Open in new tab")},void 0,!1)]},void 0,!0),(0,e.jsxDEV)(de,{},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(t=>(0,e.jsxDEV)(c,{"aria-selected":u===t,"data-tab":t,"data-testid":`mail-tab-${t}`,onClick:te,role:"tab",size:"sm",type:"button",variant:u===t?"secondary":"ghost",children:ae(t)},t,!1))},void 0,!1),(0,e.jsxDEV)("div",{className:"min-h-[12rem]",children:[u==="html"&&(i.html===void 0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No HTML body.")},void 0,!1):(0,e.jsxDEV)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:fe(i.html),title:a("Email preview")},void 0,!1)),u==="text"&&(i.text===void 0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No text body.")},void 0,!1):(0,e.jsxDEV)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:i.text},void 0,!1)),u==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:a("No headers.")},void 0,!1):(0,e.jsxDEV)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(i.headers).map(([t,s])=>`${t}: ${s}`).join(`
2
2
  `)},void 0,!1))]},void 0,!0)]},void 0,!0)]},void 0,!0)]},void 0,!0)},"MailPanel");export{Ie as MailPanel};
@@ -1,3 +1,3 @@
1
- import{a as J}from"./chunk-EEWKIQUE.js";import{c as L}from"./chunk-W666BB6V.js";import{a as v,e as y}from"./chunk-SEU5V7I6.js";import{a as P}from"./chunk-VLXV72QE.js";import{a as B}from"./chunk-LUP4YTBS.js";import{b as j}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as D}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-CKSHCYGC.js";import{a as f}from"./chunk-BOXSWNXZ.js";import{f as _}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as E,f as S,g as w,h as b,l as I}from"./chunk-ITQKVEP7.js";import{b as N}from"./chunk-22C6COGE.js";import{a as o,e as R,f as K,h as U}from"./chunk-RRCPZMC2.js";var c=R(K(),1);var e=R(U(),1);var V=S(f.exportShard),X=S(f.importShard),z=o(m=>m.map(a=>JSON.stringify(a)).join(`
1
+ import{a as J}from"./chunk-EEWKIQUE.js";import{c as L}from"./chunk-W666BB6V.js";import{a as v,e as y}from"./chunk-SEU5V7I6.js";import{a as P}from"./chunk-VLXV72QE.js";import{a as B}from"./chunk-LUP4YTBS.js";import{b as j}from"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as D}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-CKSHCYGC.js";import{a as f}from"./chunk-G7ZBM54M.js";import{f as _}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as E,f as S,g as w,h as b,l as I}from"./chunk-ITQKVEP7.js";import{b as N}from"./chunk-22C6COGE.js";import{a as o,e as R,f as K,h as U}from"./chunk-RRCPZMC2.js";var c=R(K(),1);var e=R(U(),1);var V=S(f.exportShard),X=S(f.importShard),z=o(m=>m.map(a=>JSON.stringify(a)).join(`
2
2
  `),"toNdjson"),G=o(m=>{let a=[],x=m.split(`
3
3
  `);for(let[r,n]of x.entries()){let h=n.trim();if(h==="")continue;let l=JSON.parse(h);if(typeof l!="object"||l===null)throw new N("INTERNAL",`line ${(r+1).toString()}: expected a { table, doc } object`);let s=l;if(typeof s.table!="string"||typeof s.doc!="object"||s.doc===null||Array.isArray(s.doc))throw new N("INTERNAL",`line ${(r+1).toString()}: expected a { table, doc } object`);a.push(s)}return a},"parseNdjson"),ie=o(({initialShardKey:m})=>{let a=_(),x=L(),r=E(),[n,h]=(0,c.useState)(m??""),[l,s]=(0,c.useState)(""),[C,p]=(0,c.useState)(!1),[T,u]=(0,c.useState)(null),[i,g]=(0,c.useState)(null),[A,O]=(0,c.useState)(null),$=o(async()=>{p(!0),u(null),g(null);try{let t=await a.query(V,{},w(n));j(n),s(z(t.rows)),O(t.rows.length)}catch(t){u(b(t))}finally{p(!1)}},"exportShard"),k=o(async()=>{p(!0),u(null),g(null),O(null);let t;try{t=G(l)}catch(d){u(r("Invalid NDJSON: {message}",{message:b(d)})),p(!1);return}try{let d=await a.query(X,{rows:t},w(n));j(n),g(d),x(f.readTablePage),x(f.listTables)}catch(d){u(b(d))}finally{p(!1)}},"importShard"),M=i===null?0:Object.values(i.inserted).reduce((t,d)=>t+d,0),q=o(()=>{I($())},"runExport"),F=o(()=>{I(k())},"runImport"),H=o(t=>{s(t.target.value)},"onNdjsonChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,e.jsxDEV)(v,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Export")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(y,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(B,{onChange:h,testId:"ei-shard-input",value:n},void 0,!1),(0,e.jsxDEV)(D,{"data-testid":"ei-export",disabled:C,onClick:q,type:"button",children:r("Export")},void 0,!1)]},void 0,!0),A!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:r("Exported {count} rows.",{count:A})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)(v,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Import")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(y,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxDEV)(P,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:H,placeholder:'{"table":"messages","doc":{\u2026}}',value:l},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:(0,e.jsxDEV)(J,{confirmLabel:r("Import (writes rows)?"),disabled:C||l.trim()==="",onConfirm:F,testId:"ei-import",children:r("Import")},void 0,!1)},void 0,!1),i!==null&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:r("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:M})},void 0,!1),i.errors.length>0&&(0,e.jsxDEV)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(t=>(0,e.jsxDEV)("li",{className:"text-xs text-destructive",children:r("line {line} ({table}): {message}",{line:t.line,message:t.message,table:t.table})},`${t.table}-${t.line.toString()}`,!1))},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),T!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:T},void 0,!1)]},void 0,!0)},"ExportImportPanel");export{ie as ExportImportPanel};
@@ -0,0 +1 @@
1
+ import{a as O}from"./chunk-AITOCPML.js";import{a as L}from"./chunk-2K47A3P6.js";import{b as _}from"./chunk-W666BB6V.js";import{a as M,b as F,c as H,d as T,e as d,f as n}from"./chunk-GTM65MVX.js";import{a as E,e as A}from"./chunk-SEU5V7I6.js";import{a as D}from"./chunk-LUP4YTBS.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import"./chunk-O3NAGRTR.js";import{b as w}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as B}from"./chunk-G7ZBM54M.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as K}from"./chunk-TAD43CG5.js";import{d as C,p as S}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as g,e as b,f as R,g as U,h as V}from"./chunk-RRCPZMC2.js";var $=b(U(),1),j=b(R(),1);var t=b(V(),1);var W=g(s=>Array.isArray(s?.issues)?s.issues:[],"issuesOf"),re=g(s=>{let e=(0,$.c)(21),{initialShardKey:P}=s,a=C(),[r,Q]=(0,j.useState)(P??""),c;e[0]!==r?(c=r.trim(),e[0]=r,e[1]=c):c=e[1];let N=L(c,400),f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f={},e[2]=f):f=e[2];let u;e[3]!==N?(u={live:!0,shardKey:N},e[3]=N,e[4]=u):u=e[4];let{data:h,error:i,liveError:m}=_(B.getIssues,f,u),y=h!==void 0,v;if(e[5]!==h||e[6]!==i||e[7]!==m||e[8]!==y||e[9]!==r||e[10]!==a){let I=W(h),p;e[12]!==i?(p=i!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:i},void 0,!1),e[12]=i,e[13]=p):p=e[13];let l;e[14]!==r?(l=(0,t.jsxDEV)(D,{onChange:Q,testId:"issues-shard-input",value:r},void 0,!1),e[14]=r,e[15]=l):l=e[15];let o;e[16]!==m?(o=(0,t.jsxDEV)(O,{message:m,prefix:"issues"},void 0,!1),e[16]=m,e[17]=o):o=e[17];let x;e[18]!==l||e[19]!==o?(x=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[l,o]},void 0,!0),e[18]=l,e[19]=o,e[20]=x):x=e[20],v=(0,t.jsxDEV)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,x,y&&I.length===0?(0,t.jsxDEV)(K,{description:a("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:a("No issues")},void 0,!1):(0,t.jsxDEV)(E,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(A,{className:"px-0",children:(0,t.jsxDEV)(M,{"data-testid":"issues-table",children:[(0,t.jsxDEV)(F,{children:(0,t.jsxDEV)(T,{children:[(0,t.jsxDEV)(d,{children:a("Issue")},void 0,!1),(0,t.jsxDEV)(d,{children:a("Source")},void 0,!1),(0,t.jsxDEV)(d,{className:"text-right",children:a("Events")},void 0,!1),(0,t.jsxDEV)(d,{children:a("First seen")},void 0,!1),(0,t.jsxDEV)(d,{children:a("Last seen")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(H,{children:I.map(k)},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[5]=h,e[6]=i,e[7]=m,e[8]=y,e[9]=r,e[10]=a,e[11]=v}else v=e[11];return v},"IssuesPanel");function k(s){return(0,t.jsxDEV)(T,{"data-testid":`issues-row-${s.hash}`,children:[(0,t.jsxDEV)(n,{className:"max-w-96",children:[(0,t.jsxDEV)("div",{className:"truncate font-medium",title:s.title,children:s.title},void 0,!1),(0,t.jsxDEV)("div",{className:"truncate text-xs text-muted-foreground",title:s.sampleMessage,children:s.sampleMessage},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(n,{className:"font-mono text-xs text-muted-foreground",children:s.culprit},void 0,!1),(0,t.jsxDEV)(n,{className:"text-right",children:(0,t.jsxDEV)(w,{variant:"secondary",children:s.count},void 0,!1)},void 0,!1),(0,t.jsxDEV)(n,{className:"text-xs tabular-nums text-muted-foreground",children:S(s.firstSeen)},void 0,!1),(0,t.jsxDEV)(n,{className:"text-xs tabular-nums text-muted-foreground",children:S(s.lastSeen)},void 0,!1)]},s.hash,!0)}g(k,"_temp");export{re as IssuesPanel};