@alepha/devtools 0.14.1 → 0.14.3

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 (76) hide show
  1. package/assets/devtools/{asset.Bhpm0ujk.css → asset.DbJSgVPr.css} +1 -1
  2. package/assets/devtools/chunk.B3_W5FaN.js +1 -0
  3. package/assets/devtools/chunk.BBrq-Wwo.js +7 -0
  4. package/assets/devtools/chunk.BC4Lys4j.js +1 -0
  5. package/assets/devtools/chunk.BNC0DJB8.js +1 -0
  6. package/assets/devtools/chunk.BOc4btAA.js +2 -0
  7. package/assets/devtools/chunk.BPjMdorr.js +1 -0
  8. package/assets/devtools/chunk.Bdi_dTor.js +1 -0
  9. package/assets/devtools/chunk.BeYM7pih.js +1 -0
  10. package/assets/devtools/{chunk.aHk99chr.js → chunk.BjjA59Pf.js} +1 -1
  11. package/assets/devtools/{chunk.BkBlh2Dt.js → chunk.ByuRJbSC.js} +1 -1
  12. package/assets/devtools/chunk.C1yl87Yo.js +1 -0
  13. package/assets/devtools/chunk.C5K_AIru.js +1 -0
  14. package/assets/devtools/chunk.C6NWzsJg.js +1 -0
  15. package/assets/devtools/chunk.CAWWjC4E.js +1 -0
  16. package/assets/devtools/chunk.CQ8PqHT0.js +1 -0
  17. package/assets/devtools/{chunk.CaVuq3Op.js → chunk.CYVZxO-p.js} +1 -1
  18. package/assets/devtools/{chunk.XGXwPH1e.js → chunk.ChDpavl2.js} +1 -1
  19. package/assets/devtools/chunk.DAVfKvCa.js +2 -0
  20. package/assets/devtools/chunk.DF8tZYh8.js +1 -0
  21. package/assets/devtools/{chunk.DPzX4t8Q.js → chunk.DI-f4xNk.js} +1 -1
  22. package/assets/devtools/{chunk.uTsm7un3.js → chunk.DLDchrhP.js} +1 -1
  23. package/assets/devtools/{chunk.Djkuv-DD.js → chunk.DN-SKgAD.js} +1 -1
  24. package/assets/devtools/{chunk.BVciOoK-.js → chunk.DcaVw31J.js} +1 -1
  25. package/assets/devtools/chunk.Dwv4A_H_.js +1 -0
  26. package/assets/devtools/chunk.DxjqPOcc.js +1 -0
  27. package/assets/devtools/{chunk.Duwrcaca.js → chunk.I1TSx4X4.js} +1 -1
  28. package/assets/devtools/chunk.INuuLdYd.js +1 -0
  29. package/assets/devtools/chunk.PWK2K2kI.js +1 -0
  30. package/assets/devtools/chunk.UAANdYnt.js +1 -0
  31. package/assets/devtools/chunk.XsVAJU_N.js +9 -0
  32. package/assets/devtools/chunk.iyc5GsVj.js +1 -0
  33. package/assets/devtools/chunk.mJxmm31y.js +1 -0
  34. package/assets/devtools/chunk.ospt8-RN.js +1 -0
  35. package/assets/devtools/entry.DBfTnVUe.js +75 -0
  36. package/assets/devtools/index.html +2 -2
  37. package/dist/index.d.ts +29 -0
  38. package/dist/index.js +15 -0
  39. package/dist/index.js.map +1 -1
  40. package/package.json +11 -11
  41. package/src/__tests__/DevCollectorProvider.spec.ts +7 -0
  42. package/src/api/providers/DevToolsDatabaseProvider.ts +16 -0
  43. package/src/ui/AppRouter.tsx +1 -1
  44. package/src/ui/components/DevAtomsViewer.tsx +2 -1
  45. package/src/ui/components/DevDashboard.tsx +13 -163
  46. package/src/ui/components/DevLayout.tsx +23 -48
  47. package/src/ui/components/DevTopicsViewer.tsx +3 -7
  48. package/src/ui/components/graph/DevDependencyGraph.tsx +123 -104
  49. package/src/ui/components/graph/GraphControls.tsx +31 -25
  50. package/src/ui/main.ts +8 -2
  51. package/assets/devtools/chunk.0pKzkQ-k.js +0 -1
  52. package/assets/devtools/chunk.B5eTVHku.js +0 -1
  53. package/assets/devtools/chunk.B9h7IAR1.js +0 -1
  54. package/assets/devtools/chunk.BChtaeaz.js +0 -1
  55. package/assets/devtools/chunk.BLm9NSIJ.js +0 -9
  56. package/assets/devtools/chunk.BRzkf5AB.js +0 -2
  57. package/assets/devtools/chunk.BiYuhEvJ.js +0 -1
  58. package/assets/devtools/chunk.BmVQcEyT.js +0 -1
  59. package/assets/devtools/chunk.ByjndBdY.js +0 -6
  60. package/assets/devtools/chunk.C8MW3asi.js +0 -1
  61. package/assets/devtools/chunk.CLYiSTOf.js +0 -1
  62. package/assets/devtools/chunk.CioNo4ZJ.js +0 -1
  63. package/assets/devtools/chunk.CjoaeVq1.js +0 -7
  64. package/assets/devtools/chunk.Ct5753mG.js +0 -1
  65. package/assets/devtools/chunk.D4sT5zWZ.js +0 -1
  66. package/assets/devtools/chunk.Ddpv5E_O.js +0 -1
  67. package/assets/devtools/chunk.DtstekP0.js +0 -1
  68. package/assets/devtools/chunk.R7-m7OZO.js +0 -1
  69. package/assets/devtools/chunk.VgeujX8m.js +0 -2
  70. package/assets/devtools/chunk.VjygskIP.js +0 -1
  71. package/assets/devtools/chunk.W1p_0xSo.js +0 -1
  72. package/assets/devtools/chunk.arBxf8N4.js +0 -1
  73. package/assets/devtools/chunk.bYKDU_ru.js +0 -1
  74. package/assets/devtools/chunk.cMS5bixD.js +0 -1
  75. package/assets/devtools/chunk.e1Pq7Nwk.js +0 -1
  76. package/assets/devtools/entry.Cjxjbqvs.js +0 -75
@@ -1 +0,0 @@
1
- import{w as B,j as e,ad as v,Y as D,Z as P,r as j,F as d,T as n,B as a,H as m,Q as C,ae as k,z as I,ac as w}from"./entry.Cjxjbqvs.js";import{d as $}from"./chunk.XGXwPH1e.js";import{B as x,S as g}from"./chunk.uTsm7un3.js";import{T as f}from"./chunk.Ct5753mG.js";import{T as s}from"./chunk.aHk99chr.js";import"./chunk.BlqFPyLh.js";const A=[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}]],y=B("outline","table","Table",A),K=({column:i,size:r="xs"})=>{const t=[];return i.primaryKey&&t.push({label:"PK",tooltip:"Primary Key"}),i.identity&&t.push({label:"ID",tooltip:"Auto-increment Identity"}),i.ref&&t.push({label:"FK",tooltip:`Foreign Key → ${i.ref.entity}.${i.ref.column}`}),i.createdAt&&t.push({label:"C",tooltip:"Created At (auto-set on insert)"}),i.updatedAt&&t.push({label:"U",tooltip:"Updated At (auto-set on update)"}),i.deletedAt&&t.push({label:"D",tooltip:"Deleted At (soft delete)"}),i.version&&t.push({label:"V",tooltip:"Version (optimistic locking)"}),e.jsxs(e.Fragment,{children:[t.map(o=>e.jsx(v,{label:o.tooltip,children:e.jsx(x,{size:r,variant:"light",color:"blue",children:o.label})},o.label)),i.nullable&&e.jsx(v,{label:"Nullable",children:e.jsx(x,{size:r,variant:"outline",color:"gray",children:"?"})})]})},z={PostgresProvider:"#336791",SqliteProvider:"#003B57",DatabaseProvider:"#495057",default:"#495057"},S=i=>z[i]??z.default,N=({entities:i,selectedEntity:r,onSelectEntity:t,search:o,onSearchChange:T})=>{const u=j.useMemo(()=>{const l={};for(const c of i){const h=c.provider.replace("Provider","");l[h]||(l[h]=[]),l[h].push(c)}return l},[i]),b=Object.keys(u).sort();return e.jsxs(g,{gap:0,h:"100%",children:[e.jsx(a,{p:"sm",style:{borderBottom:`1px solid ${m.colors.border}`},children:e.jsx(k,{placeholder:"Search tables...",leftSection:e.jsx(I,{size:14}),size:"xs",value:o,onChange:l=>T(l.target.value)})}),e.jsx(w,{style:{flex:1},children:b.map(l=>e.jsxs(a,{children:[e.jsx(n,{size:"xs",fw:600,c:"dimmed",px:"sm",py:"xs",style:{backgroundColor:m.colors.background,borderBottom:`1px solid ${m.colors.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:l}),u[l].map(c=>{const h=r?.name===c.name,p=S(c.provider);return e.jsxs(d,{align:"center",gap:"xs",px:"sm",py:6,onClick:()=>t(c),style:{cursor:"pointer",backgroundColor:h?`${p}15`:void 0,borderLeft:h?`2px solid ${p}`:"2px solid transparent",borderBottom:`1px solid ${m.colors.border}`},children:[e.jsx(y,{size:14,opacity:.5}),e.jsx(n,{size:"sm",style:{flex:1},truncate:!0,children:c.name}),e.jsx(n,{size:"xs",c:"dimmed",children:c.columns.length})]},c.name)})]},l))})]})},O=({entity:i})=>e.jsx(w,{h:"100%",p:"md",children:e.jsxs(g,{gap:"lg",children:[e.jsxs(a,{children:[e.jsx(n,{size:"sm",fw:600,mb:"xs",children:"Columns"}),e.jsxs(s,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Name"}),e.jsx(s.Th,{children:"Type"}),e.jsx(s.Th,{children:"Attributes"})]})}),e.jsx(s.Tbody,{children:i.columns.map(r=>e.jsxs(s.Tr,{children:[e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",fw:r.primaryKey?600:400,children:r.name})}),e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",c:"dimmed",children:r.type})}),e.jsx(s.Td,{children:e.jsx(d,{gap:4,wrap:"wrap",children:e.jsx(K,{column:r})})})]},r.name))})]})]}),i.indexes.length>0&&e.jsxs(a,{children:[e.jsx(n,{size:"sm",fw:600,mb:"xs",children:"Indexes"}),e.jsxs(s,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Name"}),e.jsx(s.Th,{children:"Columns"}),e.jsx(s.Th,{children:"Unique"})]})}),e.jsx(s.Tbody,{children:i.indexes.map((r,t)=>e.jsxs(s.Tr,{children:[e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",children:r.name||"-"})}),e.jsx(s.Td,{children:e.jsx(d,{gap:4,children:r.columns.map(o=>e.jsx(x,{size:"xs",variant:"light",children:o},o))})}),e.jsx(s.Td,{children:r.unique&&e.jsx(x,{size:"xs",color:"yellow",children:"UNIQUE"})})]},r.name||t))})]})]}),i.foreignKeys.length>0&&e.jsxs(a,{children:[e.jsx(n,{size:"sm",fw:600,mb:"xs",children:"Foreign Keys"}),e.jsxs(s,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Name"}),e.jsx(s.Th,{children:"Column"}),e.jsx(s.Th,{children:"References"})]})}),e.jsx(s.Tbody,{children:i.foreignKeys.map((r,t)=>e.jsxs(s.Tr,{children:[e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",children:r.name||"-"})}),e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",children:r.columns.join(", ")})}),e.jsx(s.Td,{children:e.jsxs(n,{size:"sm",ff:"monospace",c:"pink",children:[r.foreignEntity,".",r.foreignColumns.join(", ")]})})]},r.name||t))})]})]}),i.columns.some(r=>r.ref)&&e.jsxs(a,{children:[e.jsx(n,{size:"sm",fw:600,mb:"xs",children:"Column References"}),e.jsxs(s,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Column"}),e.jsx(s.Th,{children:"References"})]})}),e.jsx(s.Tbody,{children:i.columns.filter(r=>r.ref).map(r=>e.jsxs(s.Tr,{children:[e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",children:r.name})}),e.jsx(s.Td,{children:e.jsxs(n,{size:"sm",ff:"monospace",c:"pink",children:[r.ref?.entity,".",r.ref?.column]})})]},r.name))})]})]}),i.constraints.length>0&&e.jsxs(a,{children:[e.jsx(n,{size:"sm",fw:600,mb:"xs",children:"Constraints"}),e.jsxs(s,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:[e.jsx(s.Thead,{children:e.jsxs(s.Tr,{children:[e.jsx(s.Th,{children:"Name"}),e.jsx(s.Th,{children:"Columns"}),e.jsx(s.Th,{children:"Type"})]})}),e.jsx(s.Tbody,{children:i.constraints.map((r,t)=>e.jsxs(s.Tr,{children:[e.jsx(s.Td,{children:e.jsx(n,{size:"sm",ff:"monospace",children:r.name||"-"})}),e.jsx(s.Td,{children:e.jsx(d,{gap:4,children:r.columns.map(o=>e.jsx(x,{size:"xs",variant:"outline",children:o},o))})}),e.jsx(s.Td,{children:e.jsxs(d,{gap:4,children:[r.unique&&e.jsx(x,{size:"xs",color:"yellow",children:"UNIQUE"}),r.hasCheck&&e.jsx(x,{size:"xs",color:"blue",children:"CHECK"})]})})]},r.name||t))})]})]})]})}),R=()=>e.jsx(d,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(g,{align:"center",gap:"xs",children:[e.jsx(C,{size:48,opacity:.3}),e.jsx(n,{size:"sm",children:"Data browser coming soon"})]})}),H=({entity:i})=>{const r=S(i.provider);return e.jsxs(d,{direction:"column",h:"100%",children:[e.jsx(a,{px:"md",py:"sm",style:{borderBottom:`1px solid ${m.colors.border}`,backgroundColor:`${r}08`},children:e.jsxs(d,{align:"center",gap:"sm",children:[e.jsx(y,{size:18,opacity:.7}),e.jsx(n,{size:"md",fw:600,children:i.name}),e.jsxs(x,{size:"xs",variant:"light",color:"gray",children:[i.columns.length," columns"]})]})}),e.jsxs(f,{defaultValue:"structure",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs(f.List,{px:"md",children:[e.jsx(f.Tab,{value:"structure",children:"Structure"}),e.jsx(f.Tab,{value:"data",children:"Data"})]}),e.jsx(f.Panel,{value:"structure",style:{flex:1,overflow:"hidden"},children:e.jsx(O,{entity:i})}),e.jsx(f.Panel,{value:"data",style:{flex:1,overflow:"hidden"},children:e.jsx(R,{})})]})]})},L=()=>e.jsx(d,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(g,{align:"center",gap:"xs",children:[e.jsx(y,{size:48,opacity:.3}),e.jsx(n,{size:"sm",children:"Select a table to view its structure"})]})}),U=()=>e.jsx(d,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(g,{align:"center",gap:"xs",children:[e.jsx(C,{size:48,opacity:.3}),e.jsx(n,{children:"No entities found"}),e.jsx(n,{size:"sm",c:"dimmed",children:"Add entities using $entity primitive to see them here"})]})}),Y=()=>{const i=D(P),[r,t]=j.useState([]),[o,T]=j.useState(!0),[u,b]=j.useState(null),[l,c]=j.useState("");j.useEffect(()=>{i.fetch("/devtools/api/metadata",{schema:{response:$}}).then(p=>{t(p.data.entities),T(!1)})},[]);const h=j.useMemo(()=>{if(!l)return r;const p=l.toLowerCase();return r.filter(E=>E.name.toLowerCase().includes(p))},[r,l]);return o?e.jsx(d,{align:"center",justify:"center",h:"100%",children:e.jsx(n,{c:"dimmed",children:"Loading..."})}):r.length===0?e.jsx(U,{}):e.jsxs(d,{h:"100%",style:{overflow:"hidden"},children:[e.jsx(a,{w:240,style:{borderRight:`1px solid ${m.colors.border}`,backgroundColor:m.colors.surface},children:e.jsx(N,{entities:h,selectedEntity:u,onSelectEntity:b,search:l,onSearchChange:c})}),e.jsx(a,{style:{flex:1,overflow:"hidden"},children:u?e.jsx(H,{entity:u}):e.jsx(L,{})})]})};export{Y as DevDbStudio,Y as default};
@@ -1 +0,0 @@
1
- import{Y as B,Z as L,r as c,j as e,F as t,T as r,B as x,H as a,ae as T,z as C,ac as S,P as v,ad as w,a5 as P,a9 as A}from"./entry.Cjxjbqvs.js";import{d as E}from"./chunk.XGXwPH1e.js";import{S as g,B as u}from"./chunk.uTsm7un3.js";import{I as M}from"./chunk.Ddpv5E_O.js";import{T as j}from"./chunk.Ct5753mG.js";import{T as n}from"./chunk.aHk99chr.js";import{a as O,I}from"./chunk.BkBlh2Dt.js";import{I as R}from"./chunk.CaVuq3Op.js";import"./chunk.BlqFPyLh.js";const z={memory:"#69db7c",redis:"#ff6b6b",default:"#495057"},$=s=>z[s]??z.default,D=s=>s?typeof s=="number"?s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`:String(s):"No TTL",K=({caches:s,selectedCache:l,onSelectCache:p,search:f,onSearchChange:b})=>{const h=c.useMemo(()=>{const i={};for(const o of s){const d=o.provider||"default";i[d]||(i[d]=[]),i[d].push(o)}return i},[s]),y=Object.keys(h).sort();return e.jsxs(g,{gap:0,h:"100%",children:[e.jsx(x,{p:"sm",style:{borderBottom:`1px solid ${a.colors.border}`},children:e.jsx(T,{placeholder:"Search caches...",leftSection:e.jsx(C,{size:14}),size:"xs",value:f,onChange:i=>b(i.target.value)})}),e.jsx(S,{style:{flex:1},children:y.map(i=>e.jsxs(x,{children:[e.jsx(r,{size:"xs",fw:600,c:"dimmed",px:"sm",py:"xs",style:{backgroundColor:a.colors.background,borderBottom:`1px solid ${a.colors.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:i}),h[i].map(o=>{const d=l?.name===o.name,m=$(o.provider);return e.jsxs(t,{align:"center",gap:"xs",px:"sm",py:6,onClick:()=>p(o),style:{cursor:"pointer",backgroundColor:d?`${m}15`:void 0,borderLeft:d?`2px solid ${m}`:"2px solid transparent",borderBottom:`1px solid ${a.colors.border}`,opacity:o.disabled?.5:1},children:[e.jsx(v,{size:14,opacity:.5}),e.jsx(r,{size:"sm",style:{flex:1},truncate:!0,children:o.name}),o.disabled&&e.jsx(u,{size:"xs",variant:"light",color:"gray",children:"off"})]},o.name)})]},i))})]})},N=({cache:s})=>e.jsx(S,{h:"100%",p:"md",children:e.jsxs(g,{gap:"lg",children:[e.jsxs(x,{children:[e.jsx(r,{size:"sm",fw:600,mb:"xs",children:"Configuration"}),e.jsx(n,{striped:!0,highlightOnHover:!0,withTableBorder:!0,children:e.jsxs(n.Tbody,{children:[e.jsxs(n.Tr,{children:[e.jsx(n.Td,{w:150,children:e.jsx(r,{size:"sm",c:"dimmed",children:"Name"})}),e.jsx(n.Td,{children:e.jsx(r,{size:"sm",ff:"monospace",children:s.name})})]}),e.jsxs(n.Tr,{children:[e.jsx(n.Td,{children:e.jsx(r,{size:"sm",c:"dimmed",children:"Provider"})}),e.jsx(n.Td,{children:e.jsx(u,{size:"xs",variant:"light",color:s.provider==="redis"?"red":"green",children:s.provider})})]}),e.jsxs(n.Tr,{children:[e.jsx(n.Td,{children:e.jsx(r,{size:"sm",c:"dimmed",children:"TTL"})}),e.jsx(n.Td,{children:e.jsxs(t,{align:"center",gap:"xs",children:[e.jsx(O,{size:14,opacity:.5}),e.jsx(r,{size:"sm",ff:"monospace",children:D(s.ttl)})]})})]}),e.jsxs(n.Tr,{children:[e.jsx(n.Td,{children:e.jsx(r,{size:"sm",c:"dimmed",children:"Status"})}),e.jsx(n.Td,{children:e.jsx(u,{size:"xs",variant:"light",color:s.disabled?"gray":"green",children:s.disabled?"Disabled":"Enabled"})})]})]})})]}),e.jsxs(x,{children:[e.jsx(r,{size:"sm",fw:600,mb:"xs",children:"Actions"}),e.jsx(t,{gap:"sm",children:e.jsx(w,{label:"Clear all cached entries (coming soon)",children:e.jsx(P,{size:"xs",variant:"light",color:"red",leftSection:e.jsx(I,{size:14}),disabled:!0,children:"Clear All"})})})]})]})}),F=({cache:s})=>{const[l,p]=c.useState("");return e.jsxs(t,{direction:"column",h:"100%",children:[e.jsx(x,{p:"sm",style:{borderBottom:`1px solid ${a.colors.border}`},children:e.jsxs(t,{gap:"sm",align:"center",children:[e.jsx(T,{placeholder:"Filter by pattern...",leftSection:e.jsx(C,{size:14}),size:"xs",value:l,onChange:f=>p(f.target.value),style:{flex:1}}),e.jsx(w,{label:"Invalidate matching keys (coming soon)",children:e.jsx(A,{size:"sm",variant:"light",color:"orange",disabled:!0,children:e.jsx(I,{size:14})})})]})}),e.jsx(t,{align:"center",justify:"center",style:{flex:1},c:"dimmed",children:e.jsxs(g,{align:"center",gap:"xs",children:[e.jsx(R,{size:48,opacity:.3}),e.jsx(r,{size:"sm",children:"Key browser coming soon"}),e.jsxs(r,{size:"xs",c:"dimmed",children:["Browse and manage cached keys for ",s.name]})]})})]})},H=({cache:s})=>{const l=$(s.provider);return e.jsxs(t,{direction:"column",h:"100%",children:[e.jsx(x,{px:"md",py:"sm",style:{borderBottom:`1px solid ${a.colors.border}`,backgroundColor:`${l}08`},children:e.jsxs(t,{align:"center",gap:"sm",children:[e.jsx(v,{size:18,opacity:.7}),e.jsx(r,{size:"md",fw:600,children:s.name}),e.jsx(u,{size:"xs",variant:"light",color:s.provider==="redis"?"red":"green",children:s.provider}),s.disabled&&e.jsx(u,{size:"xs",variant:"light",color:"gray",children:"disabled"})]})}),e.jsxs(j,{defaultValue:"config",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs(j.List,{px:"md",children:[e.jsx(j.Tab,{value:"config",children:"Config"}),e.jsx(j.Tab,{value:"keys",children:"Keys"})]}),e.jsx(j.Panel,{value:"config",style:{flex:1,overflow:"hidden"},children:e.jsx(N,{cache:s})}),e.jsx(j.Panel,{value:"keys",style:{flex:1,overflow:"hidden"},children:e.jsx(F,{cache:s})})]})]})},V=()=>e.jsx(t,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(g,{align:"center",gap:"xs",children:[e.jsx(v,{size:48,opacity:.3}),e.jsx(r,{size:"sm",children:"Select a cache to view its configuration"})]})}),Y=()=>e.jsx(t,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(g,{align:"center",gap:"xs",children:[e.jsx(M,{size:48,opacity:.3}),e.jsx(r,{children:"No caches found"}),e.jsx(r,{size:"sm",c:"dimmed",children:"Add caches using $cache primitive to see them here"})]})}),ee=()=>{const s=B(L),[l,p]=c.useState([]),[f,b]=c.useState(!0),[h,y]=c.useState(null),[i,o]=c.useState("");c.useEffect(()=>{s.fetch("/devtools/api/metadata",{schema:{response:E}}).then(m=>{p(m.data.caches),b(!1)})},[]);const d=c.useMemo(()=>{if(!i)return l;const m=i.toLowerCase();return l.filter(k=>k.name.toLowerCase().includes(m))},[l,i]);return f?e.jsx(t,{align:"center",justify:"center",h:"100%",children:e.jsx(r,{c:"dimmed",children:"Loading..."})}):l.length===0?e.jsx(Y,{}):e.jsxs(t,{h:"100%",style:{overflow:"hidden"},children:[e.jsx(x,{w:240,style:{borderRight:`1px solid ${a.colors.border}`,backgroundColor:a.colors.surface},children:e.jsx(K,{caches:d,selectedCache:h,onSelectCache:y,search:i,onSearchChange:o})}),e.jsx(x,{style:{flex:1,overflow:"hidden"},children:h?e.jsx(H,{cache:h}):e.jsx(V,{})})]})};export{ee as DevCacheInspector,ee as default};
@@ -1 +0,0 @@
1
- import{at as oe,Y as re,a$ as De,r as f,A as z,b4 as je,aK as ke,x as Ie,b5 as Te,p as H,b as M,j as s,T as Ae,d as Pe,c as Ee,f as B,B as se,ay as K,aw as Ne,i as q,ah as ie,b6 as ae,U as ce,b7 as Re,$ as Le,b8 as Fe,q as Oe,a0 as _e,av as Be,a2 as Ke,aZ as $e,H as Ve,F as te,ad as ze,a5 as R,G as He,aa as qe}from"./entry.Cjxjbqvs.js";import{T as le}from"./chunk.Djkuv-DD.js";import{f as Ue,c as ue}from"./chunk.BlqFPyLh.js";import{P as L}from"./chunk.DtstekP0.js";import{A as Ge}from"./chunk.Duwrcaca.js";function de(t,o){const n=oe(),r=re(De),[a,i]=f.useState(!1),[e,c]=f.useState(),l=f.useRef(!1),u=f.useRef(void 0),d=f.useRef(void 0),y=f.useRef(!0),m=f.useRef(void 0);f.useEffect(()=>()=>{y.current=!1,u.current&&(r.clearTimeout(u.current),u.current=void 0),m.current&&(r.clearInterval(m.current),m.current=void 0),d.current&&(d.current.abort(),d.current=void 0)},[]);const v=f.useCallback(async(...g)=>{if(l.current)return;d.current&&d.current.abort();const b=new AbortController;d.current=b,l.current=!0,i(!0),c(void 0),await n.events.emit("react:action:begin",{type:"custom",id:t.id});try{const x=await t.handler(...g,{signal:b.signal});return!y.current||b.signal.aborted?void 0:(await n.events.emit("react:action:success",{type:"custom",id:t.id}),t.onSuccess&&await t.onSuccess(x),x)}catch(x){if(x instanceof Error&&x.name==="AbortError"||!y.current)return;const p=x;if(c(p),await n.events.emit("react:action:error",{type:"custom",id:t.id,error:p}),t.onError)await t.onError(p);else throw p}finally{l.current=!1,i(!1),await n.events.emit("react:action:end",{type:"custom",id:t.id}),d.current===b&&(d.current=void 0)}},[...o,t.id,t.onError,t.onSuccess]),w=f.useCallback(async(...g)=>t.debounce?(u.current&&r.clearTimeout(u.current),new Promise(b=>{u.current=r.createTimeout(async()=>{const x=await v(...g);b(x)},t.debounce??0)})):v(...g),[v,t.debounce]),h=f.useCallback(()=>{u.current&&(r.clearTimeout(u.current),u.current=void 0),d.current&&(d.current.abort(),d.current=void 0),y.current&&(l.current=!1,i(!1))},[]);return f.useEffect(()=>{t.runOnInit&&w()},o),f.useEffect(()=>{if(t.runEvery)return m.current=r.createInterval(()=>w(),t.runEvery,!0),()=>{m.current&&(r.clearInterval(m.current),m.current=void 0)}},[w,t.runEvery]),{run:w,loading:a,error:e,cancel:h}}const We=t=>{const o=z(),[n,r]=f.useState(!1);je().url.pathname;const i=typeof t=="string"?{href:t}:{...t,href:t.href},e=i.href,c=o.isActive(e,i);return{isPending:n,isActive:c,anchorProps:{href:o.base(e),onClick:async l=>{if(l?.stopPropagation(),l?.preventDefault(),!c&&!n){r(!0);try{await o.go(e)}finally{r(!1)}}}}}},me=(t,o=["loading","dirty","error"])=>{const n=oe(),r=o,[a,i]=f.useState(!1),[e,c]=f.useState(!1),[l,u]=f.useState(void 0),[d,y]=f.useState(void 0),m="form"in t?t.form:t,v="path"in t?t.path:void 0,w=r.includes("values"),h=r.includes("error"),g=r.includes("dirty"),b=r.includes("loading");return f.useEffect(()=>{const x=[];return(h||w||g)&&x.push(n.events.on("form:change",p=>{p.id===m.id&&((!v||p.path===v)&&(g&&i(!0),h&&u(void 0)),w&&y(m.currentValues))})),w&&x.push(n.events.on("form:reset",p=>{p.id===m.id&&y(p.values)})),b&&x.push(n.events.on("form:submit:begin",p=>{p.id===m.id&&c(!0)}),n.events.on("form:submit:end",p=>{p.id===m.id&&c(!1)})),(w||g)&&x.push(n.events.on("form:submit:success",p=>{p.id===m.id&&(w&&y(p.values),g&&i(!1))})),h&&x.push(n.events.on("form:submit:error",p=>{p.id===m.id&&(!v||p.error instanceof ke&&p.error.value.path===v)&&u(p.error)})),()=>{for(const p of x)p()}},[]),{dirty:a,loading:e,error:l,values:d}},ht=()=>(Ie("alepha.react.i18n.lang"),re(Te));function C(t,o){return n=>{t?.(n),o?.(n)}}function Ye(t,o,n){return n?Array.from(Ue(n,o)?.querySelectorAll(t)||[]).findIndex(r=>r===n):null}function Ze(t=!1,o={}){const[n,r]=f.useState(t),a=f.useCallback(()=>{r(c=>c||(o.onOpen?.(),!0))},[o.onOpen]),i=f.useCallback(()=>{r(c=>c&&(o.onClose?.(),!1))},[o.onClose]),e=f.useCallback(()=>{n?i():a()},[i,a,n]);return[n,{open:a,close:i,toggle:e}]}function fe({open:t,close:o,openDelay:n,closeDelay:r}){const a=f.useRef(-1),i=f.useRef(-1),e=()=>{window.clearTimeout(a.current),window.clearTimeout(i.current)},c=()=>{e(),n===0||n===void 0?t():a.current=window.setTimeout(t,n)},l=()=>{e(),r===0||r===void 0?o():i.current=window.setTimeout(o,r)};return f.useEffect(()=>e,[]),{openDropdown:c,closeDropdown:l}}var he={root:"m_849cf0da"};const Je={underline:"hover"},U=H((t,o)=>{const{underline:n,className:r,unstyled:a,mod:i,...e}=M("Anchor",Je,t);return s.jsx(Ae,{component:"a",ref:o,className:Pe({[he.root]:!a},r),...e,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:a})});U.classes=he;U.displayName="@mantine/core/Anchor";const[Qe,k]=Ee("Menu component was not found in the tree");var I={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const G=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,...c}=M("MenuDivider",null,t),l=k();return s.jsx(se,{ref:o,...l.getStyles("divider",{className:r,style:a,styles:i,classNames:n}),...c})});G.classes=I;G.displayName="@mantine/core/MenuDivider";const W=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,onMouseEnter:c,onMouseLeave:l,onKeyDown:u,children:d,...y}=M("MenuDropdown",null,t),m=f.useRef(null),v=k(),w=C(u,b=>{(b.key==="ArrowUp"||b.key==="ArrowDown")&&(b.preventDefault(),m.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),h=C(c,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.openDropdown()),g=C(l,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.closeDropdown());return s.jsxs(L.Dropdown,{...y,onMouseEnter:h,onMouseLeave:g,role:"menu","aria-orientation":"vertical",ref:K(o,m),...v.getStyles("dropdown",{className:r,style:a,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:w,children:[v.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),d]})});W.classes=I;W.displayName="@mantine/core/MenuDropdown";const[Xe,$]=Ne(),Y=H((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,color:c,closeMenuOnClick:l,leftSection:u,rightSection:d,children:y,disabled:m,"data-disabled":v,...w}=M("MenuItem",null,t),h=k(),g=$(),b=q(),{dir:x}=ie(),p=f.useRef(null),D=w,T=C(D.onClick,()=>{v||(typeof l=="boolean"?l&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),j=c?b.variantColorResolver({color:c,theme:b,variant:"light"}):void 0,A=c?ae({color:c,theme:b}):null,O=C(D.onKeyDown,P=>{P.key==="ArrowLeft"&&g&&(g.close(),g.focusParentItem())});return s.jsxs(ce,{onMouseDown:P=>P.preventDefault(),...w,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles("item",{className:r,style:a,styles:i,classNames:n}),ref:K(p,o),role:"menuitem",disabled:m,"data-menu-item":!0,"data-disabled":m||v||void 0,"data-mantine-stop-propagation":!0,onClick:T,onKeyDown:ue({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:h.loop,dir:x,orientation:"vertical",onKeyDown:O}),__vars:{"--menu-item-color":A?.isThemeColor&&A?.shade===void 0?`var(--mantine-color-${A.color}-6)`:j?.color,"--menu-item-hover":j?.hover},children:[u&&s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:u}),y&&s.jsx("div",{...h.getStyles("itemLabel",{styles:i,classNames:n}),children:y}),d&&s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:d})]})});Y.classes=I;Y.displayName="@mantine/core/MenuItem";const Z=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,...c}=M("MenuLabel",null,t),l=k();return s.jsx(se,{ref:o,...l.getStyles("label",{className:r,style:a,styles:i,classNames:n}),...c})});Z.classes=I;Z.displayName="@mantine/core/MenuLabel";const J=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,onMouseEnter:c,onMouseLeave:l,onKeyDown:u,children:d,...y}=M("MenuSubDropdown",null,t),m=f.useRef(null),v=k(),w=$(),h=C(c,w?.open),g=C(l,w?.close);return s.jsx(L.Dropdown,{...y,onMouseEnter:h,onMouseLeave:g,role:"menu","aria-orientation":"vertical",ref:K(o,m),...v.getStyles("dropdown",{className:r,style:a,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:d})});J.classes=I;J.displayName="@mantine/core/MenuSubDropdown";const Q=H((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,color:c,leftSection:l,rightSection:u,children:d,disabled:y,"data-disabled":m,closeMenuOnClick:v,...w}=M("MenuSubItem",null,t),h=k(),g=$(),b=q(),{dir:x}=ie(),p=f.useRef(null),D=w,T=c?b.variantColorResolver({color:c,theme:b,variant:"light"}):void 0,j=c?ae({color:c,theme:b}):null,A=C(D.onKeyDown,N=>{N.key==="ArrowRight"&&(g?.open(),g?.focusFirstItem()),N.key==="ArrowLeft"&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),O=C(D.onClick,()=>{!m&&v&&h.closeDropdownImmediately()}),P=C(D.onMouseEnter,g?.open),E=C(D.onMouseLeave,g?.close);return s.jsxs(ce,{onMouseDown:N=>N.preventDefault(),...w,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles("item",{className:r,style:a,styles:i,classNames:n}),ref:K(p,o),role:"menuitem",disabled:y,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":y||m||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:P,onMouseLeave:E,onClick:O,onKeyDown:ue({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:h.loop,dir:x,orientation:"vertical",onKeyDown:A}),__vars:{"--menu-item-color":j?.isThemeColor&&j?.shade===void 0?`var(--mantine-color-${j.color}-6)`:T?.color,"--menu-item-hover":T?.hover},children:[l&&s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:l}),d&&s.jsx("div",{...h.getStyles("itemLabel",{styles:i,classNames:n}),children:d}),s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:u||s.jsx(Ge,{...h.getStyles("chevron"),size:14})})]})});Q.classes=I;Q.displayName="@mantine/core/MenuSubItem";function pe({children:t,refProp:o}){if(!Re(t))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return k(),s.jsx(L.Target,{refProp:o,popupType:"menu",children:t})}pe.displayName="@mantine/core/MenuSubTarget";const et={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function F(t){const{children:o,closeDelay:n,openDelay:r,...a}=M("MenuSub",et,t),i=Le(),[e,{open:c,close:l}]=Ze(!1),u=$(),{openDropdown:d,closeDropdown:y}=fe({open:c,close:l,closeDelay:n,openDelay:r}),m=()=>window.setTimeout(()=>{document.getElementById(`${i}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),v=()=>window.setTimeout(()=>{document.getElementById(`${i}-target`)?.focus()},16);return s.jsx(Xe,{value:{opened:e,close:y,open:d,focusFirstItem:m,focusParentItem:v,parentContext:u},children:s.jsx(L,{opened:e,withinPortal:!1,withArrow:!1,id:i,...a,children:o})})}F.extend=t=>t;F.displayName="@mantine/core/MenuSub";F.Target=pe;F.Dropdown=J;F.Item=Q;const tt={refProp:"ref"},ve=f.forwardRef((t,o)=>{const{children:n,refProp:r,...a}=M("MenuTarget",tt,t),i=Fe(n);if(!i)throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const e=k(),c=i.props,l=C(c.onClick,()=>{e.trigger==="click"?e.toggleDropdown():e.trigger==="click-hover"&&(e.setOpenedViaClick(!0),e.opened||e.openDropdown())}),u=C(c.onMouseEnter,()=>(e.trigger==="hover"||e.trigger==="click-hover")&&e.openDropdown()),d=C(c.onMouseLeave,()=>{(e.trigger==="hover"||e.trigger==="click-hover"&&!e.openedViaClick)&&e.closeDropdown()});return s.jsx(L.Target,{refProp:r,popupType:"menu",ref:o,...a,children:f.cloneElement(i,{onClick:l,onMouseEnter:u,onMouseLeave:d,"data-expanded":e.opened?!0:void 0})})});ve.displayName="@mantine/core/MenuTarget";const nt={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function S(t){const o=M("Menu",nt,t),{children:n,onOpen:r,onClose:a,opened:i,defaultOpened:e,trapFocus:c,onChange:l,closeOnItemClick:u,loop:d,closeOnEscape:y,trigger:m,openDelay:v,closeDelay:w,classNames:h,styles:g,unstyled:b,variant:x,vars:p,menuItemTabIndex:D,keepMounted:T,withInitialFocusPlaceholder:j,attributes:A,...O}=o,P=Oe({name:"Menu",classes:I,props:o,classNames:h,styles:g,unstyled:b,attributes:A}),[E,N]=_e({value:i,defaultValue:e,finalValue:!1,onChange:l}),[ye,X]=f.useState(!1),_=()=>{N(!1),X(!1),E&&a?.()},V=()=>{N(!0),!E&&r?.()},ee=()=>{E?_():V()},{openDropdown:be,closeDropdown:we}=fe({open:V,close:_,closeDelay:w,openDelay:v}),xe=Me=>Ye("[data-menu-item]","[data-menu-dropdown]",Me),{resolvedClassNames:Se,resolvedStyles:Ce}=Be({classNames:h,styles:g,props:o});return s.jsx(Qe,{value:{getStyles:P,opened:E,toggleDropdown:ee,getItemIndex:xe,openedViaClick:ye,setOpenedViaClick:X,closeOnItemClick:u,closeDropdown:m==="click"?_:we,openDropdown:m==="click"?V:be,closeDropdownImmediately:_,loop:d,trigger:m,unstyled:b,menuItemTabIndex:D,withInitialFocusPlaceholder:j},children:s.jsx(L,{returnFocus:!0,...O,opened:E,onChange:ee,defaultOpened:e,trapFocus:T?!1:c,closeOnEscape:y,__staticSelector:"Menu",classNames:Se,styles:Ce,unstyled:b,variant:x,keepMounted:T,children:n})})}S.extend=t=>t;S.withProps=Ke(S);S.classes=I;S.displayName="@mantine/core/Menu";S.Item=Y;S.Label=Z;S.Dropdown=W;S.Target=ve;S.Divider=G;S.Sub=F;const ge=t=>{const{item:o,index:n}=t,r=z(),a=de({handler:async e=>{await o.onClick?.()}},[o.onClick]);if(o.type==="divider")return s.jsx(S.Divider,{},n);if(o.type==="label")return s.jsx(S.Label,{children:o.label},n);if(o.children&&o.children.length>0)return s.jsxs(S,{trigger:"hover",position:"right-start",offset:2,children:[s.jsx(S.Target,{children:s.jsx(S.Item,{leftSection:o.icon,rightSection:s.jsx(He,{size:14}),children:o.label})}),s.jsx(S.Dropdown,{children:o.children.map((e,c)=>s.jsx(ge,{item:e,index:c},c))})]},n);const i={};return t.item.onClick?i.onClick=a.run:t.item.href&&Object.assign(i,r.anchor(t.item.href)),s.jsx(S.Item,{leftSection:o.icon,onClick:o.onClick,color:o.color,rightSection:o.active?s.jsx(le,{size:"xs",variant:"transparent",children:s.jsx(qe,{})}):void 0,...i,children:o.label},n)},ne=t=>{const o=q(),n={...t},{tooltip:r,menu:a,icon:i,...e}=n;if(n.variant==="subtle"&&(e.c??="var(--mantine-color-text)",e.color??="gray"),n.intent&&(n.intent==="none"?(e.c??="var(--mantine-color-text)",e.color??="gray"):n.intent==="primary"?(e.c??="white",e.color??=o.primaryColor):n.intent==="success"?(e.c??="white",e.color??="green"):n.intent==="danger"?(e.c??="white",e.color??="red"):n.intent==="warning"?(e.c??="var(--mantine-color-text)",e.color??="yellow"):n.intent==="info"&&(e.c??="white",e.color??="blue")),n.icon){const u=$e(n.icon)?s.jsx(n.icon,{size:Ve.sizes.icon.md}):s.jsx(le,{w:24,variant:"transparent",size:"sm",c:"var(--mantine-color-text)",...n.themeIconProps,children:n.icon});n.children?e.leftSection=u:(e.children=f.Children.only(u),e.px??="xs")}if(n.leftSection&&!n.children&&(e.px??="xs"),n.textVisibleFrom){const{children:u,textVisibleFrom:d,leftSection:y,...m}=e;return s.jsxs(s.Fragment,{children:[s.jsx(te,{w:"100%",visibleFrom:d,children:s.jsx(ne,{flex:1,...m,leftSection:y,tooltip:r,menu:a,children:u})}),s.jsx(te,{w:"100%",hiddenFrom:d,children:s.jsx(ne,{px:"xs",...m,tooltip:r,menu:a,children:y})})]})}let l="href"in e&&e.href?e.href.startsWith("http")||e.target?s.jsx(ct,{...e,href:e.href,children:e.children}):s.jsx(at,{...e,href:e.href,children:e.children}):(delete e.classNameActive,delete e.variantActive,"action"in e&&e.action?s.jsx(st,{...e,action:e.action,children:e.children}):"onClick"in e&&e.onClick?s.jsx(it,{...e,onClick:e.onClick,children:e.children}):"form"in e&&e.form?e.type==="reset"?s.jsx(rt,{...e,form:e.form,children:e.children}):s.jsx(ot,{...e,form:e.form,children:e.children}):s.jsx(R,{...e,children:e.children}));if(a&&(l=s.jsxs(S,{position:a.position||"bottom-start",width:a.width||200,shadow:a.shadow||"md",trigger:a.on==="hover"?"hover":"click",...a.menuProps,children:[s.jsx(S.Target,{...a.targetProps,children:l}),s.jsx(S.Dropdown,{children:a.items.map((u,d)=>s.jsx(ge,{item:u,index:d},d))})]})),r){const u={openDelay:1e3},d=typeof r=="string"||typeof r=="number"?{...u,label:r,children:l}:{...u,...r,children:l};return s.jsx(ze,{...d})}return l},ot=t=>{const{form:o,...n}=t,r=me(o);return s.jsx(R,{...n,loading:r.loading,disabled:r.loading,type:"submit",children:t.children})},rt=t=>{const{form:o,...n}=t,r=me(o);return s.jsx(R,{...n,disabled:r.loading,type:"reset",children:t.children})},st=t=>{const{action:o,...n}=t;return s.jsx(R,{...n,disabled:o.loading||t.disabled,loading:o.loading,onClick:()=>o.run(),children:t.children})},it=t=>{const o=de({handler:async n=>{await t.onClick(n)}},[t.onClick]);return s.jsx(R,{...t,disabled:o.loading||t.disabled,loading:o.loading,onClick:o.run,children:t.children})},at=t=>{const{active:o,classNameActive:n,variantActive:r,routerGoOptions:a,...i}=t,e=z(),{isPending:c,isActive:l}=We(o?{href:t.href,...o}:{href:t.href}),u=e.anchor(t.href,a),d=i.className||"";return l&&o!==!1&&n&&(i.className=`${d} ${n}`.trim()),t.anchorProps?s.jsx(U,{component:"a",...u,...t.anchorProps,children:t.children}):s.jsx(R,{component:"a",loading:c,...i,...u,variant:l&&o!==!1?r??"filled":i.variant??"subtle",children:t.children})},ct=t=>{const{active:o,classNameActive:n,variantActive:r,routerGoOptions:a,target:i,...e}=t;return s.jsx(R,{component:"a",target:i,...e,children:t.children})};export{ne as A,Ze as a,me as b,C as c,ht as u};
@@ -1 +0,0 @@
1
- import{r,bv as E,f as F,b as W,q as L,s as B,ay as M,j as I,B as $,i as oe,bw as j,a0 as ae,$ as ie,ai as ue,aI as le,t as ce,v as de,a1 as fe}from"./entry.Cjxjbqvs.js";import{g as me}from"./chunk.uyVen0u2.js";function ve(t,e){if(t===e||Number.isNaN(t)&&Number.isNaN(e))return!0;if(!(t instanceof Object)||!(e instanceof Object))return!1;const n=Object.keys(t),{length:o}=n;if(o!==Object.keys(e).length)return!1;for(let a=0;a<o;a+=1){const i=n[a];if(!(i in e)||t[i]!==e[i]&&!(Number.isNaN(t[i])&&Number.isNaN(e[i])))return!1}return!0}function he(t,e){if(!t||!e)return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n+=1)if(!ve(t[n],e[n]))return!1;return!0}function be(t){const e=r.useRef([]),n=r.useRef(0);return he(e.current,t)||(e.current=t,n.current+=1),[n.current]}function ge(t,e){r.useEffect(t,be(e))}function pe(t,e,n={autoInvoke:!1}){const o=r.useRef(null),a=r.useCallback((...m)=>{o.current||(o.current=window.setTimeout(()=>{t(m),o.current=null},e))},[e]),i=r.useCallback(()=>{o.current&&(window.clearTimeout(o.current),o.current=null)},[]);return r.useEffect(()=>(n.autoInvoke&&a(),i),[i,a]),{start:a,clear:i}}function ye(t,e,n){const o=r.useRef(null),a=r.useRef(null);return r.useEffect(()=>{const i=typeof n=="function"?n():n;return(i||a.current)&&(o.current=new MutationObserver(t),o.current.observe(i||a.current,e)),()=>{o.current?.disconnect()}},[t,e]),a}function Re(){const[t,e]=r.useState(!1);return r.useEffect(()=>e(!0),[]),t}function we(t,e){if(!e||!t)return!1;let n=e.parentNode;for(;n!=null;){if(n===t)return!0;n=n.parentNode}return!1}function Se({target:t,parent:e,ref:n,displayAfterTransitionEnd:o}){const a=r.useRef(-1),[i,m]=r.useState(!1),[w,S]=r.useState(typeof o=="boolean"?o:!1),l=()=>{if(!t||!e||!n.current)return;const u=t.getBoundingClientRect(),c=e.getBoundingClientRect(),f=window.getComputedStyle(t),h=window.getComputedStyle(e),p=E(f.borderTopWidth)+E(h.borderTopWidth),y=E(f.borderLeftWidth)+E(h.borderLeftWidth),b={top:u.top-c.top-p,left:u.left-c.left-y,width:u.width,height:u.height};n.current.style.transform=`translateY(${b.top}px) translateX(${b.left}px)`,n.current.style.width=`${b.width}px`,n.current.style.height=`${b.height}px`},d=()=>{window.clearTimeout(a.current),n.current&&(n.current.style.transitionDuration="0ms"),l(),a.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=r.useRef(null),v=r.useRef(null);return r.useEffect(()=>{if(l(),t)return g.current=new ResizeObserver(d),g.current.observe(t),e&&(v.current=new ResizeObserver(d),v.current.observe(e)),()=>{g.current?.disconnect(),v.current?.disconnect()}},[e,t]),r.useEffect(()=>{if(e){const u=c=>{we(c.target,e)&&(d(),S(!1))};return e.addEventListener("transitionend",u),()=>{e.removeEventListener("transitionend",u)}}},[e]),pe(()=>{me()!=="test"&&m(!0)},20,{autoInvoke:!0}),ye(u=>{u.forEach(c=>{c.type==="attributes"&&c.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:w}}var P={root:"m_96b553a6"};const Ce=B((t,{transitionDuration:e})=>({root:{"--transition-duration":typeof e=="number"?`${e}ms`:e}})),_=F((t,e)=>{const n=W("FloatingIndicator",null,t),{classNames:o,className:a,style:i,styles:m,unstyled:w,vars:S,target:l,parent:d,transitionDuration:g,mod:v,displayAfterTransitionEnd:u,attributes:c,...f}=n,h=L({name:"FloatingIndicator",classes:P,props:n,className:a,style:i,classNames:o,styles:m,unstyled:w,attributes:c,vars:S,varsResolver:Ce}),p=r.useRef(null),{initialized:y,hidden:b}=Se({target:l,parent:d,ref:p,displayAfterTransitionEnd:u}),N=M(e,p);return!l||!d?null:I.jsx($,{ref:N,mod:[{initialized:y,hidden:b},v],...h("root"),...f})});_.displayName="@mantine/core/FloatingIndicator";_.classes=P;var A={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const Ne={withItemsBorders:!0},Ee=B((t,{radius:e,color:n,transitionDuration:o,size:a,transitionTimingFunction:i})=>({root:{"--sc-radius":e===void 0?void 0:fe(e),"--sc-color":n?de(n,t):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":o===void 0?void 0:`${o}ms`,"--sc-transition-timing-function":i,"--sc-padding":ce(a,"sc-padding"),"--sc-font-size":le(a)}})),q=F((t,e)=>{const n=W("SegmentedControl",Ne,t),{classNames:o,className:a,style:i,styles:m,unstyled:w,vars:S,data:l,value:d,defaultValue:g,onChange:v,size:u,name:c,disabled:f,readOnly:h,fullWidth:p,orientation:y,radius:b,color:N,transitionDuration:Ie,transitionTimingFunction:$e,variant:D,autoContrast:H,withItemsBorders:K,mod:U,attributes:X,...Y}=n,R=L({name:"SegmentedControl",props:n,classes:A,className:a,style:i,classNames:o,styles:m,unstyled:w,attributes:X,vars:S,varsResolver:Ee}),z=oe(),O=l.map(s=>typeof s=="string"?{label:s,value:s}:s),G=Re(),[J,Q]=r.useState(j()),[Z,V]=r.useState(null),[x,ee]=r.useState({}),te=(s,T)=>{x[T]=s,ee(x)},[C,ne]=ae({value:d,defaultValue:g,finalValue:Array.isArray(l)?O.find(s=>!s.disabled)?.value??l[0]?.value??null:null,onChange:v}),k=ie(c),se=O.map(s=>r.createElement($,{...R("control"),mod:{active:C===s.value,orientation:y},key:s.value},r.createElement("input",{...R("input"),disabled:f||s.disabled,type:"radio",name:k,value:s.value,id:`${k}-${s.value}`,checked:C===s.value,onChange:()=>!h&&ne(s.value),"data-focus-ring":z.focusRing,key:`${s.value}-input`}),r.createElement($,{component:"label",...R("label"),mod:{active:C===s.value&&!(f||s.disabled),disabled:f||s.disabled,"read-only":h},htmlFor:`${k}-${s.value}`,ref:T=>te(T,s.value),__vars:{"--sc-label-color":N!==void 0?ue({color:N,theme:z,autoContrast:H}):void 0},key:`${s.value}-label`},I.jsx("span",{...R("innerLabel"),children:s.label})))),re=M(e,s=>V(s));return ge(()=>{Q(j())},[l.length]),l.length===0?null:I.jsxs($,{...R("root"),variant:D,size:u,ref:re,mod:[{"full-width":p,orientation:y,initialized:G,"with-items-borders":K},U],...Y,role:"radiogroup","data-disabled":f,children:[typeof C=="string"&&I.jsx(_,{target:x[C],parent:Z,component:"span",transitionDuration:"var(--sc-transition-duration)",...R("indicator")},J),se]})});q.classes=A;q.displayName="@mantine/core/SegmentedControl";export{q as S};