nestlens 0.14.2 → 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 (73) hide show
  1. package/dist/api/api.controller.js +1 -1
  2. package/dist/api/dto/clear-entries.dto.js +3 -3
  3. package/dist/api/dto/cursor-query.dto.d.ts +4 -0
  4. package/dist/api/dto/cursor-query.dto.js +59 -58
  5. package/dist/api/dto/entries-query.dto.d.ts +1 -16
  6. package/dist/api/dto/entries-query.dto.js +28 -26
  7. package/dist/api/dto/tags.dto.js +4 -4
  8. package/dist/api/dto/transformers/query-transformers.d.ts +8 -2
  9. package/dist/api/dto/transformers/query-transformers.js +42 -16
  10. package/dist/api/dto/transformers/query-validators.d.ts +69 -0
  11. package/dist/api/dto/transformers/query-validators.js +172 -1
  12. package/dist/api/pipes/nestlens-validation.pipe.js +11 -1
  13. package/dist/dashboard/public/assets/{BatchDetailView-DQf7rhdt.js → BatchDetailView-BdQe3DAT.js} +1 -1
  14. package/dist/dashboard/public/assets/{BatchesPage-W8k8XEu3.js → BatchesPage-B9wO2Ncf.js} +1 -1
  15. package/dist/dashboard/public/assets/{CacheDetailView-D1W5C-eK.js → CacheDetailView-CMAxDfBy.js} +1 -1
  16. package/dist/dashboard/public/assets/{CachePage-CwEDXyxJ.js → CachePage-DJ8SiKoa.js} +1 -1
  17. package/dist/dashboard/public/assets/{CommandDetailView-DKQLM96e.js → CommandDetailView-Dj3SmHuj.js} +1 -1
  18. package/dist/dashboard/public/assets/{CommandsPage-B4XMyz_K.js → CommandsPage-C5EJj66E.js} +1 -1
  19. package/dist/dashboard/public/assets/{CopyButton-DfPqcshv.js → CopyButton-8NQFvMIW.js} +1 -1
  20. package/dist/dashboard/public/assets/{DashboardPage-Ce497zS8.js → DashboardPage-C2qvsAiz.js} +1 -1
  21. package/dist/dashboard/public/assets/{DataTable-Cz2phOFe.js → DataTable-ChUNEmWG.js} +1 -1
  22. package/dist/dashboard/public/assets/{DetailRow-DKG3Vf9j.js → DetailRow-BX0zpKTe.js} +1 -1
  23. package/dist/dashboard/public/assets/{DumpDetailView-BU9RRxWv.js → DumpDetailView-DtxmGLVH.js} +1 -1
  24. package/dist/dashboard/public/assets/{DumpsPage-ldSDznQa.js → DumpsPage-CMl3tRmM.js} +1 -1
  25. package/dist/dashboard/public/assets/{EntryDetailPage-BdBZLbAf.js → EntryDetailPage-NLzBL3a7.js} +3 -3
  26. package/dist/dashboard/public/assets/{EntrySearchInput-BF9N_f7y.js → EntrySearchInput-Cl30X6WS.js} +1 -1
  27. package/dist/dashboard/public/assets/{EventDetailView-CmV2uByp.js → EventDetailView-mqZ3406I.js} +1 -1
  28. package/dist/dashboard/public/assets/{EventsPage-TlQQA-mn.js → EventsPage-CRJQVA8A.js} +1 -1
  29. package/dist/dashboard/public/assets/{ExceptionDetailView-B5aRNZz5.js → ExceptionDetailView-CgGWCY9S.js} +1 -1
  30. package/dist/dashboard/public/assets/{ExceptionsPage-DqiQXiJK.js → ExceptionsPage-XejTTGZo.js} +1 -1
  31. package/dist/dashboard/public/assets/{GateDetailView-BPd0sJpT.js → GateDetailView-RDlBU8AZ.js} +1 -1
  32. package/dist/dashboard/public/assets/{GatesPage-D4s1Ogo-.js → GatesPage-CugJC28p.js} +1 -1
  33. package/dist/dashboard/public/assets/{GraphQLDetailView-Dd_pgjdZ.js → GraphQLDetailView-BFAJoQfl.js} +1 -1
  34. package/dist/dashboard/public/assets/{GraphQLPage-AOD9WXa5.js → GraphQLPage-BIhJneVf.js} +1 -1
  35. package/dist/dashboard/public/assets/{HttpClientDetailView-CR7RujPI.js → HttpClientDetailView-BQDbioP0.js} +1 -1
  36. package/dist/dashboard/public/assets/{HttpClientPage-CUNDLZdF.js → HttpClientPage-Ul44nXQ1.js} +1 -1
  37. package/dist/dashboard/public/assets/{JobDetailView-C3U9nJFo.js → JobDetailView-BOHzBDsg.js} +1 -1
  38. package/dist/dashboard/public/assets/{JobsPage-DX0A5Til.js → JobsPage-DUu59mJu.js} +1 -1
  39. package/dist/dashboard/public/assets/{LogDetailView-V_x94h-I.js → LogDetailView-DU_wZ8pq.js} +1 -1
  40. package/dist/dashboard/public/assets/{LogsPage-Cvrcv7tq.js → LogsPage-C98bcWXx.js} +1 -1
  41. package/dist/dashboard/public/assets/MailDetailView-B6KE8HV0.js +9 -0
  42. package/dist/dashboard/public/assets/{MailPage-BZbVLHHN.js → MailPage-Ca_c3Mbx.js} +1 -1
  43. package/dist/dashboard/public/assets/{ModelDetailView-CUEA5nRD.js → ModelDetailView-DSW4FtAE.js} +1 -1
  44. package/dist/dashboard/public/assets/{ModelsPage-CKUeCZLn.js → ModelsPage-Db-cZ_tz.js} +1 -1
  45. package/dist/dashboard/public/assets/{NotificationDetailView-CT4EIDa3.js → NotificationDetailView-B4LoEIas.js} +1 -1
  46. package/dist/dashboard/public/assets/{NotificationsPage-CVnjoHST.js → NotificationsPage-B4GN3KiM.js} +1 -1
  47. package/dist/dashboard/public/assets/{PageHeader-DR_M5h7z.js → PageHeader-CwpXbfba.js} +1 -1
  48. package/dist/dashboard/public/assets/{QueriesPage-DR3EHxfO.js → QueriesPage-CQfaBmXe.js} +1 -1
  49. package/dist/dashboard/public/assets/{QueryDetailView-dWmmR_nP.js → QueryDetailView-B4wcgIki.js} +1 -1
  50. package/dist/dashboard/public/assets/{RedisDetailView-PALK5x6N.js → RedisDetailView-DtJd51k9.js} +1 -1
  51. package/dist/dashboard/public/assets/{RedisPage-D-9y0o0o.js → RedisPage-DYRX-6Tf.js} +1 -1
  52. package/dist/dashboard/public/assets/{RequestDetailView-DiS1WZ4m.js → RequestDetailView-BKlhzTF2.js} +1 -1
  53. package/dist/dashboard/public/assets/{RequestsPage-CCSIr_jW.js → RequestsPage-ClUJnaiz.js} +1 -1
  54. package/dist/dashboard/public/assets/{ScheduleDetailView-G86hV8Ed.js → ScheduleDetailView-BA3IBVOs.js} +1 -1
  55. package/dist/dashboard/public/assets/{SchedulePage-CQVmVvYe.js → SchedulePage-C9Sf4Nzg.js} +1 -1
  56. package/dist/dashboard/public/assets/{UserCard-Bp6Bf3OI.js → UserCard-BiPMOHC2.js} +1 -1
  57. package/dist/dashboard/public/assets/{ViewDetailView-D-dBm6G6.js → ViewDetailView-CLcKQAzy.js} +1 -1
  58. package/dist/dashboard/public/assets/{ViewsPage-ErK5Vmy0.js → ViewsPage-Bpg9xsiQ.js} +1 -1
  59. package/dist/dashboard/public/assets/{calendar-BfDDUQSW.js → calendar-9taI7KIF.js} +1 -1
  60. package/dist/dashboard/public/assets/{circle-alert-DJ_9D_4c.js → circle-alert-3qwz1WcZ.js} +1 -1
  61. package/dist/dashboard/public/assets/{circle-check-big-CiGeQW9J.js → circle-check-big-DcP6kxnu.js} +1 -1
  62. package/dist/dashboard/public/assets/{circle-x-B-V5s-zK.js → circle-x-C5FZ5L0I.js} +1 -1
  63. package/dist/dashboard/public/assets/{eye-LljylR_O.js → eye-7S1ZlGkA.js} +1 -1
  64. package/dist/dashboard/public/assets/{index-HxcGVcSo.js → index-CC9YqlAO.js} +2 -2
  65. package/dist/dashboard/public/assets/{search-VPXcw9Ki.js → search-DlyuMX5Q.js} +1 -1
  66. package/dist/dashboard/public/assets/{send-CdCk9jQ5.js → send-C8jkJh8C.js} +1 -1
  67. package/dist/dashboard/public/assets/{timer-I7o5QV6X.js → timer-DiBZzrwD.js} +1 -1
  68. package/dist/dashboard/public/assets/{types-BMBEhoQ2.js → types-7eWhJMm7.js} +1 -1
  69. package/dist/dashboard/public/assets/{users-CFzKwpf2.js → users-G6Z4vIpX.js} +1 -1
  70. package/dist/dashboard/public/assets/{zap-DMB3w7zm.js → zap-DaVFRg-y.js} +1 -1
  71. package/dist/dashboard/public/index.html +1 -1
  72. package/package.json +1 -1
  73. package/dist/dashboard/public/assets/MailDetailView-CYCQI9Z8.js +0 -9
@@ -0,0 +1,9 @@
1
+ import{c as pr,j as l,M as fn,C as dr}from"./index-CC9YqlAO.js";import{C as hr,B as gr}from"./types-7eWhJMm7.js";import{p as Rt,f as Tr}from"./date-Dwgqy666.js";import{D as $,f as _r}from"./DetailRow-BX0zpKTe.js";import{T as xr}from"./EntryDetailPage-NLzBL3a7.js";import{C as we}from"./CopyButton-8NQFvMIW.js";import{C as br}from"./circle-x-C5FZ5L0I.js";import{C as yr}from"./circle-check-big-DcP6kxnu.js";import{U as Ar}from"./users-G6Z4vIpX.js";import{C as Er}from"./circle-alert-3qwz1WcZ.js";import"./vendor-DBTT3jXp.js";import"./search-DlyuMX5Q.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Sr=pr("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */function mn(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,c=Array(r);i<r;i++)c[i]=n[i];return c}function Nr(n){if(Array.isArray(n))return n}function wr(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var c,m,h,g,X=[],N=!0,q=!1;try{if(h=(i=i.call(n)).next,r!==0)for(;!(N=(c=h.call(i)).done)&&(X.push(c.value),X.length!==r);N=!0);}catch(j){q=!0,m=j}finally{try{if(!N&&i.return!=null&&(g=i.return(),Object(g)!==g))return}finally{if(q)throw m}}return X}}function Rr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function Or(n,r){return Nr(n)||wr(n,r)||Dr(n,r)||Rr()}function Dr(n,r){if(n){if(typeof n=="string")return mn(n,r);var i={}.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?mn(n,r):void 0}}const On=Object.entries,pn=Object.setPrototypeOf,vr=Object.isFrozen,Dn=Object.getPrototypeOf,vn=Object.getOwnPropertyDescriptor;let S=Object.freeze,R=Object.seal,Te=Object.create,Cn=typeof Reflect<"u"&&Reflect,Ot=Cn.apply,Dt=Cn.construct;S||(S=function(r){return r});R||(R=function(r){return r});Ot||(Ot=function(r,i){for(var c=arguments.length,m=new Array(c>2?c-2:0),h=2;h<c;h++)m[h-2]=arguments[h];return r.apply(i,m)});Dt||(Dt=function(r){for(var i=arguments.length,c=new Array(i>1?i-1:0),m=1;m<i;m++)c[m-1]=arguments[m];return new r(...c)});const Y=b(Array.prototype.forEach),Cr=b(Array.prototype.lastIndexOf),dn=b(Array.prototype.pop),Re=b(Array.prototype.push),Lr=b(Array.prototype.slice),Ir=b(Array.prototype.splice),_e=Array.isArray,gt=Ln(Set),Tt=b(Set.prototype.add),Oe=b(Set.prototype.has),ie=b(String.prototype.toLowerCase),_t=b(String.prototype.toString),hn=b(String.prototype.match),De=b(String.prototype.replace),gn=b(String.prototype.indexOf),Mr=b(String.prototype.trim),kr=b(Number.prototype.toString),Pr=b(Boolean.prototype.toString),Tn=typeof BigInt>"u"?null:b(BigInt.prototype.toString),_n=typeof Symbol>"u"?null:b(Symbol.prototype.toString),L=b(Object.prototype.hasOwnProperty),ve=b(Object.prototype.toString),w=b(RegExp.prototype.test),V=Ln(TypeError);function b(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),m=1;m<i;m++)c[m-1]=arguments[m];return Ot(n,r,c)}}function Ln(n){return function(){for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return Dt(n,i)}}function d(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ie;if(pn&&pn(n,null),!_e(r))return n;let c=r.length;for(;c--;){let m=r[c];if(typeof m=="string"){const h=i(m);h!==m&&(vr(r)||(r[c]=h),m=h)}n[m]=!0}return n}function jr(n){for(let r=0;r<n.length;r++)L(n,r)||(n[r]=null);return n}function I(n){const r=Te(null);for(const c of On(n)){var i=Or(c,2);const m=i[0],h=i[1];L(n,m)&&(_e(h)?r[m]=jr(h):h&&typeof h=="object"&&h.constructor===Object?r[m]=I(h):r[m]=h)}return r}function Ur(n){switch(typeof n){case"string":return n;case"number":return kr(n);case"boolean":return Pr(n);case"bigint":return Tn?Tn(n):"0";case"symbol":return _n?_n(n):"Symbol()";case"undefined":return ve(n);case"function":case"object":{if(n===null)return ve(n);const r=n,i=P(r,"toString");if(typeof i=="function"){const c=i(r);return typeof c=="string"?c:ve(c)}return ve(n)}default:return ve(n)}}function P(n,r){for(;n!==null;){const c=vn(n,r);if(c){if(c.get)return b(c.get);if(typeof c.value=="function")return b(c.value)}n=Dn(n)}function i(){return null}return i}function zr(n,r){for(;n!==null;){const i=vn(n,r);if(i)return i.get?b(i.get):null;n=Dn(n)}return null}function Fr(n){try{return w(n,""),!0}catch{return!1}}const xn=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),xt=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bt=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Hr=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),yt=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Br=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bn=S(["#text"]),yn=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),At=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),An=S(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Be=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Gr=R(/{{[\w\W]*|^[\w\W]*}}/g),Wr=R(/<%[\w\W]*|^[\w\W]*%>/g),$r=R(/\${[\w\W]*/g),Yr=R(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vr=R(/^aria-[\-\w]+$/),En=R(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xr=R(/^(?:\w+script|data):/i),qr=R(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kr=R(/^html$/i),Zr=R(/^[a-z][.\w]*(-[.\w]+)+$/i),Et=R(/<[/\w!]/g),Sn=R(/<[/\w]/g),Jr=R(/<\/no(script|embed|frames)/i),Nn=R(/\/>/i),A={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qr=S(d({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),eo=function(){return typeof window>"u"?null:window},to=function(r,i){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let c=null;const m="data-tt-policy-suffix";i&&i.hasAttribute(m)&&(c=i.getAttribute(m));const h="dompurify"+(c?"#"+c:"");try{return r.createPolicy(h,{createHTML(g){return g},createScriptURL(g){return g}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},wn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Q=function(r,i,c,m){return L(r,i)&&_e(r[i])?d(m.base?I(m.base):{},r[i],m.transform):c},St=function(r,i,c){const m=L(r,i)?r[i]:void 0;return m&&typeof m=="object"?I(m):c()};function In(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eo();const r=a=>In(a);if(r.version="3.4.17",r.removed=[],!n||!n.document||n.document.nodeType!==A.document||!n.Element)return r.isSupported=!1,r;let i=n.document;const c=i,m=c.currentScript;n.DocumentFragment;const h=n.HTMLTemplateElement,g=n.Node,X=n.Element,N=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const q=n.DOMParser,j=n.trustedTypes,U=X.prototype,M=P(U,"cloneNode"),G=P(U,"remove"),vt=P(U,"removeAttributeNode"),Mn=P(U,"nextSibling"),xe=P(U,"childNodes"),ae=P(U,"parentNode"),Ge=P(U,"shadowRoot"),We=P(U,"attributes"),ee=g&&g.prototype?P(g.prototype,"nodeType"):null,le=g&&g.prototype?P(g.prototype,"nodeName"):null,Ce=g&&g.prototype?P(g.prototype,"ownerDocument"):null,k=function(e){return ee?ee(e):e.nodeType},be=function(e){return le?le(e):e.nodeName},Ct=zr(U,"namespaceURI"),$e=function(e){return Ct?Ct(e):e.namespaceURI};if(typeof h=="function"){const a=i.createElement("template");a.content&&a.content.ownerDocument&&(i=a.content.ownerDocument)}let D,te="",Ye,Lt=!1,ye=0;const It=function(){if(ye>0)throw V('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ce=function(e){It(),ye++;try{return D.createHTML(e)}finally{ye--}},kn=function(e){It(),ye++;try{return D.createScriptURL(e)}finally{ye--}},Pn=function(){return Lt||(Ye=to(j,m),Lt=!0),Ye},Le=i,Ve=Le.implementation,Mt=Le.createNodeIterator,jn=Le.createDocumentFragment,Un=Le.getElementsByTagName,zn=c.importNode;let T=wn();r.isSupported=typeof On=="function"&&typeof ae=="function"&&Ve&&Ve.createHTMLDocument!==void 0;const Fn=Gr,Hn=Wr,Bn=$r,Gn=Yr,Wn=Vr,$n=Xr,kt=qr,Yn=Zr;let Pt=En,_=null;const Xe=d({},[...xn,...xt,...bt,...yt,...bn]);let x=null;const qe=d({},[...yn,...At,...An,...Be]);let F=Object.seal(Te(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,jt=null;const K=Object.seal(Te(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ut=!0,Ke=!0,zt=!1,Ze=!0,W=!1,ne=!0,re=!1,Je=!1,Ie=null,Me=null,Qe=!1,ue=!1,ke=!1,Pe=!1,Ft=!0,Ht=!1;const Bt="user-content-";let et=!0,tt=!1,oe=null,fe={},se=null;const Gt=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Wt=null;const $t=d({},["audio","video","img","source","image","track"]);let Yt=null;const Vt=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),je="http://www.w3.org/1998/Math/MathML",Ue="http://www.w3.org/2000/svg",H="http://www.w3.org/1999/xhtml";let me=H,nt=!1,rt=null;const Vn=d({},[je,Ue,H],_t),Xt=S(["mi","mo","mn","ms","mtext"]);let ot=d({},Xt);const qt=S(["annotation-xml"]);let st=d({},qt);const Xn=d({},["title","style","font","a","script"]);let Ee=null;const qn=["application/xhtml+xml","text/html"],Kn="text/html";let y=null,pe=null;const Zn=i.createElement("form"),Kt=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pe&&pe===e)return;(!e||typeof e!="object")&&(e={}),e=I(e),Ee=qn.indexOf(e.PARSER_MEDIA_TYPE)===-1?Kn:e.PARSER_MEDIA_TYPE,y=Ee==="application/xhtml+xml"?_t:ie,_=Q(e,"ALLOWED_TAGS",Xe,{transform:y}),x=Q(e,"ALLOWED_ATTR",qe,{transform:y}),rt=Q(e,"ALLOWED_NAMESPACES",Vn,{transform:_t}),Yt=Q(e,"ADD_URI_SAFE_ATTR",Vt,{transform:y,base:Vt}),Wt=Q(e,"ADD_DATA_URI_TAGS",$t,{transform:y,base:$t}),se=Q(e,"FORBID_CONTENTS",Gt,{transform:y}),Ae=Q(e,"FORBID_TAGS",I({}),{transform:y}),jt=Q(e,"FORBID_ATTR",I({}),{transform:y}),fe=L(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?I(e.USE_PROFILES):e.USE_PROFILES:!1,Ut=e.ALLOW_ARIA_ATTR!==!1,Ke=e.ALLOW_DATA_ATTR!==!1,zt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,W=e.SAFE_FOR_TEMPLATES||!1,ne=e.SAFE_FOR_XML!==!1,re=e.WHOLE_DOCUMENT||!1,ue=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,Qe=e.FORCE_BODY||!1,Ft=e.SANITIZE_DOM!==!1,Ht=e.SANITIZE_NAMED_PROPS||!1,et=e.KEEP_CONTENT!==!1,tt=e.IN_PLACE||!1,Pt=Fr(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:En,me=typeof e.NAMESPACE=="string"?e.NAMESPACE:H,ot=St(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>d({},Xt)),st=St(e,"HTML_INTEGRATION_POINTS",()=>d({},qt));const t=St(e,"CUSTOM_ELEMENT_HANDLING",()=>Te(null));if(F=Te(null),L(t,"tagNameCheck")&&Kt(t.tagNameCheck)&&(F.tagNameCheck=t.tagNameCheck),L(t,"attributeNameCheck")&&Kt(t.attributeNameCheck)&&(F.attributeNameCheck=t.attributeNameCheck),L(t,"allowCustomizedBuiltInElements")&&typeof t.allowCustomizedBuiltInElements=="boolean"&&(F.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),R(F),W&&(Ke=!1),ke&&(ue=!0),fe&&(_=d({},bn),x=Te(null),fe.html===!0&&(d(_,xn),d(x,yn)),fe.svg===!0&&(d(_,xt),d(x,At),d(x,Be)),fe.svgFilters===!0&&(d(_,bt),d(x,At),d(x,Be)),fe.mathMl===!0&&(d(_,yt),d(x,An),d(x,Be))),K.tagCheck=null,K.attributeCheck=null,L(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?K.tagCheck=e.ADD_TAGS:_e(e.ADD_TAGS)&&(_===Xe&&(_=I(_)),d(_,e.ADD_TAGS,y))),L(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?K.attributeCheck=e.ADD_ATTR:_e(e.ADD_ATTR)&&(x===qe&&(x=I(x)),d(x,e.ADD_ATTR,y))),L(e,"ADD_FORBID_CONTENTS")&&_e(e.ADD_FORBID_CONTENTS)&&(se===Gt&&(se=I(se)),d(se,e.ADD_FORBID_CONTENTS,y)),et&&(_["#text"]=!0),re&&d(_,["html","head","body"]),_.table&&(d(_,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const o=D;D=e.TRUSTED_TYPES_POLICY;try{te=ce("")}catch(s){throw D=o,s}}else e.TRUSTED_TYPES_POLICY===null?(D=void 0,te=""):(D===void 0&&(D=Pn()),D&&typeof te=="string"&&(te=ce("")));S&&S(e),pe=e},Zt=d({},[...xt,...bt,...Hr]),Jt=d({},[...yt,...Br]),Jn=function(e,t,o){return t.namespaceURI===H?e==="svg":t.namespaceURI===je?e==="svg"&&(o==="annotation-xml"||ot[o]):!!Zt[e]},Qn=function(e,t,o){return t.namespaceURI===H?e==="math":t.namespaceURI===Ue?e==="math"&&st[o]:!!Jt[e]},er=function(e,t,o){return t.namespaceURI===Ue&&!st[o]||t.namespaceURI===je&&!ot[o]?!1:!Jt[e]&&(Xn[e]||!Zt[e])},tr=function(e){const t=$e(e),o=ie(be(e)),s=ae(e);let u,f;return s&&k(s)===A.element?(u={namespaceURI:$e(s)},f=ie(be(s))):(u={namespaceURI:me},f="template"),rt[t]?t===Ue?Jn(o,u,f):t===je?Qn(o,u,f):t===H?er(o,u,f):!!(Ee==="application/xhtml+xml"&&rt[t]):!1},Z=function(e){Re(r.removed,{element:e});try{ae(e).removeChild(e)}catch{if(G(e),!ae(e))throw V("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qt=function(e,t,o){try{vt(e,t)}catch{try{e.removeAttribute(o)}catch{}}},at=function(e){ct(e);const t=xe(e);t&&Y(Lr(t),s=>{try{G(s)}catch{}});const o=k(e)===A.element?We(e):null;if(o)for(let s=o.length-1;s>=0;--s){const u=o[s],f=u&&u.name;typeof f=="string"&&Qt(e,u,f)}},de=function(e,t,o){if(!o)try{o=t.getAttributeNode(e)}catch{o=null}Re(r.removed,{attribute:o||null,from:t});try{o?vt(t,o):t.removeAttribute(e)}catch{try{t.removeAttribute(e)}catch{}}if(e==="is")if(ue||ke)try{Z(t)}catch{}else try{t.setAttribute(e,"")}catch{}},en=function(e){const t=We(e);if(t)for(let o=t.length-1;o>=0;--o){const s=t[o],u=s&&s.name;typeof u!="string"||x[y(u)]||Qt(e,s,u)}},lt=function(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const s=[e];for(;s.length>0;){const u=s.pop();if(t(u)===!1)continue;if(o&&k(u)===A.element){const p=Ge(u);J(p)&&s.push(p)}const f=xe(u);if(f)for(let p=f.length-1;p>=0;--p)s.push(f[p])}},ct=function(e){lt(e,t=>{k(t)===A.element&&en(t)})},ut=function(e){const t=[];return lt(e,o=>{t.push(o)},!0),t},nr=function(e,t){const o=gt();Y(ut(e),s=>{k(s)===A.element&&Tt(o,s)}),Y(t,s=>{k(s)===A.element&&!Oe(o,s)&&en(s)})},tn=function(e,t){let o=!1;return Y(r.removed,s=>{s.element&&(o=o||s.element===e,ct(s.element))}),nr(e,t),o},rr=8,or=function(e,t){const o=oe;let s=null;const u=()=>(s||(s=gt(),Y(t,f=>{Tt(s,f)})),s);for(let f=0;;f++){const p=ut(e),E=[e];let B=!1;if(Y(p,O=>{k(O)===A.documentFragment?Re(E,O):!B&&!Oe(o,O)&&(B=Oe(u(),O))}),!B)return;if(f>=rr)throw V("the tree kept changing during in-place sanitization; refusing to return it");Y(E,(O,v)=>{sr(O,v>0,e,u())})}},sr=function(e,t,o,s){const u=ft(e);let f;for(;f=u.nextNode();)!Oe(s,f)||Oe(oe,f)||(t&&z(T.uponSanitizeShadowNode,f,null),pt(f,o),dt(f,o),J(f.content)&&Ne(f.content))},ir=function(e){oe&&Tt(oe,e)},nn=function(e,t){return ne?e==="patchsrc"?!0:e==="for"&&t!=="label"&&t!=="output":!1},ar=function(e){ne&&lt(e,t=>{const o=k(t);if(o===A.processingInstruction||o===A.comment&&w(Sn,t.data)){try{G(t)}catch{}return!1}if(o===A.element){const s=t,u=y(be(t));try{s.hasAttribute&&s.hasAttribute("patchsrc")&&s.removeAttribute("patchsrc"),s.hasAttribute&&s.hasAttribute("for")&&nn("for",u)&&s.removeAttribute("for")}catch{}}return!0})},rn=function(e){let t=null,o=null;if(Qe)e="<remove></remove>"+e;else{const f=hn(e,/^[\r\n\t ]+/);o=f&&f[0]}Ee==="application/xhtml+xml"&&me===H&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const s=D?ce(e):e;if(me===H)try{t=new q().parseFromString(s,Ee)}catch{}if(!t||!t.documentElement){t=Ve.createDocument(me,"template",null);try{t.documentElement.innerHTML=nt?te:s}catch{}}const u=t.body||t.documentElement;return e&&o&&u.insertBefore(i.createTextNode(o),u.childNodes[0]||null),me===H?Un.call(t,re?"html":"body")[0]:re?t.documentElement:u},ft=function(e){const t=Ce?Ce(e):e.ownerDocument;return Mt.call(t||e,e,N.SHOW_ELEMENT|N.SHOW_COMMENT|N.SHOW_TEXT|N.SHOW_PROCESSING_INSTRUCTION|N.SHOW_CDATA_SECTION,null)},ze=function(e){return e=De(e,Fn," "),e=De(e,Hn," "),e=De(e,Bn," "),e},mt=function(e){var t;on(e);const o=(t=e.querySelectorAll)===null||t===void 0?void 0:t.call(e,"template");o&&Y(o,s=>{J(s.content)&&mt(s.content)})},on=function(e){e.normalize();const t=Ce?Ce(e):e.ownerDocument,o=Mt.call(t||e,e,N.SHOW_TEXT|N.SHOW_COMMENT|N.SHOW_CDATA_SECTION|N.SHOW_PROCESSING_INSTRUCTION,null);let s=o.nextNode();for(;s;)s.data=ze(s.data),s=o.nextNode()},Fe=function(e){const t=le?le(e):null;return typeof t!="string"||y(t)!=="form"?!1:typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||e.attributes!==We(e)||typeof e.removeAttribute!="function"||typeof e.removeAttributeNode!="function"||typeof e.getAttributeNode!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function"||e.nodeType!==ee(e)||e.childNodes!==xe(e)},J=function(e){if(!ee||typeof e!="object"||e===null)return!1;try{return ee(e)===A.documentFragment}catch{return!1}},Se=function(e){if(!ee||typeof e!="object"||e===null)return!1;try{return typeof ee(e)=="number"}catch{return!1}};function z(a,e,t){a.length!==0&&Y(a,o=>{o.call(r,e,t,pe)})}const lr=function(e,t){return!!(ne&&e.hasChildNodes()&&!Se(e.firstElementChild)&&w(Et,e.textContent)&&w(Et,e.innerHTML)||ne&&Qr[t]&&k(e)===A.element&&$e(e)===H&&(Se(e.firstElementChild)||typeof e.textContent=="string"&&w(Et,e.textContent))||e.nodeType===A.processingInstruction||ne&&e.nodeType===A.comment&&w(Sn,e.data))},He=function(e,t){if(e instanceof RegExp)return w(e,t);if(e instanceof Function){for(var o=arguments.length,s=new Array(o>2?o-2:0),u=2;u<o;u++)s[u-2]=arguments[u];return!!e(t,...s)}return!1},cr=function(e,t,o){if(!Ae[t]&&ln(t)&&He(F.tagNameCheck,t))return!1;if(et&&!se[t]&&!se[ie(t)]){const s=ae(e),u=xe(e);if(u&&s){const f=u.length;for(let p=f-1;p>=0;--p){const E=e===o?M(u[p],!0):u[p];s.insertBefore(E,Mn(e))}}}return Z(e),!0},sn=function(e,t,o,s){return e.length===0?t:t===o||t===s?I(t):t},he=function(e,t){return e===t||ae(e)!==null?!1:(tt&&ct(e),!0)},pt=function(e,t){if(ir(e),z(T.beforeSanitizeElements,e,null),he(e,t))return!0;if(Fe(e))return Z(e),!0;const o=y(be(e));if(_=sn(T.uponSanitizeElement,_,Xe,Ie),z(T.uponSanitizeElement,e,{tagName:o,allowedTags:_}),he(e,t))return!0;if(lr(e,o))return Z(e),!0;if(Ae[o]||!(K.tagCheck instanceof Function&&K.tagCheck(o))&&!_[o]){const s=cr(e,o,t);return s===!1&&(z(T.afterSanitizeElements,e,null),he(e,t))?!0:s}if(k(e)===A.element&&!tr(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&w(Jr,e.innerHTML))return Z(e),!0;if(W&&e.nodeType===A.text){const s=ze(e.textContent);e.textContent!==s&&(Re(r.removed,{element:e.cloneNode()}),e.textContent=s)}return z(T.afterSanitizeElements,e,null),he(e,t)},an=function(e,t,o){if(jt[t]||nn(t,e)||Ft&&(t==="id"||t==="name")&&(o in i||o in Zn))return!1;const s=x[t]||K.attributeCheck instanceof Function&&K.attributeCheck(t,e);return Ke&&w(Gn,t)||Ut&&w(Wn,t)?!0:s?Yt[t]||w(Pt,De(o,kt,""))||(t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&gn(o,"data:")===0&&Wt[e]||zt&&!w($n,De(o,kt,""))?!0:!o:ln(e)&&He(F.tagNameCheck,e)&&He(F.attributeNameCheck,t,e)||t==="is"&&F.allowCustomizedBuiltInElements&&He(F.tagNameCheck,o)},ur=d({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ln=function(e){return!ur[ie(e)]&&w(Yn,e)},fr=function(e,t,o,s){if(D&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!o)switch(j.getAttributeType(e,t)){case"TrustedHTML":return ce(s);case"TrustedScriptURL":return kn(s)}return s},mr=function(e,t,o,s){try{return o?e.setAttributeNS(o,t,s):e.setAttribute(t,s),Fe(e)?(Z(e),!1):!0}catch{return de(t,e),!1}},cn=function(e,t){return ne&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ie(e)==="attributename"&&hn(t,"href")!==null},dt=function(e,t){if(z(T.beforeSanitizeAttributes,e,null),he(e,t))return;const o=e.attributes;if(!o||Fe(e))return;x=sn(T.uponSanitizeAttribute,x,qe,Me);const s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:x,forceKeepAttr:void 0};let u=o.length;const f=y(e.nodeName);for(;u--;){const p=o[u],E=p.name,B=p.namespaceURI,O=p.value,v=y(E),ge=O;let C=E==="value"?ge:Mr(ge),un=!1;if(s.attrName=v,s.attrValue=C,s.keepAttr=!0,s.forceKeepAttr=void 0,z(T.uponSanitizeAttribute,e,s),C=s.attrValue,Ht&&(v==="id"||v==="name")&&gn(C,Bt)!==0&&(de(E,e,p),C=Bt+C,un=!0),cn(E,C)){de(E,e,p);continue}if(!s.forceKeepAttr){if(!s.keepAttr){de(E,e,p);continue}if(!Ze&&w(Nn,C)){de(E,e,p);continue}if(W&&(C=ze(C)),!an(f,v,C)){de(E,e,p);continue}C=fr(f,v,B,C),C!==ge&&mr(e,E,B,C)&&un&&dn(r.removed)}}z(T.afterSanitizeAttributes,e,null),he(e,t)},Ne=function(e){let t=null;const o=ft(e);for(z(T.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)if(z(T.uponSanitizeShadowNode,t,null),pt(t,e),dt(t,e),J(t.content)&&Ne(t.content),k(t)===A.element){const s=Ge(t);J(s)&&(ht(s),Ne(s))}W&&on(e),z(T.afterSanitizeShadowDOM,e,null)},ht=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const o=t.pop();if(o.shadow){Ne(o.shadow);continue}const s=o.node,u=k(s)===A.element,f=xe(s);if(f)for(let p=f.length-1;p>=0;--p)t.push({node:f[p],shadow:null});if(u){const p=le?le(s):null;if(typeof p=="string"&&y(p)==="template"){const E=s.content;J(E)&&t.push({node:E,shadow:null})}}if(u){const p=Ge(s);J(p)&&t.push({node:null,shadow:p},{node:p,shadow:null})}}};return r.sanitize=function(a){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,s=null,u=null;if(nt=!a,nt&&(a="<!-->"),typeof a!="string"&&!Se(a)&&(a=Ur(a),typeof a!="string"))throw V("dirty is not a string, aborting");if(!r.isSupported)return a;Je?(_=Ie,x=Me):it(e),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(_=I(_)),T.uponSanitizeAttribute.length>0&&(x=I(x)),r.removed=[];const f=tt&&typeof a!="string"&&Se(a);let p=[];const E=oe;if(f){ar(a);const v=be(a);if(typeof v=="string"){const ge=y(v);if(!_[ge]||Ae[ge])throw at(a),V("root node is forbidden and cannot be sanitized in-place")}if(Fe(a))throw at(a),V("root node is clobbered and cannot be sanitized in-place");p=ut(a),oe=gt()}else if(Se(a))t=rn("<!---->"),o=t.ownerDocument.importNode(a,!0),o.nodeType===A.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o),ht(t);else{if(!ue&&!W&&!re&&a.indexOf("<")===-1)return D&&Pe?ce(a):a;if(t=rn(a),!t)return ue?null:Pe?te:""}t&&Qe&&Z(t.firstChild);const B=f?a:t;try{f&&ht(a);const v=ft(B);for(;s=v.nextNode();)pt(s,B),dt(s,B),J(s.content)&&Ne(s.content);f&&or(a,p)}catch(v){throw f&&(at(a),tn(a,p)),v}finally{oe=E}if(f){if(tn(a,p))throw V("a node selected for removal could not be safely returned; refusing to sanitize in place");return W&&mt(a),a}if(ue){if(W&&mt(t),ke)for(u=jn.call(t.ownerDocument);t.firstChild;)u.appendChild(t.firstChild);else u=t;return(x.shadowroot||x.shadowrootmode)&&(u=zn.call(c,u,!0)),u}let O=re?t.outerHTML:t.innerHTML;return re&&_["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&w(Kr,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
8
+ `+O),W&&(O=ze(O)),D&&Pe?ce(O):O},r.setConfig=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};it(a),Je=!0,Ie=_,Me=x},r.clearConfig=function(){pe=null,Je=!1,Ie=null,Me=null,D=Ye,te=""},r.isValidAttribute=function(a,e,t){pe||it({});const o=y(a),s=y(e);return typeof t=="string"&&(cn(e,t)||!Ze&&w(Nn,t))?!1:an(o,s,t)},r.addHook=function(a,e){typeof e=="function"&&L(T,a)&&Re(T[a],e)},r.removeHook=function(a,e){if(L(T,a)){if(e!==void 0){const t=Cr(T[a],e);return t===-1?void 0:Ir(T[a],t,1)[0]}return dn(T[a])}},r.removeHooks=function(a){L(T,a)&&(T[a]=[])},r.removeAllHooks=function(){T=wn()},r}var no=In();function Nt(n){return Array.isArray(n)?n.join(", "):n}function ro(n){return/[^\x00-\x7F]/.test(n)?`=?UTF-8?B?${btoa(unescape(encodeURIComponent(n)))}?=`:n}function oo(){const n=Date.now(),r=Math.random().toString(36).substring(2,15);return`<${n}.${r}@nestlens.local>`}function so(n,r){const i=[],c=`----=_Part_${Date.now()}_${Math.random().toString(36).substring(2)}`,m=n.html&&n.text;return n.from&&i.push(`From: ${n.from}`),i.push(`To: ${Nt(n.to)}`),n.cc&&i.push(`Cc: ${Nt(n.cc)}`),n.bcc&&i.push(`Bcc: ${Nt(n.bcc)}`),i.push(`Subject: ${ro(n.subject)}`),i.push(`Date: ${Rt(r).toUTCString()}`),i.push(`Message-ID: ${oo()}`),i.push("MIME-Version: 1.0"),i.push("X-NestLens-Status: "+n.status),n.duration&&i.push("X-NestLens-Duration: "+n.duration+"ms"),m?(i.push(`Content-Type: multipart/alternative; boundary="${c}"`),i.push(""),i.push(`--${c}`),i.push("Content-Type: text/plain; charset=utf-8"),i.push("Content-Transfer-Encoding: 8bit"),i.push(""),i.push(n.text||""),i.push(""),i.push(`--${c}`),i.push("Content-Type: text/html; charset=utf-8"),i.push("Content-Transfer-Encoding: 8bit"),i.push(""),i.push(n.html||""),i.push(""),i.push(`--${c}--`)):n.html?(i.push("Content-Type: text/html; charset=utf-8"),i.push("Content-Transfer-Encoding: 8bit"),i.push(""),i.push(n.html)):(i.push("Content-Type: text/plain; charset=utf-8"),i.push("Content-Transfer-Encoding: 8bit"),i.push(""),i.push(n.text||"")),i.join(`\r
9
+ `)}function io(n,r,i){const c=so(n,r),m=new Blob([c],{type:"message/rfc822"}),h=URL.createObjectURL(m),g=document.createElement("a");g.href=h,g.download=`mail-${n.subject.substring(0,30).replace(/[^a-zA-Z0-9]/g,"_")}.eml`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(h)}const Rn={sent:{icon:yr,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30",label:"SENT"},failed:{icon:br,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30",label:"FAILED"}};function wt(n){return Array.isArray(n)?n:[n]}const ao=["sent","failed"];function yo({entry:n}){const{payload:r,createdAt:i,tags:c}=n,m=(c??[]).filter(M=>!ao.includes(M.toLowerCase())),h=Rn[r.status]||Rn.sent,g=h.icon,X=wt(r.to),N=r.cc?wt(r.cc):[],q=r.bcc?wt(r.bcc):[],j=[];r.html&&j.push({id:"html",label:"HTML Preview",content:l.jsx("div",{className:"p-4",children:l.jsx("div",{className:"mail-preview bg-white text-gray-900 border border-gray-200 dark:border-gray-600 rounded-lg p-4 max-h-[500px] overflow-auto shadow-sm",dangerouslySetInnerHTML:{__html:no.sanitize(r.html)}})})}),r.text&&j.push({id:"text",label:"Plain Text",content:l.jsx("div",{className:"p-4",children:l.jsx("pre",{className:"bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 text-sm text-gray-900 dark:text-white whitespace-pre-wrap font-mono max-h-[500px] overflow-auto",children:r.text})})});const U=r.html?"html":"text";return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:`p-2 ${h.bg} rounded-lg`,children:l.jsx(fn,{className:`h-5 w-5 ${h.color}`})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white truncate",children:r.subject}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Mail Details"})]})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(we,{text:r.subject,label:"Copy subject"}),l.jsx("button",{onClick:()=>io(r,i),className:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Download as .eml file",children:l.jsx(Sr,{className:"h-4 w-4"})})]})]})}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[l.jsx(g,{className:"h-4 w-4"}),l.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),l.jsx("p",{className:`text-lg font-bold ${r.status==="sent"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:h.label})]}),l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[l.jsx(dr,{className:"h-4 w-4"}),l.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),l.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[r.duration,l.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[l.jsx(Ar,{className:"h-4 w-4"}),l.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Recipients"})]}),l.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:X.length+N.length+q.length})]}),l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[l.jsx(fn,{className:"h-4 w-4"}),l.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Content"})]}),l.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[r.html?"HTML":"",r.html&&r.text?" + ":"",r.text?"Text":"",!r.html&&!r.text&&"-"]})]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),l.jsx("div",{className:"p-4",children:l.jsxs("dl",{className:"divide-y-0",children:[l.jsx($,{label:"Time",value:l.jsxs("span",{children:[_r(Rt(i),"MMMM do yyyy, h:mm:ss a")," ",l.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",Tr(Rt(i),{addSuffix:!0}),")"]})]})}),l.jsx($,{label:"Subject",value:l.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:r.subject})}),r.from&&l.jsx($,{label:"From",value:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:r.from}),l.jsx(we,{text:r.from})]})}),l.jsx($,{label:"To",value:l.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:X.map((M,G)=>l.jsxs("div",{className:"flex items-center space-x-1",children:[l.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:M}),l.jsx(we,{text:M})]},G))})}),N.length>0&&l.jsx($,{label:"CC",value:l.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:N.map((M,G)=>l.jsxs("div",{className:"flex items-center space-x-1",children:[l.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:M}),l.jsx(we,{text:M})]},G))})}),q.length>0&&l.jsx($,{label:"BCC",value:l.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:q.map((M,G)=>l.jsxs("div",{className:"flex items-center space-x-1",children:[l.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:M}),l.jsx(we,{text:M})]},G))})}),l.jsx($,{label:"Status",value:l.jsx(hr,{listType:"mail",filterType:"statuses",filterValue:r.status,children:r.status.toUpperCase()})}),l.jsx($,{label:"Duration",value:`${r.duration}ms`}),m.length>0&&l.jsx($,{label:"Tags",value:l.jsx(gr,{items:m,listType:"mail"})})]})})]}),r.error&&l.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[l.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Er,{className:"h-5 w-5 text-red-500"}),l.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),l.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:l.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:r.error})})]}),j.length>0&&l.jsx(xr,{tabs:j,defaultTab:U,hashKey:"mail"})]})}export{yo as default};
@@ -1 +1 @@
1
- import{j as t,M as c}from"./index-HxcGVcSo.js";import{e as D,b as m}from"./vendor-DBTT3jXp.js";import{f as L,p as P}from"./date-Dwgqy666.js";import{u as S,a as W,P as B,R as $,N as H,L as q}from"./PageHeader-DR_M5h7z.js";import{u as I,g as z,C as G}from"./types-BMBEhoQ2.js";import{T as n,D as J,a as K,b as O}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";const Q=["sent","failed","pending","queued","error"];function te(){const g=D(),{addFilter:o,clearAll:h,serverFilters:p,headerFilters:x}=I("mail"),{rangeFilters:f,windowMinutes:y}=S(),{entries:j,loading:b,refreshing:r,error:C,refresh:d,newEntriesCount:k,hasMore:w,loadMore:T,loadNew:N,autoRefreshEnabled:M,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=W({type:"mail",limit:50,filters:{...p,...f},windowMinutes:y}),i=j.filter(e=>z(e)),u=m.useCallback(e=>{const a=Array.isArray(e)?e:[e];return a.length===1?a[0]:`${a[0]} +${a.length-1}`},[]),F=m.useMemo(()=>[{key:"status",header:"Status",width:"80px",render:e=>t.jsx(G,{listType:"mail",filterType:"statuses",children:e.payload.status})},{key:"subject",header:"Subject",minWidth:"250px",render:e=>t.jsx(n,{truncate:!0,maxWidth:"350px",children:e.payload.subject.length>60?e.payload.subject.substring(0,60)+"...":e.payload.subject})},{key:"to",header:"To",width:"200px",render:e=>t.jsx(n,{mono:!0,secondary:!0,truncate:!0,maxWidth:"180px",children:u(e.payload.to)})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(J,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const a=(e.tags??[]).filter(l=>!Q.includes(l.toLowerCase()));return t.jsx(K,{tags:a,max:3,onTagClick:(l,A)=>{A.stopPropagation(),o("tags",l)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(n,{secondary:!0,className:"text-xs",children:L(P(e.createdAt),{addSuffix:!0})})}],[o,u]);return b&&i.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(B,{title:"Mail",icon:c,iconColor:"text-pink-600 dark:text-pink-400",count:i.length,totalCount:s==null?void 0:s.total,clearable:{type:"mail",label:"mail",onCleared:d},refreshing:r,autoRefreshEnabled:M,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx($,{route:"mail"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:k,onClick:N,loading:r}),t.jsx(O,{columns:F,data:i,keyExtractor:e=>e.id,onRowClick:e=>g(`/mail/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No emails recorded yet",error:C,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:w,onClick:T,loading:r})]})]})}export{te as default};
1
+ import{j as t,M as c}from"./index-CC9YqlAO.js";import{e as D,b as m}from"./vendor-DBTT3jXp.js";import{f as L,p as P}from"./date-Dwgqy666.js";import{u as S,a as W,P as B,R as $,N as H,L as q}from"./PageHeader-CwpXbfba.js";import{u as I,g as z,C as G}from"./types-7eWhJMm7.js";import{T as n,D as J,a as K,b as O}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";const Q=["sent","failed","pending","queued","error"];function te(){const g=D(),{addFilter:o,clearAll:h,serverFilters:p,headerFilters:x}=I("mail"),{rangeFilters:f,windowMinutes:y}=S(),{entries:j,loading:b,refreshing:r,error:C,refresh:d,newEntriesCount:k,hasMore:w,loadMore:T,loadNew:N,autoRefreshEnabled:M,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=W({type:"mail",limit:50,filters:{...p,...f},windowMinutes:y}),i=j.filter(e=>z(e)),u=m.useCallback(e=>{const a=Array.isArray(e)?e:[e];return a.length===1?a[0]:`${a[0]} +${a.length-1}`},[]),F=m.useMemo(()=>[{key:"status",header:"Status",width:"80px",render:e=>t.jsx(G,{listType:"mail",filterType:"statuses",children:e.payload.status})},{key:"subject",header:"Subject",minWidth:"250px",render:e=>t.jsx(n,{truncate:!0,maxWidth:"350px",children:e.payload.subject.length>60?e.payload.subject.substring(0,60)+"...":e.payload.subject})},{key:"to",header:"To",width:"200px",render:e=>t.jsx(n,{mono:!0,secondary:!0,truncate:!0,maxWidth:"180px",children:u(e.payload.to)})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(J,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const a=(e.tags??[]).filter(l=>!Q.includes(l.toLowerCase()));return t.jsx(K,{tags:a,max:3,onTagClick:(l,A)=>{A.stopPropagation(),o("tags",l)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(n,{secondary:!0,className:"text-xs",children:L(P(e.createdAt),{addSuffix:!0})})}],[o,u]);return b&&i.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(B,{title:"Mail",icon:c,iconColor:"text-pink-600 dark:text-pink-400",count:i.length,totalCount:s==null?void 0:s.total,clearable:{type:"mail",label:"mail",onCleared:d},refreshing:r,autoRefreshEnabled:M,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx($,{route:"mail"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:k,onClick:N,loading:r}),t.jsx(O,{columns:F,data:i,keyExtractor:e=>e.id,onRowClick:e=>g(`/mail/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No emails recorded yet",error:C,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:w,onClick:T,loading:r})]})]})}export{te as default};
@@ -1 +1 @@
1
- import{j as e,d as o,F as b,C as g,D as u}from"./index-HxcGVcSo.js";import{b as y}from"./vendor-DBTT3jXp.js";import{p as x,f}from"./date-Dwgqy666.js";import{D as s,f as v}from"./DetailRow-DKG3Vf9j.js";import{C as l}from"./types-BMBEhoQ2.js";import{u as n,C as m,T as N}from"./EntryDetailPage-BdBZLbAf.js";import{C as k}from"./CopyButton-DfPqcshv.js";import{C as w}from"./circle-x-B-V5s-zK.js";import"./search-VPXcw9Ki.js";function V({entry:p}){const{payload:a,createdAt:i}=p,t=n(),d=n(),[c,h]=y.useState("data"),r=[];a.data!==void 0&&r.push({id:"data",label:"Data",content:e.jsx(m,{data:a.data,toolbarState:t.state,searchBar:t.SearchBar,maxHeight:400})}),a.where!==void 0&&r.push({id:"where",label:"Where",content:e.jsx(m,{data:a.where,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})});const j=()=>{if(c==="data"&&a.data!==void 0)return e.jsx(t.Toolbar,{data:a.data});if(c==="where"&&a.where!==void 0)return e.jsx(d.Toolbar,{data:a.where})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(o,{className:"h-5 w-5 text-purple-600 dark:text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.entity}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Model Event"})]})]}),e.jsx(k,{text:a.entity,label:"Copy entity name"})]})}),e.jsxs("div",{className:`grid ${a.recordCount!==void 0?"grid-cols-2 md:grid-cols-4":"grid-cols-2 md:grid-cols-3"} divide-x divide-gray-200 dark:divide-gray-700`,children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Action"})]}),e.jsx("p",{className:"text-lg font-bold text-purple-600 dark:text-purple-400",children:a.action.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Entity"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.entity,children:a.entity})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),a.recordCount!==void 0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Records"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a.recordCount})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[v(x(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",f(x(i),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Action",value:e.jsx(l,{listType:"models",filterType:"actions",filterValue:a.action,children:a.action.toUpperCase()})}),e.jsx(s,{label:"Entity",value:e.jsx(l,{listType:"models",filterType:"entities",filterValue:a.entity,children:a.entity})}),a.source&&e.jsx(s,{label:"Source",value:e.jsx(l,{listType:"models",filterType:"sources",filterValue:a.source,children:a.source})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`}),a.recordCount!==void 0&&e.jsx(s,{label:"Records",value:String(a.recordCount)})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(w,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),r.length>0&&e.jsx(N,{tabs:r,defaultTab:"data",hashKey:"model",headerRight:j(),onTabChange:h})]})}export{V as default};
1
+ import{j as e,d as o,F as b,C as g,D as u}from"./index-CC9YqlAO.js";import{b as y}from"./vendor-DBTT3jXp.js";import{p as x,f}from"./date-Dwgqy666.js";import{D as s,f as v}from"./DetailRow-BX0zpKTe.js";import{C as l}from"./types-7eWhJMm7.js";import{u as n,C as m,T as N}from"./EntryDetailPage-NLzBL3a7.js";import{C as k}from"./CopyButton-8NQFvMIW.js";import{C as w}from"./circle-x-C5FZ5L0I.js";import"./search-DlyuMX5Q.js";function V({entry:p}){const{payload:a,createdAt:i}=p,t=n(),d=n(),[c,h]=y.useState("data"),r=[];a.data!==void 0&&r.push({id:"data",label:"Data",content:e.jsx(m,{data:a.data,toolbarState:t.state,searchBar:t.SearchBar,maxHeight:400})}),a.where!==void 0&&r.push({id:"where",label:"Where",content:e.jsx(m,{data:a.where,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})});const j=()=>{if(c==="data"&&a.data!==void 0)return e.jsx(t.Toolbar,{data:a.data});if(c==="where"&&a.where!==void 0)return e.jsx(d.Toolbar,{data:a.where})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(o,{className:"h-5 w-5 text-purple-600 dark:text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.entity}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Model Event"})]})]}),e.jsx(k,{text:a.entity,label:"Copy entity name"})]})}),e.jsxs("div",{className:`grid ${a.recordCount!==void 0?"grid-cols-2 md:grid-cols-4":"grid-cols-2 md:grid-cols-3"} divide-x divide-gray-200 dark:divide-gray-700`,children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Action"})]}),e.jsx("p",{className:"text-lg font-bold text-purple-600 dark:text-purple-400",children:a.action.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Entity"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.entity,children:a.entity})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),a.recordCount!==void 0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Records"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a.recordCount})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[v(x(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",f(x(i),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Action",value:e.jsx(l,{listType:"models",filterType:"actions",filterValue:a.action,children:a.action.toUpperCase()})}),e.jsx(s,{label:"Entity",value:e.jsx(l,{listType:"models",filterType:"entities",filterValue:a.entity,children:a.entity})}),a.source&&e.jsx(s,{label:"Source",value:e.jsx(l,{listType:"models",filterType:"sources",filterValue:a.source,children:a.source})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`}),a.recordCount!==void 0&&e.jsx(s,{label:"Records",value:String(a.recordCount)})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(w,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),r.length>0&&e.jsx(N,{tabs:r,defaultTab:"data",hashKey:"model",headerRight:j(),onTabChange:h})]})}export{V as default};
@@ -1 +1 @@
1
- import{j as t,d as c}from"./index-HxcGVcSo.js";import{e as P,b as A}from"./vendor-DBTT3jXp.js";import{f as D,p as T}from"./date-Dwgqy666.js";import{u as B,a as L,P as H,R as S,N as I,L as U}from"./PageHeader-DR_M5h7z.js";import{u as $,l as q,C as l}from"./types-BMBEhoQ2.js";import{T as o,D as z,b as G}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";function Y(){const u=P(),{addFilter:a,clearAll:p,serverFilters:m,headerFilters:h}=$("models"),{rangeFilters:x,windowMinutes:g}=B(),{entries:y,loading:f,refreshing:s,error:j,refresh:d,newEntriesCount:C,hasMore:w,loadMore:k,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:v,meta:i,isHighlighted:R}=L({type:"model",limit:50,filters:{...m,...x},windowMinutes:g}),n=y.filter(e=>q(e)),M=A.useMemo(()=>[{key:"action",header:"Action",width:"120px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("actions",e.payload.action)},children:e.payload.action.toUpperCase()})},{key:"entity",header:"Entity",width:"150px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("entities",e.payload.entity)},className:"font-mono",children:e.payload.entity})},{key:"source",header:"Source",width:"150px",render:e=>{const r=e.payload.source;return r?t.jsx(l,{onClick:F=>{F.stopPropagation(),a("sources",r)},className:"font-mono text-xs",children:r}):t.jsx(o,{secondary:!0,children:"-"})}},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(z,{ms:e.payload.duration||0})},{key:"records",header:"Records",width:"80px",align:"center",render:e=>e.payload.recordCount!==void 0?t.jsx(o,{children:e.payload.recordCount}):t.jsx(o,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:D(T(e.createdAt),{addSuffix:!0})})}],[a]);return f&&n.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(H,{title:"Models",icon:c,iconColor:"text-purple-600 dark:text-purple-400",count:n.length,totalCount:i==null?void 0:i.total,clearable:{type:"model",label:"models",onCleared:d},refreshing:s,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:v,filters:h,filterControls:t.jsx(S,{route:"models"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(I,{count:C,onClick:N,loading:s}),t.jsx(G,{columns:M,data:n,keyExtractor:e=>e.id,onRowClick:e=>u(`/models/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No model events recorded yet",error:j,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(U,{hasMore:w,onClick:k,loading:s})]})]})}export{Y as default};
1
+ import{j as t,d as c}from"./index-CC9YqlAO.js";import{e as P,b as A}from"./vendor-DBTT3jXp.js";import{f as D,p as T}from"./date-Dwgqy666.js";import{u as B,a as L,P as H,R as S,N as I,L as U}from"./PageHeader-CwpXbfba.js";import{u as $,l as q,C as l}from"./types-7eWhJMm7.js";import{T as o,D as z,b as G}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";function Y(){const u=P(),{addFilter:a,clearAll:p,serverFilters:m,headerFilters:h}=$("models"),{rangeFilters:x,windowMinutes:g}=B(),{entries:y,loading:f,refreshing:s,error:j,refresh:d,newEntriesCount:C,hasMore:w,loadMore:k,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:v,meta:i,isHighlighted:R}=L({type:"model",limit:50,filters:{...m,...x},windowMinutes:g}),n=y.filter(e=>q(e)),M=A.useMemo(()=>[{key:"action",header:"Action",width:"120px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("actions",e.payload.action)},children:e.payload.action.toUpperCase()})},{key:"entity",header:"Entity",width:"150px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("entities",e.payload.entity)},className:"font-mono",children:e.payload.entity})},{key:"source",header:"Source",width:"150px",render:e=>{const r=e.payload.source;return r?t.jsx(l,{onClick:F=>{F.stopPropagation(),a("sources",r)},className:"font-mono text-xs",children:r}):t.jsx(o,{secondary:!0,children:"-"})}},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(z,{ms:e.payload.duration||0})},{key:"records",header:"Records",width:"80px",align:"center",render:e=>e.payload.recordCount!==void 0?t.jsx(o,{children:e.payload.recordCount}):t.jsx(o,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:D(T(e.createdAt),{addSuffix:!0})})}],[a]);return f&&n.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(H,{title:"Models",icon:c,iconColor:"text-purple-600 dark:text-purple-400",count:n.length,totalCount:i==null?void 0:i.total,clearable:{type:"model",label:"models",onCleared:d},refreshing:s,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:v,filters:h,filterControls:t.jsx(S,{route:"models"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(I,{count:C,onClick:N,loading:s}),t.jsx(G,{columns:M,data:n,keyExtractor:e=>e.id,onRowClick:e=>u(`/models/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No model events recorded yet",error:j,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(U,{hasMore:w,onClick:k,loading:s})]})]})}export{Y as default};
@@ -1 +1 @@
1
- import{j as e,f as c,C as j}from"./index-HxcGVcSo.js";import{p as x,f as y}from"./date-Dwgqy666.js";import{D as s,f as b}from"./DetailRow-DKG3Vf9j.js";import{C as n}from"./types-BMBEhoQ2.js";import{u as f,C as N,T as u}from"./EntryDetailPage-BdBZLbAf.js";import{C as v}from"./CopyButton-DfPqcshv.js";import{C as k}from"./circle-check-big-CiGeQW9J.js";import{C as o}from"./circle-x-B-V5s-zK.js";import{S as w}from"./send-CdCk9jQ5.js";import"./vendor-DBTT3jXp.js";import"./search-VPXcw9Ki.js";function I({entry:m}){const{payload:a,createdAt:l}=m,i=f(),t=a.status==="sent"?{icon:k,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:o,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},p=t.icon,d=a.metadata!==void 0?[{id:"metadata",label:"Metadata",content:e.jsx(N,{data:a.metadata,toolbarState:i.state,searchBar:i.SearchBar,maxHeight:400})}]:[],r=Array.isArray(a.recipient)?a.recipient:[a.recipient];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(c,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:a.title||a.type}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Notification"})]})]}),e.jsx(v,{text:r.join(", "),label:"Copy recipient"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(c,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Type"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white truncate",title:a.type,children:a.type})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(j,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Recipients"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:r.length})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[b(x(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",y(x(l),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Type",value:e.jsx(n,{listType:"notifications",filterType:"types",filterValue:a.type,children:a.type})}),e.jsx(s,{label:r.length>1?"Recipients":"Recipient",value:e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((h,g)=>e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:h},g))})}),a.title&&e.jsx(s,{label:"Title",value:a.title}),a.message&&e.jsx(s,{label:"Message",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:a.message})}),e.jsx(s,{label:"Status",value:e.jsx(n,{listType:"notifications",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(o,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),d.length>0&&e.jsx(u,{tabs:d,defaultTab:"metadata",hashKey:"notification",headerRight:e.jsx(i.Toolbar,{data:a.metadata})})]})}export{I as default};
1
+ import{j as e,f as c,C as j}from"./index-CC9YqlAO.js";import{p as x,f as y}from"./date-Dwgqy666.js";import{D as s,f as b}from"./DetailRow-BX0zpKTe.js";import{C as n}from"./types-7eWhJMm7.js";import{u as f,C as N,T as u}from"./EntryDetailPage-NLzBL3a7.js";import{C as v}from"./CopyButton-8NQFvMIW.js";import{C as k}from"./circle-check-big-DcP6kxnu.js";import{C as o}from"./circle-x-C5FZ5L0I.js";import{S as w}from"./send-C8jkJh8C.js";import"./vendor-DBTT3jXp.js";import"./search-DlyuMX5Q.js";function I({entry:m}){const{payload:a,createdAt:l}=m,i=f(),t=a.status==="sent"?{icon:k,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:o,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},p=t.icon,d=a.metadata!==void 0?[{id:"metadata",label:"Metadata",content:e.jsx(N,{data:a.metadata,toolbarState:i.state,searchBar:i.SearchBar,maxHeight:400})}]:[],r=Array.isArray(a.recipient)?a.recipient:[a.recipient];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(c,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:a.title||a.type}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Notification"})]})]}),e.jsx(v,{text:r.join(", "),label:"Copy recipient"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(c,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Type"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white truncate",title:a.type,children:a.type})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(j,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Recipients"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:r.length})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[b(x(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",y(x(l),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Type",value:e.jsx(n,{listType:"notifications",filterType:"types",filterValue:a.type,children:a.type})}),e.jsx(s,{label:r.length>1?"Recipients":"Recipient",value:e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((h,g)=>e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:h},g))})}),a.title&&e.jsx(s,{label:"Title",value:a.title}),a.message&&e.jsx(s,{label:"Message",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:a.message})}),e.jsx(s,{label:"Status",value:e.jsx(n,{listType:"notifications",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(o,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),d.length>0&&e.jsx(u,{tabs:d,defaultTab:"metadata",hashKey:"notification",headerRight:e.jsx(i.Toolbar,{data:a.metadata})})]})}export{I as default};
@@ -1 +1 @@
1
- import{j as t,f as d}from"./index-HxcGVcSo.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as W,R as L,N as H,L as S}from"./PageHeader-DR_M5h7z.js";import{u as I,m as U,C as c}from"./types-BMBEhoQ2.js";import{T as a,D as $,b as q}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";function X(){const p=T(),{addFilter:i,clearAll:u,serverFilters:h,headerFilters:x}=I("notifications"),{rangeFilters:m,windowMinutes:f}=A(),{entries:g,loading:y,refreshing:r,error:j,refresh:l,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"notification",limit:50,filters:{...h,...m},windowMinutes:f}),o=g.filter(e=>U(e)),F=D.useMemo(()=>[{key:"type",header:"Type",width:"150px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("types",e.payload.type)},children:e.payload.type})},{key:"recipient",header:"Recipient",minWidth:"200px",render:e=>t.jsx(a,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.recipient})},{key:"title",header:"Title",minWidth:"200px",render:e=>e.payload.title?t.jsx(a,{truncate:!0,maxWidth:"300px",children:e.payload.title}):t.jsx(a,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[i]);return y&&o.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(W,{title:"Notifications",icon:d,iconColor:"text-indigo-600 dark:text-indigo-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"notification",label:"notifications",onCleared:l},refreshing:r,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx(L,{route:"notifications"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:C,onClick:N,loading:r}),t.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>p(`/notifications/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No notifications recorded yet",error:j,onRetry:l,emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
1
+ import{j as t,f as d}from"./index-CC9YqlAO.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as W,R as L,N as H,L as S}from"./PageHeader-CwpXbfba.js";import{u as I,m as U,C as c}from"./types-7eWhJMm7.js";import{T as a,D as $,b as q}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";function X(){const p=T(),{addFilter:i,clearAll:u,serverFilters:h,headerFilters:x}=I("notifications"),{rangeFilters:m,windowMinutes:f}=A(),{entries:g,loading:y,refreshing:r,error:j,refresh:l,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"notification",limit:50,filters:{...h,...m},windowMinutes:f}),o=g.filter(e=>U(e)),F=D.useMemo(()=>[{key:"type",header:"Type",width:"150px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("types",e.payload.type)},children:e.payload.type})},{key:"recipient",header:"Recipient",minWidth:"200px",render:e=>t.jsx(a,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.recipient})},{key:"title",header:"Title",minWidth:"200px",render:e=>e.payload.title?t.jsx(a,{truncate:!0,maxWidth:"300px",children:e.payload.title}):t.jsx(a,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[i]);return y&&o.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(W,{title:"Notifications",icon:d,iconColor:"text-indigo-600 dark:text-indigo-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"notification",label:"notifications",onCleared:l},refreshing:r,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx(L,{route:"notifications"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:C,onClick:N,loading:r}),t.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>p(`/notifications/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No notifications recorded yet",error:j,onRetry:l,emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
@@ -1 +1 @@
1
- import{b as a,f as je}from"./vendor-DBTT3jXp.js";import{t as Se,z as q,p as I,v as Ne,w as Re,j as e,C as Ce,x as G,l as X,f as Ee,y as Le,k as $e,X as Fe}from"./index-HxcGVcSo.js";import{t as Ae}from"./types-BMBEhoQ2.js";import{T as De}from"./timer-I7o5QV6X.js";function Oe(){return Se("/stream")}function Ie(s,r=!0){const n=a.useRef(s),[i,o]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!r||typeof EventSource>"u")return;const d=new EventSource(Oe(),{withCredentials:!0}),u=l=>{try{n.current(JSON.parse(l.data))}catch{}};return d.addEventListener("entry",u),d.onopen=()=>o(!0),d.onerror=()=>o(!1),()=>{d.removeEventListener("entry",u),d.close(),o(!1)}},[r]),{connected:i}}function Y(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(Y).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${Y(s[n])}`).join(",")+"}"}const se=500;function ne(s,r){if(r.length===0)return s;const n=new Set(s.map(d=>d.id)),i=r.filter(d=>!n.has(d.id));if(i.length===0)return s;const o=[...i,...s];return o.length>se?o.slice(0,se):o}const ce="nestlens-auto-refresh";function qe(){try{const s=localStorage.getItem(ce);return s===null?!0:s==="true"}catch{return!0}}function Te(s){try{localStorage.setItem(ce,String(s))}catch{}}function ze(s={}){const{type:r,limit:n=50,autoRefresh:i,autoRefreshInterval:o=5e3,filters:d,windowMinutes:u}=s,l=Y(d),h=`${r}|${n}|${l}|${u??0}`,[j,N]=a.useState({key:l,value:d});j.key!==l&&N({key:l,value:d});const R=j.value,x=a.useCallback(()=>!u||u<=0?R:{...R,from:new Date(Date.now()-u*6e4).toISOString()},[R,u]),[m,f]=a.useState([]),[S,$]=a.useState(null),[C,E]=a.useState(!1),[M,F]=a.useState(null),[k,A]=a.useState(null),[y,p]=a.useState(0),[b,H]=a.useState(i??qe()),v=a.useRef(null),T=a.useRef(null),D=a.useRef(!1),W=a.useRef(null),oe=a.useRef(!0),de=S===null&&M===null,ue=C||S!==null&&S!==h,me=a.useRef(l),P=a.useRef(new Map),[,fe]=a.useState(0),Q=1e4,Z=a.useCallback(t=>{f(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0),F(null),oe.current=!1,me.current=l,$(h)},[l,h]),ee=a.useCallback(t=>{const c=t instanceof Error?t:new Error("Failed to fetch entries");F(c),console.error("Failed to fetch entries:",t),q.error("Failed to load entries"),$(h)},[h]),ge=a.useCallback(async()=>{if(!(!(k!=null&&k.oldestSequence)||!k.hasMore)){E(!0);try{const t=await I({type:r,limit:n,beforeSequence:k.oldestSequence,filters:x()});f(c=>{const g=new Set(c.map(w=>w.id));return[...c,...t.data.filter(w=>!g.has(w.id))]}),A(t.meta)}catch(t){console.error("Failed to load more entries:",t),q.error("Failed to load more entries")}finally{E(!1)}}},[r,n,k,x]),xe=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0,E(!0);try{const t=await I({type:r,limit:y||n,afterSequence:v.current,filters:x()});if(t.data.length>0){const c=Date.now();t.data.forEach(g=>{P.current.set(g.id,c)}),f(g=>ne(g,t.data)),v.current=t.meta.newestSequence,p(0)}}catch(t){console.error("Failed to load new entries:",t),q.error("Failed to load new entries")}finally{D.current=!1,E(!1)}}},[r,n,y,x]),U=a.useCallback(async()=>{E(!0);try{F(null);const t=await I({type:r,limit:n,filters:x()});f(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0)}catch(t){const c=t instanceof Error?t:new Error("Failed to refresh entries");F(c),console.error("Failed to refresh entries:",t),q.error("Failed to refresh entries")}finally{E(!1)}},[r,n,x]),he=t=>!!(t&&Object.values(t).some(c=>Array.isArray(c)?c.length>0:c!==void 0&&c!=="")),_=a.useCallback(async()=>{if(!v.current){await U();return}const t=x();try{if(!he(t)){const g=await Ne(v.current,r);p(g.data.count);return}const c=await I({type:r,limit:n,afterSequence:v.current,filters:t});p(c.data.length)}catch{}},[r,n,x,U]),ye=a.useCallback(t=>{H(t),Te(t)},[]),pe=a.useCallback(t=>{f(c=>c.map(g=>g.id===t.id?t:g))},[]);a.useEffect(()=>{let t=!0;return I({type:r,limit:n,filters:x()}).then(c=>{t&&Z(c)},c=>{t&&ee(c)}),()=>{t=!1}},[r,n,x,Z,ee]);const be=a.useCallback(t=>{const c=P.current.get(t);return c?Date.now()-c<Q:!1},[]),te=a.useCallback(()=>{const t=Date.now();let c=!1;P.current.forEach((g,w)=>{t-g>=Q&&(P.current.delete(w),c=!0)}),c&&fe(g=>g+1)},[]),B=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0;try{const t=W.current??v.current,g=(await Re(r)).data;if(typeof g=="number"&&g>t){const w=await I({type:r,limit:n,afterSequence:t,filters:x()});if(W.current=w.meta.hasMore?w.meta.newestSequence??t:g,w.data.length>0){const ve=Date.now();w.data.forEach(L=>{P.current.set(L.id,ve)});let re=0;f(L=>{const ae=ne(L,w.data);return re=ae.length-L.length,ae}),v.current=w.meta.newestSequence,A(L=>L?{...L,total:L.total+re,newestSequence:w.meta.newestSequence}:w.meta)}}}catch{}finally{D.current=!1}}},[r,n,x]);a.useEffect(()=>(b?T.current=setInterval(B,o):T.current=setInterval(_,o),()=>{T.current&&(clearInterval(T.current),T.current=null)}),[b,o,B,_]),a.useEffect(()=>{const t=setInterval(te,1e3);return()=>clearInterval(t)},[te]);const O=a.useRef(null),we=a.useCallback(t=>{r&&t.type!==r||O.current||(O.current=setTimeout(()=>{O.current=null,b?B():_()},200))},[r,b,B,_]),{connected:ke}=Ie(we);return a.useEffect(()=>()=>{O.current&&(clearTimeout(O.current),O.current=null)},[]),{entries:m,loading:de,refreshing:ue,error:M,meta:k,newEntriesCount:y,hasMore:(k==null?void 0:k.hasMore)??!1,loadMore:ge,loadNew:xe,refresh:U,setAutoRefresh:ye,autoRefreshEnabled:b,updateEntry:pe,isHighlighted:be,live:ke}}const J=[{id:"all",label:"Any time",minutes:0},{id:"5m",label:"Last 5 minutes",minutes:5},{id:"15m",label:"Last 15 minutes",minutes:15},{id:"1h",label:"Last hour",minutes:60},{id:"24h",label:"Last 24 hours",minutes:1440}],V=[{id:"any",label:"Any duration",ms:0},{id:"100",label:"Over 100ms",ms:100},{id:"500",label:"Over 500ms",ms:500},{id:"1000",label:"Over 1s",ms:1e3},{id:"5000",label:"Over 5s",ms:5e3}],K="window",z="slower",Pe=s=>J.some(r=>r.id===s),Me=s=>V.some(r=>r.id===s);function We(){var x;const[s,r]=je(),n=s.get(K),i=s.get(z),o=Pe(n)?n:"all",d=Me(i)?i:"any",u=a.useCallback((m,f,S)=>{r($=>{const C=new URLSearchParams($);return S?C.delete(m):C.set(m,f),C},{replace:!0})},[r]),l=a.useCallback(m=>u(K,m,m==="all"),[u]),h=a.useCallback(m=>u(z,m,m==="any"),[u]),j=a.useCallback(()=>{r(m=>{const f=new URLSearchParams(m);return f.delete(K),f.delete(z),f},{replace:!0})},[r]),N=((x=J.find(m=>m.id===o))==null?void 0:x.minutes)??0,R=a.useMemo(()=>{var f;const m=((f=V.find(S=>S.id===d))==null?void 0:f.ms)??0;return m>0?{minDuration:m}:{}},[d]);return{window:o,duration:d,setWindow:l,setDuration:h,windowMinutes:N,rangeFilters:R,hasRange:o!=="all"||d!=="any",clearRanges:j}}const ie="flex items-center gap-1.5 rounded-md px-2 py-1 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer focus-within:ring-2 focus-within:ring-primary-500",le="appearance-none bg-transparent text-xs font-medium text-gray-700 dark:text-gray-200 border-0 p-0 pr-1 rounded focus:outline-none focus:ring-2 focus:ring-primary-500 cursor-pointer";function Ge({route:s}){var u;const{window:r,duration:n,setWindow:i,setDuration:o}=We(),d=((u=Ae(s))==null?void 0:u.measuresDuration)??!1;return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:ie,children:[e.jsx(Ce,{className:"h-3.5 w-3.5 flex-shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Time window"}),e.jsx("select",{"aria-label":"Time window","data-testid":"window-filter",value:r,onChange:l=>i(l.target.value),className:le,children:J.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 flex-shrink-0 opacity-60","aria-hidden":"true"})]}),d&&e.jsxs("label",{className:ie,children:[e.jsx(De,{className:"h-3.5 w-3.5 flex-shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Minimum duration"}),e.jsx("select",{"aria-label":"Minimum duration","data-testid":"duration-filter",value:n,onChange:l=>o(l.target.value),className:le,children:V.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 flex-shrink-0 opacity-60","aria-hidden":"true"})]})]})}function Ye({count:s,onClick:r,loading:n}){return s===0?null:e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(Ee,{className:"h-4 w-4"}),e.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function Xe({hasMore:s,onClick:r,loading:n}){return s?e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"}),e.jsx("span",{children:"Load older entries"})]}):null}function _e({type:s,label:r,onCleared:n}){const[i,o]=a.useState(!1),[d,u]=a.useState(!1),l=a.useCallback(async()=>{if(!i){o(!0),setTimeout(()=>o(!1),5e3);return}o(!1),u(!0);try{const{message:h}=await Le(s);q.success(h),n()}catch(h){q.error(`Could not clear ${r}: ${h instanceof Error?h.message:String(h)}`)}finally{u(!1)}},[i,s,r,n]);return e.jsxs("button",{onClick:l,disabled:d,"aria-label":i?`Confirm deleting all ${r}`:`Delete all ${r}`,title:i?`Press again to delete all ${r}`:`Delete all ${r}`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${i?"bg-red-600 text-white hover:bg-red-700":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-red-600 dark:hover:text-red-400"}`,children:[e.jsx($e,{className:"h-4 w-4"}),e.jsx("span",{children:i?`Delete all ${r}?`:"Clear"})]})}function Je({title:s,icon:r,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:o,subtitle:d,loading:u,refreshing:l,onRefresh:h,clearable:j,autoRefreshEnabled:N,onAutoRefreshToggle:R,live:x,filters:m=[],onClearAllFilters:f,actions:S,filterControls:$}){const C=a.useRef(null),[E,M]=a.useState(0);a.useLayoutEffect(()=>{const y=C.current;if(!y)return;const p=()=>M(y.getBoundingClientRect().height);if(p(),typeof ResizeObserver>"u")return;const b=new ResizeObserver(p);return b.observe(y),()=>b.disconnect()},[]);const F=m.length>0,k=i??o,A=m.reduce((y,p)=>(y[p.category]||(y[p.category]=[]),y[p.category].push(p),y),{});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:C,className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:e.jsx(r,{className:`h-5 w-5 ${n}`})}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),k!==void 0&&e.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[k.toLocaleString(),o!==void 0&&i!==void 0&&i!==o&&e.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",o.toLocaleString()]})]}),d&&e.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:d})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[S,x&&e.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),e.jsx("span",{children:"Live"})]}),R&&e.jsxs("button",{onClick:()=>R(!N),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${N?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:N?"Auto-refresh enabled":"Auto-refresh disabled",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${N?"bg-green-500 animate-pulse":"bg-gray-400"}`}),e.jsx("span",{children:"Auto Refresh"})]}),j&&e.jsx(_e,{type:j.type,label:j.label,onCleared:j.onCleared}),h&&e.jsx("button",{onClick:h,disabled:!!u||!!l,"aria-busy":l,"aria-label":l?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:e.jsx(X,{className:`h-4 w-4 ${l?"animate-spin":""}`})})]})]}),$&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:$}),F&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:e.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(A).map(([y,p])=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[y,":"]}),p.map((b,H)=>e.jsxs("button",{onClick:b.onRemove,"aria-label":`Remove ${y} filter: ${b.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[e.jsx("span",{children:b.value}),e.jsx(Fe,{className:"h-3 w-3 opacity-60 group-hover:opacity-100"})]},`${b.category}-${b.value}-${H}`))]},y)),f&&m.length>1&&e.jsx("button",{onClick:f,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]}),e.jsx("div",{"aria-hidden":"true","data-testid":"page-header-spacer",style:{height:E}})]})}function Ve({tabs:s,activeTab:r,onChange:n}){return e.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>e.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&e.jsx("span",{className:`ml-1.5 text-xs ${r===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function Qe({label:s,enabled:r,onChange:n,icon:i}){return e.jsxs("button",{onClick:()=>n(!r),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&e.jsx(i,{className:"h-4 w-4"}),e.jsx("span",{children:s})]})}export{Ve as F,Xe as L,Ye as N,Je as P,Ge as R,Qe as T,ze as a,We as u};
1
+ import{b as a,f as je}from"./vendor-DBTT3jXp.js";import{t as Se,z as q,p as I,v as Ne,w as Re,j as e,C as Ce,x as G,l as X,f as Ee,y as Le,k as $e,X as Fe}from"./index-CC9YqlAO.js";import{t as Ae}from"./types-7eWhJMm7.js";import{T as De}from"./timer-DiBZzrwD.js";function Oe(){return Se("/stream")}function Ie(s,r=!0){const n=a.useRef(s),[i,o]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!r||typeof EventSource>"u")return;const d=new EventSource(Oe(),{withCredentials:!0}),u=l=>{try{n.current(JSON.parse(l.data))}catch{}};return d.addEventListener("entry",u),d.onopen=()=>o(!0),d.onerror=()=>o(!1),()=>{d.removeEventListener("entry",u),d.close(),o(!1)}},[r]),{connected:i}}function Y(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(Y).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${Y(s[n])}`).join(",")+"}"}const se=500;function ne(s,r){if(r.length===0)return s;const n=new Set(s.map(d=>d.id)),i=r.filter(d=>!n.has(d.id));if(i.length===0)return s;const o=[...i,...s];return o.length>se?o.slice(0,se):o}const ce="nestlens-auto-refresh";function qe(){try{const s=localStorage.getItem(ce);return s===null?!0:s==="true"}catch{return!0}}function Te(s){try{localStorage.setItem(ce,String(s))}catch{}}function ze(s={}){const{type:r,limit:n=50,autoRefresh:i,autoRefreshInterval:o=5e3,filters:d,windowMinutes:u}=s,l=Y(d),h=`${r}|${n}|${l}|${u??0}`,[j,N]=a.useState({key:l,value:d});j.key!==l&&N({key:l,value:d});const R=j.value,x=a.useCallback(()=>!u||u<=0?R:{...R,from:new Date(Date.now()-u*6e4).toISOString()},[R,u]),[m,f]=a.useState([]),[S,$]=a.useState(null),[C,E]=a.useState(!1),[M,F]=a.useState(null),[k,A]=a.useState(null),[y,p]=a.useState(0),[b,H]=a.useState(i??qe()),v=a.useRef(null),T=a.useRef(null),D=a.useRef(!1),W=a.useRef(null),oe=a.useRef(!0),de=S===null&&M===null,ue=C||S!==null&&S!==h,me=a.useRef(l),P=a.useRef(new Map),[,fe]=a.useState(0),Q=1e4,Z=a.useCallback(t=>{f(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0),F(null),oe.current=!1,me.current=l,$(h)},[l,h]),ee=a.useCallback(t=>{const c=t instanceof Error?t:new Error("Failed to fetch entries");F(c),console.error("Failed to fetch entries:",t),q.error("Failed to load entries"),$(h)},[h]),ge=a.useCallback(async()=>{if(!(!(k!=null&&k.oldestSequence)||!k.hasMore)){E(!0);try{const t=await I({type:r,limit:n,beforeSequence:k.oldestSequence,filters:x()});f(c=>{const g=new Set(c.map(w=>w.id));return[...c,...t.data.filter(w=>!g.has(w.id))]}),A(t.meta)}catch(t){console.error("Failed to load more entries:",t),q.error("Failed to load more entries")}finally{E(!1)}}},[r,n,k,x]),xe=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0,E(!0);try{const t=await I({type:r,limit:y||n,afterSequence:v.current,filters:x()});if(t.data.length>0){const c=Date.now();t.data.forEach(g=>{P.current.set(g.id,c)}),f(g=>ne(g,t.data)),v.current=t.meta.newestSequence,p(0)}}catch(t){console.error("Failed to load new entries:",t),q.error("Failed to load new entries")}finally{D.current=!1,E(!1)}}},[r,n,y,x]),U=a.useCallback(async()=>{E(!0);try{F(null);const t=await I({type:r,limit:n,filters:x()});f(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0)}catch(t){const c=t instanceof Error?t:new Error("Failed to refresh entries");F(c),console.error("Failed to refresh entries:",t),q.error("Failed to refresh entries")}finally{E(!1)}},[r,n,x]),he=t=>!!(t&&Object.values(t).some(c=>Array.isArray(c)?c.length>0:c!==void 0&&c!=="")),_=a.useCallback(async()=>{if(!v.current){await U();return}const t=x();try{if(!he(t)){const g=await Ne(v.current,r);p(g.data.count);return}const c=await I({type:r,limit:n,afterSequence:v.current,filters:t});p(c.data.length)}catch{}},[r,n,x,U]),ye=a.useCallback(t=>{H(t),Te(t)},[]),pe=a.useCallback(t=>{f(c=>c.map(g=>g.id===t.id?t:g))},[]);a.useEffect(()=>{let t=!0;return I({type:r,limit:n,filters:x()}).then(c=>{t&&Z(c)},c=>{t&&ee(c)}),()=>{t=!1}},[r,n,x,Z,ee]);const be=a.useCallback(t=>{const c=P.current.get(t);return c?Date.now()-c<Q:!1},[]),te=a.useCallback(()=>{const t=Date.now();let c=!1;P.current.forEach((g,w)=>{t-g>=Q&&(P.current.delete(w),c=!0)}),c&&fe(g=>g+1)},[]),B=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0;try{const t=W.current??v.current,g=(await Re(r)).data;if(typeof g=="number"&&g>t){const w=await I({type:r,limit:n,afterSequence:t,filters:x()});if(W.current=w.meta.hasMore?w.meta.newestSequence??t:g,w.data.length>0){const ve=Date.now();w.data.forEach(L=>{P.current.set(L.id,ve)});let re=0;f(L=>{const ae=ne(L,w.data);return re=ae.length-L.length,ae}),v.current=w.meta.newestSequence,A(L=>L?{...L,total:L.total+re,newestSequence:w.meta.newestSequence}:w.meta)}}}catch{}finally{D.current=!1}}},[r,n,x]);a.useEffect(()=>(b?T.current=setInterval(B,o):T.current=setInterval(_,o),()=>{T.current&&(clearInterval(T.current),T.current=null)}),[b,o,B,_]),a.useEffect(()=>{const t=setInterval(te,1e3);return()=>clearInterval(t)},[te]);const O=a.useRef(null),we=a.useCallback(t=>{r&&t.type!==r||O.current||(O.current=setTimeout(()=>{O.current=null,b?B():_()},200))},[r,b,B,_]),{connected:ke}=Ie(we);return a.useEffect(()=>()=>{O.current&&(clearTimeout(O.current),O.current=null)},[]),{entries:m,loading:de,refreshing:ue,error:M,meta:k,newEntriesCount:y,hasMore:(k==null?void 0:k.hasMore)??!1,loadMore:ge,loadNew:xe,refresh:U,setAutoRefresh:ye,autoRefreshEnabled:b,updateEntry:pe,isHighlighted:be,live:ke}}const J=[{id:"all",label:"Any time",minutes:0},{id:"5m",label:"Last 5 minutes",minutes:5},{id:"15m",label:"Last 15 minutes",minutes:15},{id:"1h",label:"Last hour",minutes:60},{id:"24h",label:"Last 24 hours",minutes:1440}],V=[{id:"any",label:"Any duration",ms:0},{id:"100",label:"Over 100ms",ms:100},{id:"500",label:"Over 500ms",ms:500},{id:"1000",label:"Over 1s",ms:1e3},{id:"5000",label:"Over 5s",ms:5e3}],K="window",z="slower",Pe=s=>J.some(r=>r.id===s),Me=s=>V.some(r=>r.id===s);function We(){var x;const[s,r]=je(),n=s.get(K),i=s.get(z),o=Pe(n)?n:"all",d=Me(i)?i:"any",u=a.useCallback((m,f,S)=>{r($=>{const C=new URLSearchParams($);return S?C.delete(m):C.set(m,f),C},{replace:!0})},[r]),l=a.useCallback(m=>u(K,m,m==="all"),[u]),h=a.useCallback(m=>u(z,m,m==="any"),[u]),j=a.useCallback(()=>{r(m=>{const f=new URLSearchParams(m);return f.delete(K),f.delete(z),f},{replace:!0})},[r]),N=((x=J.find(m=>m.id===o))==null?void 0:x.minutes)??0,R=a.useMemo(()=>{var f;const m=((f=V.find(S=>S.id===d))==null?void 0:f.ms)??0;return m>0?{minDuration:m}:{}},[d]);return{window:o,duration:d,setWindow:l,setDuration:h,windowMinutes:N,rangeFilters:R,hasRange:o!=="all"||d!=="any",clearRanges:j}}const ie="flex items-center gap-1.5 rounded-md px-2 py-1 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer focus-within:ring-2 focus-within:ring-primary-500",le="appearance-none bg-transparent text-xs font-medium text-gray-700 dark:text-gray-200 border-0 p-0 pr-1 rounded focus:outline-none focus:ring-2 focus:ring-primary-500 cursor-pointer";function Ge({route:s}){var u;const{window:r,duration:n,setWindow:i,setDuration:o}=We(),d=((u=Ae(s))==null?void 0:u.measuresDuration)??!1;return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:ie,children:[e.jsx(Ce,{className:"h-3.5 w-3.5 flex-shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Time window"}),e.jsx("select",{"aria-label":"Time window","data-testid":"window-filter",value:r,onChange:l=>i(l.target.value),className:le,children:J.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 flex-shrink-0 opacity-60","aria-hidden":"true"})]}),d&&e.jsxs("label",{className:ie,children:[e.jsx(De,{className:"h-3.5 w-3.5 flex-shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Minimum duration"}),e.jsx("select",{"aria-label":"Minimum duration","data-testid":"duration-filter",value:n,onChange:l=>o(l.target.value),className:le,children:V.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 flex-shrink-0 opacity-60","aria-hidden":"true"})]})]})}function Ye({count:s,onClick:r,loading:n}){return s===0?null:e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(Ee,{className:"h-4 w-4"}),e.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function Xe({hasMore:s,onClick:r,loading:n}){return s?e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"}),e.jsx("span",{children:"Load older entries"})]}):null}function _e({type:s,label:r,onCleared:n}){const[i,o]=a.useState(!1),[d,u]=a.useState(!1),l=a.useCallback(async()=>{if(!i){o(!0),setTimeout(()=>o(!1),5e3);return}o(!1),u(!0);try{const{message:h}=await Le(s);q.success(h),n()}catch(h){q.error(`Could not clear ${r}: ${h instanceof Error?h.message:String(h)}`)}finally{u(!1)}},[i,s,r,n]);return e.jsxs("button",{onClick:l,disabled:d,"aria-label":i?`Confirm deleting all ${r}`:`Delete all ${r}`,title:i?`Press again to delete all ${r}`:`Delete all ${r}`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${i?"bg-red-600 text-white hover:bg-red-700":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-red-600 dark:hover:text-red-400"}`,children:[e.jsx($e,{className:"h-4 w-4"}),e.jsx("span",{children:i?`Delete all ${r}?`:"Clear"})]})}function Je({title:s,icon:r,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:o,subtitle:d,loading:u,refreshing:l,onRefresh:h,clearable:j,autoRefreshEnabled:N,onAutoRefreshToggle:R,live:x,filters:m=[],onClearAllFilters:f,actions:S,filterControls:$}){const C=a.useRef(null),[E,M]=a.useState(0);a.useLayoutEffect(()=>{const y=C.current;if(!y)return;const p=()=>M(y.getBoundingClientRect().height);if(p(),typeof ResizeObserver>"u")return;const b=new ResizeObserver(p);return b.observe(y),()=>b.disconnect()},[]);const F=m.length>0,k=i??o,A=m.reduce((y,p)=>(y[p.category]||(y[p.category]=[]),y[p.category].push(p),y),{});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:C,className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:e.jsx(r,{className:`h-5 w-5 ${n}`})}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),k!==void 0&&e.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[k.toLocaleString(),o!==void 0&&i!==void 0&&i!==o&&e.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",o.toLocaleString()]})]}),d&&e.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:d})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[S,x&&e.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),e.jsx("span",{children:"Live"})]}),R&&e.jsxs("button",{onClick:()=>R(!N),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${N?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:N?"Auto-refresh enabled":"Auto-refresh disabled",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${N?"bg-green-500 animate-pulse":"bg-gray-400"}`}),e.jsx("span",{children:"Auto Refresh"})]}),j&&e.jsx(_e,{type:j.type,label:j.label,onCleared:j.onCleared}),h&&e.jsx("button",{onClick:h,disabled:!!u||!!l,"aria-busy":l,"aria-label":l?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:e.jsx(X,{className:`h-4 w-4 ${l?"animate-spin":""}`})})]})]}),$&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:$}),F&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:e.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(A).map(([y,p])=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[y,":"]}),p.map((b,H)=>e.jsxs("button",{onClick:b.onRemove,"aria-label":`Remove ${y} filter: ${b.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[e.jsx("span",{children:b.value}),e.jsx(Fe,{className:"h-3 w-3 opacity-60 group-hover:opacity-100"})]},`${b.category}-${b.value}-${H}`))]},y)),f&&m.length>1&&e.jsx("button",{onClick:f,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]}),e.jsx("div",{"aria-hidden":"true","data-testid":"page-header-spacer",style:{height:E}})]})}function Ve({tabs:s,activeTab:r,onChange:n}){return e.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>e.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&e.jsx("span",{className:`ml-1.5 text-xs ${r===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function Qe({label:s,enabled:r,onChange:n,icon:i}){return e.jsxs("button",{onClick:()=>n(!r),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&e.jsx(i,{className:"h-4 w-4"}),e.jsx("span",{children:s})]})}export{Ve as F,Xe as L,Ye as N,Je as P,Ge as R,Qe as T,ze as a,We as u};
@@ -1 +1 @@
1
- import{j as r,D as d}from"./index-HxcGVcSo.js";import{e as P,b as u}from"./vendor-DBTT3jXp.js";import{f as Q,p as B}from"./date-Dwgqy666.js";import{u as O,a as W,P as H,T as I,R as Z,N as $,L as z}from"./PageHeader-DR_M5h7z.js";import{u as G,a as J,C as K}from"./types-BMBEhoQ2.js";import{E as U}from"./EntrySearchInput-BF9N_f7y.js";import{T as c,D as V,a as X,b as Y}from"./DataTable-Cz2phOFe.js";import{Z as h}from"./zap-DMB3w7zm.js";import"./timer-I7o5QV6X.js";import"./search-VPXcw9Ki.js";function de(){const p=P(),[i,m]=u.useState(!1),{addFilter:l,clearAll:x,serverFilters:g,headerFilters:y}=G("queries"),{rangeFilters:f,windowMinutes:w}=O(),j={...g,slow:i?!0:void 0},{entries:b,loading:C,refreshing:s,error:k,refresh:n,newEntriesCount:T,hasMore:N,loadMore:q,loadNew:v,autoRefreshEnabled:E,live:S,setAutoRefresh:F,meta:a,isHighlighted:R}=W({type:"query",limit:50,filters:{...j,...f},windowMinutes:w}),t=b.filter(e=>J(e)),D=u.useMemo(()=>[{key:"source",header:"Source",width:"120px",render:e=>r.jsx(K,{listType:"queries",filterType:"sources",children:e.payload.source||"unknown"})},{key:"query",header:"Query",minWidth:"300px",render:e=>r.jsxs("div",{className:"flex items-start space-x-2",children:[e.payload.slow&&r.jsx(h,{className:"h-4 w-4 text-yellow-500 flex-shrink-0 mt-0.5"}),r.jsx(c,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.query.length>100?e.payload.query.substring(0,100)+"...":e.payload.query})]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>r.jsx(V,{ms:e.payload.duration||0,slowThreshold:e.payload.slow?0:1e3})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const L=(e.payload.source||"unknown").toLowerCase(),M=(e.tags??[]).filter(o=>o.toLowerCase()!==L);return r.jsx(X,{tags:M,max:3,onTagClick:(o,A)=>{A.stopPropagation(),l("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>r.jsx(c,{secondary:!0,className:"text-xs",children:Q(B(e.createdAt),{addSuffix:!0})})}],[l]);return C&&t.length===0?r.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):r.jsxs("div",{children:[r.jsx(H,{title:"Queries",icon:d,iconColor:"text-purple-600 dark:text-purple-400",count:t.length,totalCount:a==null?void 0:a.total,clearable:{type:"query",label:"queries",onCleared:n},refreshing:s,autoRefreshEnabled:E,live:S,onAutoRefreshToggle:F,filters:y,filterControls:r.jsx(Z,{route:"queries"}),onClearAllFilters:x,actions:r.jsx(I,{label:"Slow Only",enabled:i,onChange:m,icon:h})}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(U,{placeholder:"Search by SQL, table, source, tag, or content..."}),r.jsx($,{count:T,onClick:v,loading:s}),r.jsx(Y,{columns:D,data:t,keyExtractor:e=>e.id,onRowClick:e=>p(`/queries/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No queries recorded yet",error:k,onRetry:n,emptyIcon:r.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),r.jsx(z,{hasMore:N,onClick:q,loading:s})]})]})}export{de as default};
1
+ import{j as r,D as d}from"./index-CC9YqlAO.js";import{e as P,b as u}from"./vendor-DBTT3jXp.js";import{f as Q,p as B}from"./date-Dwgqy666.js";import{u as O,a as W,P as H,T as I,R as Z,N as $,L as z}from"./PageHeader-CwpXbfba.js";import{u as G,a as J,C as K}from"./types-7eWhJMm7.js";import{E as U}from"./EntrySearchInput-Cl30X6WS.js";import{T as c,D as V,a as X,b as Y}from"./DataTable-ChUNEmWG.js";import{Z as h}from"./zap-DaVFRg-y.js";import"./timer-DiBZzrwD.js";import"./search-DlyuMX5Q.js";function de(){const p=P(),[i,m]=u.useState(!1),{addFilter:l,clearAll:x,serverFilters:g,headerFilters:y}=G("queries"),{rangeFilters:f,windowMinutes:w}=O(),j={...g,slow:i?!0:void 0},{entries:b,loading:C,refreshing:s,error:k,refresh:n,newEntriesCount:T,hasMore:N,loadMore:q,loadNew:v,autoRefreshEnabled:E,live:S,setAutoRefresh:F,meta:a,isHighlighted:R}=W({type:"query",limit:50,filters:{...j,...f},windowMinutes:w}),t=b.filter(e=>J(e)),D=u.useMemo(()=>[{key:"source",header:"Source",width:"120px",render:e=>r.jsx(K,{listType:"queries",filterType:"sources",children:e.payload.source||"unknown"})},{key:"query",header:"Query",minWidth:"300px",render:e=>r.jsxs("div",{className:"flex items-start space-x-2",children:[e.payload.slow&&r.jsx(h,{className:"h-4 w-4 text-yellow-500 flex-shrink-0 mt-0.5"}),r.jsx(c,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.query.length>100?e.payload.query.substring(0,100)+"...":e.payload.query})]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>r.jsx(V,{ms:e.payload.duration||0,slowThreshold:e.payload.slow?0:1e3})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const L=(e.payload.source||"unknown").toLowerCase(),M=(e.tags??[]).filter(o=>o.toLowerCase()!==L);return r.jsx(X,{tags:M,max:3,onTagClick:(o,A)=>{A.stopPropagation(),l("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>r.jsx(c,{secondary:!0,className:"text-xs",children:Q(B(e.createdAt),{addSuffix:!0})})}],[l]);return C&&t.length===0?r.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):r.jsxs("div",{children:[r.jsx(H,{title:"Queries",icon:d,iconColor:"text-purple-600 dark:text-purple-400",count:t.length,totalCount:a==null?void 0:a.total,clearable:{type:"query",label:"queries",onCleared:n},refreshing:s,autoRefreshEnabled:E,live:S,onAutoRefreshToggle:F,filters:y,filterControls:r.jsx(Z,{route:"queries"}),onClearAllFilters:x,actions:r.jsx(I,{label:"Slow Only",enabled:i,onChange:m,icon:h})}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(U,{placeholder:"Search by SQL, table, source, tag, or content..."}),r.jsx($,{count:T,onClick:v,loading:s}),r.jsx(Y,{columns:D,data:t,keyExtractor:e=>e.id,onRowClick:e=>p(`/queries/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No queries recorded yet",error:k,onRetry:n,emptyIcon:r.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),r.jsx(z,{hasMore:N,onClick:q,loading:s})]})]})}export{de as default};
@@ -1,4 +1,4 @@
1
- import{c as RT,j as r,z as UE}from"./index-HxcGVcSo.js";import{p as oE,f as PT}from"./date-Dwgqy666.js";import{D as K,f as nT}from"./DetailRow-DKG3Vf9j.js";import{C as GE}from"./types-BMBEhoQ2.js";import{g as iT,b as g}from"./vendor-DBTT3jXp.js";import{a as MT,b as UT}from"./EntryDetailPage-BdBZLbAf.js";import"./search-VPXcw9Ki.js";/**
1
+ import{c as RT,j as r,z as UE}from"./index-CC9YqlAO.js";import{p as oE,f as PT}from"./date-Dwgqy666.js";import{D as K,f as nT}from"./DetailRow-BX0zpKTe.js";import{C as GE}from"./types-7eWhJMm7.js";import{g as iT,b as g}from"./vendor-DBTT3jXp.js";import{a as MT,b as UT}from"./EntryDetailPage-NLzBL3a7.js";import"./search-DlyuMX5Q.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e,D as u,b as f,C as y}from"./index-HxcGVcSo.js";import{b as N}from"./vendor-DBTT3jXp.js";import{p as o,f as v}from"./date-Dwgqy666.js";import{D as a,f as k}from"./DetailRow-DKG3Vf9j.js";import{C as n}from"./types-BMBEhoQ2.js";import{u as x,C as m,T as C}from"./EntryDetailPage-BdBZLbAf.js";import{C as w}from"./CopyButton-DfPqcshv.js";import{C as T}from"./circle-check-big-CiGeQW9J.js";import{C as g}from"./circle-x-B-V5s-zK.js";import"./search-VPXcw9Ki.js";function H({entry:h}){const{payload:s,createdAt:i}=h,d=x(),l=x(),[c,p]=N.useState("args"),r=s.status==="success"?{icon:T,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},b=r.icon,t=[];s.args&&s.args.length>0&&t.push({id:"args",label:"Arguments",content:e.jsx(m,{data:s.args,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),s.result!==void 0&&t.push({id:"result",label:"Result",content:e.jsx(m,{data:s.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})});const j=()=>{if(c==="args"&&s.args&&s.args.length>0)return e.jsx(d.Toolbar,{data:s.args});if(c==="result"&&s.result!==void 0)return e.jsx(l.Toolbar,{data:s.result})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(u,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.command}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Redis Command"})]})]}),e.jsx(w,{text:s.command,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:s.command})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:s.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(a,{label:"Time",value:e.jsxs("span",{children:[k(o(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(o(i),{addSuffix:!0}),")"]})]})}),e.jsx(a,{label:"Command",value:e.jsx(n,{listType:"redis",filterType:"commands",filterValue:s.command,children:s.command})}),s.keyPattern&&e.jsx(a,{label:"Key Pattern",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.keyPattern})}),e.jsx(a,{label:"Status",value:e.jsx(n,{listType:"redis",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(a,{label:"Duration",value:`${s.duration}ms`})]})})]}),s.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:s.error})})]}),t.length>0&&e.jsx(C,{tabs:t,defaultTab:"args",hashKey:"redis",headerRight:j(),onTabChange:p})]})}export{H as default};
1
+ import{j as e,D as u,b as f,C as y}from"./index-CC9YqlAO.js";import{b as N}from"./vendor-DBTT3jXp.js";import{p as o,f as v}from"./date-Dwgqy666.js";import{D as a,f as k}from"./DetailRow-BX0zpKTe.js";import{C as n}from"./types-7eWhJMm7.js";import{u as x,C as m,T as C}from"./EntryDetailPage-NLzBL3a7.js";import{C as w}from"./CopyButton-8NQFvMIW.js";import{C as T}from"./circle-check-big-DcP6kxnu.js";import{C as g}from"./circle-x-C5FZ5L0I.js";import"./search-DlyuMX5Q.js";function H({entry:h}){const{payload:s,createdAt:i}=h,d=x(),l=x(),[c,p]=N.useState("args"),r=s.status==="success"?{icon:T,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},b=r.icon,t=[];s.args&&s.args.length>0&&t.push({id:"args",label:"Arguments",content:e.jsx(m,{data:s.args,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),s.result!==void 0&&t.push({id:"result",label:"Result",content:e.jsx(m,{data:s.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})});const j=()=>{if(c==="args"&&s.args&&s.args.length>0)return e.jsx(d.Toolbar,{data:s.args});if(c==="result"&&s.result!==void 0)return e.jsx(l.Toolbar,{data:s.result})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(u,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.command}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Redis Command"})]})]}),e.jsx(w,{text:s.command,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:s.command})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:s.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(a,{label:"Time",value:e.jsxs("span",{children:[k(o(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(o(i),{addSuffix:!0}),")"]})]})}),e.jsx(a,{label:"Command",value:e.jsx(n,{listType:"redis",filterType:"commands",filterValue:s.command,children:s.command})}),s.keyPattern&&e.jsx(a,{label:"Key Pattern",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.keyPattern})}),e.jsx(a,{label:"Status",value:e.jsx(n,{listType:"redis",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(a,{label:"Duration",value:`${s.duration}ms`})]})})]}),s.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:s.error})})]}),t.length>0&&e.jsx(C,{tabs:t,defaultTab:"args",hashKey:"redis",headerRight:j(),onTabChange:p})]})}export{H as default};
@@ -1 +1 @@
1
- import{j as a,D as l}from"./index-HxcGVcSo.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{f as M,p as T}from"./date-Dwgqy666.js";import{u as A,a as B,P as L,R as H,N as S,L as W}from"./PageHeader-DR_M5h7z.js";import{u as I,k as K,C as c}from"./types-BMBEhoQ2.js";import{T as n,D as U,b as $}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";function X(){const m=D(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("redis"),{rangeFilters:x,windowMinutes:g}=A(),{entries:y,loading:f,refreshing:r,error:j,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:R,setAutoRefresh:E,meta:s,isHighlighted:P}=B({type:"redis",limit:50,filters:{...h,...x},windowMinutes:g}),o=y.filter(e=>K(e)),v=F.useMemo(()=>[{key:"command",header:"Command",width:"120px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("commands",e.payload.command)},className:"font-mono",children:e.payload.command})},{key:"keyPattern",header:"Key Pattern",minWidth:"200px",render:e=>e.payload.keyPattern?a.jsx(n,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.keyPattern}):a.jsx(n,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(U,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(n,{secondary:!0,className:"text-xs",children:M(T(e.createdAt),{addSuffix:!0})})}],[t]);return f&&o.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(L,{title:"Redis",icon:l,iconColor:"text-red-600 dark:text-red-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"redis",label:"redis",onCleared:d},refreshing:r,autoRefreshEnabled:N,live:R,onAutoRefreshToggle:E,filters:p,filterControls:a.jsx(H,{route:"redis"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(S,{count:C,onClick:b,loading:r}),a.jsx($,{columns:v,data:o,keyExtractor:e=>e.id,onRowClick:e=>m(`/redis/${e.id}`),rowClassName:e=>P(e.id)?"highlight-new":"",emptyMessage:"No Redis commands recorded yet",error:j,onRetry:d,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(W,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
1
+ import{j as a,D as l}from"./index-CC9YqlAO.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{f as M,p as T}from"./date-Dwgqy666.js";import{u as A,a as B,P as L,R as H,N as S,L as W}from"./PageHeader-CwpXbfba.js";import{u as I,k as K,C as c}from"./types-7eWhJMm7.js";import{T as n,D as U,b as $}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";function X(){const m=D(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("redis"),{rangeFilters:x,windowMinutes:g}=A(),{entries:y,loading:f,refreshing:r,error:j,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:R,setAutoRefresh:E,meta:s,isHighlighted:P}=B({type:"redis",limit:50,filters:{...h,...x},windowMinutes:g}),o=y.filter(e=>K(e)),v=F.useMemo(()=>[{key:"command",header:"Command",width:"120px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("commands",e.payload.command)},className:"font-mono",children:e.payload.command})},{key:"keyPattern",header:"Key Pattern",minWidth:"200px",render:e=>e.payload.keyPattern?a.jsx(n,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.keyPattern}):a.jsx(n,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(U,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(n,{secondary:!0,className:"text-xs",children:M(T(e.createdAt),{addSuffix:!0})})}],[t]);return f&&o.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(L,{title:"Redis",icon:l,iconColor:"text-red-600 dark:text-red-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"redis",label:"redis",onCleared:d},refreshing:r,autoRefreshEnabled:N,live:R,onAutoRefreshToggle:E,filters:p,filterControls:a.jsx(H,{route:"redis"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(S,{count:C,onClick:b,loading:r}),a.jsx($,{columns:v,data:o,keyExtractor:e=>e.id,onRowClick:e=>m(`/redis/${e.id}`),rowClassName:e=>P(e.id)?"highlight-new":"",emptyMessage:"No Redis commands recorded yet",error:j,onRetry:d,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(W,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
@@ -1 +1 @@
1
- import{j as e,i as f}from"./index-HxcGVcSo.js";import{b,L as p}from"./vendor-DBTT3jXp.js";import{f as q,p as k}from"./date-Dwgqy666.js";import{D as y,f as R}from"./DetailRow-DKG3Vf9j.js";import{b as D,c as L,a as H,d as U,e as V,f as O,g as F,C as x,B as E}from"./types-BMBEhoQ2.js";import{u as M,T as S,C as v}from"./EntryDetailPage-BdBZLbAf.js";import{U as I}from"./UserCard-Bp6Bf3OI.js";import"./search-VPXcw9Ki.js";function j(r){return r<1?"<1 ms":r<1e3?`${r.toFixed(2)} ms`:`${(r/1e3).toFixed(2)} s`}function w(r,s){return r.length<=s?r:r.substring(0,s)+"..."}function J({entries:r}){const s=b.useMemo(()=>{const a=r.filter(o=>D(o)),d=r.filter(o=>L(o)),c=r.filter(o=>H(o)),m=r.filter(o=>U(o)),n=r.filter(o=>V(o)),h=r.filter(o=>O(o)),u=r.filter(o=>F(o));return{exceptions:a,logs:d,queries:c,events:m,jobs:n,cache:h,mail:u}},[r]),t=b.useMemo(()=>[{id:"exceptions",label:"Exceptions",entries:s.exceptions,color:"bg-red-500"},{id:"logs",label:"Logs",entries:s.logs,color:"bg-blue-500"},{id:"queries",label:"Queries",entries:s.queries,color:"bg-purple-500"},{id:"events",label:"Events",entries:s.events,color:"bg-green-500"},{id:"jobs",label:"Jobs",entries:s.jobs,color:"bg-yellow-500"},{id:"cache",label:"Cache",entries:s.cache,color:"bg-cyan-500"},{id:"mail",label:"Mail",entries:s.mail,color:"bg-pink-500"}].filter(d=>d.entries.length>0),[s]),[l,i]=b.useState(()=>s.exceptions.length>0?"exceptions":s.logs.length>0?"logs":s.queries.length>0?"queries":s.events.length>0?"events":s.jobs.length>0?"jobs":s.cache.length>0?"cache":s.mail.length>0?"mail":"queries"),g=b.useMemo(()=>{if(s.queries.length===0)return null;const a=s.queries.reduce((m,n)=>m+n.payload.duration,0),d=new Set(s.queries.map(m=>m.payload.query)).size,c=s.queries.length-d;return{total:a,duplicates:c}},[s.queries]);return t.length===0?null:e.jsxs("div",{className:"card overflow-hidden",children:[e.jsx("div",{className:"flex flex-wrap gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.map(a=>e.jsxs("button",{onClick:()=>i(a.id),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${l===a.id?"bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[a.label,e.jsx("span",{className:`inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-medium rounded ${l===a.id?"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300":"bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-400"}`,children:a.entries.length})]},a.id))}),e.jsxs("div",{children:[l==="queries"&&s.queries.length>0&&e.jsxs("div",{children:[g&&e.jsxs("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800/50 text-sm text-gray-600 dark:text-gray-400 flex justify-between",children:[e.jsxs("span",{children:[s.queries.length," queries, ",g.duplicates," of which are duplicated"]}),e.jsxs("span",{children:["Total: ",e.jsx("strong",{children:j(g.total)})]})]}),e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.queries.map(a=>e.jsxs(p,{to:`/queries/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate flex-1 mr-4",children:w(a.payload.query,70)}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.slow&&e.jsx(x,{listType:"queries",children:"SLOW"}),e.jsx("span",{className:`text-sm font-mono ${a.payload.slow?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400"}`,children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]}),l==="exceptions"&&s.exceptions.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.exceptions.map(a=>e.jsx(p,{to:`/exceptions/${a.id}`,className:"block px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{listType:"exceptions",filterType:"names",filterValue:a.payload.name,children:a.payload.name}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:w(a.payload.message,60)})]}),a.payload.context&&e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-500 mt-1",children:["at ",a.payload.context]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]})},a.id))}),l==="logs"&&s.logs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.logs.map(a=>e.jsxs(p,{to:`/logs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"logs",filterType:"levels",filterValue:a.payload.level,children:a.payload.level.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.message,60)}),a.payload.context&&e.jsx(x,{listType:"logs",filterType:"contexts",filterValue:a.payload.context,className:"text-xs",children:a.payload.context})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="events"&&s.events.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.events.map(a=>e.jsxs(p,{to:`/events/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"events",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:[a.payload.listeners.length," listener(s)"]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="jobs"&&s.jobs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.jobs.map(a=>e.jsxs(p,{to:`/jobs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"jobs",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["on ",a.payload.queue]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.duration!==void 0&&e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="cache"&&s.cache.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.cache.map(a=>e.jsxs(p,{to:`/cache/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"cache",filterType:"operations",filterValue:a.payload.operation,children:a.payload.operation.toUpperCase()}),e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.key,50)}),a.payload.hit!==void 0&&e.jsx(x,{listType:"cache",clickable:!1,children:a.payload.hit?"HIT":"MISS"})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="mail"&&s.mail.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.mail.map(a=>e.jsxs(p,{to:`/mail/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"mail",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:a.payload.subject}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["to ",Array.isArray(a.payload.to)?a.payload.to.join(", "):a.payload.to]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]})]})}const K={request:"bg-blue-500",query:"bg-purple-500",graphql:"bg-fuchsia-500",exception:"bg-red-500",log:"bg-green-500",job:"bg-yellow-500",schedule:"bg-gray-500",batch:"bg-lime-500",command:"bg-slate-500",cache:"bg-cyan-500",redis:"bg-rose-500",model:"bg-violet-500","http-client":"bg-indigo-500",mail:"bg-orange-500",notification:"bg-pink-500",view:"bg-teal-500",gate:"bg-amber-500",dump:"bg-emerald-500",event:"bg-sky-500"},$=r=>r<1?"<1ms":r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,P=["query","operationName","key","url","path","name","message","command","operation"],Q=r=>{const s=r.payload,l=(P.map(i=>s[i]).find(i=>typeof i=="string"&&i.trim().length>0)??r.type).replace(/\s+/g," ").trim();return l.length>70?`${l.slice(0,70)}…`:l};function z({request:r,related:s}){const{spans:t,window:l}=b.useMemo(()=>{const g=[r,...s].map(n=>{const h=k(n.createdAt).getTime(),u=Number(n.payload.duration??0),o=Number.isFinite(u)&&u>0?u:0;return{entry:n,offset:h-o,duration:o,label:Q(n)}}),a=g.map(n=>n.offset),d=g.map(n=>n.offset+n.duration),c=Math.min(...a),m=Math.max(...d);return{window:Math.max(1,m-c),spans:g.map(n=>({...n,offset:n.offset-c})).sort((n,h)=>n.offset-h.offset||n.duration-h.duration)}},[r,s]);return t.length<=1?null:e.jsxs("div",{className:"card overflow-hidden","data-testid":"request-timeline",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Timeline"}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.length," entries over ",$(l)]})]}),e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:t.map(i=>{const g=Math.min(Math.max(i.duration/l*100,.75),100),a=Math.min(i.offset/l*100,100-g),d=K[i.entry.type]??"bg-gray-400";return e.jsxs(p,{to:`/entries/${i.entry.id}`,className:"flex items-center gap-3 px-4 py-2 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",children:[e.jsx("span",{className:"w-24 shrink-0 text-xs font-medium text-gray-500 dark:text-gray-400 capitalize",children:i.entry.type}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-mono text-gray-700 dark:text-gray-300 truncate",title:i.label,children:i.label}),e.jsx("span",{className:"relative w-1/2 shrink-0 h-4 rounded bg-gray-100 dark:bg-gray-800",children:e.jsx("span",{className:`absolute top-0 h-full rounded ${d}`,style:{left:`${a}%`,width:`${g}%`},"data-testid":"timeline-bar"})}),e.jsx("span",{className:"w-16 shrink-0 text-right text-xs tabular-nums text-gray-500 dark:text-gray-400",children:i.duration>0?$(i.duration):""})]},`${i.entry.type}-${i.entry.id}`)})})]})}function G(r){if(r===0)return"0 B";const s=1024,t=["B","KB","MB","GB"],l=Math.floor(Math.log(r)/Math.log(s));return`${parseFloat((r/Math.pow(s,l)).toFixed(1))} ${t[l]}`}function _(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}function W(r,s){if(s){const t=Object.keys(s).find(l=>l.toLowerCase()==="host");if(t&&s[t])return s[t]}try{return new URL(r).host}catch{return"-"}}function X(r,s){return r!=null&&r.toLowerCase().includes("/graphql")?"GRAPHQL":s.toUpperCase()}function ie({entry:r,related:s=[]}){const{payload:t,createdAt:l}=r,i=W(t.url,t.headers),g=X(t.path,t.method),a=(r.tags??[]).filter(A=>A.toUpperCase()!==g),d=M(),c=M(),[m,n]=b.useState("payload"),[h,u]=b.useState("response"),o={};t.body&&(o.body=t.body),t.query&&Object.keys(t.query).length>0&&(o.query=t.query),t.params&&Object.keys(t.params).length>0&&(o.params=t.params);const T={payload:Object.keys(o).length>0?o:{},headers:t.headers||{}},N={response:t.responseBody||{},"response-headers":t.responseHeaders??{},session:t.session&&Object.keys(t.session).length>0?t.session:{}},C=[{id:"payload",label:"Payload",content:e.jsx(v,{data:T.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})},{id:"headers",label:"Headers",content:e.jsx(v,{data:T.headers,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}],B=[{id:"response",label:"Response",content:e.jsx(v,{data:N.response,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"response-headers",label:"Headers",content:e.jsx(v,{data:N["response-headers"],toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"session",label:"Session",content:e.jsx(v,{data:N.session,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Request Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(y,{label:"Time",value:e.jsxs("span",{children:[R(k(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",q(k(l),{addSuffix:!0}),")"]})]})}),e.jsx(y,{label:"Hostname",value:i!=="-"?e.jsx(x,{listType:"requests",filterType:"hostnames",filterValue:i,className:"font-mono",children:i}):"-"}),t.controllerAction&&e.jsx(y,{label:"Controller Action",value:e.jsx(x,{listType:"requests",filterType:"controllers",filterValue:t.controllerAction,className:"font-mono",children:t.controllerAction})}),e.jsx(y,{label:"Path",value:e.jsx(x,{listType:"requests",filterType:"paths",filterValue:t.path,className:"font-mono",children:t.path})}),e.jsx(y,{label:"Status",value:t.statusCode?e.jsx(x,{listType:"requests",filterType:"statuses",filterValue:String(t.statusCode),children:String(t.statusCode)}):"-"}),e.jsx(y,{label:"Duration",value:t.duration!==void 0?e.jsx("span",{className:t.duration>1e3?"text-yellow-600 dark:text-yellow-400 font-medium":"",children:_(t.duration)}):"-"}),e.jsx(y,{label:"IP Address",value:t.ip?e.jsx(x,{listType:"requests",filterType:"ips",filterValue:t.ip,className:"font-mono",children:t.ip}):"-"}),t.userAgent&&e.jsx(y,{label:"User Agent",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.userAgent})}),t.handler&&t.handler!==t.controllerAction&&e.jsx(y,{label:"Handler",value:e.jsx("code",{className:"font-mono text-sm",children:t.handler})}),t.memory!==void 0&&e.jsx(y,{label:"Memory Usage",value:G(t.memory)}),a.length>0&&e.jsx(y,{label:"Tags",value:e.jsx(E,{items:a,listType:"requests",maxItems:99})})]})})]}),t.user&&e.jsx(I,{user:t.user}),e.jsx(S,{tabs:C,defaultTab:"payload",hashKey:"req",headerRight:e.jsx(d.Toolbar,{data:T[m]}),onTabChange:n}),e.jsx(S,{tabs:B,defaultTab:"response",hashKey:"res",headerRight:e.jsx(c.Toolbar,{data:N[h]}),onTabChange:u}),e.jsx(z,{request:r,related:s}),e.jsx(J,{entries:s})]})}export{ie as default};
1
+ import{j as e,i as f}from"./index-CC9YqlAO.js";import{b,L as p}from"./vendor-DBTT3jXp.js";import{f as q,p as k}from"./date-Dwgqy666.js";import{D as y,f as R}from"./DetailRow-BX0zpKTe.js";import{b as D,c as L,a as H,d as U,e as V,f as O,g as F,C as x,B as E}from"./types-7eWhJMm7.js";import{u as M,T as S,C as v}from"./EntryDetailPage-NLzBL3a7.js";import{U as I}from"./UserCard-BiPMOHC2.js";import"./search-DlyuMX5Q.js";function j(r){return r<1?"<1 ms":r<1e3?`${r.toFixed(2)} ms`:`${(r/1e3).toFixed(2)} s`}function w(r,s){return r.length<=s?r:r.substring(0,s)+"..."}function J({entries:r}){const s=b.useMemo(()=>{const a=r.filter(o=>D(o)),d=r.filter(o=>L(o)),c=r.filter(o=>H(o)),m=r.filter(o=>U(o)),n=r.filter(o=>V(o)),h=r.filter(o=>O(o)),u=r.filter(o=>F(o));return{exceptions:a,logs:d,queries:c,events:m,jobs:n,cache:h,mail:u}},[r]),t=b.useMemo(()=>[{id:"exceptions",label:"Exceptions",entries:s.exceptions,color:"bg-red-500"},{id:"logs",label:"Logs",entries:s.logs,color:"bg-blue-500"},{id:"queries",label:"Queries",entries:s.queries,color:"bg-purple-500"},{id:"events",label:"Events",entries:s.events,color:"bg-green-500"},{id:"jobs",label:"Jobs",entries:s.jobs,color:"bg-yellow-500"},{id:"cache",label:"Cache",entries:s.cache,color:"bg-cyan-500"},{id:"mail",label:"Mail",entries:s.mail,color:"bg-pink-500"}].filter(d=>d.entries.length>0),[s]),[l,i]=b.useState(()=>s.exceptions.length>0?"exceptions":s.logs.length>0?"logs":s.queries.length>0?"queries":s.events.length>0?"events":s.jobs.length>0?"jobs":s.cache.length>0?"cache":s.mail.length>0?"mail":"queries"),g=b.useMemo(()=>{if(s.queries.length===0)return null;const a=s.queries.reduce((m,n)=>m+n.payload.duration,0),d=new Set(s.queries.map(m=>m.payload.query)).size,c=s.queries.length-d;return{total:a,duplicates:c}},[s.queries]);return t.length===0?null:e.jsxs("div",{className:"card overflow-hidden",children:[e.jsx("div",{className:"flex flex-wrap gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.map(a=>e.jsxs("button",{onClick:()=>i(a.id),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${l===a.id?"bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[a.label,e.jsx("span",{className:`inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-medium rounded ${l===a.id?"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300":"bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-400"}`,children:a.entries.length})]},a.id))}),e.jsxs("div",{children:[l==="queries"&&s.queries.length>0&&e.jsxs("div",{children:[g&&e.jsxs("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800/50 text-sm text-gray-600 dark:text-gray-400 flex justify-between",children:[e.jsxs("span",{children:[s.queries.length," queries, ",g.duplicates," of which are duplicated"]}),e.jsxs("span",{children:["Total: ",e.jsx("strong",{children:j(g.total)})]})]}),e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.queries.map(a=>e.jsxs(p,{to:`/queries/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate flex-1 mr-4",children:w(a.payload.query,70)}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.slow&&e.jsx(x,{listType:"queries",children:"SLOW"}),e.jsx("span",{className:`text-sm font-mono ${a.payload.slow?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400"}`,children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]}),l==="exceptions"&&s.exceptions.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.exceptions.map(a=>e.jsx(p,{to:`/exceptions/${a.id}`,className:"block px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{listType:"exceptions",filterType:"names",filterValue:a.payload.name,children:a.payload.name}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:w(a.payload.message,60)})]}),a.payload.context&&e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-500 mt-1",children:["at ",a.payload.context]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]})},a.id))}),l==="logs"&&s.logs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.logs.map(a=>e.jsxs(p,{to:`/logs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"logs",filterType:"levels",filterValue:a.payload.level,children:a.payload.level.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.message,60)}),a.payload.context&&e.jsx(x,{listType:"logs",filterType:"contexts",filterValue:a.payload.context,className:"text-xs",children:a.payload.context})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="events"&&s.events.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.events.map(a=>e.jsxs(p,{to:`/events/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"events",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:[a.payload.listeners.length," listener(s)"]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="jobs"&&s.jobs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.jobs.map(a=>e.jsxs(p,{to:`/jobs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"jobs",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["on ",a.payload.queue]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.duration!==void 0&&e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="cache"&&s.cache.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.cache.map(a=>e.jsxs(p,{to:`/cache/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"cache",filterType:"operations",filterValue:a.payload.operation,children:a.payload.operation.toUpperCase()}),e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.key,50)}),a.payload.hit!==void 0&&e.jsx(x,{listType:"cache",clickable:!1,children:a.payload.hit?"HIT":"MISS"})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="mail"&&s.mail.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.mail.map(a=>e.jsxs(p,{to:`/mail/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"mail",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:a.payload.subject}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["to ",Array.isArray(a.payload.to)?a.payload.to.join(", "):a.payload.to]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]})]})}const K={request:"bg-blue-500",query:"bg-purple-500",graphql:"bg-fuchsia-500",exception:"bg-red-500",log:"bg-green-500",job:"bg-yellow-500",schedule:"bg-gray-500",batch:"bg-lime-500",command:"bg-slate-500",cache:"bg-cyan-500",redis:"bg-rose-500",model:"bg-violet-500","http-client":"bg-indigo-500",mail:"bg-orange-500",notification:"bg-pink-500",view:"bg-teal-500",gate:"bg-amber-500",dump:"bg-emerald-500",event:"bg-sky-500"},$=r=>r<1?"<1ms":r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,P=["query","operationName","key","url","path","name","message","command","operation"],Q=r=>{const s=r.payload,l=(P.map(i=>s[i]).find(i=>typeof i=="string"&&i.trim().length>0)??r.type).replace(/\s+/g," ").trim();return l.length>70?`${l.slice(0,70)}…`:l};function z({request:r,related:s}){const{spans:t,window:l}=b.useMemo(()=>{const g=[r,...s].map(n=>{const h=k(n.createdAt).getTime(),u=Number(n.payload.duration??0),o=Number.isFinite(u)&&u>0?u:0;return{entry:n,offset:h-o,duration:o,label:Q(n)}}),a=g.map(n=>n.offset),d=g.map(n=>n.offset+n.duration),c=Math.min(...a),m=Math.max(...d);return{window:Math.max(1,m-c),spans:g.map(n=>({...n,offset:n.offset-c})).sort((n,h)=>n.offset-h.offset||n.duration-h.duration)}},[r,s]);return t.length<=1?null:e.jsxs("div",{className:"card overflow-hidden","data-testid":"request-timeline",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Timeline"}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.length," entries over ",$(l)]})]}),e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:t.map(i=>{const g=Math.min(Math.max(i.duration/l*100,.75),100),a=Math.min(i.offset/l*100,100-g),d=K[i.entry.type]??"bg-gray-400";return e.jsxs(p,{to:`/entries/${i.entry.id}`,className:"flex items-center gap-3 px-4 py-2 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",children:[e.jsx("span",{className:"w-24 shrink-0 text-xs font-medium text-gray-500 dark:text-gray-400 capitalize",children:i.entry.type}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-mono text-gray-700 dark:text-gray-300 truncate",title:i.label,children:i.label}),e.jsx("span",{className:"relative w-1/2 shrink-0 h-4 rounded bg-gray-100 dark:bg-gray-800",children:e.jsx("span",{className:`absolute top-0 h-full rounded ${d}`,style:{left:`${a}%`,width:`${g}%`},"data-testid":"timeline-bar"})}),e.jsx("span",{className:"w-16 shrink-0 text-right text-xs tabular-nums text-gray-500 dark:text-gray-400",children:i.duration>0?$(i.duration):""})]},`${i.entry.type}-${i.entry.id}`)})})]})}function G(r){if(r===0)return"0 B";const s=1024,t=["B","KB","MB","GB"],l=Math.floor(Math.log(r)/Math.log(s));return`${parseFloat((r/Math.pow(s,l)).toFixed(1))} ${t[l]}`}function _(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}function W(r,s){if(s){const t=Object.keys(s).find(l=>l.toLowerCase()==="host");if(t&&s[t])return s[t]}try{return new URL(r).host}catch{return"-"}}function X(r,s){return r!=null&&r.toLowerCase().includes("/graphql")?"GRAPHQL":s.toUpperCase()}function ie({entry:r,related:s=[]}){const{payload:t,createdAt:l}=r,i=W(t.url,t.headers),g=X(t.path,t.method),a=(r.tags??[]).filter(A=>A.toUpperCase()!==g),d=M(),c=M(),[m,n]=b.useState("payload"),[h,u]=b.useState("response"),o={};t.body&&(o.body=t.body),t.query&&Object.keys(t.query).length>0&&(o.query=t.query),t.params&&Object.keys(t.params).length>0&&(o.params=t.params);const T={payload:Object.keys(o).length>0?o:{},headers:t.headers||{}},N={response:t.responseBody||{},"response-headers":t.responseHeaders??{},session:t.session&&Object.keys(t.session).length>0?t.session:{}},C=[{id:"payload",label:"Payload",content:e.jsx(v,{data:T.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})},{id:"headers",label:"Headers",content:e.jsx(v,{data:T.headers,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}],B=[{id:"response",label:"Response",content:e.jsx(v,{data:N.response,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"response-headers",label:"Headers",content:e.jsx(v,{data:N["response-headers"],toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"session",label:"Session",content:e.jsx(v,{data:N.session,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Request Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(y,{label:"Time",value:e.jsxs("span",{children:[R(k(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",q(k(l),{addSuffix:!0}),")"]})]})}),e.jsx(y,{label:"Hostname",value:i!=="-"?e.jsx(x,{listType:"requests",filterType:"hostnames",filterValue:i,className:"font-mono",children:i}):"-"}),t.controllerAction&&e.jsx(y,{label:"Controller Action",value:e.jsx(x,{listType:"requests",filterType:"controllers",filterValue:t.controllerAction,className:"font-mono",children:t.controllerAction})}),e.jsx(y,{label:"Path",value:e.jsx(x,{listType:"requests",filterType:"paths",filterValue:t.path,className:"font-mono",children:t.path})}),e.jsx(y,{label:"Status",value:t.statusCode?e.jsx(x,{listType:"requests",filterType:"statuses",filterValue:String(t.statusCode),children:String(t.statusCode)}):"-"}),e.jsx(y,{label:"Duration",value:t.duration!==void 0?e.jsx("span",{className:t.duration>1e3?"text-yellow-600 dark:text-yellow-400 font-medium":"",children:_(t.duration)}):"-"}),e.jsx(y,{label:"IP Address",value:t.ip?e.jsx(x,{listType:"requests",filterType:"ips",filterValue:t.ip,className:"font-mono",children:t.ip}):"-"}),t.userAgent&&e.jsx(y,{label:"User Agent",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.userAgent})}),t.handler&&t.handler!==t.controllerAction&&e.jsx(y,{label:"Handler",value:e.jsx("code",{className:"font-mono text-sm",children:t.handler})}),t.memory!==void 0&&e.jsx(y,{label:"Memory Usage",value:G(t.memory)}),a.length>0&&e.jsx(y,{label:"Tags",value:e.jsx(E,{items:a,listType:"requests",maxItems:99})})]})})]}),t.user&&e.jsx(I,{user:t.user}),e.jsx(S,{tabs:C,defaultTab:"payload",hashKey:"req",headerRight:e.jsx(d.Toolbar,{data:T[m]}),onTabChange:n}),e.jsx(S,{tabs:B,defaultTab:"response",hashKey:"res",headerRight:e.jsx(c.Toolbar,{data:N[h]}),onTabChange:u}),e.jsx(z,{request:r,related:s}),e.jsx(J,{entries:s})]})}export{ie as default};
@@ -1 +1 @@
1
- import{j as t,A as P,e as A}from"./index-HxcGVcSo.js";import{e as v,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as F}from"./date-Dwgqy666.js";import{u as L,a as H,P as S,R as G,N as B,L as I}from"./PageHeader-DR_M5h7z.js";import{u as O,i as U,C as d}from"./types-BMBEhoQ2.js";import{E as W}from"./EntrySearchInput-BF9N_f7y.js";import{T as u,D as Q,a as $,b as z}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";import"./search-VPXcw9Ki.js";const J=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],K=r=>{var s;return(s=r.payload.path)!=null&&s.toLowerCase().includes("/graphql")?"GRAPHQL":r.payload.method.toUpperCase()};function ae(){const r=v(),{addFilter:s,clearAll:h,serverFilters:c,headerFilters:p}=O("requests"),{rangeFilters:m,windowMinutes:g}=L(),{entries:x,loading:y,refreshing:a,error:f,refresh:n,newEntriesCount:C,hasMore:j,loadMore:T,loadNew:E,autoRefreshEnabled:b,live:w,setAutoRefresh:k,meta:o,isHighlighted:R}=H({type:"request",limit:50,filters:{...c,...m},windowMinutes:g}),i=x.filter(e=>U(e)),q=D.useMemo(()=>[{key:"method",header:"Method",width:"100px",render:e=>t.jsx(d,{listType:"requests",filterType:"methods",children:K(e)})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(u,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.path})},{key:"status",header:"Status",width:"80px",align:"center",render:e=>t.jsx(d,{listType:"requests",filterType:"statuses",children:e.payload.statusCode??0})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(Q,{ms:e.payload.duration??0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>t.jsx($,{tags:(e.tags??[]).filter(l=>!J.includes(l.toUpperCase())),max:3,onTagClick:(l,N)=>{N.stopPropagation(),s("tags",l)}})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(u,{secondary:!0,className:"text-xs",children:M(F(e.createdAt),{addSuffix:!0})})}],[s]);return y&&i.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(S,{title:"Requests",icon:P,iconColor:"text-blue-600 dark:text-blue-400",count:i.length,totalCount:o==null?void 0:o.total,clearable:{type:"request",label:"requests",onCleared:n},refreshing:a,autoRefreshEnabled:b,live:w,onAutoRefreshToggle:k,filters:p,filterControls:t.jsx(G,{route:"requests"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{placeholder:"Search by path, method, status, tag, or content..."}),t.jsx(B,{count:C,onClick:E,loading:a}),t.jsx(z,{columns:q,data:i,keyExtractor:e=>e.id,onRowClick:e=>r(`/requests/${e.id}`),emptyMessage:"No requests recorded yet",error:f,onRetry:n,emptyIcon:t.jsx(A,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"}),rowClassName:e=>R(e.id)?"highlight-new":""}),t.jsx(I,{hasMore:j,onClick:T,loading:a})]})]})}export{ae as default};
1
+ import{j as t,A as P,e as A}from"./index-CC9YqlAO.js";import{e as v,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as F}from"./date-Dwgqy666.js";import{u as L,a as H,P as S,R as G,N as B,L as I}from"./PageHeader-CwpXbfba.js";import{u as O,i as U,C as d}from"./types-7eWhJMm7.js";import{E as W}from"./EntrySearchInput-Cl30X6WS.js";import{T as u,D as Q,a as $,b as z}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";import"./search-DlyuMX5Q.js";const J=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],K=r=>{var s;return(s=r.payload.path)!=null&&s.toLowerCase().includes("/graphql")?"GRAPHQL":r.payload.method.toUpperCase()};function ae(){const r=v(),{addFilter:s,clearAll:h,serverFilters:c,headerFilters:p}=O("requests"),{rangeFilters:m,windowMinutes:g}=L(),{entries:x,loading:y,refreshing:a,error:f,refresh:n,newEntriesCount:C,hasMore:j,loadMore:T,loadNew:E,autoRefreshEnabled:b,live:w,setAutoRefresh:k,meta:o,isHighlighted:R}=H({type:"request",limit:50,filters:{...c,...m},windowMinutes:g}),i=x.filter(e=>U(e)),q=D.useMemo(()=>[{key:"method",header:"Method",width:"100px",render:e=>t.jsx(d,{listType:"requests",filterType:"methods",children:K(e)})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(u,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.path})},{key:"status",header:"Status",width:"80px",align:"center",render:e=>t.jsx(d,{listType:"requests",filterType:"statuses",children:e.payload.statusCode??0})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(Q,{ms:e.payload.duration??0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>t.jsx($,{tags:(e.tags??[]).filter(l=>!J.includes(l.toUpperCase())),max:3,onTagClick:(l,N)=>{N.stopPropagation(),s("tags",l)}})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(u,{secondary:!0,className:"text-xs",children:M(F(e.createdAt),{addSuffix:!0})})}],[s]);return y&&i.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(S,{title:"Requests",icon:P,iconColor:"text-blue-600 dark:text-blue-400",count:i.length,totalCount:o==null?void 0:o.total,clearable:{type:"request",label:"requests",onCleared:n},refreshing:a,autoRefreshEnabled:b,live:w,onAutoRefreshToggle:k,filters:p,filterControls:t.jsx(G,{route:"requests"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{placeholder:"Search by path, method, status, tag, or content..."}),t.jsx(B,{count:C,onClick:E,loading:a}),t.jsx(z,{columns:q,data:i,keyExtractor:e=>e.id,onRowClick:e=>r(`/requests/${e.id}`),emptyMessage:"No requests recorded yet",error:f,onRetry:n,emptyIcon:t.jsx(A,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"}),rowClassName:e=>R(e.id)?"highlight-new":""}),t.jsx(I,{hasMore:j,onClick:T,loading:a})]})]})}export{ae as default};