@alepha/devtools 0.19.3 → 0.19.4

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 (188) hide show
  1. package/assets/ui/200.html +2 -2
  2. package/assets/ui/200.html.br +2 -1
  3. package/assets/ui/404.html +2 -2
  4. package/assets/ui/404.html.br +2 -1
  5. package/assets/ui/asset.Co90YiKM.css +1 -0
  6. package/assets/ui/asset.Co90YiKM.css.br +0 -0
  7. package/assets/ui/{chunk.D_-fkSwu.js → chunk.5aCoyqfh.js} +1 -1
  8. package/assets/ui/chunk.5aCoyqfh.js.br +0 -0
  9. package/assets/ui/chunk.AicQIFSI.js +1 -0
  10. package/assets/ui/chunk.AicQIFSI.js.br +0 -0
  11. package/assets/ui/{chunk.yh4jaMrg.js → chunk.B25mt84g.js} +1 -1
  12. package/assets/ui/chunk.B25mt84g.js.br +0 -0
  13. package/assets/ui/chunk.B9RkIaX-.js +1 -0
  14. package/assets/ui/chunk.B9RkIaX-.js.br +2 -0
  15. package/assets/ui/{chunk.B9jGefQy.js → chunk.BHvLlrSE.js} +1 -1
  16. package/assets/ui/chunk.BHvLlrSE.js.br +0 -0
  17. package/assets/ui/{chunk.Cj1opA98.js → chunk.BQTCyAmI.js} +1 -1
  18. package/assets/ui/chunk.BQTCyAmI.js.br +0 -0
  19. package/assets/ui/{chunk.CvCu4yZb.js → chunk.BSkVN_fO.js} +1 -1
  20. package/assets/ui/chunk.BSkVN_fO.js.br +0 -0
  21. package/assets/ui/chunk.Be6RDdvy.js +7 -0
  22. package/assets/ui/chunk.Be6RDdvy.js.br +0 -0
  23. package/assets/ui/{chunk.De1vj4hM.js → chunk.BennGilR.js} +1 -1
  24. package/assets/ui/chunk.BennGilR.js.br +0 -0
  25. package/assets/ui/chunk.Bm1U8jkC.js +1 -0
  26. package/assets/ui/chunk.Bm1U8jkC.js.br +0 -0
  27. package/assets/ui/chunk.Bu6ZqSw8.js +1 -0
  28. package/assets/ui/chunk.Bu6ZqSw8.js.br +0 -0
  29. package/assets/ui/{chunk.DYIu-C82.js → chunk.Bz4sdeJh.js} +1 -1
  30. package/assets/ui/chunk.Bz4sdeJh.js.br +0 -0
  31. package/assets/ui/{chunk.BHYZ9sAK.js → chunk.CVhxB_15.js} +1 -1
  32. package/assets/ui/chunk.CVhxB_15.js.br +0 -0
  33. package/assets/ui/chunk.CdOrvGjm.js +80 -0
  34. package/assets/ui/chunk.CdOrvGjm.js.br +0 -0
  35. package/{dist/public/chunk.9plHAFDW.js → assets/ui/chunk.Cegc4FKP.js} +1 -1
  36. package/assets/ui/chunk.Cegc4FKP.js.br +0 -0
  37. package/assets/ui/{chunk.Dc4PCYcb.js → chunk.CgYWVQAO.js} +1 -1
  38. package/assets/ui/chunk.CgYWVQAO.js.br +0 -0
  39. package/assets/ui/chunk.D5WfK8mA.js +1 -0
  40. package/assets/ui/chunk.D5WfK8mA.js.br +0 -0
  41. package/assets/ui/chunk.D6c-Jq33.js +1 -0
  42. package/assets/ui/chunk.D6c-Jq33.js.br +0 -0
  43. package/assets/ui/{chunk.DOwjsMaD.js → chunk.DGcirGNX.js} +1 -1
  44. package/assets/ui/chunk.DGcirGNX.js.br +0 -0
  45. package/assets/ui/chunk.Dab7se_P.js +1 -0
  46. package/assets/ui/chunk.Dab7se_P.js.br +0 -0
  47. package/assets/ui/{chunk.B82rsdDI.js → chunk.DyV4G4y9.js} +1 -1
  48. package/assets/ui/chunk.DyV4G4y9.js.br +0 -0
  49. package/assets/ui/{chunk.Bc7_n90V.js → chunk.W_TFMb5-.js} +1 -1
  50. package/assets/ui/chunk.W_TFMb5-.js.br +0 -0
  51. package/assets/ui/{chunk.D93ZmnLR.js → chunk.dxweq5IS.js} +1 -1
  52. package/assets/ui/chunk.dxweq5IS.js.br +1 -0
  53. package/assets/ui/{chunk.CJt_09bu.js → chunk.froMhC7u.js} +1 -1
  54. package/assets/ui/chunk.froMhC7u.js.br +0 -0
  55. package/assets/ui/{chunk.CK6Z-I-W.js → chunk.umroamPs.js} +1 -1
  56. package/assets/ui/chunk.umroamPs.js.br +0 -0
  57. package/assets/ui/{chunk.DxnuHDOY.js → chunk.uqgDIUyw.js} +1 -1
  58. package/assets/ui/chunk.uqgDIUyw.js.br +0 -0
  59. package/assets/ui/entry.DI5fIO6T.js +2 -0
  60. package/assets/ui/entry.DI5fIO6T.js.br +0 -0
  61. package/assets/ui/index.html +2 -2
  62. package/assets/ui/index.html.br +2 -1
  63. package/dist/public/200.html +2 -2
  64. package/dist/public/200.html.br +2 -1
  65. package/dist/public/404.html +2 -2
  66. package/dist/public/404.html.br +2 -1
  67. package/dist/public/asset.Co90YiKM.css +1 -0
  68. package/dist/public/asset.Co90YiKM.css.br +0 -0
  69. package/dist/public/{chunk.D_-fkSwu.js → chunk.5aCoyqfh.js} +1 -1
  70. package/dist/public/chunk.5aCoyqfh.js.br +0 -0
  71. package/dist/public/chunk.AicQIFSI.js +1 -0
  72. package/dist/public/chunk.AicQIFSI.js.br +0 -0
  73. package/dist/public/{chunk.yh4jaMrg.js → chunk.B25mt84g.js} +1 -1
  74. package/dist/public/chunk.B25mt84g.js.br +0 -0
  75. package/dist/public/chunk.B9RkIaX-.js +1 -0
  76. package/dist/public/chunk.B9RkIaX-.js.br +2 -0
  77. package/dist/public/{chunk.B9jGefQy.js → chunk.BHvLlrSE.js} +1 -1
  78. package/dist/public/chunk.BHvLlrSE.js.br +0 -0
  79. package/dist/public/{chunk.Cj1opA98.js → chunk.BQTCyAmI.js} +1 -1
  80. package/dist/public/chunk.BQTCyAmI.js.br +0 -0
  81. package/dist/public/{chunk.CvCu4yZb.js → chunk.BSkVN_fO.js} +1 -1
  82. package/dist/public/chunk.BSkVN_fO.js.br +0 -0
  83. package/dist/public/chunk.Be6RDdvy.js +7 -0
  84. package/dist/public/chunk.Be6RDdvy.js.br +0 -0
  85. package/dist/public/{chunk.De1vj4hM.js → chunk.BennGilR.js} +1 -1
  86. package/dist/public/chunk.BennGilR.js.br +0 -0
  87. package/dist/public/chunk.Bm1U8jkC.js +1 -0
  88. package/dist/public/chunk.Bm1U8jkC.js.br +0 -0
  89. package/dist/public/chunk.Bu6ZqSw8.js +1 -0
  90. package/dist/public/chunk.Bu6ZqSw8.js.br +0 -0
  91. package/dist/public/{chunk.DYIu-C82.js → chunk.Bz4sdeJh.js} +1 -1
  92. package/dist/public/chunk.Bz4sdeJh.js.br +0 -0
  93. package/dist/public/{chunk.BHYZ9sAK.js → chunk.CVhxB_15.js} +1 -1
  94. package/dist/public/chunk.CVhxB_15.js.br +0 -0
  95. package/dist/public/chunk.CdOrvGjm.js +80 -0
  96. package/dist/public/chunk.CdOrvGjm.js.br +0 -0
  97. package/{assets/ui/chunk.9plHAFDW.js → dist/public/chunk.Cegc4FKP.js} +1 -1
  98. package/dist/public/chunk.Cegc4FKP.js.br +0 -0
  99. package/dist/public/{chunk.Dc4PCYcb.js → chunk.CgYWVQAO.js} +1 -1
  100. package/dist/public/chunk.CgYWVQAO.js.br +0 -0
  101. package/dist/public/chunk.D5WfK8mA.js +1 -0
  102. package/dist/public/chunk.D5WfK8mA.js.br +0 -0
  103. package/dist/public/chunk.D6c-Jq33.js +1 -0
  104. package/dist/public/chunk.D6c-Jq33.js.br +0 -0
  105. package/dist/public/{chunk.DOwjsMaD.js → chunk.DGcirGNX.js} +1 -1
  106. package/dist/public/chunk.DGcirGNX.js.br +0 -0
  107. package/dist/public/chunk.Dab7se_P.js +1 -0
  108. package/dist/public/chunk.Dab7se_P.js.br +0 -0
  109. package/dist/public/{chunk.B82rsdDI.js → chunk.DyV4G4y9.js} +1 -1
  110. package/dist/public/chunk.DyV4G4y9.js.br +0 -0
  111. package/dist/public/{chunk.Bc7_n90V.js → chunk.W_TFMb5-.js} +1 -1
  112. package/dist/public/chunk.W_TFMb5-.js.br +0 -0
  113. package/dist/public/{chunk.D93ZmnLR.js → chunk.dxweq5IS.js} +1 -1
  114. package/dist/public/chunk.dxweq5IS.js.br +1 -0
  115. package/dist/public/{chunk.CJt_09bu.js → chunk.froMhC7u.js} +1 -1
  116. package/dist/public/chunk.froMhC7u.js.br +0 -0
  117. package/dist/public/{chunk.CK6Z-I-W.js → chunk.umroamPs.js} +1 -1
  118. package/dist/public/chunk.umroamPs.js.br +0 -0
  119. package/dist/public/{chunk.DxnuHDOY.js → chunk.uqgDIUyw.js} +1 -1
  120. package/dist/public/chunk.uqgDIUyw.js.br +0 -0
  121. package/dist/public/entry.DI5fIO6T.js +2 -0
  122. package/dist/public/entry.DI5fIO6T.js.br +0 -0
  123. package/dist/public/index.html +2 -2
  124. package/dist/public/index.html.br +2 -1
  125. package/package.json +11 -11
  126. package/src/entities/logs.ts +3 -1
  127. package/assets/ui/asset.Cxu56LSy.css +0 -1
  128. package/assets/ui/asset.Cxu56LSy.css.br +0 -0
  129. package/assets/ui/chunk.9plHAFDW.js.br +0 -0
  130. package/assets/ui/chunk.B82rsdDI.js.br +0 -0
  131. package/assets/ui/chunk.B9jGefQy.js.br +0 -0
  132. package/assets/ui/chunk.BHYZ9sAK.js.br +0 -0
  133. package/assets/ui/chunk.Bc7_n90V.js.br +0 -0
  134. package/assets/ui/chunk.CCbhJSL_.js +0 -1
  135. package/assets/ui/chunk.CCbhJSL_.js.br +0 -0
  136. package/assets/ui/chunk.CJt_09bu.js.br +0 -0
  137. package/assets/ui/chunk.CK6Z-I-W.js.br +0 -1
  138. package/assets/ui/chunk.Cj1opA98.js.br +0 -0
  139. package/assets/ui/chunk.CvCu4yZb.js.br +0 -0
  140. package/assets/ui/chunk.D93ZmnLR.js.br +0 -6
  141. package/assets/ui/chunk.D9MCnLj_.js +0 -7
  142. package/assets/ui/chunk.D9MCnLj_.js.br +0 -0
  143. package/assets/ui/chunk.DOwjsMaD.js.br +0 -0
  144. package/assets/ui/chunk.DYIu-C82.js.br +0 -0
  145. package/assets/ui/chunk.D_-fkSwu.js.br +0 -0
  146. package/assets/ui/chunk.Dc4PCYcb.js.br +0 -0
  147. package/assets/ui/chunk.De1vj4hM.js.br +0 -0
  148. package/assets/ui/chunk.DuQak1OK.js +0 -1
  149. package/assets/ui/chunk.DuQak1OK.js.br +0 -0
  150. package/assets/ui/chunk.DxnuHDOY.js.br +0 -0
  151. package/assets/ui/chunk.TIounDiA.js +0 -1
  152. package/assets/ui/chunk.TIounDiA.js.br +0 -0
  153. package/assets/ui/chunk.p3hCiSrt.js +0 -80
  154. package/assets/ui/chunk.p3hCiSrt.js.br +0 -0
  155. package/assets/ui/chunk.yh4jaMrg.js.br +0 -0
  156. package/assets/ui/entry.DnXws2rz.js +0 -2
  157. package/assets/ui/entry.DnXws2rz.js.br +0 -0
  158. package/dist/public/asset.Cxu56LSy.css +0 -1
  159. package/dist/public/asset.Cxu56LSy.css.br +0 -0
  160. package/dist/public/chunk.9plHAFDW.js.br +0 -0
  161. package/dist/public/chunk.B82rsdDI.js.br +0 -0
  162. package/dist/public/chunk.B9jGefQy.js.br +0 -0
  163. package/dist/public/chunk.BHYZ9sAK.js.br +0 -0
  164. package/dist/public/chunk.Bc7_n90V.js.br +0 -0
  165. package/dist/public/chunk.CCbhJSL_.js +0 -1
  166. package/dist/public/chunk.CCbhJSL_.js.br +0 -0
  167. package/dist/public/chunk.CJt_09bu.js.br +0 -0
  168. package/dist/public/chunk.CK6Z-I-W.js.br +0 -1
  169. package/dist/public/chunk.Cj1opA98.js.br +0 -0
  170. package/dist/public/chunk.CvCu4yZb.js.br +0 -0
  171. package/dist/public/chunk.D93ZmnLR.js.br +0 -6
  172. package/dist/public/chunk.D9MCnLj_.js +0 -7
  173. package/dist/public/chunk.D9MCnLj_.js.br +0 -0
  174. package/dist/public/chunk.DOwjsMaD.js.br +0 -0
  175. package/dist/public/chunk.DYIu-C82.js.br +0 -0
  176. package/dist/public/chunk.D_-fkSwu.js.br +0 -0
  177. package/dist/public/chunk.Dc4PCYcb.js.br +0 -0
  178. package/dist/public/chunk.De1vj4hM.js.br +0 -0
  179. package/dist/public/chunk.DuQak1OK.js +0 -1
  180. package/dist/public/chunk.DuQak1OK.js.br +0 -0
  181. package/dist/public/chunk.DxnuHDOY.js.br +0 -0
  182. package/dist/public/chunk.TIounDiA.js +0 -1
  183. package/dist/public/chunk.TIounDiA.js.br +0 -0
  184. package/dist/public/chunk.p3hCiSrt.js +0 -80
  185. package/dist/public/chunk.p3hCiSrt.js.br +0 -0
  186. package/dist/public/chunk.yh4jaMrg.js.br +0 -0
  187. package/dist/public/entry.DnXws2rz.js +0 -2
  188. package/dist/public/entry.DnXws2rz.js.br +0 -0
@@ -0,0 +1 @@
1
+ import{A as e}from"./chunk.CdOrvGjm.js";var t=e(`outline`,`settings`,`Settings`,[[`path`,{d:`M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065`,key:`svg-0`}],[`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`,key:`svg-1`}]]);export{t};
Binary file
@@ -1 +1 @@
1
- import{At as e,D as t,E as n,J as r,Lt as i,a,jt as o,tt as s}from"./chunk.p3hCiSrt.js";var c=i(o(),1),l=e(),u=(e,t)=>{if(!t)return e;let n=t.toLowerCase();return e.reduce((e,r)=>{if(r.children){let i=u(r.children,t);i.length>0?e.push({...r,children:i}):r.label.toLowerCase().includes(n)&&e.push(r)}else r.label.toLowerCase().includes(n)&&e.push(r);return e},[])},d=e=>{let t=0;for(let n of e)n.children&&n.children.length>0?t+=d(n.children):t++;return t},f=({nodes:e,selectedId:t,openNodes:n,search:r=``,onSelect:i,onToggle:o,showLeafCount:s=!0})=>(0,l.jsx)(a,{direction:`column`,gap:2,style:{minHeight:0},children:(0,c.useMemo)(()=>u(e,r),[e,r]).map(e=>(0,l.jsx)(p,{node:e,depth:0,selectedId:t,openNodes:n,onSelect:i,onToggle:o,showLeafCount:s},e.id))}),p=({node:e,depth:i,selectedId:o,openNodes:c,onSelect:u,onToggle:f,showLeafCount:m})=>{let h=!!e.children&&e.children.length>0,g=c.has(e.id),_=o===e.id,v=h?d(e.children):0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{w:`100%`,py:4,className:`devtools-tree-node`,"data-selected":_||void 0,style:{borderRadius:6,paddingLeft:8+i*20,paddingRight:8,transition:`background 100ms ease`},onClick:()=>{h?f(e.id):u(e.id)},children:(0,l.jsxs)(a,{gap:8,wrap:`nowrap`,children:[h?(0,l.jsx)(a,{style:{width:14,flexShrink:0,display:`flex`,alignItems:`center`},children:g?(0,l.jsx)(t,{size:14,opacity:.5}):(0,l.jsx)(n,{size:14,opacity:.5})}):(0,l.jsx)(a,{style:{width:14,flexShrink:0,display:`flex`,alignItems:`center`}}),e.icon,(0,l.jsx)(r,{fz:12,fw:_?600:400,truncate:!0,style:{flex:1},children:e.label}),e.badge,h&&m&&v>0&&(0,l.jsx)(r,{fz:10,c:`dimmed`,style:{flexShrink:0},children:v})]})}),h&&g&&(0,l.jsx)(a,{direction:`column`,gap:2,style:{minHeight:0},children:e.children.map(e=>(0,l.jsx)(p,{node:e,depth:i+1,selectedId:o,openNodes:c,onSelect:u,onToggle:f,showLeafCount:m},e.id))})]})};export{f as t};
1
+ import{At as e,D as t,E as n,J as r,Lt as i,a,jt as o,tt as s}from"./chunk.CdOrvGjm.js";var c=i(o(),1),l=e(),u=(e,t)=>{if(!t)return e;let n=t.toLowerCase();return e.reduce((e,r)=>{if(r.children){let i=u(r.children,t);i.length>0?e.push({...r,children:i}):r.label.toLowerCase().includes(n)&&e.push(r)}else r.label.toLowerCase().includes(n)&&e.push(r);return e},[])},d=e=>{let t=0;for(let n of e)n.children&&n.children.length>0?t+=d(n.children):t++;return t},f=({nodes:e,selectedId:t,openNodes:n,search:r=``,onSelect:i,onToggle:o,showLeafCount:s=!0})=>(0,l.jsx)(a,{direction:`column`,gap:2,style:{minHeight:0},children:(0,c.useMemo)(()=>u(e,r),[e,r]).map(e=>(0,l.jsx)(p,{node:e,depth:0,selectedId:t,openNodes:n,onSelect:i,onToggle:o,showLeafCount:s},e.id))}),p=({node:e,depth:i,selectedId:o,openNodes:c,onSelect:u,onToggle:f,showLeafCount:m})=>{let h=!!e.children&&e.children.length>0,g=c.has(e.id),_=o===e.id,v=h?d(e.children):0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{w:`100%`,py:4,className:`devtools-tree-node`,"data-selected":_||void 0,style:{borderRadius:6,paddingLeft:8+i*20,paddingRight:8,transition:`background 100ms ease`},onClick:()=>{h?f(e.id):u(e.id)},children:(0,l.jsxs)(a,{gap:8,wrap:`nowrap`,children:[h?(0,l.jsx)(a,{style:{width:14,flexShrink:0,display:`flex`,alignItems:`center`},children:g?(0,l.jsx)(t,{size:14,opacity:.5}):(0,l.jsx)(n,{size:14,opacity:.5})}):(0,l.jsx)(a,{style:{width:14,flexShrink:0,display:`flex`,alignItems:`center`}}),e.icon,(0,l.jsx)(r,{fz:12,fw:_?600:400,truncate:!0,style:{flex:1},children:e.label}),e.badge,h&&m&&v>0&&(0,l.jsx)(r,{fz:10,c:`dimmed`,style:{flexShrink:0},children:v})]})}),h&&g&&(0,l.jsx)(a,{direction:`column`,gap:2,style:{minHeight:0},children:e.children.map(e=>(0,l.jsx)(p,{node:e,depth:i+1,selectedId:o,openNodes:c,onSelect:u,onToggle:f,showLeafCount:m},e.id))})]})};export{f as t};
Binary file
@@ -0,0 +1 @@
1
+ import{A as e}from"./chunk.CdOrvGjm.js";var t=e(`outline`,`database`,`Database`,[[`path`,{d:`M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0`,key:`svg-0`}],[`path`,{d:`M4 6v6a8 3 0 0 0 16 0v-6`,key:`svg-1`}],[`path`,{d:`M4 12v6a8 3 0 0 0 16 0v-6`,key:`svg-2`}]]);export{t};
@@ -0,0 +1,2 @@
1
+ ����{b'h����՟j�\�c����9]\ �gtM��&<y(�-��jC=��8h1��̓@K�-��(�1䗁W�k�Ȧ^���ڇ�<�{Xz�
2
+ ��P��AFx�ADz����CŞb�8@F[�o#�5�6�U֣$h��Y?��>�� ���-�G�
@@ -1 +1 @@
1
- import{A as e,At as t,Ct as n,Dt as r,Et as i,H as a,J as o,L as s,Lt as c,M as l,Nt as u,Pt as d,U as f,X as p,a as m,at as h,bt as g,ct as _,d as v,dt as y,ft as b,gt as x,it as S,jt as C,kt as w,l as ee,lt as T,mt as E,n as D,nt as O,pt as k,r as A,rt as j,tt as te,u as M,ut as ne,v as re,vt as N,wt as ie,xt as ae,z as oe}from"./chunk.p3hCiSrt.js";import{t as P}from"./chunk.D93ZmnLR.js";import{a as se,i as F,n as ce,r as I,t as L}from"./chunk.BHYZ9sAK.js";import{a as R}from"./entry.DnXws2rz.js";import{t as le}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{t as ue}from"./chunk.yh4jaMrg.js";function z(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function B(e,t){if(typeof e==`string`&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var V=c(C(),1),H=t(),de={serialize:JSON.stringify,deserialize:JSON.parse,size:`sm`,indentSpaces:2},U=h(e=>{let{value:t,defaultValue:n,onChange:r,formatOnBlur:i,validationError:a,serialize:o,deserialize:s,onFocus:c,onBlur:l,readOnly:u,error:d,indentSpaces:f,...p}=T(`JsonInput`,de,e),[m,h]=N({value:t,defaultValue:n,finalValue:``,onChange:r}),[g,_]=(0,V.useState)(B(m,s));return(0,H.jsx)(oe,{value:m,onChange:e=>h(e.currentTarget.value),onFocus:e=>{c?.(e),_(!0)},onBlur:e=>{l?.(e);let t=B(e.currentTarget.value,s);i&&!u&&t&&e.currentTarget.value.trim()!==``&&h(o(s(e.currentTarget.value),null,f)),_(t)},readOnly:u,...p,autoComplete:`off`,__staticSelector:`JsonInput`,error:g?d:a||!0,"data-monospace":!0})});U.classes=p.classes,U.displayName=`@mantine/core/JsonInput`;var[fe,W]=ie(`Tabs component was not found in the tree`),G={root:`m_89d60db1`,"list--default":`m_576c9d4`,list:`m_89d33d6d`,tab:`m_4ec4dce6`,panel:`m_b0c91715`,tabSection:`m_fc420b1f`,tabLabel:`m_42bbd1ae`,"tab--default":`m_539e827b`,"list--outline":`m_6772fbd5`,"tab--outline":`m_b59ab47c`,"tab--pills":`m_c3381914`},K=h(e=>{let t=T(`TabsList`,null,e),{children:n,className:r,grow:i,justify:a,classNames:o,styles:s,style:c,mod:l,...u}=t,d=W();return(0,H.jsx)(S,{...d.getStyles(`list`,{className:r,style:c,classNames:o,styles:s,props:t,variant:d.variant}),role:`tablist`,variant:d.variant,mod:[{grow:i,orientation:d.orientation,placement:d.orientation===`vertical`&&d.placement,inverted:d.inverted},l],"aria-orientation":d.orientation,__vars:{"--tabs-justify":a},...u,children:n})});K.classes=G,K.displayName=`@mantine/core/TabsList`;var q=h(e=>{let t=T(`TabsPanel`,null,e),{children:n,className:r,value:i,classNames:a,styles:o,style:s,mod:c,keepMounted:l,...u}=t,d=y(),f=W(),p=f.value===i,m=f.keepMounted||l,h=m&&d!==`test`?(0,H.jsx)(V.Activity,{mode:p?`visible`:`hidden`,children:n}):m||p?n:null;return(0,H.jsx)(S,{...f.getStyles(`panel`,{className:r,classNames:a,styles:o,style:[s,p?void 0:{display:`none`}],props:t}),mod:[{orientation:f.orientation},c],role:`tabpanel`,id:f.getPanelId(i),"aria-labelledby":f.getTabId(i),...u,children:h})});q.classes=G,q.displayName=`@mantine/core/TabsPanel`;var J=h(e=>{let t=T(`TabsTab`,null,e),{className:r,children:i,rightSection:a,leftSection:o,value:s,onClick:c,onKeyDown:l,disabled:u,color:d,style:f,classNames:p,styles:m,vars:h,mod:g,tabIndex:_,...v}=t,y=ne(),{dir:b}=j(),x=W(),S=s===x.value,C=e=>{x.onChange(x.allowTabDeactivation&&s===x.value?null:s),c?.(e)},w={classNames:p,styles:m,props:t};return(0,H.jsxs)(te,{...x.getStyles(`tab`,{className:r,style:f,variant:x.variant,...w}),disabled:u,unstyled:x.unstyled,variant:x.variant,mod:[{active:S,disabled:u,orientation:x.orientation,inverted:x.inverted,placement:x.orientation===`vertical`&&x.placement},g],role:`tab`,id:x.getTabId(s),"aria-selected":S,tabIndex:_===void 0?S||x.value===null?0:-1:_,"aria-controls":x.getPanelId(s),onClick:C,__vars:{"--tabs-color":d?E(d,y):void 0},onKeyDown:n({siblingSelector:`[role="tab"]`,parentSelector:`[role="tablist"]`,activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||`horizontal`,dir:b,onKeyDown:l}),...v,children:[o&&(0,H.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`left`,children:o}),i&&(0,H.jsx)(`span`,{...x.getStyles(`tabLabel`,w),children:i}),a&&(0,H.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`right`,children:a})]})});J.classes=G,J.displayName=`@mantine/core/TabsTab`;var Y=`Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value`,pe={keepMounted:!0,orientation:`horizontal`,loop:!0,activateTabWithKeyboard:!0,variant:`default`,placement:`left`},X=x((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":ae(t),"--tabs-color":E(n,e),"--tabs-text-color":b(r,e)?k({color:n,theme:e,autoContrast:r}):void 0}})),Z=h(e=>{let t=T(`Tabs`,pe,e),{defaultValue:n,value:r,onChange:i,orientation:a,children:o,loop:s,id:c,activateTabWithKeyboard:l,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,placement:h,keepMounted:v,classNames:y,styles:b,unstyled:x,className:C,style:w,vars:ee,autoContrast:E,mod:D,attributes:O,...k}=t,A=g(c),[j,te]=N({value:r,defaultValue:n,finalValue:null,onChange:i}),M=_({name:`Tabs`,props:t,classes:G,className:C,style:w,classNames:y,styles:b,unstyled:x,attributes:O,vars:ee,varsResolver:X});return(0,H.jsx)(fe,{value:{placement:h,value:j,orientation:a,id:A,loop:s,activateTabWithKeyboard:l,getTabId:z(`${A}-tab`,Y),getPanelId:z(`${A}-panel`,Y),onChange:te,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,keepMounted:v,unstyled:x,getStyles:M},children:(0,H.jsx)(S,{id:A,variant:d,mod:[{orientation:a,inverted:a===`horizontal`&&m,placement:a===`vertical`&&h},D],...M(`root`),...k,children:o})})});Z.classes=G,Z.varsResolver=X,Z.displayName=`@mantine/core/Tabs`,Z.Tab=J,Z.Panel=q,Z.List=K;var me=e(`outline`,`folder-open`,`FolderOpen`,[[`path`,{d:`M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2`,key:`svg-0`}]]),he=e(`outline`,`folder`,`Folder`,[[`path`,{d:`M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2`,key:`svg-0`}]]),ge=e(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),_e=e(`outline`,`schema`,`Schema`,[[`path`,{d:`M5 2h5v4h-5l0 -4`,key:`svg-0`}],[`path`,{d:`M15 10h5v4h-5l0 -4`,key:`svg-1`}],[`path`,{d:`M5 18h5v4h-5l0 -4`,key:`svg-2`}],[`path`,{d:`M5 10h5v4h-5l0 -4`,key:`svg-3`}],[`path`,{d:`M10 12h5`,key:`svg-4`}],[`path`,{d:`M7.5 6v4`,key:`svg-5`}],[`path`,{d:`M7.5 14v4`,key:`svg-6`}]]),ve={GET:{color:`var(--mantine-color-green-text)`,bg:`var(--mantine-color-green-light)`},POST:{color:`var(--mantine-color-blue-text)`,bg:`var(--mantine-color-blue-light)`},PUT:{color:`var(--mantine-color-orange-text)`,bg:`var(--mantine-color-orange-light)`},PATCH:{color:`var(--mantine-color-yellow-text)`,bg:`var(--mantine-color-yellow-light)`},DELETE:{color:`var(--mantine-color-red-text)`,bg:`var(--mantine-color-red-light)`}},ye={page:I,queue:L,topic:F,cache:R},be={page:`var(--mantine-color-blue-text)`,queue:`var(--mantine-color-orange-text)`,topic:`var(--mantine-color-pink-text)`,cache:`var(--mantine-color-cyan-text)`},xe={actions:{icon:se,color:`var(--mantine-color-teal-text)`},pages:{icon:I,color:`var(--mantine-color-blue-text)`},queues:{icon:L,color:`var(--mantine-color-orange-text)`},topics:{icon:F,color:`var(--mantine-color-pink-text)`},caches:{icon:R,color:`var(--mantine-color-cyan-text)`},routes:{icon:ce,color:`var(--mantine-color-violet-text)`}},Se=({method:e})=>{let t=e.toUpperCase(),n=t===`DELETE`?`DEL`:t,r=ve[t]??{color:`var(--mantine-color-dimmed)`,bg:`var(--mantine-color-default-hover)`};return(0,H.jsx)(o,{component:`span`,fz:9,fw:700,ff:`monospace`,lh:1,style:{paddingTop:5,color:r.color,background:r.bg,padding:`2px 4px`,borderRadius:3,flexShrink:0,letterSpacing:.3,width:32,textAlign:`center`,display:`inline-block`},children:n})},Ce=(e,t)=>{let n=e.type===`folder`,r=e.type===`action`,i;if(n){let n=xe[e.id];if(n){let e=n.icon;i=(0,H.jsx)(e,{size:15,color:n.color,style:{flexShrink:0}})}else i=(0,H.jsx)(t.has(e.id)?me:he,{size:15,color:`var(--mantine-color-dimmed)`,style:{flexShrink:0}})}else i=r?(0,H.jsx)(Se,{method:e.data?.method??`GET`}):(0,H.jsx)(ye[e.type]??I,{size:15,color:be[e.type]??`var(--mantine-color-dimmed)`,style:{flexShrink:0}});return{id:e.id,label:e.label,icon:i,children:e.children?.map(e=>Ce(e,t))}},we=({nodes:e,selectedId:t,openNodes:n,search:r,onSelect:i,onToggle:a})=>(0,H.jsx)(ue,{nodes:(0,V.useMemo)(()=>e.map(e=>Ce(e,n)),[e,n]),selectedId:t,openNodes:n,search:r,onSelect:i,onToggle:a}),Te={GET:`teal`,POST:`blue`,PUT:`orange`,PATCH:`yellow`,DELETE:`red`},Q=d.object({}),$=e=>{if(!e)return null;try{let t=u(e);if(t?.properties)return t}catch{}return null},Ee=e=>typeof e==`string`?e:e?.name??String(e),De=(e,t)=>{if(!t)return null;switch(e){case`$rateLimit`:if(t.max)return[{label:`max:${t.max}`,color:`red`}];break;case`$circuit`:if(t.threshold)return[{label:`threshold:${t.threshold}`,color:`red`}];break;case`$throttle`:if(t.rate)return[{label:`rate:${t.rate}`,color:`yellow`}];break;case`$retry`:if(t.max)return[{label:`max:${t.max}`,color:`blue`}];break;case`$cors`:if(t.origin)return[{label:String(t.origin),color:`blue`}];break;case`$lock`:if(t.key)return[{label:`key:${t.key}`,color:`pink`}];break}return null},Oe=({mw:e})=>{let t=e.options,n=t?.roles?.length||t?.permissions?.length||t?.issuers?.length||t?.optional,r=e.name===`$secure`?null:De(e.name,t),i=(0,H.jsx)(f,{size:`sm`,variant:`light`,color:`violet`,children:e.name});return(0,H.jsxs)(m,{gap:`xs`,wrap:`wrap`,align:`center`,children:[t&&!n&&!r&&e.name!==`$secure`?(0,H.jsx)(s,{label:JSON.stringify(t,null,2),multiline:!0,maw:400,styles:{tooltip:{fontFamily:`monospace`,fontSize:11}},children:i}):i,t?.roles?.length>0&&t.roles.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`cyan`,children:e},e)),t?.permissions?.length>0&&t.permissions.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`orange`,children:Ee(e)},Ee(e))),t?.issuers?.length>0&&t.issuers.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`green`,children:e},e)),t?.optional&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:`optional`}),r?.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:e.color,children:e.label},e.label))]})},ke=({action:e})=>{let t=w(r),[n,s]=(0,V.useState)(`{}`),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(!1),[p,h]=(0,V.useState)(0),g=`${e.method}:${e.fullPath}`,_=(0,V.useMemo)(()=>e.method===`GET`?null:$(e.body),[g]),v=(0,V.useMemo)(()=>$(e.query),[g]),y=(0,V.useMemo)(()=>$(e.params),[g]),b=i({schema:_??Q,handler:()=>{}},[_]),x=i({schema:v??Q,handler:()=>{}},[v]),S=i({schema:y??Q,handler:()=>{}},[y]),C=!!_,T=(0,V.useRef)(n);T.current=n;let E=(0,V.useCallback)(async()=>{d(!0),l(null);let n=performance.now();try{let r=e.fullPath;if(y){let e=S.currentValues;for(let[t,n]of Object.entries(e))n!=null&&(r=r.replace(`:${t}`,encodeURIComponent(String(n))))}if(v){let e=x.currentValues,t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();n&&(r+=`?${n}`)}let i;if(e.method!==`GET`)if(C)i=b.currentValues;else try{i=JSON.parse(T.current)}catch{i=void 0}let a=await t.fetch(r,{method:e.method,body:e.method===`GET`?void 0:JSON.stringify(i),headers:e.method===`GET`?void 0:{"Content-Type":`application/json`}});h(Math.round(performance.now()-n)),l({status:a.status,data:a.data})}catch(e){h(Math.round(performance.now()-n)),l({error:e.message??`Request failed`})}finally{d(!1)}},[t,e,C,b,x,S,_,v,y]);return(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(m,{gap:`sm`,mb:`xs`,children:[(0,H.jsx)(f,{size:`lg`,variant:`light`,color:Te[e.method]??`gray`,children:e.method}),(0,H.jsx)(P,{fz:`sm`,children:e.fullPath}),e.secure&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`yellow`,children:`Secure`})]}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),e.middlewares?.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Middleware`}),(0,H.jsx)(m,{direction:`column`,gap:`xs`,children:e.middlewares.map(e=>(0,H.jsx)(Oe,{mw:e},e.name))})]}),(0,H.jsxs)(Z,{defaultValue:`schema`,children:[(0,H.jsxs)(Z.List,{children:[(0,H.jsx)(Z.Tab,{value:`schema`,leftSection:(0,H.jsx)(_e,{size:14}),children:`Schema`}),(0,H.jsx)(Z.Tab,{value:`tryit`,leftSection:(0,H.jsx)(ge,{size:14}),children:`Try It`})]}),(0,H.jsx)(Z.Panel,{value:`schema`,pt:`md`,children:(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[e.body&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Request Body`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.body,defaultExpandedDepth:2,size:`xs`})})]}),e.params&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.params,defaultExpandedDepth:2,size:`xs`})})]}),e.query&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.query,defaultExpandedDepth:2,size:`xs`})})]}),e.response&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Response`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.response,defaultExpandedDepth:2,size:`xs`})})]}),!e.body&&!e.params&&!e.query&&!e.response&&(0,H.jsx)(o,{c:`dimmed`,fz:`sm`,children:`No schema defined for this action.`})]})}),(0,H.jsx)(Z.Panel,{value:`tryit`,pt:`md`,children:(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[y&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(A,{form:S,skipSubmitButton:!0,skipFormElement:!0,columns:1})]}),v&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(A,{form:x,skipSubmitButton:!0,skipFormElement:!0,columns:1})]}),e.method!==`GET`&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Request Body`}),_?(0,H.jsx)(A,{form:b,skipSubmitButton:!0,skipFormElement:!0,columns:1}):(0,H.jsx)(U,{value:n,onChange:s,formatOnBlur:!0,autosize:!0,minRows:4,maxRows:12,styles:{input:{fontFamily:`monospace`,fontSize:12}}})]}),(0,H.jsxs)(m,{children:[(0,H.jsx)(ee,{size:`xs`,loading:u,onClick:E,color:Te[e.method]??`blue`,icon:(0,H.jsx)(ge,{size:14}),children:`Send Request`}),p>0&&(0,H.jsxs)(o,{fz:`xs`,c:`dimmed`,children:[p,`ms`]})]}),c&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Response`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:c.error?(0,H.jsx)(o,{c:`red`,fz:`sm`,children:c.error}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{size:`xs`,mb:`xs`,color:c.status<400?`teal`:`red`,children:c.status}),(0,H.jsx)(D,{data:c.data,defaultExpandedDepth:3,size:`xs`})]})})]})]})})]})]})},Ae=e=>e?e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`:`No TTL`,je=({cache:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name})}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`cyan`,children:`Cache`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider}),e.disabled&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`red`,children:`Disabled`})]}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsxs)(m,{direction:`column`,gap:`xs`,children:[(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`TTL`}),(0,H.jsx)(o,{fz:`sm`,ff:`monospace`,children:Ae(e.ttl)})]}),(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`Provider`}),(0,H.jsx)(o,{fz:`sm`,ff:`monospace`,children:e.provider??`default`})]}),(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`Status`}),(0,H.jsx)(f,{size:`xs`,color:e.disabled?`red`:`green`,children:e.disabled?`Disabled`:`Active`})]})]})})]}),Me=({page:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.label||e.name}),e.path&&(0,H.jsx)(P,{fz:`sm`,mb:`xs`,children:e.path}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[e.hasLazy&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`blue`,children:`Lazy`}),e.hasParent&&(0,H.jsxs)(f,{size:`xs`,variant:`light`,color:`gray`,children:[`Parent: `,e.parentName??`?`]}),e.hasChildren&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`teal`,children:`Children`}),e.hasErrorHandler&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`red`,children:`Error Handler`}),e.hasResolve&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`violet`,children:`Loader`}),e.client&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`orange`,children:`Client Only`}),e.static&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`cyan`,children:`Static`})]}),e.params&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.params,defaultExpandedDepth:2,size:`xs`})})]}),e.query&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.query,defaultExpandedDepth:2,size:`xs`})})]})]}),Ne=({queue:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`orange`,children:`Queue`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider})]}),e.schema&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Job Schema`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.schema,defaultExpandedDepth:2,size:`xs`})})]})]}),Pe=({topic:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`pink`,children:`Topic`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider}),e.subscribers>0&&(0,H.jsxs)(f,{size:`xs`,variant:`light`,color:`gray`,children:[e.subscribers,` subscriber`,e.subscribers===1?``:`s`]})]}),e.schema&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Message Schema`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.schema,defaultExpandedDepth:2,size:`xs`})})]})]}),Fe=d.object({selected:d.optional(d.text()),open:d.optional(d.text())}),Ie=e=>{let t=[];if(e.actions?.length>0){let n={id:`actions`,label:`actions`,type:`folder`,children:[]},r=new Map;for(let t of e.actions){let e=t.group||`default`;r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let[e,t]of Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t))){let r=e.split(`:`),i=n;for(let e=0;e<r.length;e++){let t=`actions:${r.slice(0,e+1).join(`:`)}`,n=i.children?.find(e=>e.id===t);n||(n={id:t,label:r[e],type:`folder`,children:[]},i.children=i.children??[],i.children.push(n)),i=n}let a=t.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({id:`action:${e.method}:${e.fullPath}`,label:e.name,type:`action`,data:e}));i.children=i.children??[],i.children.push(...a)}t.push(n)}if(e.pages?.length>0){let n=new Map,r=[];for(let t of e.pages)n.set(t.name,{id:`page:${t.name}`,label:t.name,type:`page`,data:t,children:[]});let i=new Set;for(let t of e.pages)if(t.parentName&&n.has(t.parentName)){let e=n.get(t.parentName);e.children=e.children??[],i.has(t.name)||(e.children.push(n.get(t.name)),i.add(t.name))}for(let t of e.pages)if(t.childrenNames){let e=n.get(t.name);for(let r of t.childrenNames)n.has(r)&&!i.has(r)&&(e.children=e.children??[],e.children.push(n.get(r)),i.add(r))}for(let t of e.pages)i.has(t.name)||r.push(n.get(t.name));let a=e=>{for(let t of e)t.children?.length===0?t.children=void 0:t.children&&a(t.children)};a(r),t.push({id:`pages`,label:`pages`,type:`folder`,children:r})}return e.queues?.length>0&&t.push({id:`queues`,label:`queues`,type:`folder`,children:e.queues.map(e=>({id:`queue:${e.name}`,label:e.name,type:`queue`,data:e}))}),e.topics?.length>0&&t.push({id:`topics`,label:`topics`,type:`folder`,children:e.topics.map(e=>({id:`topic:${e.name}`,label:e.name,type:`topic`,data:e}))}),e.caches?.length>0&&t.push({id:`caches`,label:`caches`,type:`folder`,children:e.caches.map(e=>({id:`cache:${e.name}`,label:e.name,type:`cache`,data:e}))}),t},Le=()=>{let e=w(r),[t,n]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[s,c]=v(Fe,{format:`querystring`}),[u,d]=(0,V.useState)(new Set(s.open?s.open.split(`,`):[`routes`,`actions`]));(0,V.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:le}}).then(e=>n(e.data)).catch(()=>{})},[e]);let f=(0,V.useMemo)(()=>t?Ie(t):[],[t]),p=s.selected??``,h=(0,V.useMemo)(()=>{if(!p||!t)return null;let[e,...n]=p.split(`:`),r=n.join(`:`);switch(e){case`action`:{let e=r.indexOf(`:`),n=e>=0?r.slice(0,e):``,i=e>=0?r.slice(e+1):r;return{type:`action`,data:t.actions?.find(e=>e.method===n&&e.fullPath===i)}}case`page`:return{type:`page`,data:t.pages?.find(e=>e.name===r)};case`queue`:return{type:`queue`,data:t.queues?.find(e=>e.name===r)};case`topic`:return{type:`topic`,data:t.topics?.find(e=>e.name===r)};case`cache`:return{type:`cache`,data:t.caches?.find(e=>e.name===r)};default:return null}},[p,t]),g=(0,V.useCallback)(e=>{c({selected:e,open:Array.from(u).join(`,`)})},[c,u]),_=(0,V.useCallback)(e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c({selected:s.selected,open:Array.from(n).join(`,`)}),n})},[c,s.selected]);return(0,H.jsxs)(m,{style:{flex:1,overflow:`hidden`},children:[(0,H.jsxs)(m,{w:280,style:{borderRight:`1px solid ${M.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,H.jsx)(m,{p:`xs`,children:(0,H.jsx)(l,{placeholder:`Search...`,size:`xs`,leftSection:(0,H.jsx)(re,{size:14}),value:i,onChange:e=>a(e.currentTarget.value)})}),(0,H.jsx)(O,{style:{flex:1},px:`xs`,pb:`xs`,children:(0,H.jsx)(we,{nodes:f,selectedId:p,openNodes:u,search:i,onSelect:g,onToggle:_})})]}),(0,H.jsxs)(m,{style:{flex:1,overflow:`auto`},p:`lg`,children:[!h&&(0,H.jsx)(m,{align:`center`,justify:`center`,h:`100%`,children:(0,H.jsx)(o,{c:`dimmed`,fz:`sm`,children:`Select a resource from the tree`})}),h?.type===`action`&&h.data&&(0,H.jsx)(ke,{action:h.data}),h?.type===`page`&&h.data&&(0,H.jsx)(Me,{page:h.data}),h?.type===`queue`&&h.data&&(0,H.jsx)(Ne,{queue:h.data}),h?.type===`topic`&&h.data&&(0,H.jsx)(Pe,{topic:h.data}),h?.type===`cache`&&h.data&&(0,H.jsx)(je,{cache:h.data})]})]})};export{Le as DevExplorer,Le as default};
1
+ import{A as e,At as t,Ct as n,Dt as r,Et as i,H as a,J as o,L as s,Lt as c,M as l,Nt as u,Pt as d,U as f,X as p,a as m,at as h,bt as g,ct as _,d as v,dt as y,ft as b,gt as x,it as S,jt as C,kt as w,l as ee,lt as T,mt as E,n as D,nt as O,pt as k,r as A,rt as j,tt as te,u as M,ut as ne,v as re,vt as N,wt as ie,xt as ae,z as oe}from"./chunk.CdOrvGjm.js";import{t as P}from"./chunk.dxweq5IS.js";import{a as se,i as F,n as ce,r as I,t as L}from"./chunk.CVhxB_15.js";import{t as R}from"./chunk.B9RkIaX-.js";import{t as le}from"./chunk.DGcirGNX.js";import"./chunk.Bu6ZqSw8.js";import{t as ue}from"./chunk.B25mt84g.js";function z(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function B(e,t){if(typeof e==`string`&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var V=c(C(),1),H=t(),de={serialize:JSON.stringify,deserialize:JSON.parse,size:`sm`,indentSpaces:2},U=h(e=>{let{value:t,defaultValue:n,onChange:r,formatOnBlur:i,validationError:a,serialize:o,deserialize:s,onFocus:c,onBlur:l,readOnly:u,error:d,indentSpaces:f,...p}=T(`JsonInput`,de,e),[m,h]=N({value:t,defaultValue:n,finalValue:``,onChange:r}),[g,_]=(0,V.useState)(B(m,s));return(0,H.jsx)(oe,{value:m,onChange:e=>h(e.currentTarget.value),onFocus:e=>{c?.(e),_(!0)},onBlur:e=>{l?.(e);let t=B(e.currentTarget.value,s);i&&!u&&t&&e.currentTarget.value.trim()!==``&&h(o(s(e.currentTarget.value),null,f)),_(t)},readOnly:u,...p,autoComplete:`off`,__staticSelector:`JsonInput`,error:g?d:a||!0,"data-monospace":!0})});U.classes=p.classes,U.displayName=`@mantine/core/JsonInput`;var[fe,W]=ie(`Tabs component was not found in the tree`),G={root:`m_89d60db1`,"list--default":`m_576c9d4`,list:`m_89d33d6d`,tab:`m_4ec4dce6`,panel:`m_b0c91715`,tabSection:`m_fc420b1f`,tabLabel:`m_42bbd1ae`,"tab--default":`m_539e827b`,"list--outline":`m_6772fbd5`,"tab--outline":`m_b59ab47c`,"tab--pills":`m_c3381914`},K=h(e=>{let t=T(`TabsList`,null,e),{children:n,className:r,grow:i,justify:a,classNames:o,styles:s,style:c,mod:l,...u}=t,d=W();return(0,H.jsx)(S,{...d.getStyles(`list`,{className:r,style:c,classNames:o,styles:s,props:t,variant:d.variant}),role:`tablist`,variant:d.variant,mod:[{grow:i,orientation:d.orientation,placement:d.orientation===`vertical`&&d.placement,inverted:d.inverted},l],"aria-orientation":d.orientation,__vars:{"--tabs-justify":a},...u,children:n})});K.classes=G,K.displayName=`@mantine/core/TabsList`;var q=h(e=>{let t=T(`TabsPanel`,null,e),{children:n,className:r,value:i,classNames:a,styles:o,style:s,mod:c,keepMounted:l,...u}=t,d=y(),f=W(),p=f.value===i,m=f.keepMounted||l,h=m&&d!==`test`?(0,H.jsx)(V.Activity,{mode:p?`visible`:`hidden`,children:n}):m||p?n:null;return(0,H.jsx)(S,{...f.getStyles(`panel`,{className:r,classNames:a,styles:o,style:[s,p?void 0:{display:`none`}],props:t}),mod:[{orientation:f.orientation},c],role:`tabpanel`,id:f.getPanelId(i),"aria-labelledby":f.getTabId(i),...u,children:h})});q.classes=G,q.displayName=`@mantine/core/TabsPanel`;var J=h(e=>{let t=T(`TabsTab`,null,e),{className:r,children:i,rightSection:a,leftSection:o,value:s,onClick:c,onKeyDown:l,disabled:u,color:d,style:f,classNames:p,styles:m,vars:h,mod:g,tabIndex:_,...v}=t,y=ne(),{dir:b}=j(),x=W(),S=s===x.value,C=e=>{x.onChange(x.allowTabDeactivation&&s===x.value?null:s),c?.(e)},w={classNames:p,styles:m,props:t};return(0,H.jsxs)(te,{...x.getStyles(`tab`,{className:r,style:f,variant:x.variant,...w}),disabled:u,unstyled:x.unstyled,variant:x.variant,mod:[{active:S,disabled:u,orientation:x.orientation,inverted:x.inverted,placement:x.orientation===`vertical`&&x.placement},g],role:`tab`,id:x.getTabId(s),"aria-selected":S,tabIndex:_===void 0?S||x.value===null?0:-1:_,"aria-controls":x.getPanelId(s),onClick:C,__vars:{"--tabs-color":d?E(d,y):void 0},onKeyDown:n({siblingSelector:`[role="tab"]`,parentSelector:`[role="tablist"]`,activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||`horizontal`,dir:b,onKeyDown:l}),...v,children:[o&&(0,H.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`left`,children:o}),i&&(0,H.jsx)(`span`,{...x.getStyles(`tabLabel`,w),children:i}),a&&(0,H.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`right`,children:a})]})});J.classes=G,J.displayName=`@mantine/core/TabsTab`;var Y=`Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value`,pe={keepMounted:!0,orientation:`horizontal`,loop:!0,activateTabWithKeyboard:!0,variant:`default`,placement:`left`},X=x((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":ae(t),"--tabs-color":E(n,e),"--tabs-text-color":b(r,e)?k({color:n,theme:e,autoContrast:r}):void 0}})),Z=h(e=>{let t=T(`Tabs`,pe,e),{defaultValue:n,value:r,onChange:i,orientation:a,children:o,loop:s,id:c,activateTabWithKeyboard:l,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,placement:h,keepMounted:v,classNames:y,styles:b,unstyled:x,className:C,style:w,vars:ee,autoContrast:E,mod:D,attributes:O,...k}=t,A=g(c),[j,te]=N({value:r,defaultValue:n,finalValue:null,onChange:i}),M=_({name:`Tabs`,props:t,classes:G,className:C,style:w,classNames:y,styles:b,unstyled:x,attributes:O,vars:ee,varsResolver:X});return(0,H.jsx)(fe,{value:{placement:h,value:j,orientation:a,id:A,loop:s,activateTabWithKeyboard:l,getTabId:z(`${A}-tab`,Y),getPanelId:z(`${A}-panel`,Y),onChange:te,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,keepMounted:v,unstyled:x,getStyles:M},children:(0,H.jsx)(S,{id:A,variant:d,mod:[{orientation:a,inverted:a===`horizontal`&&m,placement:a===`vertical`&&h},D],...M(`root`),...k,children:o})})});Z.classes=G,Z.varsResolver=X,Z.displayName=`@mantine/core/Tabs`,Z.Tab=J,Z.Panel=q,Z.List=K;var me=e(`outline`,`folder-open`,`FolderOpen`,[[`path`,{d:`M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2`,key:`svg-0`}]]),he=e(`outline`,`folder`,`Folder`,[[`path`,{d:`M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2`,key:`svg-0`}]]),ge=e(`outline`,`player-play`,`PlayerPlay`,[[`path`,{d:`M7 4v16l13 -8l-13 -8`,key:`svg-0`}]]),_e=e(`outline`,`schema`,`Schema`,[[`path`,{d:`M5 2h5v4h-5l0 -4`,key:`svg-0`}],[`path`,{d:`M15 10h5v4h-5l0 -4`,key:`svg-1`}],[`path`,{d:`M5 18h5v4h-5l0 -4`,key:`svg-2`}],[`path`,{d:`M5 10h5v4h-5l0 -4`,key:`svg-3`}],[`path`,{d:`M10 12h5`,key:`svg-4`}],[`path`,{d:`M7.5 6v4`,key:`svg-5`}],[`path`,{d:`M7.5 14v4`,key:`svg-6`}]]),ve={GET:{color:`var(--mantine-color-green-text)`,bg:`var(--mantine-color-green-light)`},POST:{color:`var(--mantine-color-blue-text)`,bg:`var(--mantine-color-blue-light)`},PUT:{color:`var(--mantine-color-orange-text)`,bg:`var(--mantine-color-orange-light)`},PATCH:{color:`var(--mantine-color-yellow-text)`,bg:`var(--mantine-color-yellow-light)`},DELETE:{color:`var(--mantine-color-red-text)`,bg:`var(--mantine-color-red-light)`}},ye={page:I,queue:L,topic:F,cache:R},be={page:`var(--mantine-color-blue-text)`,queue:`var(--mantine-color-orange-text)`,topic:`var(--mantine-color-pink-text)`,cache:`var(--mantine-color-cyan-text)`},xe={actions:{icon:se,color:`var(--mantine-color-teal-text)`},pages:{icon:I,color:`var(--mantine-color-blue-text)`},queues:{icon:L,color:`var(--mantine-color-orange-text)`},topics:{icon:F,color:`var(--mantine-color-pink-text)`},caches:{icon:R,color:`var(--mantine-color-cyan-text)`},routes:{icon:ce,color:`var(--mantine-color-violet-text)`}},Se=({method:e})=>{let t=e.toUpperCase(),n=t===`DELETE`?`DEL`:t,r=ve[t]??{color:`var(--mantine-color-dimmed)`,bg:`var(--mantine-color-default-hover)`};return(0,H.jsx)(o,{component:`span`,fz:9,fw:700,ff:`monospace`,lh:1,style:{paddingTop:5,color:r.color,background:r.bg,padding:`2px 4px`,borderRadius:3,flexShrink:0,letterSpacing:.3,width:32,textAlign:`center`,display:`inline-block`},children:n})},Ce=(e,t)=>{let n=e.type===`folder`,r=e.type===`action`,i;if(n){let n=xe[e.id];if(n){let e=n.icon;i=(0,H.jsx)(e,{size:15,color:n.color,style:{flexShrink:0}})}else i=(0,H.jsx)(t.has(e.id)?me:he,{size:15,color:`var(--mantine-color-dimmed)`,style:{flexShrink:0}})}else i=r?(0,H.jsx)(Se,{method:e.data?.method??`GET`}):(0,H.jsx)(ye[e.type]??I,{size:15,color:be[e.type]??`var(--mantine-color-dimmed)`,style:{flexShrink:0}});return{id:e.id,label:e.label,icon:i,children:e.children?.map(e=>Ce(e,t))}},we=({nodes:e,selectedId:t,openNodes:n,search:r,onSelect:i,onToggle:a})=>(0,H.jsx)(ue,{nodes:(0,V.useMemo)(()=>e.map(e=>Ce(e,n)),[e,n]),selectedId:t,openNodes:n,search:r,onSelect:i,onToggle:a}),Te={GET:`teal`,POST:`blue`,PUT:`orange`,PATCH:`yellow`,DELETE:`red`},Q=d.object({}),$=e=>{if(!e)return null;try{let t=u(e);if(t?.properties)return t}catch{}return null},Ee=e=>typeof e==`string`?e:e?.name??String(e),De=(e,t)=>{if(!t)return null;switch(e){case`$rateLimit`:if(t.max)return[{label:`max:${t.max}`,color:`red`}];break;case`$circuit`:if(t.threshold)return[{label:`threshold:${t.threshold}`,color:`red`}];break;case`$throttle`:if(t.rate)return[{label:`rate:${t.rate}`,color:`yellow`}];break;case`$retry`:if(t.max)return[{label:`max:${t.max}`,color:`blue`}];break;case`$cors`:if(t.origin)return[{label:String(t.origin),color:`blue`}];break;case`$lock`:if(t.key)return[{label:`key:${t.key}`,color:`pink`}];break}return null},Oe=({mw:e})=>{let t=e.options,n=t?.roles?.length||t?.permissions?.length||t?.issuers?.length||t?.optional,r=e.name===`$secure`?null:De(e.name,t),i=(0,H.jsx)(f,{size:`sm`,variant:`light`,color:`violet`,children:e.name});return(0,H.jsxs)(m,{gap:`xs`,wrap:`wrap`,align:`center`,children:[t&&!n&&!r&&e.name!==`$secure`?(0,H.jsx)(s,{label:JSON.stringify(t,null,2),multiline:!0,maw:400,styles:{tooltip:{fontFamily:`monospace`,fontSize:11}},children:i}):i,t?.roles?.length>0&&t.roles.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`cyan`,children:e},e)),t?.permissions?.length>0&&t.permissions.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`orange`,children:Ee(e)},Ee(e))),t?.issuers?.length>0&&t.issuers.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:`green`,children:e},e)),t?.optional&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:`optional`}),r?.map(e=>(0,H.jsx)(f,{size:`xs`,variant:`dot`,color:e.color,children:e.label},e.label))]})},ke=({action:e})=>{let t=w(r),[n,s]=(0,V.useState)(`{}`),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(!1),[p,h]=(0,V.useState)(0),g=`${e.method}:${e.fullPath}`,_=(0,V.useMemo)(()=>e.method===`GET`?null:$(e.body),[g]),v=(0,V.useMemo)(()=>$(e.query),[g]),y=(0,V.useMemo)(()=>$(e.params),[g]),b=i({schema:_??Q,handler:()=>{}},[_]),x=i({schema:v??Q,handler:()=>{}},[v]),S=i({schema:y??Q,handler:()=>{}},[y]),C=!!_,T=(0,V.useRef)(n);T.current=n;let E=(0,V.useCallback)(async()=>{d(!0),l(null);let n=performance.now();try{let r=e.fullPath;if(y){let e=S.currentValues;for(let[t,n]of Object.entries(e))n!=null&&(r=r.replace(`:${t}`,encodeURIComponent(String(n))))}if(v){let e=x.currentValues,t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();n&&(r+=`?${n}`)}let i;if(e.method!==`GET`)if(C)i=b.currentValues;else try{i=JSON.parse(T.current)}catch{i=void 0}let a=await t.fetch(r,{method:e.method,body:e.method===`GET`?void 0:JSON.stringify(i),headers:e.method===`GET`?void 0:{"Content-Type":`application/json`}});h(Math.round(performance.now()-n)),l({status:a.status,data:a.data})}catch(e){h(Math.round(performance.now()-n)),l({error:e.message??`Request failed`})}finally{d(!1)}},[t,e,C,b,x,S,_,v,y]);return(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(m,{gap:`sm`,mb:`xs`,children:[(0,H.jsx)(f,{size:`lg`,variant:`light`,color:Te[e.method]??`gray`,children:e.method}),(0,H.jsx)(P,{fz:`sm`,children:e.fullPath}),e.secure&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`yellow`,children:`Secure`})]}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),e.middlewares?.length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Middleware`}),(0,H.jsx)(m,{direction:`column`,gap:`xs`,children:e.middlewares.map(e=>(0,H.jsx)(Oe,{mw:e},e.name))})]}),(0,H.jsxs)(Z,{defaultValue:`schema`,children:[(0,H.jsxs)(Z.List,{children:[(0,H.jsx)(Z.Tab,{value:`schema`,leftSection:(0,H.jsx)(_e,{size:14}),children:`Schema`}),(0,H.jsx)(Z.Tab,{value:`tryit`,leftSection:(0,H.jsx)(ge,{size:14}),children:`Try It`})]}),(0,H.jsx)(Z.Panel,{value:`schema`,pt:`md`,children:(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[e.body&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Request Body`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.body,defaultExpandedDepth:2,size:`xs`})})]}),e.params&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.params,defaultExpandedDepth:2,size:`xs`})})]}),e.query&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.query,defaultExpandedDepth:2,size:`xs`})})]}),e.response&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Response`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.response,defaultExpandedDepth:2,size:`xs`})})]}),!e.body&&!e.params&&!e.query&&!e.response&&(0,H.jsx)(o,{c:`dimmed`,fz:`sm`,children:`No schema defined for this action.`})]})}),(0,H.jsx)(Z.Panel,{value:`tryit`,pt:`md`,children:(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[y&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(A,{form:S,skipSubmitButton:!0,skipFormElement:!0,columns:1})]}),v&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(A,{form:x,skipSubmitButton:!0,skipFormElement:!0,columns:1})]}),e.method!==`GET`&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Request Body`}),_?(0,H.jsx)(A,{form:b,skipSubmitButton:!0,skipFormElement:!0,columns:1}):(0,H.jsx)(U,{value:n,onChange:s,formatOnBlur:!0,autosize:!0,minRows:4,maxRows:12,styles:{input:{fontFamily:`monospace`,fontSize:12}}})]}),(0,H.jsxs)(m,{children:[(0,H.jsx)(ee,{size:`xs`,loading:u,onClick:E,color:Te[e.method]??`blue`,icon:(0,H.jsx)(ge,{size:14}),children:`Send Request`}),p>0&&(0,H.jsxs)(o,{fz:`xs`,c:`dimmed`,children:[p,`ms`]})]}),c&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Response`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:c.error?(0,H.jsx)(o,{c:`red`,fz:`sm`,children:c.error}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{size:`xs`,mb:`xs`,color:c.status<400?`teal`:`red`,children:c.status}),(0,H.jsx)(D,{data:c.data,defaultExpandedDepth:3,size:`xs`})]})})]})]})})]})]})},Ae=e=>e?e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`:`No TTL`,je=({cache:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsx)(`div`,{children:(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name})}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`cyan`,children:`Cache`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider}),e.disabled&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`red`,children:`Disabled`})]}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsxs)(m,{direction:`column`,gap:`xs`,children:[(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`TTL`}),(0,H.jsx)(o,{fz:`sm`,ff:`monospace`,children:Ae(e.ttl)})]}),(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`Provider`}),(0,H.jsx)(o,{fz:`sm`,ff:`monospace`,children:e.provider??`default`})]}),(0,H.jsxs)(m,{justify:`space-between`,children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,children:`Status`}),(0,H.jsx)(f,{size:`xs`,color:e.disabled?`red`:`green`,children:e.disabled?`Disabled`:`Active`})]})]})})]}),Me=({page:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.label||e.name}),e.path&&(0,H.jsx)(P,{fz:`sm`,mb:`xs`,children:e.path}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[e.hasLazy&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`blue`,children:`Lazy`}),e.hasParent&&(0,H.jsxs)(f,{size:`xs`,variant:`light`,color:`gray`,children:[`Parent: `,e.parentName??`?`]}),e.hasChildren&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`teal`,children:`Children`}),e.hasErrorHandler&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`red`,children:`Error Handler`}),e.hasResolve&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`violet`,children:`Loader`}),e.client&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`orange`,children:`Client Only`}),e.static&&(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`cyan`,children:`Static`})]}),e.params&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Path Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.params,defaultExpandedDepth:2,size:`xs`})})]}),e.query&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Query Parameters`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.query,defaultExpandedDepth:2,size:`xs`})})]})]}),Ne=({queue:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`orange`,children:`Queue`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider})]}),e.schema&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Job Schema`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.schema,defaultExpandedDepth:2,size:`xs`})})]})]}),Pe=({topic:e})=>(0,H.jsxs)(m,{direction:`column`,gap:`md`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`lg`,fw:600,mb:`xs`,children:e.name}),e.description&&(0,H.jsx)(o,{fz:`sm`,c:`dimmed`,children:e.description})]}),(0,H.jsxs)(m,{gap:`xs`,children:[(0,H.jsx)(f,{size:`xs`,variant:`light`,color:`pink`,children:`Topic`}),e.provider&&(0,H.jsx)(f,{size:`xs`,variant:`outline`,color:`gray`,children:e.provider}),e.subscribers>0&&(0,H.jsxs)(f,{size:`xs`,variant:`light`,color:`gray`,children:[e.subscribers,` subscriber`,e.subscribers===1?``:`s`]})]}),e.schema&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(o,{fz:`xs`,c:`dimmed`,mb:`xs`,tt:`uppercase`,fw:600,children:`Message Schema`}),(0,H.jsx)(a,{padding:`sm`,style:{background:M.colors.surface,border:`1px solid ${M.colors.border}`},children:(0,H.jsx)(D,{data:e.schema,defaultExpandedDepth:2,size:`xs`})})]})]}),Fe=d.object({selected:d.optional(d.text()),open:d.optional(d.text())}),Ie=e=>{let t=[];if(e.actions?.length>0){let n={id:`actions`,label:`actions`,type:`folder`,children:[]},r=new Map;for(let t of e.actions){let e=t.group||`default`;r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let[e,t]of Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t))){let r=e.split(`:`),i=n;for(let e=0;e<r.length;e++){let t=`actions:${r.slice(0,e+1).join(`:`)}`,n=i.children?.find(e=>e.id===t);n||(n={id:t,label:r[e],type:`folder`,children:[]},i.children=i.children??[],i.children.push(n)),i=n}let a=t.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({id:`action:${e.method}:${e.fullPath}`,label:e.name,type:`action`,data:e}));i.children=i.children??[],i.children.push(...a)}t.push(n)}if(e.pages?.length>0){let n=new Map,r=[];for(let t of e.pages)n.set(t.name,{id:`page:${t.name}`,label:t.name,type:`page`,data:t,children:[]});let i=new Set;for(let t of e.pages)if(t.parentName&&n.has(t.parentName)){let e=n.get(t.parentName);e.children=e.children??[],i.has(t.name)||(e.children.push(n.get(t.name)),i.add(t.name))}for(let t of e.pages)if(t.childrenNames){let e=n.get(t.name);for(let r of t.childrenNames)n.has(r)&&!i.has(r)&&(e.children=e.children??[],e.children.push(n.get(r)),i.add(r))}for(let t of e.pages)i.has(t.name)||r.push(n.get(t.name));let a=e=>{for(let t of e)t.children?.length===0?t.children=void 0:t.children&&a(t.children)};a(r),t.push({id:`pages`,label:`pages`,type:`folder`,children:r})}return e.queues?.length>0&&t.push({id:`queues`,label:`queues`,type:`folder`,children:e.queues.map(e=>({id:`queue:${e.name}`,label:e.name,type:`queue`,data:e}))}),e.topics?.length>0&&t.push({id:`topics`,label:`topics`,type:`folder`,children:e.topics.map(e=>({id:`topic:${e.name}`,label:e.name,type:`topic`,data:e}))}),e.caches?.length>0&&t.push({id:`caches`,label:`caches`,type:`folder`,children:e.caches.map(e=>({id:`cache:${e.name}`,label:e.name,type:`cache`,data:e}))}),t},Le=()=>{let e=w(r),[t,n]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[s,c]=v(Fe,{format:`querystring`}),[u,d]=(0,V.useState)(new Set(s.open?s.open.split(`,`):[`routes`,`actions`]));(0,V.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:le}}).then(e=>n(e.data)).catch(()=>{})},[e]);let f=(0,V.useMemo)(()=>t?Ie(t):[],[t]),p=s.selected??``,h=(0,V.useMemo)(()=>{if(!p||!t)return null;let[e,...n]=p.split(`:`),r=n.join(`:`);switch(e){case`action`:{let e=r.indexOf(`:`),n=e>=0?r.slice(0,e):``,i=e>=0?r.slice(e+1):r;return{type:`action`,data:t.actions?.find(e=>e.method===n&&e.fullPath===i)}}case`page`:return{type:`page`,data:t.pages?.find(e=>e.name===r)};case`queue`:return{type:`queue`,data:t.queues?.find(e=>e.name===r)};case`topic`:return{type:`topic`,data:t.topics?.find(e=>e.name===r)};case`cache`:return{type:`cache`,data:t.caches?.find(e=>e.name===r)};default:return null}},[p,t]),g=(0,V.useCallback)(e=>{c({selected:e,open:Array.from(u).join(`,`)})},[c,u]),_=(0,V.useCallback)(e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c({selected:s.selected,open:Array.from(n).join(`,`)}),n})},[c,s.selected]);return(0,H.jsxs)(m,{style:{flex:1,overflow:`hidden`},children:[(0,H.jsxs)(m,{w:280,style:{borderRight:`1px solid ${M.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,H.jsx)(m,{p:`xs`,children:(0,H.jsx)(l,{placeholder:`Search...`,size:`xs`,leftSection:(0,H.jsx)(re,{size:14}),value:i,onChange:e=>a(e.currentTarget.value)})}),(0,H.jsx)(O,{style:{flex:1},px:`xs`,pb:`xs`,children:(0,H.jsx)(we,{nodes:f,selectedId:p,openNodes:u,search:i,onSelect:g,onToggle:_})})]}),(0,H.jsxs)(m,{style:{flex:1,overflow:`auto`},p:`lg`,children:[!h&&(0,H.jsx)(m,{align:`center`,justify:`center`,h:`100%`,children:(0,H.jsx)(o,{c:`dimmed`,fz:`sm`,children:`Select a resource from the tree`})}),h?.type===`action`&&h.data&&(0,H.jsx)(ke,{action:h.data}),h?.type===`page`&&h.data&&(0,H.jsx)(Me,{page:h.data}),h?.type===`queue`&&h.data&&(0,H.jsx)(Ne,{queue:h.data}),h?.type===`topic`&&h.data&&(0,H.jsx)(Pe,{topic:h.data}),h?.type===`cache`&&h.data&&(0,H.jsx)(je,{cache:h.data})]})]})};export{Le as DevExplorer,Le as default};
Binary file
@@ -1 +1 @@
1
- import{A as e,At as t,Dt as n,J as r,Lt as i,M as a,N as o,R as s,U as c,a as l,jt as u,kt as d,l as f,n as p,nt as m,u as h,v as g,z as _}from"./chunk.p3hCiSrt.js";import{n as v,t as y}from"./chunk.Bc7_n90V.js";import{t as b}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";import{t as x}from"./chunk.yh4jaMrg.js";var S=e(`outline`,`device-floppy`,`DeviceFloppy`,[[`path`,{d:`M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M14 4l0 4l-6 0l0 -4`,key:`svg-2`}]]),C=i(u(),1),w=t(),T=e=>{let t={key:``,label:``,children:[]};for(let n of e){let e=n.name.split(`.`),r=t;for(let t=0;t<e.length;t++){let i=e.slice(0,t+1).join(`.`),a=r.children.find(e=>e.key===i);a||(a={key:i,label:e[t],children:[]},r.children.push(a)),t===e.length-1&&(a.atom=n),r=a}}return t.children.map(E)},E=e=>{for(;!e.atom&&e.children.length===1;){let t=e.children[0];e={...t,label:`${e.label}.${t.label}`}}return{...e,children:e.children.map(E)}},D=e=>{let t=!!e.atom&&e.children.length===0;return{id:e.atom?`atom:${e.atom.name}`:`folder:${e.key}`,label:e.label,icon:t?(0,w.jsx)(v,{size:13,color:`var(--mantine-color-violet-text)`,style:{flexShrink:0}}):void 0,badge:t&&e.atom?.currentValue!==void 0?(0,w.jsx)(c,{size:`xs`,variant:`light`,color:`green`,children:`set`}):void 0,children:e.children.length>0?e.children.map(D):void 0}},O=({schema:e,value:t,onChange:n})=>{if(!e)return null;let i=e;if(e.anyOf){let t=e.anyOf.find(e=>e.type!==`null`);t&&(i=t)}let c=i.type;return c===`object`&&i.properties?(0,w.jsx)(l,{direction:`column`,gap:`sm`,children:Object.entries(i.properties).map(([e,i])=>(0,w.jsxs)(l,{children:[(0,w.jsxs)(r,{fz:`xs`,fw:500,mb:4,children:[i.title||e,i.description&&(0,w.jsx)(r,{span:!0,fz:10,c:`dimmed`,ml:`xs`,children:i.description})]}),(0,w.jsx)(O,{schema:i,value:t?.[e],onChange:r=>n({...t,[e]:r})})]},e))}):c===`boolean`?(0,w.jsx)(o,{checked:t??!1,onChange:e=>n(e.currentTarget.checked),size:`sm`}):c===`number`||c===`integer`?(0,w.jsx)(s,{size:`xs`,value:t??``,onChange:e=>n(e===``?void 0:e),allowDecimal:c===`number`}):i.enum?(0,w.jsxs)(`select`,{value:t??``,onChange:e=>n(e.target.value||void 0),style:{padding:`4px 8px`,borderRadius:4,border:`1px solid ${h.colors.border}`,backgroundColor:h.colors.surface,color:`inherit`,fontSize:12,width:`100%`},children:[(0,w.jsx)(`option`,{value:``,children:`Select...`}),i.enum.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]}):(0,w.jsx)(a,{size:`xs`,value:t??``,onChange:e=>n(e.target.value||void 0)})},k=({atom:e,onSave:t})=>{let[n,i]=(0,C.useState)(e.currentValue??e.defaultValue),[a,s]=(0,C.useState)(!1),[u,d]=(0,C.useState)(``),[g,b]=(0,C.useState)(null);(0,C.useEffect)(()=>{let t=e.currentValue??e.defaultValue;i(t),d(JSON.stringify(t,null,2)),b(null)},[e]);let x=e=>{d(e);try{i(JSON.parse(e)),b(null)}catch{b(`Invalid JSON`)}},T=e.currentValue!==void 0,E=e.schema?.type,D=!E||E===`array`;return(0,w.jsxs)(l,{direction:`column`,h:`100%`,children:[(0,w.jsxs)(l,{px:`md`,py:`sm`,style:{borderBottom:`1px solid ${h.colors.border}`,flexShrink:0},children:[(0,w.jsxs)(l,{align:`center`,gap:`sm`,children:[(0,w.jsx)(v,{size:16,opacity:.5}),(0,w.jsx)(r,{fz:`sm`,fw:600,ff:`monospace`,children:e.name}),(0,w.jsx)(c,{size:`xs`,variant:`light`,color:T?`green`:`gray`,children:T?`has value`:`default`})]}),e.description&&(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,mt:4,children:e.description})]}),(0,w.jsx)(m,{style:{flex:1},p:`md`,children:(0,w.jsxs)(l,{direction:`column`,gap:`lg`,children:[(0,w.jsxs)(l,{gap:`lg`,wrap:`wrap`,children:[(0,w.jsxs)(l,{style:{flex:1,minWidth:200},children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Current Value`}),e.currentValue===void 0?(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,fs:`italic`,children:`(using default)`}):(0,w.jsx)(p,{data:e.currentValue,maxDepth:3})]}),(0,w.jsxs)(l,{style:{flex:1,minWidth:200},children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Default Value`}),e.defaultValue===void 0?(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,fs:`italic`,children:`(no default)`}):(0,w.jsx)(p,{data:e.defaultValue,maxDepth:3})]})]}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(l,{align:`center`,justify:`space-between`,mb:`sm`,children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,children:`Edit Value`}),(0,w.jsxs)(l,{gap:`xs`,align:`center`,children:[(0,w.jsx)(o,{size:`xs`,label:`JSON`,checked:a||D,onChange:e=>s(e.currentTarget.checked),disabled:D}),(0,w.jsx)(f,{size:`sm`,variant:`light`,tooltip:`Reset to default`,onClick:()=>{let t=e.defaultValue;i(t),d(JSON.stringify(t,null,2)),b(null)},icon:(0,w.jsx)(y,{size:14})}),(0,w.jsx)(f,{size:`xs`,icon:(0,w.jsx)(S,{size:14}),onClick:()=>t(n),disabled:a&&!!g,children:`Save`})]})]}),a||D?(0,w.jsx)(_,{value:u,onChange:e=>x(e.target.value),autosize:!0,minRows:6,maxRows:20,error:g??void 0,styles:{input:{fontFamily:`monospace`,fontSize:12}}}):(0,w.jsx)(l,{p:`sm`,style:{border:`1px solid ${h.colors.border}`,borderRadius:8,background:h.colors.surface},children:(0,w.jsx)(O,{schema:e.schema,value:n,onChange:i})})]}),(0,w.jsxs)(l,{children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Schema`}),(0,w.jsx)(p,{data:e.schema,maxDepth:2})]})]})})]})},A=()=>{let e=d(n),[t,i]=(0,C.useState)([]),[o,s]=(0,C.useState)(``),[c,u]=(0,C.useState)(``),[f,p]=(0,C.useState)(new Set),_=(0,C.useCallback)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:b}}).then(e=>{i(e.data.atoms);let t=new Set;for(let n of e.data.atoms){let e=n.name.split(`.`)[0];t.add(`folder:${e}`)}p(e=>e.size>0?e:t)}).catch(()=>{})},[e]);(0,C.useEffect)(()=>{_()},[_]);let y=(0,C.useMemo)(()=>{if(!o)return t;let e=o.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,o]),S=(0,C.useMemo)(()=>T(y),[y]),E=(0,C.useMemo)(()=>S.map(D),[S]),O=(0,C.useMemo)(()=>t.find(e=>e.name===c),[t,c]),A=(0,C.useCallback)(async t=>{if(O)try{await e.fetch(`/__devtools/api/atoms`,{method:`POST`,body:JSON.stringify({name:O.name,value:t})}),_()}catch(e){console.error(`Failed to save atom:`,e)}},[e,O,_]),j=(0,C.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,C.useCallback)(e=>{u(e.replace(/^atom:/,``))},[]);if(t.length===0)return(0,w.jsx)(l,{align:`center`,justify:`center`,style:{flex:1},c:`dimmed`,children:(0,w.jsxs)(l,{direction:`column`,align:`center`,gap:`xs`,children:[(0,w.jsx)(v,{size:40,opacity:.3}),(0,w.jsx)(r,{fz:`sm`,children:`No atoms found`}),(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,children:`Use $atom primitive to define state atoms`})]})});let N=c?`atom:${c}`:``;return(0,w.jsxs)(l,{style:{flex:1,overflow:`hidden`},children:[(0,w.jsxs)(l,{w:260,style:{borderRight:`1px solid ${h.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,w.jsx)(l,{p:`xs`,style:{flexShrink:0},children:(0,w.jsx)(a,{placeholder:`Search atoms...`,leftSection:(0,w.jsx)(g,{size:14}),size:`xs`,value:o,onChange:e=>s(e.currentTarget.value)})}),(0,w.jsx)(m,{style:{flex:1},px:`xs`,pb:`xs`,children:(0,w.jsx)(x,{nodes:E,selectedId:N,openNodes:f,onSelect:M,onToggle:j})})]}),(0,w.jsx)(l,{style:{flex:1,overflow:`hidden`},children:O?(0,w.jsx)(k,{atom:O,onSave:A}):(0,w.jsx)(l,{align:`center`,justify:`center`,h:`100%`,children:(0,w.jsx)(r,{c:`dimmed`,fz:`sm`,children:`Select an atom to view its details`})})})]})},j=()=>(0,w.jsx)(A,{});export{j as default};
1
+ import{A as e,At as t,Dt as n,J as r,Lt as i,M as a,N as o,R as s,U as c,a as l,jt as u,kt as d,l as f,n as p,nt as m,u as h,v as g,z as _}from"./chunk.CdOrvGjm.js";import{n as v,t as y}from"./chunk.W_TFMb5-.js";import{t as b}from"./chunk.DGcirGNX.js";import"./chunk.Bu6ZqSw8.js";import{t as x}from"./chunk.B25mt84g.js";var S=e(`outline`,`device-floppy`,`DeviceFloppy`,[[`path`,{d:`M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2`,key:`svg-0`}],[`path`,{d:`M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M14 4l0 4l-6 0l0 -4`,key:`svg-2`}]]),C=i(u(),1),w=t(),T=e=>{let t={key:``,label:``,children:[]};for(let n of e){let e=n.name.split(`.`),r=t;for(let t=0;t<e.length;t++){let i=e.slice(0,t+1).join(`.`),a=r.children.find(e=>e.key===i);a||(a={key:i,label:e[t],children:[]},r.children.push(a)),t===e.length-1&&(a.atom=n),r=a}}return t.children.map(E)},E=e=>{for(;!e.atom&&e.children.length===1;){let t=e.children[0];e={...t,label:`${e.label}.${t.label}`}}return{...e,children:e.children.map(E)}},D=e=>{let t=!!e.atom&&e.children.length===0;return{id:e.atom?`atom:${e.atom.name}`:`folder:${e.key}`,label:e.label,icon:t?(0,w.jsx)(v,{size:13,color:`var(--mantine-color-violet-text)`,style:{flexShrink:0}}):void 0,badge:t&&e.atom?.currentValue!==void 0?(0,w.jsx)(c,{size:`xs`,variant:`light`,color:`green`,children:`set`}):void 0,children:e.children.length>0?e.children.map(D):void 0}},O=({schema:e,value:t,onChange:n})=>{if(!e)return null;let i=e;if(e.anyOf){let t=e.anyOf.find(e=>e.type!==`null`);t&&(i=t)}let c=i.type;return c===`object`&&i.properties?(0,w.jsx)(l,{direction:`column`,gap:`sm`,children:Object.entries(i.properties).map(([e,i])=>(0,w.jsxs)(l,{children:[(0,w.jsxs)(r,{fz:`xs`,fw:500,mb:4,children:[i.title||e,i.description&&(0,w.jsx)(r,{span:!0,fz:10,c:`dimmed`,ml:`xs`,children:i.description})]}),(0,w.jsx)(O,{schema:i,value:t?.[e],onChange:r=>n({...t,[e]:r})})]},e))}):c===`boolean`?(0,w.jsx)(o,{checked:t??!1,onChange:e=>n(e.currentTarget.checked),size:`sm`}):c===`number`||c===`integer`?(0,w.jsx)(s,{size:`xs`,value:t??``,onChange:e=>n(e===``?void 0:e),allowDecimal:c===`number`}):i.enum?(0,w.jsxs)(`select`,{value:t??``,onChange:e=>n(e.target.value||void 0),style:{padding:`4px 8px`,borderRadius:4,border:`1px solid ${h.colors.border}`,backgroundColor:h.colors.surface,color:`inherit`,fontSize:12,width:`100%`},children:[(0,w.jsx)(`option`,{value:``,children:`Select...`}),i.enum.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]}):(0,w.jsx)(a,{size:`xs`,value:t??``,onChange:e=>n(e.target.value||void 0)})},k=({atom:e,onSave:t})=>{let[n,i]=(0,C.useState)(e.currentValue??e.defaultValue),[a,s]=(0,C.useState)(!1),[u,d]=(0,C.useState)(``),[g,b]=(0,C.useState)(null);(0,C.useEffect)(()=>{let t=e.currentValue??e.defaultValue;i(t),d(JSON.stringify(t,null,2)),b(null)},[e]);let x=e=>{d(e);try{i(JSON.parse(e)),b(null)}catch{b(`Invalid JSON`)}},T=e.currentValue!==void 0,E=e.schema?.type,D=!E||E===`array`;return(0,w.jsxs)(l,{direction:`column`,h:`100%`,children:[(0,w.jsxs)(l,{px:`md`,py:`sm`,style:{borderBottom:`1px solid ${h.colors.border}`,flexShrink:0},children:[(0,w.jsxs)(l,{align:`center`,gap:`sm`,children:[(0,w.jsx)(v,{size:16,opacity:.5}),(0,w.jsx)(r,{fz:`sm`,fw:600,ff:`monospace`,children:e.name}),(0,w.jsx)(c,{size:`xs`,variant:`light`,color:T?`green`:`gray`,children:T?`has value`:`default`})]}),e.description&&(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,mt:4,children:e.description})]}),(0,w.jsx)(m,{style:{flex:1},p:`md`,children:(0,w.jsxs)(l,{direction:`column`,gap:`lg`,children:[(0,w.jsxs)(l,{gap:`lg`,wrap:`wrap`,children:[(0,w.jsxs)(l,{style:{flex:1,minWidth:200},children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Current Value`}),e.currentValue===void 0?(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,fs:`italic`,children:`(using default)`}):(0,w.jsx)(p,{data:e.currentValue,maxDepth:3})]}),(0,w.jsxs)(l,{style:{flex:1,minWidth:200},children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Default Value`}),e.defaultValue===void 0?(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,fs:`italic`,children:`(no default)`}):(0,w.jsx)(p,{data:e.defaultValue,maxDepth:3})]})]}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(l,{align:`center`,justify:`space-between`,mb:`sm`,children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,children:`Edit Value`}),(0,w.jsxs)(l,{gap:`xs`,align:`center`,children:[(0,w.jsx)(o,{size:`xs`,label:`JSON`,checked:a||D,onChange:e=>s(e.currentTarget.checked),disabled:D}),(0,w.jsx)(f,{size:`sm`,variant:`light`,tooltip:`Reset to default`,onClick:()=>{let t=e.defaultValue;i(t),d(JSON.stringify(t,null,2)),b(null)},icon:(0,w.jsx)(y,{size:14})}),(0,w.jsx)(f,{size:`xs`,icon:(0,w.jsx)(S,{size:14}),onClick:()=>t(n),disabled:a&&!!g,children:`Save`})]})]}),a||D?(0,w.jsx)(_,{value:u,onChange:e=>x(e.target.value),autosize:!0,minRows:6,maxRows:20,error:g??void 0,styles:{input:{fontFamily:`monospace`,fontSize:12}}}):(0,w.jsx)(l,{p:`sm`,style:{border:`1px solid ${h.colors.border}`,borderRadius:8,background:h.colors.surface},children:(0,w.jsx)(O,{schema:e.schema,value:n,onChange:i})})]}),(0,w.jsxs)(l,{children:[(0,w.jsx)(r,{fz:10,c:`dimmed`,tt:`uppercase`,fw:600,lts:.5,mb:`xs`,children:`Schema`}),(0,w.jsx)(p,{data:e.schema,maxDepth:2})]})]})})]})},A=()=>{let e=d(n),[t,i]=(0,C.useState)([]),[o,s]=(0,C.useState)(``),[c,u]=(0,C.useState)(``),[f,p]=(0,C.useState)(new Set),_=(0,C.useCallback)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:b}}).then(e=>{i(e.data.atoms);let t=new Set;for(let n of e.data.atoms){let e=n.name.split(`.`)[0];t.add(`folder:${e}`)}p(e=>e.size>0?e:t)}).catch(()=>{})},[e]);(0,C.useEffect)(()=>{_()},[_]);let y=(0,C.useMemo)(()=>{if(!o)return t;let e=o.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,o]),S=(0,C.useMemo)(()=>T(y),[y]),E=(0,C.useMemo)(()=>S.map(D),[S]),O=(0,C.useMemo)(()=>t.find(e=>e.name===c),[t,c]),A=(0,C.useCallback)(async t=>{if(O)try{await e.fetch(`/__devtools/api/atoms`,{method:`POST`,body:JSON.stringify({name:O.name,value:t})}),_()}catch(e){console.error(`Failed to save atom:`,e)}},[e,O,_]),j=(0,C.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,C.useCallback)(e=>{u(e.replace(/^atom:/,``))},[]);if(t.length===0)return(0,w.jsx)(l,{align:`center`,justify:`center`,style:{flex:1},c:`dimmed`,children:(0,w.jsxs)(l,{direction:`column`,align:`center`,gap:`xs`,children:[(0,w.jsx)(v,{size:40,opacity:.3}),(0,w.jsx)(r,{fz:`sm`,children:`No atoms found`}),(0,w.jsx)(r,{fz:`xs`,c:`dimmed`,children:`Use $atom primitive to define state atoms`})]})});let N=c?`atom:${c}`:``;return(0,w.jsxs)(l,{style:{flex:1,overflow:`hidden`},children:[(0,w.jsxs)(l,{w:260,style:{borderRight:`1px solid ${h.colors.border}`,flexShrink:0,display:`flex`,flexDirection:`column`},children:[(0,w.jsx)(l,{p:`xs`,style:{flexShrink:0},children:(0,w.jsx)(a,{placeholder:`Search atoms...`,leftSection:(0,w.jsx)(g,{size:14}),size:`xs`,value:o,onChange:e=>s(e.currentTarget.value)})}),(0,w.jsx)(m,{style:{flex:1},px:`xs`,pb:`xs`,children:(0,w.jsx)(x,{nodes:E,selectedId:N,openNodes:f,onSelect:M,onToggle:j})})]}),(0,w.jsx)(l,{style:{flex:1,overflow:`hidden`},children:O?(0,w.jsx)(k,{atom:O,onSave:A}):(0,w.jsx)(l,{align:`center`,justify:`center`,h:`100%`,children:(0,w.jsx)(r,{c:`dimmed`,fz:`sm`,children:`Select an atom to view its details`})})})]})},j=()=>(0,w.jsx)(A,{});export{j as default};
Binary file
@@ -1,2 +1,2 @@
1
- import{At as e,Dt as t,J as n,L as r,Lt as i,M as a,O as o,U as s,a as c,jt as l,kt as u,lt as d,nt as f,u as p,v as m,w as h}from"./chunk.p3hCiSrt.js";import{t as g}from"./chunk.D93ZmnLR.js";import{t as _}from"./chunk.De1vj4hM.js";import{t as v}from"./chunk.DOwjsMaD.js";import"./chunk.TIounDiA.js";var y=i(l(),1);function b(e={timeout:2e3}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),s=t=>{window.clearTimeout(a),o(window.setTimeout(()=>i(!1),e.timeout)),i(t)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>s(!0)).catch(e=>n(e)):n(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{i(!1),n(null),window.clearTimeout(a)},error:t,copied:r}}var x=e(),S={timeout:1e3};function C(e){let{children:t,timeout:n,value:r,...i}=d(`CopyButton`,S,e),a=b({timeout:n});return(0,x.jsx)(x.Fragment,{children:t({copy:()=>a.copy(r),copied:a.copied,...i})})}C.displayName=`@mantine/core/CopyButton`;var w=[`secret`,`password`,`key`,`token`,`api_key`],T=e=>{let t=e.toLowerCase();return w.some(e=>t.includes(e))},E=e=>{let t=new Map;for(let n of e){let e=n.schema;if(e?.properties)for(let[r,i]of Object.entries(e.properties)){if(t.has(r))continue;let e=i,a=n.values[r],o=e.type??`unknown`,s=e.format;if(e.anyOf){let t=e.anyOf.find(e=>e.type!==`null`);t&&(o=t.type??`unknown`,s=t.format)}t.set(r,{name:r,value:a,type:o,description:e.description,format:s})}}return Array.from(t.values()).sort((e,t)=>e.name.localeCompare(t.name))},D=({variable:e})=>{let t=e.value!==void 0&&e.value!==``,i=t?String(e.value):``,a=T(e.name);return(0,x.jsxs)(c,{direction:`column`,children:[e.description?.split(`
1
+ import{At as e,Dt as t,J as n,L as r,Lt as i,M as a,O as o,U as s,a as c,jt as l,kt as u,lt as d,nt as f,u as p,v as m,w as h}from"./chunk.CdOrvGjm.js";import{t as g}from"./chunk.dxweq5IS.js";import{t as _}from"./chunk.BennGilR.js";import{t as v}from"./chunk.DGcirGNX.js";import"./chunk.Bu6ZqSw8.js";var y=i(l(),1);function b(e={timeout:2e3}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),s=t=>{window.clearTimeout(a),o(window.setTimeout(()=>i(!1),e.timeout)),i(t)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>s(!0)).catch(e=>n(e)):n(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{i(!1),n(null),window.clearTimeout(a)},error:t,copied:r}}var x=e(),S={timeout:1e3};function C(e){let{children:t,timeout:n,value:r,...i}=d(`CopyButton`,S,e),a=b({timeout:n});return(0,x.jsx)(x.Fragment,{children:t({copy:()=>a.copy(r),copied:a.copied,...i})})}C.displayName=`@mantine/core/CopyButton`;var w=[`secret`,`password`,`key`,`token`,`api_key`],T=e=>{let t=e.toLowerCase();return w.some(e=>t.includes(e))},E=e=>{let t=new Map;for(let n of e){let e=n.schema;if(e?.properties)for(let[r,i]of Object.entries(e.properties)){if(t.has(r))continue;let e=i,a=n.values[r],o=e.type??`unknown`,s=e.format;if(e.anyOf){let t=e.anyOf.find(e=>e.type!==`null`);t&&(o=t.type??`unknown`,s=t.format)}t.set(r,{name:r,value:a,type:o,description:e.description,format:s})}}return Array.from(t.values()).sort((e,t)=>e.name.localeCompare(t.name))},D=({variable:e})=>{let t=e.value!==void 0&&e.value!==``,i=t?String(e.value):``,a=T(e.name);return(0,x.jsxs)(c,{direction:`column`,children:[e.description?.split(`
2
2
  `).map((e,t)=>(0,x.jsxs)(n,{fz:11,ff:`monospace`,c:`dimmed`,fs:`italic`,lh:1.6,children:[`# `,e]},t)),(0,x.jsxs)(c,{align:`center`,gap:0,style:{lineHeight:1.6},children:[(0,x.jsx)(n,{fz:12,ff:`monospace`,fw:600,c:`teal.5`,component:`span`,children:e.name}),(0,x.jsx)(n,{fz:12,ff:`monospace`,c:`dimmed`,component:`span`,children:`=`}),t?(0,x.jsx)(n,{fz:12,ff:`monospace`,component:`span`,style:{filter:a?`blur(4px)`:void 0,transition:`filter 150ms`,cursor:a?`pointer`:void 0},onMouseEnter:e=>{a&&(e.currentTarget.style.filter=`none`)},onMouseLeave:e=>{a&&(e.currentTarget.style.filter=`blur(4px)`)},children:i}):(0,x.jsx)(n,{fz:12,ff:`monospace`,c:`dimmed`,fs:`italic`,component:`span`,children:`(not set)`}),(0,x.jsx)(s,{size:`xs`,variant:`dot`,color:`gray`,ml:`sm`,style:{flexShrink:0},children:e.format||e.type}),t&&(0,x.jsx)(C,{value:String(e.value),children:({copied:e,copy:t})=>(0,x.jsx)(r,{label:e?`Copied!`:`Copy`,withArrow:!0,children:(0,x.jsx)(c,{ml:6,onClick:t,style:{cursor:`pointer`,flexShrink:0},c:e?`teal`:`dimmed`,children:e?(0,x.jsx)(o,{size:12}):(0,x.jsx)(h,{size:12})})})})]})]})},O=()=>{let e=u(t),[r,i]=(0,y.useState)([]),[o,l]=(0,y.useState)(``);(0,y.useEffect)(()=>{e.fetch(`/__devtools/api/metadata`,{schema:{response:v}}).then(e=>i(e.data.envs)).catch(()=>{})},[e]);let d=(0,y.useMemo)(()=>E(r),[r]),h=(0,y.useMemo)(()=>{if(!o)return d;let e=o.toLowerCase();return d.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[d,o]);return d.length===0?(0,x.jsx)(c,{align:`center`,justify:`center`,style:{flex:1},c:`dimmed`,children:(0,x.jsxs)(c,{direction:`column`,align:`center`,gap:`xs`,children:[(0,x.jsx)(_,{size:40,opacity:.3}),(0,x.jsx)(n,{fz:`sm`,children:`No environment variables found`}),(0,x.jsx)(n,{fz:`xs`,c:`dimmed`,children:`Use $env primitive to define expected environment variables`})]})}):(0,x.jsxs)(c,{direction:`column`,style:{flex:1},children:[(0,x.jsx)(c,{p:`sm`,style:{borderBottom:`1px solid ${p.colors.border}`,flexShrink:0},children:(0,x.jsxs)(c,{gap:`sm`,align:`center`,children:[(0,x.jsx)(a,{placeholder:`Search variables...`,leftSection:(0,x.jsx)(m,{size:14}),size:`xs`,value:o,onChange:e=>l(e.currentTarget.value),style:{flex:1,maxWidth:340}}),(0,x.jsxs)(s,{variant:`light`,color:`gray`,size:`sm`,children:[h.length,` / `,d.length]})]})}),(0,x.jsx)(f,{style:{flex:1},p:`md`,children:(0,x.jsx)(g,{block:!0,style:{background:p.colors.surface,border:`1px solid ${p.colors.border}`,borderRadius:8,padding:16},children:(0,x.jsx)(c,{direction:`column`,gap:8,children:h.map(e=>(0,x.jsx)(D,{variable:e},e.name))})})})]})},k=()=>(0,x.jsx)(O,{});export{k as default};
Binary file