nestlens 0.17.2 → 0.17.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.
- package/dist/dashboard/public/assets/{BatchDetailView-MwxKpCBw.js → BatchDetailView-DAtR5FPg.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-vFo0vIr2.js → BatchesPage-BPA6JhXD.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-CcGupoLQ.js → CacheDetailView-DlShiGIf.js} +2 -2
- package/dist/dashboard/public/assets/{CachePage-CU847w5_.js → CachePage-4gqe08jc.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-CVZrIKo6.js → CommandDetailView-D90ipdrR.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-BbiQyAea.js → CommandsPage-bO8ow8DA.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-DpZHVixQ.js → CopyButton-DaF0vYeo.js} +1 -1
- package/dist/dashboard/public/assets/DashboardPage-DeKPc8p-.js +21 -0
- package/dist/dashboard/public/assets/{DataTable-CCXj8zzB.js → DataTable-CIlMLJo4.js} +9 -9
- package/dist/dashboard/public/assets/{DetailRow-C35E-Fg7.js → DetailRow-BC_kcJT3.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-C3AszicE.js → DumpDetailView-CejsvpwV.js} +3 -3
- package/dist/dashboard/public/assets/{DumpsPage-nKkfeRGr.js → DumpsPage-BtDTjZ7O.js} +1 -1
- package/dist/dashboard/public/assets/EntryDetailPage-DUWwJ_hP.js +27 -0
- package/dist/dashboard/public/assets/EntrySearchInput-Iv-9Wirn.js +1 -0
- package/dist/dashboard/public/assets/{EventDetailView-i_T5zzxK.js → EventDetailView-gBzHbxMY.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage--LGwQSIW.js → EventsPage-B8t1V0Vx.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-BD375JkM.js → ExceptionDetailView-CAJwXNN0.js} +2 -2
- package/dist/dashboard/public/assets/{ExceptionsPage-DJRQKir2.js → ExceptionsPage-BnoHLwKA.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-DjS0BcxS.js → GateDetailView-CmKN_iLu.js} +2 -2
- package/dist/dashboard/public/assets/{GatesPage-CP3_e7g1.js → GatesPage-Bgt4HOfH.js} +1 -1
- package/dist/dashboard/public/assets/GraphQLDetailView-CCMHYaLc.js +6 -0
- package/dist/dashboard/public/assets/{GraphQLPage-BCr6tRBy.js → GraphQLPage-C-lDawkW.js} +1 -1
- package/dist/dashboard/public/assets/HttpClientDetailView-tCQJY3WT.js +1 -0
- package/dist/dashboard/public/assets/{HttpClientPage-opI4zxU2.js → HttpClientPage-B0-n_3yk.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-4qAPrQWH.js → JobDetailView-COX5nxJL.js} +2 -2
- package/dist/dashboard/public/assets/{JobsPage-BuCIb8wu.js → JobsPage-BKGnM4ne.js} +1 -1
- package/dist/dashboard/public/assets/LogDetailView-CiFkQjNz.js +1 -0
- package/dist/dashboard/public/assets/{LogsPage-BYUqINeg.js → LogsPage-NIDMxNxD.js} +1 -1
- package/dist/dashboard/public/assets/{MailDetailView-BPFRJcUh.js → MailDetailView-B4hhGA3f.js} +2 -2
- package/dist/dashboard/public/assets/{MailPage-n712tj0J.js → MailPage-CYEkpVKG.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-BDzUh_Kg.js → ModelDetailView-DiI8V80r.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-BgXuFcOx.js → ModelsPage-B9sb5wNN.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-D-wwNBBg.js → NotificationDetailView-jBvJjcrv.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-eznKkQYP.js → NotificationsPage-CQmtJ4Uw.js} +1 -1
- package/dist/dashboard/public/assets/PageHeader-Tnp0JBDF.js +1 -0
- package/dist/dashboard/public/assets/QueriesPage-92MXcQ8v.js +1 -0
- package/dist/dashboard/public/assets/{QueryDetailView-BkUuf3JM.js → QueryDetailView-0RW6Mgfq.js} +2 -2
- package/dist/dashboard/public/assets/{RedisDetailView-EHqxefP1.js → RedisDetailView-B2ckYL3H.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-BqyStSRQ.js → RedisPage-CZU4kHNw.js} +1 -1
- package/dist/dashboard/public/assets/RequestDetailView-Cm-OEVhR.js +1 -0
- package/dist/dashboard/public/assets/{RequestsPage-CSmOa0Pi.js → RequestsPage-CNVJHWoJ.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-BPjjgHxu.js → ScheduleDetailView-CrBW0QSz.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-Brf1dEFU.js → SchedulePage-wVYGrpuQ.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-CEq6mQ5k.js → UserCard-B4mNJVOd.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-DzuPi6K1.js → ViewDetailView-CMAf9inJ.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-ClbTUhv0.js → ViewsPage-76yfd6hO.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-CMjU8s5-.js → calendar-DCypCI0I.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-DQGZE3D0.js → circle-alert-BEvvepIR.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-Br_lvQdJ.js → circle-check-big-DZttXeD-.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-DFyAuyMN.js → circle-x-CioeSSBA.js} +1 -1
- package/dist/dashboard/public/assets/{eye-BlDJOCMu.js → eye-CwQoBjXn.js} +1 -1
- package/dist/dashboard/public/assets/{index-CNTaNUkj.js → index-BaD1MX7a.js} +2 -2
- package/dist/dashboard/public/assets/index-CMvt7uFU.css +1 -0
- package/dist/dashboard/public/assets/{search-CcMiea1V.js → search-BtkJjUPF.js} +1 -1
- package/dist/dashboard/public/assets/{send-CSgocT8I.js → send-CvZt49HP.js} +1 -1
- package/dist/dashboard/public/assets/{timer-CDc7JIAB.js → timer-D72f3hG4.js} +1 -1
- package/dist/dashboard/public/assets/{types-DqF5HlZi.js → types-BHYinjn2.js} +1 -1
- package/dist/dashboard/public/assets/{users-D9yOg5Si.js → users-BHTpEUZQ.js} +1 -1
- package/dist/dashboard/public/assets/{zap-QXV06WYA.js → zap-Cx84VGgd.js} +1 -1
- package/dist/dashboard/public/index.html +2 -2
- package/package.json +1 -1
- package/dist/dashboard/public/assets/DashboardPage-Ck0F9Z12.js +0 -21
- package/dist/dashboard/public/assets/EntryDetailPage-C63KztnI.js +0 -27
- package/dist/dashboard/public/assets/EntrySearchInput-BNjSxfmZ.js +0 -1
- package/dist/dashboard/public/assets/GraphQLDetailView-BubeJCJT.js +0 -6
- package/dist/dashboard/public/assets/HttpClientDetailView-yb-3URIg.js +0 -1
- package/dist/dashboard/public/assets/LogDetailView--AEX1d6S.js +0 -1
- package/dist/dashboard/public/assets/PageHeader-Dhs9cPza.js +0 -1
- package/dist/dashboard/public/assets/QueriesPage-Df7S76B_.js +0 -1
- package/dist/dashboard/public/assets/RequestDetailView-D0pFJlIF.js +0 -1
- package/dist/dashboard/public/assets/index-ReuerEhs.css +0 -1
package/dist/dashboard/public/assets/{MailDetailView-BPFRJcUh.js → MailDetailView-B4hhGA3f.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as pr,j as l,M as fn,C as dr}from"./index-
|
|
1
|
+
import{c as pr,j as l,M as fn,C as dr}from"./index-BaD1MX7a.js";import{C as hr,B as gr}from"./types-BHYinjn2.js";import{p as Rt,f as Tr}from"./date-Dwgqy666.js";import{D as $,f as _r}from"./DetailRow-BC_kcJT3.js";import{T as xr}from"./EntryDetailPage-DUWwJ_hP.js";import{C as we}from"./CopyButton-DaF0vYeo.js";import{C as br}from"./circle-x-CioeSSBA.js";import{C as yr}from"./circle-check-big-DZttXeD-.js";import{U as Ar}from"./users-BHTpEUZQ.js";import{C as Er}from"./circle-alert-BEvvepIR.js";import"./vendor-DBTT3jXp.js";import"./search-BtkJjUPF.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -6,4 +6,4 @@ import{c as pr,j as l,M as fn,C as dr}from"./index-CNTaNUkj.js";import{C as hr,B
|
|
|
6
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
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&<(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
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-
|
|
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-xs",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:"*:not-first:border-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-
|
|
1
|
+
import{j as t,M as c}from"./index-BaD1MX7a.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-Tnp0JBDF.js";import{u as I,g as z,C as G}from"./types-BHYinjn2.js";import{T as n,D as J,a as K,b as O}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.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};
|
package/dist/dashboard/public/assets/{ModelDetailView-BDzUh_Kg.js → ModelDetailView-DiI8V80r.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,d as o,F as b,C as g,D as u}from"./index-
|
|
1
|
+
import{j as e,d as o,F as b,C as g,D as u}from"./index-BaD1MX7a.js";import{b as y}from"./vendor-DBTT3jXp.js";import{p as x,f}from"./date-Dwgqy666.js";import{D as s,f as N}from"./DetailRow-BC_kcJT3.js";import{C as l}from"./types-BHYinjn2.js";import{u as n,C as m,T as v}from"./EntryDetailPage-DUWwJ_hP.js";import{C as k}from"./CopyButton-DaF0vYeo.js";import{C as w}from"./circle-x-CioeSSBA.js";import"./search-BtkJjUPF.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:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[N(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(v,{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-
|
|
1
|
+
import{j as t,d as c}from"./index-BaD1MX7a.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-Tnp0JBDF.js";import{u as $,l as q,C as l}from"./types-BHYinjn2.js";import{T as o,D as z,b as G}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.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-
|
|
1
|
+
import{j as e,f as c,C as j}from"./index-BaD1MX7a.js";import{p as x,f as b}from"./date-Dwgqy666.js";import{D as s,f as y}from"./DetailRow-BC_kcJT3.js";import{C as n}from"./types-BHYinjn2.js";import{u as f,C as N,T as u}from"./EntryDetailPage-DUWwJ_hP.js";import{C as v}from"./CopyButton-DaF0vYeo.js";import{C as k}from"./circle-check-big-DZttXeD-.js";import{C as o}from"./circle-x-CioeSSBA.js";import{S as w}from"./send-CvZt49HP.js";import"./vendor-DBTT3jXp.js";import"./search-BtkJjUPF.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:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[y(x(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",b(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};
|
package/dist/dashboard/public/assets/{NotificationsPage-eznKkQYP.js → NotificationsPage-CQmtJ4Uw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,f as d}from"./index-
|
|
1
|
+
import{j as t,f as d}from"./index-BaD1MX7a.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-Tnp0JBDF.js";import{u as I,m as U,C as c}from"./types-BHYinjn2.js";import{T as a,D as $,b as q}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.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};
|
|
@@ -0,0 +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-BaD1MX7a.js";import{t as Ae}from"./types-BHYinjn2.js";import{T as De}from"./timer-D72f3hG4.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),x=`${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,h=a.useCallback(()=>!u||u<=0?R:{...R,from:new Date(Date.now()-u*6e4).toISOString()},[R,u]),[m,g]=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!==x,me=a.useRef(l),P=a.useRef(new Map),[,ge]=a.useState(0),Q=1e4,Z=a.useCallback(t=>{g(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,$(x)},[l,x]),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"),$(x)},[x]),fe=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:h()});g(c=>{const f=new Set(c.map(w=>w.id));return[...c,...t.data.filter(w=>!f.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,h]),he=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:h()});if(t.data.length>0){const c=Date.now();t.data.forEach(f=>{P.current.set(f.id,c)}),g(f=>ne(f,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,h]),U=a.useCallback(async()=>{E(!0);try{F(null);const t=await I({type:r,limit:n,filters:h()});g(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,h]),xe=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=h();try{if(!xe(t)){const f=await Ne(v.current,r);p(f.data.count);return}const c=await I({type:r,limit:n,afterSequence:v.current,filters:t});p(c.data.length)}catch{}},[r,n,h,U]),ye=a.useCallback(t=>{H(t),Te(t)},[]),pe=a.useCallback(t=>{g(c=>c.map(f=>f.id===t.id?t:f))},[]);a.useEffect(()=>{let t=!0;return I({type:r,limit:n,filters:h()}).then(c=>{t&&Z(c)},c=>{t&&ee(c)}),()=>{t=!1}},[r,n,h,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((f,w)=>{t-f>=Q&&(P.current.delete(w),c=!0)}),c&&ge(f=>f+1)},[]),B=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0;try{const t=W.current??v.current,f=(await Re(r)).data;if(typeof f=="number"&&f>t){const w=await I({type:r,limit:n,afterSequence:t,filters:h()});if(W.current=w.meta.hasMore?w.meta.newestSequence??t:f,w.data.length>0){const ve=Date.now();w.data.forEach(L=>{P.current.set(L.id,ve)});let re=0;g(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,h]);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:fe,loadNew:he,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 h;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,g,S)=>{r($=>{const C=new URLSearchParams($);return S?C.delete(m):C.set(m,g),C},{replace:!0})},[r]),l=a.useCallback(m=>u(K,m,m==="all"),[u]),x=a.useCallback(m=>u(z,m,m==="any"),[u]),j=a.useCallback(()=>{r(m=>{const g=new URLSearchParams(m);return g.delete(K),g.delete(z),g},{replace:!0})},[r]),N=((h=J.find(m=>m.id===o))==null?void 0:h.minutes)??0,R=a.useMemo(()=>{var g;const m=((g=V.find(S=>S.id===d))==null?void 0:g.ms)??0;return m>0?{minDuration:m}:{}},[d]);return{window:o,duration:d,setWindow:l,setDuration:x,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-sm focus:outline-hidden 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 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 shrink-0 opacity-60","aria-hidden":"true"})]}),d&&e.jsxs("label",{className:ie,children:[e.jsx(De,{className:"h-3.5 w-3.5 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 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:x}=await Le(s);q.success(x),n()}catch(x){q.error(`Could not clear ${r}: ${x instanceof Error?x.message:String(x)}`)}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:x,clearable:j,autoRefreshEnabled:N,onAutoRefreshToggle:R,live:h,filters:m=[],onClearAllFilters:g,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,h&&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 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}),x&&e.jsx("button",{onClick:x,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 group-focus-visible:opacity-100"})]},`${b.category}-${b.value}-${H}`))]},y)),g&&m.length>1&&e.jsx("button",{onClick:g,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,D as d}from"./index-BaD1MX7a.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-Tnp0JBDF.js";import{u as G,a as J,C as K}from"./types-BHYinjn2.js";import{E as U}from"./EntrySearchInput-Iv-9Wirn.js";import{T as c,D as V,a as X,b as Y}from"./DataTable-CIlMLJo4.js";import{Z as h}from"./zap-Cx84VGgd.js";import"./timer-D72f3hG4.js";import"./search-BtkJjUPF.js";function de(){const p=P(),[i,m]=u.useState(!1),{addFilter:l,clearAll:g,serverFilters:x,headerFilters:y}=G("queries"),{rangeFilters:f,windowMinutes:w}=O(),j={...x,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 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:g,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};
|
package/dist/dashboard/public/assets/{QueryDetailView-BkUuf3JM.js → QueryDetailView-0RW6Mgfq.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as RT,j as r,z as UE}from"./index-
|
|
1
|
+
import{c as RT,j as r,z as UE}from"./index-BaD1MX7a.js";import{p as oE,f as PT}from"./date-Dwgqy666.js";import{D as K,f as nT}from"./DetailRow-BC_kcJT3.js";import{C as GE}from"./types-BHYinjn2.js";import{g as iT,b as g}from"./vendor-DBTT3jXp.js";import{a as MT,b as UT}from"./EntryDetailPage-DUWwJ_hP.js";import"./search-BtkJjUPF.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -26,4 +26,4 @@ If possible, please select a more specific dialect (like sqlite, postgresql, etc
|
|
|
26
26
|
`)},D.prototype.displayStateStack=function(N,L){for(var C,t=0,n=0;n<N.length;n++){var a=N[n],o=a.rule.toString(a.dot);o===C?t++:(t>0&&L.push(" ^ "+t+" more lines identical to this"),t=0,L.push(" "+o)),C=o}},D.prototype.getSymbolDisplay=function(N){return F(N)},D.prototype.buildFirstStateStack=function(N,L){if(L.indexOf(N)!==-1)return null;if(N.wantedBy.length===0)return[N];var C=N.wantedBy[0],t=[N].concat(L),n=this.buildFirstStateStack(C,t);return n===null?null:[N].concat(n)},D.prototype.save=function(){var N=this.table[this.current];return N.lexerState=this.lexerState,N},D.prototype.restore=function(N){var L=N.index;this.current=L,this.table[L]=N,this.table.splice(L+1),this.lexerState=N.lexerState,this.results=this.finish()},D.prototype.rewind=function(N){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[N])},D.prototype.finish=function(){var N=[],L=this.grammar.start,C=this.table[this.table.length-1];return C.states.forEach(function(t){t.rule.name===L&&t.dot===t.rule.symbols.length&&t.reference===0&&t.data!==D.fail&&N.push(t)}),N.map(function(t){return t.data})};function F(N){var L=typeof N;if(L==="string")return N;if(L==="object"){if(N.literal)return JSON.stringify(N.literal);if(N instanceof RegExp)return"character matching "+N;if(N.type)return N.type+" token";if(N.test)return"token matching "+String(N.test);throw new Error("Unknown symbol type: "+N)}}function H(N){var L=typeof N;if(L==="string")return N;if(L==="object"){if(N.literal)return JSON.stringify(N.literal);if(N instanceof RegExp)return N.toString();if(N.type)return"%"+N.type;if(N.test)return"<"+String(N.test)+">";throw new Error("Unknown symbol type: "+N)}}return{Parser:D,Grammar:e,Rule:E}})})(J)),J.exports}var JI=vI();const $I=iT(JI);function wI(T){return T.map(QI).map(ZI).map(qI).map(kI).map(jI)}const QI=(T,E,R)=>{if(ST(T.type)){const S=zI(R,E);if(S&&S.type===O.PROPERTY_ACCESS_OPERATOR)return Object.assign(Object.assign({},T),{type:O.IDENTIFIER,text:T.raw});const e=X(R,E);if(e&&e.type===O.PROPERTY_ACCESS_OPERATOR)return Object.assign(Object.assign({},T),{type:O.IDENTIFIER,text:T.raw})}return T},ZI=(T,E,R)=>{if(T.type===O.RESERVED_FUNCTION_NAME){const S=X(R,E);if(!S||!CT(S))return Object.assign(Object.assign({},T),{type:O.IDENTIFIER,text:T.raw})}return T},qI=(T,E,R)=>{if(T.type===O.RESERVED_DATA_TYPE){const S=X(R,E);if(S&&CT(S))return Object.assign(Object.assign({},T),{type:O.RESERVED_PARAMETERIZED_DATA_TYPE})}return T},kI=(T,E,R)=>{if(T.type===O.IDENTIFIER){const S=X(R,E);if(S&&tT(S))return Object.assign(Object.assign({},T),{type:O.ARRAY_IDENTIFIER})}return T},jI=(T,E,R)=>{if(T.type===O.RESERVED_DATA_TYPE){const S=X(R,E);if(S&&tT(S))return Object.assign(Object.assign({},T),{type:O.ARRAY_KEYWORD})}return T},zI=(T,E)=>X(T,E,-1),X=(T,E,R=1)=>{let S=1;for(;T[E+S*R]&&EO(T[E+S*R]);)S++;return T[E+S*R]},CT=T=>T.type===O.OPEN_PAREN&&T.text==="(",tT=T=>T.type===O.OPEN_PAREN&&T.text==="[",EO=T=>T.type===O.BLOCK_COMMENT||T.type===O.LINE_COMMENT;class _T{constructor(E){this.tokenize=E,this.index=0,this.tokens=[],this.input=""}reset(E,R){this.input=E,this.index=0,this.tokens=this.tokenize(E)}next(){return this.tokens[this.index++]}save(){}formatError(E){const{line:R,col:S}=LT(this.input,E.start);return`Parse error at token: ${E.text} at line ${R} column ${S}`}has(E){return E in O}}var _;(function(T){T.statement="statement",T.clause="clause",T.set_operation="set_operation",T.function_call="function_call",T.parameterized_data_type="parameterized_data_type",T.array_subscript="array_subscript",T.property_access="property_access",T.parenthesis="parenthesis",T.between_predicate="between_predicate",T.case_expression="case_expression",T.case_when="case_when",T.case_else="case_else",T.limit_clause="limit_clause",T.all_columns_asterisk="all_columns_asterisk",T.literal="literal",T.identifier="identifier",T.keyword="keyword",T.data_type="data_type",T.parameter="parameter",T.operator="operator",T.comma="comma",T.line_comment="line_comment",T.block_comment="block_comment",T.disable_comment="disable_comment"})(_=_||(_={}));function aE(T){return T[0]}const s=new _T(T=>[]),d=([[T]])=>T,G=T=>({type:_.keyword,tokenType:T.type,text:T.text,raw:T.raw}),zE=T=>({type:_.data_type,text:T.text,raw:T.raw}),l=(T,{leading:E,trailing:R})=>(E!=null&&E.length&&(T=Object.assign(Object.assign({},T),{leadingComments:E})),R!=null&&R.length&&(T=Object.assign(Object.assign({},T),{trailingComments:R})),T),TO=(T,{leading:E,trailing:R})=>{if(E!=null&&E.length){const[S,...e]=T;T=[l(S,{leading:E}),...e]}if(R!=null&&R.length){const S=T.slice(0,-1),e=T[T.length-1];T=[...S,l(e,{trailing:R})]}return T},RO={Lexer:s,ParserRules:[{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","statement"],postprocess:T=>T[0].concat([T[1]])},{name:"main",symbols:["main$ebnf$1"],postprocess:([T])=>{const E=T[T.length-1];return E&&!E.hasSemicolon?E.children.length>0?T:T.slice(0,-1):T}},{name:"statement$subexpression$1",symbols:[s.has("DELIMITER")?{type:"DELIMITER"}:DELIMITER]},{name:"statement$subexpression$1",symbols:[s.has("EOF")?{type:"EOF"}:EOF]},{name:"statement",symbols:["expressions_or_clauses","statement$subexpression$1"],postprocess:([T,[E]])=>({type:_.statement,children:T,hasSemicolon:E.type===O.DELIMITER})},{name:"expressions_or_clauses$ebnf$1",symbols:[]},{name:"expressions_or_clauses$ebnf$1",symbols:["expressions_or_clauses$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"expressions_or_clauses$ebnf$2",symbols:[]},{name:"expressions_or_clauses$ebnf$2",symbols:["expressions_or_clauses$ebnf$2","clause"],postprocess:T=>T[0].concat([T[1]])},{name:"expressions_or_clauses",symbols:["expressions_or_clauses$ebnf$1","expressions_or_clauses$ebnf$2"],postprocess:([T,E])=>[...T,...E]},{name:"clause$subexpression$1",symbols:["limit_clause"]},{name:"clause$subexpression$1",symbols:["select_clause"]},{name:"clause$subexpression$1",symbols:["other_clause"]},{name:"clause$subexpression$1",symbols:["set_operation"]},{name:"clause",symbols:["clause$subexpression$1"],postprocess:d},{name:"limit_clause$ebnf$1$subexpression$1$ebnf$1",symbols:["free_form_sql"]},{name:"limit_clause$ebnf$1$subexpression$1$ebnf$1",symbols:["limit_clause$ebnf$1$subexpression$1$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"limit_clause$ebnf$1$subexpression$1",symbols:[s.has("COMMA")?{type:"COMMA"}:COMMA,"limit_clause$ebnf$1$subexpression$1$ebnf$1"]},{name:"limit_clause$ebnf$1",symbols:["limit_clause$ebnf$1$subexpression$1"],postprocess:aE},{name:"limit_clause$ebnf$1",symbols:[],postprocess:()=>null},{name:"limit_clause",symbols:[s.has("LIMIT")?{type:"LIMIT"}:LIMIT,"_","expression_chain_","limit_clause$ebnf$1"],postprocess:([T,E,R,S])=>{if(S){const[e,P]=S;return{type:_.limit_clause,limitKw:l(G(T),{trailing:E}),offset:R,count:P}}else return{type:_.limit_clause,limitKw:l(G(T),{trailing:E}),count:R}}},{name:"select_clause$subexpression$1$ebnf$1",symbols:[]},{name:"select_clause$subexpression$1$ebnf$1",symbols:["select_clause$subexpression$1$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"select_clause$subexpression$1",symbols:["all_columns_asterisk","select_clause$subexpression$1$ebnf$1"]},{name:"select_clause$subexpression$1$ebnf$2",symbols:[]},{name:"select_clause$subexpression$1$ebnf$2",symbols:["select_clause$subexpression$1$ebnf$2","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"select_clause$subexpression$1",symbols:["asteriskless_free_form_sql","select_clause$subexpression$1$ebnf$2"]},{name:"select_clause",symbols:[s.has("RESERVED_SELECT")?{type:"RESERVED_SELECT"}:RESERVED_SELECT,"select_clause$subexpression$1"],postprocess:([T,[E,R]])=>({type:_.clause,nameKw:G(T),children:[E,...R]})},{name:"select_clause",symbols:[s.has("RESERVED_SELECT")?{type:"RESERVED_SELECT"}:RESERVED_SELECT],postprocess:([T])=>({type:_.clause,nameKw:G(T),children:[]})},{name:"all_columns_asterisk",symbols:[s.has("ASTERISK")?{type:"ASTERISK"}:ASTERISK],postprocess:()=>({type:_.all_columns_asterisk})},{name:"other_clause$ebnf$1",symbols:[]},{name:"other_clause$ebnf$1",symbols:["other_clause$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"other_clause",symbols:[s.has("RESERVED_CLAUSE")?{type:"RESERVED_CLAUSE"}:RESERVED_CLAUSE,"other_clause$ebnf$1"],postprocess:([T,E])=>({type:_.clause,nameKw:G(T),children:E})},{name:"set_operation$ebnf$1",symbols:[]},{name:"set_operation$ebnf$1",symbols:["set_operation$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"set_operation",symbols:[s.has("RESERVED_SET_OPERATION")?{type:"RESERVED_SET_OPERATION"}:RESERVED_SET_OPERATION,"set_operation$ebnf$1"],postprocess:([T,E])=>({type:_.set_operation,nameKw:G(T),children:E})},{name:"expression_chain_$ebnf$1",symbols:["expression_with_comments_"]},{name:"expression_chain_$ebnf$1",symbols:["expression_chain_$ebnf$1","expression_with_comments_"],postprocess:T=>T[0].concat([T[1]])},{name:"expression_chain_",symbols:["expression_chain_$ebnf$1"],postprocess:aE},{name:"expression_chain$ebnf$1",symbols:[]},{name:"expression_chain$ebnf$1",symbols:["expression_chain$ebnf$1","_expression_with_comments"],postprocess:T=>T[0].concat([T[1]])},{name:"expression_chain",symbols:["expression","expression_chain$ebnf$1"],postprocess:([T,E])=>[T,...E]},{name:"andless_expression_chain$ebnf$1",symbols:[]},{name:"andless_expression_chain$ebnf$1",symbols:["andless_expression_chain$ebnf$1","_andless_expression_with_comments"],postprocess:T=>T[0].concat([T[1]])},{name:"andless_expression_chain",symbols:["andless_expression","andless_expression_chain$ebnf$1"],postprocess:([T,E])=>[T,...E]},{name:"expression_with_comments_",symbols:["expression","_"],postprocess:([T,E])=>l(T,{trailing:E})},{name:"_expression_with_comments",symbols:["_","expression"],postprocess:([T,E])=>l(E,{leading:T})},{name:"_andless_expression_with_comments",symbols:["_","andless_expression"],postprocess:([T,E])=>l(E,{leading:T})},{name:"free_form_sql$subexpression$1",symbols:["asteriskless_free_form_sql"]},{name:"free_form_sql$subexpression$1",symbols:["asterisk"]},{name:"free_form_sql",symbols:["free_form_sql$subexpression$1"],postprocess:d},{name:"asteriskless_free_form_sql$subexpression$1",symbols:["asteriskless_andless_expression"]},{name:"asteriskless_free_form_sql$subexpression$1",symbols:["logic_operator"]},{name:"asteriskless_free_form_sql$subexpression$1",symbols:["comma"]},{name:"asteriskless_free_form_sql$subexpression$1",symbols:["comment"]},{name:"asteriskless_free_form_sql$subexpression$1",symbols:["other_keyword"]},{name:"asteriskless_free_form_sql",symbols:["asteriskless_free_form_sql$subexpression$1"],postprocess:d},{name:"expression$subexpression$1",symbols:["andless_expression"]},{name:"expression$subexpression$1",symbols:["logic_operator"]},{name:"expression",symbols:["expression$subexpression$1"],postprocess:d},{name:"andless_expression$subexpression$1",symbols:["asteriskless_andless_expression"]},{name:"andless_expression$subexpression$1",symbols:["asterisk"]},{name:"andless_expression",symbols:["andless_expression$subexpression$1"],postprocess:d},{name:"asteriskless_andless_expression$subexpression$1",symbols:["atomic_expression"]},{name:"asteriskless_andless_expression$subexpression$1",symbols:["between_predicate"]},{name:"asteriskless_andless_expression$subexpression$1",symbols:["case_expression"]},{name:"asteriskless_andless_expression",symbols:["asteriskless_andless_expression$subexpression$1"],postprocess:d},{name:"atomic_expression$subexpression$1",symbols:["array_subscript"]},{name:"atomic_expression$subexpression$1",symbols:["function_call"]},{name:"atomic_expression$subexpression$1",symbols:["property_access"]},{name:"atomic_expression$subexpression$1",symbols:["parenthesis"]},{name:"atomic_expression$subexpression$1",symbols:["curly_braces"]},{name:"atomic_expression$subexpression$1",symbols:["square_brackets"]},{name:"atomic_expression$subexpression$1",symbols:["operator"]},{name:"atomic_expression$subexpression$1",symbols:["identifier"]},{name:"atomic_expression$subexpression$1",symbols:["parameter"]},{name:"atomic_expression$subexpression$1",symbols:["literal"]},{name:"atomic_expression$subexpression$1",symbols:["data_type"]},{name:"atomic_expression$subexpression$1",symbols:["keyword"]},{name:"atomic_expression",symbols:["atomic_expression$subexpression$1"],postprocess:d},{name:"array_subscript",symbols:[s.has("ARRAY_IDENTIFIER")?{type:"ARRAY_IDENTIFIER"}:ARRAY_IDENTIFIER,"_","square_brackets"],postprocess:([T,E,R])=>({type:_.array_subscript,array:l({type:_.identifier,quoted:!1,text:T.text},{trailing:E}),parenthesis:R})},{name:"array_subscript",symbols:[s.has("ARRAY_KEYWORD")?{type:"ARRAY_KEYWORD"}:ARRAY_KEYWORD,"_","square_brackets"],postprocess:([T,E,R])=>({type:_.array_subscript,array:l(G(T),{trailing:E}),parenthesis:R})},{name:"function_call",symbols:[s.has("RESERVED_FUNCTION_NAME")?{type:"RESERVED_FUNCTION_NAME"}:RESERVED_FUNCTION_NAME,"_","parenthesis"],postprocess:([T,E,R])=>({type:_.function_call,nameKw:l(G(T),{trailing:E}),parenthesis:R})},{name:"parenthesis",symbols:[{literal:"("},"expressions_or_clauses",{literal:")"}],postprocess:([T,E,R])=>({type:_.parenthesis,children:E,openParen:"(",closeParen:")"})},{name:"curly_braces$ebnf$1",symbols:[]},{name:"curly_braces$ebnf$1",symbols:["curly_braces$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"curly_braces",symbols:[{literal:"{"},"curly_braces$ebnf$1",{literal:"}"}],postprocess:([T,E,R])=>({type:_.parenthesis,children:E,openParen:"{",closeParen:"}"})},{name:"square_brackets$ebnf$1",symbols:[]},{name:"square_brackets$ebnf$1",symbols:["square_brackets$ebnf$1","free_form_sql"],postprocess:T=>T[0].concat([T[1]])},{name:"square_brackets",symbols:[{literal:"["},"square_brackets$ebnf$1",{literal:"]"}],postprocess:([T,E,R])=>({type:_.parenthesis,children:E,openParen:"[",closeParen:"]"})},{name:"property_access$subexpression$1",symbols:["identifier"]},{name:"property_access$subexpression$1",symbols:["array_subscript"]},{name:"property_access$subexpression$1",symbols:["all_columns_asterisk"]},{name:"property_access$subexpression$1",symbols:["parameter"]},{name:"property_access",symbols:["atomic_expression","_",s.has("PROPERTY_ACCESS_OPERATOR")?{type:"PROPERTY_ACCESS_OPERATOR"}:PROPERTY_ACCESS_OPERATOR,"_","property_access$subexpression$1"],postprocess:([T,E,R,S,[e]])=>({type:_.property_access,object:l(T,{trailing:E}),operator:R.text,property:l(e,{leading:S})})},{name:"between_predicate",symbols:[s.has("BETWEEN")?{type:"BETWEEN"}:BETWEEN,"_","andless_expression_chain","_",s.has("AND")?{type:"AND"}:AND,"_","andless_expression"],postprocess:([T,E,R,S,e,P,D])=>({type:_.between_predicate,betweenKw:G(T),expr1:TO(R,{leading:E,trailing:S}),andKw:G(e),expr2:[l(D,{leading:P})]})},{name:"case_expression$ebnf$1",symbols:["expression_chain_"],postprocess:aE},{name:"case_expression$ebnf$1",symbols:[],postprocess:()=>null},{name:"case_expression$ebnf$2",symbols:[]},{name:"case_expression$ebnf$2",symbols:["case_expression$ebnf$2","case_clause"],postprocess:T=>T[0].concat([T[1]])},{name:"case_expression",symbols:[s.has("CASE")?{type:"CASE"}:CASE,"_","case_expression$ebnf$1","case_expression$ebnf$2",s.has("END")?{type:"END"}:END],postprocess:([T,E,R,S,e])=>({type:_.case_expression,caseKw:l(G(T),{trailing:E}),endKw:G(e),expr:R||[],clauses:S})},{name:"case_clause",symbols:[s.has("WHEN")?{type:"WHEN"}:WHEN,"_","expression_chain_",s.has("THEN")?{type:"THEN"}:THEN,"_","expression_chain_"],postprocess:([T,E,R,S,e,P])=>({type:_.case_when,whenKw:l(G(T),{trailing:E}),thenKw:l(G(S),{trailing:e}),condition:R,result:P})},{name:"case_clause",symbols:[s.has("ELSE")?{type:"ELSE"}:ELSE,"_","expression_chain_"],postprocess:([T,E,R])=>({type:_.case_else,elseKw:l(G(T),{trailing:E}),result:R})},{name:"comma$subexpression$1",symbols:[s.has("COMMA")?{type:"COMMA"}:COMMA]},{name:"comma",symbols:["comma$subexpression$1"],postprocess:([[T]])=>({type:_.comma})},{name:"asterisk$subexpression$1",symbols:[s.has("ASTERISK")?{type:"ASTERISK"}:ASTERISK]},{name:"asterisk",symbols:["asterisk$subexpression$1"],postprocess:([[T]])=>({type:_.operator,text:T.text})},{name:"operator$subexpression$1",symbols:[s.has("OPERATOR")?{type:"OPERATOR"}:OPERATOR]},{name:"operator",symbols:["operator$subexpression$1"],postprocess:([[T]])=>({type:_.operator,text:T.text})},{name:"identifier$subexpression$1",symbols:[s.has("IDENTIFIER")?{type:"IDENTIFIER"}:IDENTIFIER]},{name:"identifier$subexpression$1",symbols:[s.has("QUOTED_IDENTIFIER")?{type:"QUOTED_IDENTIFIER"}:QUOTED_IDENTIFIER]},{name:"identifier$subexpression$1",symbols:[s.has("VARIABLE")?{type:"VARIABLE"}:VARIABLE]},{name:"identifier",symbols:["identifier$subexpression$1"],postprocess:([[T]])=>({type:_.identifier,quoted:T.type!=="IDENTIFIER",text:T.text})},{name:"parameter$subexpression$1",symbols:[s.has("NAMED_PARAMETER")?{type:"NAMED_PARAMETER"}:NAMED_PARAMETER]},{name:"parameter$subexpression$1",symbols:[s.has("QUOTED_PARAMETER")?{type:"QUOTED_PARAMETER"}:QUOTED_PARAMETER]},{name:"parameter$subexpression$1",symbols:[s.has("NUMBERED_PARAMETER")?{type:"NUMBERED_PARAMETER"}:NUMBERED_PARAMETER]},{name:"parameter$subexpression$1",symbols:[s.has("POSITIONAL_PARAMETER")?{type:"POSITIONAL_PARAMETER"}:POSITIONAL_PARAMETER]},{name:"parameter$subexpression$1",symbols:[s.has("CUSTOM_PARAMETER")?{type:"CUSTOM_PARAMETER"}:CUSTOM_PARAMETER]},{name:"parameter",symbols:["parameter$subexpression$1"],postprocess:([[T]])=>({type:_.parameter,key:T.key,text:T.text})},{name:"literal$subexpression$1",symbols:[s.has("NUMBER")?{type:"NUMBER"}:NUMBER]},{name:"literal$subexpression$1",symbols:[s.has("STRING")?{type:"STRING"}:STRING]},{name:"literal",symbols:["literal$subexpression$1"],postprocess:([[T]])=>({type:_.literal,text:T.text})},{name:"keyword$subexpression$1",symbols:[s.has("RESERVED_KEYWORD")?{type:"RESERVED_KEYWORD"}:RESERVED_KEYWORD]},{name:"keyword$subexpression$1",symbols:[s.has("RESERVED_KEYWORD_PHRASE")?{type:"RESERVED_KEYWORD_PHRASE"}:RESERVED_KEYWORD_PHRASE]},{name:"keyword$subexpression$1",symbols:[s.has("RESERVED_JOIN")?{type:"RESERVED_JOIN"}:RESERVED_JOIN]},{name:"keyword",symbols:["keyword$subexpression$1"],postprocess:([[T]])=>G(T)},{name:"data_type$subexpression$1",symbols:[s.has("RESERVED_DATA_TYPE")?{type:"RESERVED_DATA_TYPE"}:RESERVED_DATA_TYPE]},{name:"data_type$subexpression$1",symbols:[s.has("RESERVED_DATA_TYPE_PHRASE")?{type:"RESERVED_DATA_TYPE_PHRASE"}:RESERVED_DATA_TYPE_PHRASE]},{name:"data_type",symbols:["data_type$subexpression$1"],postprocess:([[T]])=>zE(T)},{name:"data_type",symbols:[s.has("RESERVED_PARAMETERIZED_DATA_TYPE")?{type:"RESERVED_PARAMETERIZED_DATA_TYPE"}:RESERVED_PARAMETERIZED_DATA_TYPE,"_","parenthesis"],postprocess:([T,E,R])=>({type:_.parameterized_data_type,dataType:l(zE(T),{trailing:E}),parenthesis:R})},{name:"logic_operator$subexpression$1",symbols:[s.has("AND")?{type:"AND"}:AND]},{name:"logic_operator$subexpression$1",symbols:[s.has("OR")?{type:"OR"}:OR]},{name:"logic_operator$subexpression$1",symbols:[s.has("XOR")?{type:"XOR"}:XOR]},{name:"logic_operator",symbols:["logic_operator$subexpression$1"],postprocess:([[T]])=>G(T)},{name:"other_keyword$subexpression$1",symbols:[s.has("WHEN")?{type:"WHEN"}:WHEN]},{name:"other_keyword$subexpression$1",symbols:[s.has("THEN")?{type:"THEN"}:THEN]},{name:"other_keyword$subexpression$1",symbols:[s.has("ELSE")?{type:"ELSE"}:ELSE]},{name:"other_keyword$subexpression$1",symbols:[s.has("END")?{type:"END"}:END]},{name:"other_keyword",symbols:["other_keyword$subexpression$1"],postprocess:([[T]])=>G(T)},{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","comment"],postprocess:T=>T[0].concat([T[1]])},{name:"_",symbols:["_$ebnf$1"],postprocess:([T])=>T},{name:"comment",symbols:[s.has("LINE_COMMENT")?{type:"LINE_COMMENT"}:LINE_COMMENT],postprocess:([T])=>({type:_.line_comment,text:T.text,precedingWhitespace:T.precedingWhitespace})},{name:"comment",symbols:[s.has("BLOCK_COMMENT")?{type:"BLOCK_COMMENT"}:BLOCK_COMMENT],postprocess:([T])=>({type:_.block_comment,text:T.text,precedingWhitespace:T.precedingWhitespace})},{name:"comment",symbols:[s.has("DISABLE_COMMENT")?{type:"DISABLE_COMMENT"}:DISABLE_COMMENT],postprocess:([T])=>({type:_.disable_comment,text:T.text,precedingWhitespace:T.precedingWhitespace})}],ParserStart:"main"},{Parser:AO,Grammar:SO}=$I;function IO(T){let E={};const R=new _T(e=>[...wI(T.tokenize(e,E)),AT(e.length)]),S=new AO(SO.fromCompiled(RO),{lexer:R});return{parse:(e,P)=>{E=P;const{results:D}=S.feed(e);if(D.length===1)return D[0];throw D.length===0?new Error("Parse error: Invalid SQL"):new Error(`Parse error: Ambiguous grammar
|
|
27
27
|
${JSON.stringify(D,void 0,2)}`)}}}var I;(function(T){T[T.SPACE=0]="SPACE",T[T.NO_SPACE=1]="NO_SPACE",T[T.NO_NEWLINE=2]="NO_NEWLINE",T[T.NEWLINE=3]="NEWLINE",T[T.MANDATORY_NEWLINE=4]="MANDATORY_NEWLINE",T[T.INDENT=5]="INDENT",T[T.SINGLE_INDENT=6]="SINGLE_INDENT"})(I=I||(I={}));class sT{constructor(E){this.indentation=E,this.items=[]}add(...E){for(const R of E)switch(R){case I.SPACE:this.items.push(I.SPACE);break;case I.NO_SPACE:this.trimHorizontalWhitespace();break;case I.NO_NEWLINE:this.trimWhitespace();break;case I.NEWLINE:this.trimHorizontalWhitespace(),this.addNewline(I.NEWLINE);break;case I.MANDATORY_NEWLINE:this.trimHorizontalWhitespace(),this.addNewline(I.MANDATORY_NEWLINE);break;case I.INDENT:this.addIndentation();break;case I.SINGLE_INDENT:this.items.push(I.SINGLE_INDENT);break;default:this.items.push(R)}}trimHorizontalWhitespace(){for(;OO(b(this.items));)this.items.pop()}trimWhitespace(){for(;NO(b(this.items));)this.items.pop()}addNewline(E){if(this.items.length>0)switch(b(this.items)){case I.NEWLINE:this.items.pop(),this.items.push(E);break;case I.MANDATORY_NEWLINE:break;default:this.items.push(E);break}}addIndentation(){for(let E=0;E<this.indentation.getLevel();E++)this.items.push(I.SINGLE_INDENT)}toString(){return this.items.map(E=>this.itemToString(E)).join("")}getLayoutItems(){return this.items}isAtStartOfLine(){for(let E=this.items.length-1;E>=0;E--){const R=this.items[E];if(R!==I.SINGLE_INDENT)return R===I.NEWLINE||R===I.MANDATORY_NEWLINE}return!1}itemToString(E){switch(E){case I.SPACE:return" ";case I.NEWLINE:case I.MANDATORY_NEWLINE:return`
|
|
28
28
|
`;case I.SINGLE_INDENT:return this.indentation.getSingleIndent();default:return E}}}const OO=T=>T===I.SPACE||T===I.SINGLE_INDENT,NO=T=>T===I.SPACE||T===I.SINGLE_INDENT||T===I.NEWLINE;function ET(T,E){if(E==="standard")return T;let R=[];return T.length>=10&&T.includes(" ")&&([T,...R]=T.split(" ")),E==="tabularLeft"?T=T.padEnd(9," "):T=T.padStart(9," "),T+["",...R].join(" ")}function TT(T){return mT(T)||T===O.RESERVED_CLAUSE||T===O.RESERVED_SELECT||T===O.RESERVED_SET_OPERATION||T===O.RESERVED_JOIN||T===O.LIMIT}const PE="top-level",eO="block-level";class rT{constructor(E){this.indent=E,this.indentTypes=[]}getSingleIndent(){return this.indent}getLevel(){return this.indentTypes.length}increaseTopLevel(){this.indentTypes.push(PE)}increaseBlockLevel(){this.indentTypes.push(eO)}decreaseTopLevel(){this.indentTypes.length>0&&b(this.indentTypes)===PE&&this.indentTypes.pop()}decreaseBlockLevel(){for(;this.indentTypes.length>0&&this.indentTypes.pop()===PE;);}}class LO extends sT{constructor(E){super(new rT("")),this.expressionWidth=E,this.length=0,this.trailingSpace=!1}add(...E){if(E.forEach(R=>this.addToLength(R)),this.length>this.expressionWidth)throw new nE;super.add(...E)}addToLength(E){if(typeof E=="string")this.length+=E.length,this.trailingSpace=!1;else{if(E===I.MANDATORY_NEWLINE||E===I.NEWLINE)throw new nE;E===I.INDENT||E===I.SINGLE_INDENT||E===I.SPACE?this.trailingSpace||(this.length++,this.trailingSpace=!0):(E===I.NO_NEWLINE||E===I.NO_SPACE)&&this.trailingSpace&&(this.trailingSpace=!1,this.length--)}}}class nE extends Error{}class w{constructor({cfg:E,dialectCfg:R,params:S,layout:e,inline:P=!1}){this.inline=!1,this.nodes=[],this.index=-1,this.cfg=E,this.dialectCfg=R,this.inline=P,this.params=S,this.layout=e}format(E){for(this.nodes=E,this.index=0;this.index<this.nodes.length;this.index++)this.formatNode(this.nodes[this.index]);return this.layout}formatNode(E){this.formatComments(E.leadingComments),this.formatNodeWithoutComments(E),this.formatComments(E.trailingComments)}formatNodeWithoutComments(E){switch(E.type){case _.function_call:return this.formatFunctionCall(E);case _.parameterized_data_type:return this.formatParameterizedDataType(E);case _.array_subscript:return this.formatArraySubscript(E);case _.property_access:return this.formatPropertyAccess(E);case _.parenthesis:return this.formatParenthesis(E);case _.between_predicate:return this.formatBetweenPredicate(E);case _.case_expression:return this.formatCaseExpression(E);case _.case_when:return this.formatCaseWhen(E);case _.case_else:return this.formatCaseElse(E);case _.clause:return this.formatClause(E);case _.set_operation:return this.formatSetOperation(E);case _.limit_clause:return this.formatLimitClause(E);case _.all_columns_asterisk:return this.formatAllColumnsAsterisk(E);case _.literal:return this.formatLiteral(E);case _.identifier:return this.formatIdentifier(E);case _.parameter:return this.formatParameter(E);case _.operator:return this.formatOperator(E);case _.comma:return this.formatComma(E);case _.line_comment:return this.formatLineComment(E);case _.block_comment:return this.formatBlockComment(E);case _.disable_comment:return this.formatBlockComment(E);case _.data_type:return this.formatDataType(E);case _.keyword:return this.formatKeywordNode(E)}}formatFunctionCall(E){this.withComments(E.nameKw,()=>{this.layout.add(this.showFunctionKw(E.nameKw))}),this.formatNode(E.parenthesis)}formatParameterizedDataType(E){this.withComments(E.dataType,()=>{this.layout.add(this.showDataType(E.dataType))}),this.formatNode(E.parenthesis)}formatArraySubscript(E){let R;switch(E.array.type){case _.data_type:R=this.showDataType(E.array);break;case _.keyword:R=this.showKw(E.array);break;default:R=this.showIdentifier(E.array);break}this.withComments(E.array,()=>{this.layout.add(R)}),this.formatNode(E.parenthesis)}formatPropertyAccess(E){this.formatNode(E.object),this.layout.add(I.NO_SPACE,E.operator),this.formatNode(E.property)}formatParenthesis(E){const R=this.formatInlineExpression(E.children);R?(this.layout.add(E.openParen),this.layout.add(...R.getLayoutItems()),this.layout.add(I.NO_SPACE,E.closeParen,I.SPACE)):(this.layout.add(E.openParen,I.NEWLINE),h(this.cfg)?(this.layout.add(I.INDENT),this.layout=this.formatSubExpression(E.children)):(this.layout.indentation.increaseBlockLevel(),this.layout.add(I.INDENT),this.layout=this.formatSubExpression(E.children),this.layout.indentation.decreaseBlockLevel()),this.layout.add(I.NEWLINE,I.INDENT,E.closeParen,I.SPACE))}formatBetweenPredicate(E){this.layout.add(this.showKw(E.betweenKw),I.SPACE),this.layout=this.formatSubExpression(E.expr1),this.layout.add(I.NO_SPACE,I.SPACE,this.showNonTabularKw(E.andKw),I.SPACE),this.layout=this.formatSubExpression(E.expr2),this.layout.add(I.SPACE)}formatCaseExpression(E){this.formatNode(E.caseKw),this.layout.indentation.increaseBlockLevel(),this.layout=this.formatSubExpression(E.expr),this.layout=this.formatSubExpression(E.clauses),this.layout.indentation.decreaseBlockLevel(),this.layout.add(I.NEWLINE,I.INDENT),this.formatNode(E.endKw)}formatCaseWhen(E){this.layout.add(I.NEWLINE,I.INDENT),this.formatNode(E.whenKw),this.layout=this.formatSubExpression(E.condition),this.formatNode(E.thenKw),this.layout=this.formatSubExpression(E.result)}formatCaseElse(E){this.layout.add(I.NEWLINE,I.INDENT),this.formatNode(E.elseKw),this.layout=this.formatSubExpression(E.result)}formatClause(E){this.isOnelineClause(E)?this.formatClauseInOnelineStyle(E):h(this.cfg)?this.formatClauseInTabularStyle(E):this.formatClauseInIndentedStyle(E)}isOnelineClause(E){return h(this.cfg)?this.dialectCfg.tabularOnelineClauses[E.nameKw.text]:this.dialectCfg.onelineClauses[E.nameKw.text]}formatClauseInIndentedStyle(E){this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E.nameKw),I.NEWLINE),this.layout.indentation.increaseTopLevel(),this.layout.add(I.INDENT),this.layout=this.formatSubExpression(E.children),this.layout.indentation.decreaseTopLevel()}formatClauseInOnelineStyle(E){this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E.nameKw),I.SPACE),this.layout=this.formatSubExpression(E.children)}formatClauseInTabularStyle(E){this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E.nameKw),I.SPACE),this.layout.indentation.increaseTopLevel(),this.layout=this.formatSubExpression(E.children),this.layout.indentation.decreaseTopLevel()}formatSetOperation(E){this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E.nameKw),I.NEWLINE),this.layout.add(I.INDENT),this.layout=this.formatSubExpression(E.children)}formatLimitClause(E){this.withComments(E.limitKw,()=>{this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E.limitKw))}),this.layout.indentation.increaseTopLevel(),h(this.cfg)?this.layout.add(I.SPACE):this.layout.add(I.NEWLINE,I.INDENT),E.offset?(this.layout=this.formatSubExpression(E.offset),this.layout.add(I.NO_SPACE,",",I.SPACE),this.layout=this.formatSubExpression(E.count)):this.layout=this.formatSubExpression(E.count),this.layout.indentation.decreaseTopLevel()}formatAllColumnsAsterisk(E){this.layout.add("*",I.SPACE)}formatLiteral(E){this.layout.add(E.text,I.SPACE)}formatIdentifier(E){this.layout.add(this.showIdentifier(E),I.SPACE)}formatParameter(E){this.layout.add(this.params.get(E),I.SPACE)}formatOperator({text:E}){E==="-"&&this.dialectCfg.identifierDashes?this.layout.add(E,I.SPACE):this.cfg.denseOperators||this.dialectCfg.alwaysDenseOperators.includes(E)?this.layout.add(I.NO_SPACE,E):E===":"?this.layout.add(I.NO_SPACE,E,I.SPACE):this.layout.add(E,I.SPACE)}formatComma(E){this.inline?this.layout.add(I.NO_SPACE,",",I.SPACE):this.layout.add(I.NO_SPACE,",",I.NEWLINE,I.INDENT)}withComments(E,R){this.formatComments(E.leadingComments),R(),this.formatComments(E.trailingComments)}formatComments(E){E&&E.forEach(R=>{R.type===_.line_comment?this.formatLineComment(R):this.formatBlockComment(R)})}formatLineComment(E){rE(E.precedingWhitespace||"")?this.layout.add(I.NEWLINE,I.INDENT,E.text,I.MANDATORY_NEWLINE,I.INDENT):this.layout.getLayoutItems().length>0?this.layout.add(I.NO_NEWLINE,I.SPACE,E.text,I.MANDATORY_NEWLINE,I.INDENT):this.layout.add(E.text,I.MANDATORY_NEWLINE,I.INDENT)}formatBlockComment(E){E.type===_.block_comment&&this.isStandaloneBlockComment(E)?(this.splitBlockComment(E.text).forEach(R=>{this.layout.add(I.NEWLINE,I.INDENT,R)}),this.layout.add(I.NEWLINE,I.INDENT)):this.layout.add(E.text,I.SPACE)}isStandaloneBlockComment(E){return rE(E.text)||rE(E.precedingWhitespace||"")||this.layout.isAtStartOfLine()}isDocComment(E){const R=E.split(/\n/);return/^\/\*\*?$/.test(R[0])&&R.slice(1,R.length-1).every(S=>/^\s*\*/.test(S))&&/^\s*\*\/$/.test(b(R))}splitBlockComment(E){return this.isDocComment(E)?E.split(/\n/).map(R=>/^\s*\*/.test(R)?" "+R.replace(/^\s*/,""):R):E.split(/\n/).map(R=>R.replace(/^\s*/,""))}formatSubExpression(E){return new w({cfg:this.cfg,dialectCfg:this.dialectCfg,params:this.params,layout:this.layout,inline:this.inline}).format(E)}formatInlineExpression(E){const R=this.params.getPositionalParameterIndex();try{return new w({cfg:this.cfg,dialectCfg:this.dialectCfg,params:this.params,layout:new LO(this.cfg.expressionWidth),inline:!0}).format(E)}catch(S){if(S instanceof nE){this.params.setPositionalParameterIndex(R);return}else throw S}}formatKeywordNode(E){switch(E.tokenType){case O.RESERVED_JOIN:return this.formatJoin(E);case O.AND:case O.OR:case O.XOR:return this.formatLogicalOperator(E);default:return this.formatKeyword(E)}}formatJoin(E){h(this.cfg)?(this.layout.indentation.decreaseTopLevel(),this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E),I.SPACE),this.layout.indentation.increaseTopLevel()):this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E),I.SPACE)}formatKeyword(E){this.layout.add(this.showKw(E),I.SPACE)}formatLogicalOperator(E){this.cfg.logicalOperatorNewline==="before"?h(this.cfg)?(this.layout.indentation.decreaseTopLevel(),this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E),I.SPACE),this.layout.indentation.increaseTopLevel()):this.layout.add(I.NEWLINE,I.INDENT,this.showKw(E),I.SPACE):this.layout.add(this.showKw(E),I.NEWLINE,I.INDENT)}formatDataType(E){this.layout.add(this.showDataType(E),I.SPACE)}showKw(E){return TT(E.tokenType)?ET(this.showNonTabularKw(E),this.cfg.indentStyle):this.showNonTabularKw(E)}showNonTabularKw(E){switch(this.cfg.keywordCase){case"preserve":return v(E.raw);case"upper":return E.text;case"lower":return E.text.toLowerCase()}}showFunctionKw(E){return TT(E.tokenType)?ET(this.showNonTabularFunctionKw(E),this.cfg.indentStyle):this.showNonTabularFunctionKw(E)}showNonTabularFunctionKw(E){switch(this.cfg.functionCase){case"preserve":return v(E.raw);case"upper":return E.text;case"lower":return E.text.toLowerCase()}}showIdentifier(E){if(E.quoted)return E.text;switch(this.cfg.identifierCase){case"preserve":return E.text;case"upper":return E.text.toUpperCase();case"lower":return E.text.toLowerCase()}}showDataType(E){switch(this.cfg.dataTypeCase){case"preserve":return v(E.raw);case"upper":return E.text;case"lower":return E.text.toLowerCase()}}}class CO{constructor(E,R){this.dialect=E,this.cfg=R,this.params=new gI(this.cfg.params)}format(E){const R=this.parse(E);return this.formatAst(R).trimEnd()}parse(E){return IO(this.dialect.tokenizer).parse(E,this.cfg.paramTypes||{})}formatAst(E){return E.map(R=>this.formatStatement(R)).join(`
|
|
29
|
-
`.repeat(this.cfg.linesBetweenQueries+1))}formatStatement(E){const R=new w({cfg:this.cfg,dialectCfg:this.dialect.formatOptions,params:this.params,layout:new sT(new rT(bI(this.cfg)))}).format(E.children);return E.hasSemicolon&&(this.cfg.newlineBeforeSemicolon?R.add(I.NEWLINE,";"):R.add(I.NO_NEWLINE,";")),R.toString()}}class $ extends Error{}function tO(T){const E=["multilineLists","newlineBeforeOpenParen","newlineBeforeCloseParen","aliasAs","commaPosition","tabulateAlias"];for(const R of E)if(R in T)throw new $(`${R} config is no more supported.`);if(T.expressionWidth<=0)throw new $(`expressionWidth config must be positive number. Received ${T.expressionWidth} instead.`);if(T.params&&!_O(T.params)&&console.warn('WARNING: All "params" option values should be strings.'),T.paramTypes&&!sO(T.paramTypes))throw new $("Empty regex given in custom paramTypes. That would result in matching infinite amount of parameters.");return T}function _O(T){return(T instanceof Array?T:Object.values(T)).every(R=>typeof R=="string")}function sO(T){return T.custom&&Array.isArray(T.custom)?T.custom.every(E=>E.regex!==""):!0}var rO=function(T,E){var R={};for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&E.indexOf(S)<0&&(R[S]=T[S]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,S=Object.getOwnPropertySymbols(T);e<S.length;e++)E.indexOf(S[e])<0&&Object.prototype.propertyIsEnumerable.call(T,S[e])&&(R[S[e]]=T[S[e]]);return R};const DT={bigquery:"bigquery",clickhouse:"clickhouse",db2:"db2",db2i:"db2i",duckdb:"duckdb",hive:"hive",mariadb:"mariadb",mysql:"mysql",n1ql:"n1ql",plsql:"plsql",postgresql:"postgresql",redshift:"redshift",spark:"spark",sqlite:"sqlite",sql:"sql",tidb:"tidb",trino:"trino",transactsql:"transactsql",tsql:"transactsql",singlestoredb:"singlestoredb",snowflake:"snowflake"},DO=Object.keys(DT),aO={tabWidth:2,useTabs:!1,keywordCase:"preserve",identifierCase:"preserve",dataTypeCase:"preserve",functionCase:"preserve",indentStyle:"standard",logicalOperatorNewline:"before",expressionWidth:50,linesBetweenQueries:1,denseOperators:!1,newlineBeforeSemicolon:!1},PO=(T,E={})=>{if(typeof E.language=="string"&&!DO.includes(E.language))throw new $(`Unsupported SQL dialect: ${E.language}`);const R=DT[E.language||"sql"];return nO(T,Object.assign(Object.assign({},E),{dialect:lI[R]}))},nO=(T,E)=>{var{dialect:R}=E,S=rO(E,["dialect"]);if(typeof T!="string")throw new Error("Invalid query argument. Expected string, instead got "+typeof T);const e=tO(Object.assign(Object.assign({},aO),S));return new CO(yI(R),e).format(T)},iO=["SELECT","FROM","WHERE","AND","OR","NOT","IN","IS","NULL","JOIN","LEFT","RIGHT","INNER","OUTER","ON","AS","DISTINCT","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","ALTER","DROP","TABLE","INDEX","VIEW","ORDER","BY","ASC","DESC","GROUP","HAVING","LIMIT","OFFSET","UNION","ALL","CASE","WHEN","THEN","ELSE","END","COUNT","SUM","AVG","MIN","MAX","LIKE","BETWEEN","EXISTS","PRIMARY","KEY","FOREIGN","REFERENCES","CASCADE","CONSTRAINT","BEGIN","COMMIT","ROLLBACK","TRANSACTION"];function MO(T){let E=T;E=E.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),E=E.replace(/'([^']*)'/g,`<span class="sql-string">'$1'</span>`),E=E.replace(/\b(\d+)\b/g,'<span class="sql-number">$1</span>'),E=E.replace(/(\$\d+|\?|:\w+)/g,'<span class="sql-param">$1</span>');const R=new RegExp(`\\b(${iO.join("|")})\\b`,"gi");return E=E.replace(R,'<span class="sql-keyword">$1</span>'),E}function UO({query:T,parameters:E,duration:R,slow:S}){const[e,P]=g.useState(!0),[D,F]=g.useState(!1),H=g.useMemo(()=>{if(!e)return T;try{return PO(T,{language:"postgresql",keywordCase:"upper",indentStyle:"standard"})}catch{return T}},[T,e]),N=g.useMemo(()=>MO(H),[H]),L=async()=>{try{await navigator.clipboard.writeText(H),F(!0),UE.success("SQL copied!"),setTimeout(()=>F(!1),2e3)}catch{UE.error("Failed to copy")}};return r.jsxs("div",{className:"card overflow-hidden",children:[r.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"SQL Query"}),R!==void 0&&r.jsxs("span",{className:`text-sm font-medium ${S?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400"}`,children:[R,"ms"]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("button",{onClick:()=>P(!e),className:`p-2 rounded-lg transition-colors ${e?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400":"hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500"}`,title:e?"Show raw SQL":"Format SQL",children:e?r.jsx(oT,{className:"h-4 w-4"}):r.jsx(GT,{className:"h-4 w-4"})}),r.jsx("button",{onClick:L,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Copy SQL",children:D?r.jsx(MT,{className:"h-4 w-4 text-green-500"}):r.jsx(UT,{className:"h-4 w-4 text-gray-500"})})]})]}),r.jsx("div",{className:"p-4 bg-gray-50 dark:bg-gray-900 overflow-x-auto",children:r.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap text-gray-800 dark:text-gray-100",dangerouslySetInnerHTML:{__html:N}})}),E&&E.length>0&&r.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:[r.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"Parameters:"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:E.map((C,t)=>r.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded bg-gray-200 dark:bg-gray-800 text-sm font-mono",children:[r.jsxs("span",{className:"text-purple-600 dark:text-purple-400 mr-1",children:["$",t+1,":"]}),r.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:C===null?r.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"NULL"}):typeof C=="string"?r.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["'",C,"'"]}):r.jsx("span",{className:"text-amber-600 dark:text-yellow-400",children:String(C)})})]},t))})]})]})}function oO(T){return T<1e3?`${T} ms`:`${(T/1e3).toFixed(2)} s`}function uO({entry:T}){const{payload:E,createdAt:R}=T;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"card",children:[r.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Query Details"})}),r.jsx("div",{className:"p-4",children:r.jsxs("dl",{className:"
|
|
29
|
+
`.repeat(this.cfg.linesBetweenQueries+1))}formatStatement(E){const R=new w({cfg:this.cfg,dialectCfg:this.dialect.formatOptions,params:this.params,layout:new sT(new rT(bI(this.cfg)))}).format(E.children);return E.hasSemicolon&&(this.cfg.newlineBeforeSemicolon?R.add(I.NEWLINE,";"):R.add(I.NO_NEWLINE,";")),R.toString()}}class $ extends Error{}function tO(T){const E=["multilineLists","newlineBeforeOpenParen","newlineBeforeCloseParen","aliasAs","commaPosition","tabulateAlias"];for(const R of E)if(R in T)throw new $(`${R} config is no more supported.`);if(T.expressionWidth<=0)throw new $(`expressionWidth config must be positive number. Received ${T.expressionWidth} instead.`);if(T.params&&!_O(T.params)&&console.warn('WARNING: All "params" option values should be strings.'),T.paramTypes&&!sO(T.paramTypes))throw new $("Empty regex given in custom paramTypes. That would result in matching infinite amount of parameters.");return T}function _O(T){return(T instanceof Array?T:Object.values(T)).every(R=>typeof R=="string")}function sO(T){return T.custom&&Array.isArray(T.custom)?T.custom.every(E=>E.regex!==""):!0}var rO=function(T,E){var R={};for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&E.indexOf(S)<0&&(R[S]=T[S]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,S=Object.getOwnPropertySymbols(T);e<S.length;e++)E.indexOf(S[e])<0&&Object.prototype.propertyIsEnumerable.call(T,S[e])&&(R[S[e]]=T[S[e]]);return R};const DT={bigquery:"bigquery",clickhouse:"clickhouse",db2:"db2",db2i:"db2i",duckdb:"duckdb",hive:"hive",mariadb:"mariadb",mysql:"mysql",n1ql:"n1ql",plsql:"plsql",postgresql:"postgresql",redshift:"redshift",spark:"spark",sqlite:"sqlite",sql:"sql",tidb:"tidb",trino:"trino",transactsql:"transactsql",tsql:"transactsql",singlestoredb:"singlestoredb",snowflake:"snowflake"},DO=Object.keys(DT),aO={tabWidth:2,useTabs:!1,keywordCase:"preserve",identifierCase:"preserve",dataTypeCase:"preserve",functionCase:"preserve",indentStyle:"standard",logicalOperatorNewline:"before",expressionWidth:50,linesBetweenQueries:1,denseOperators:!1,newlineBeforeSemicolon:!1},PO=(T,E={})=>{if(typeof E.language=="string"&&!DO.includes(E.language))throw new $(`Unsupported SQL dialect: ${E.language}`);const R=DT[E.language||"sql"];return nO(T,Object.assign(Object.assign({},E),{dialect:lI[R]}))},nO=(T,E)=>{var{dialect:R}=E,S=rO(E,["dialect"]);if(typeof T!="string")throw new Error("Invalid query argument. Expected string, instead got "+typeof T);const e=tO(Object.assign(Object.assign({},aO),S));return new CO(yI(R),e).format(T)},iO=["SELECT","FROM","WHERE","AND","OR","NOT","IN","IS","NULL","JOIN","LEFT","RIGHT","INNER","OUTER","ON","AS","DISTINCT","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","ALTER","DROP","TABLE","INDEX","VIEW","ORDER","BY","ASC","DESC","GROUP","HAVING","LIMIT","OFFSET","UNION","ALL","CASE","WHEN","THEN","ELSE","END","COUNT","SUM","AVG","MIN","MAX","LIKE","BETWEEN","EXISTS","PRIMARY","KEY","FOREIGN","REFERENCES","CASCADE","CONSTRAINT","BEGIN","COMMIT","ROLLBACK","TRANSACTION"];function MO(T){let E=T;E=E.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),E=E.replace(/'([^']*)'/g,`<span class="sql-string">'$1'</span>`),E=E.replace(/\b(\d+)\b/g,'<span class="sql-number">$1</span>'),E=E.replace(/(\$\d+|\?|:\w+)/g,'<span class="sql-param">$1</span>');const R=new RegExp(`\\b(${iO.join("|")})\\b`,"gi");return E=E.replace(R,'<span class="sql-keyword">$1</span>'),E}function UO({query:T,parameters:E,duration:R,slow:S}){const[e,P]=g.useState(!0),[D,F]=g.useState(!1),H=g.useMemo(()=>{if(!e)return T;try{return PO(T,{language:"postgresql",keywordCase:"upper",indentStyle:"standard"})}catch{return T}},[T,e]),N=g.useMemo(()=>MO(H),[H]),L=async()=>{try{await navigator.clipboard.writeText(H),F(!0),UE.success("SQL copied!"),setTimeout(()=>F(!1),2e3)}catch{UE.error("Failed to copy")}};return r.jsxs("div",{className:"card overflow-hidden",children:[r.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"SQL Query"}),R!==void 0&&r.jsxs("span",{className:`text-sm font-medium ${S?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400"}`,children:[R,"ms"]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("button",{onClick:()=>P(!e),className:`p-2 rounded-lg transition-colors ${e?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400":"hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500"}`,title:e?"Show raw SQL":"Format SQL",children:e?r.jsx(oT,{className:"h-4 w-4"}):r.jsx(GT,{className:"h-4 w-4"})}),r.jsx("button",{onClick:L,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Copy SQL",children:D?r.jsx(MT,{className:"h-4 w-4 text-green-500"}):r.jsx(UT,{className:"h-4 w-4 text-gray-500"})})]})]}),r.jsx("div",{className:"p-4 bg-gray-50 dark:bg-gray-900 overflow-x-auto",children:r.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap text-gray-800 dark:text-gray-100",dangerouslySetInnerHTML:{__html:N}})}),E&&E.length>0&&r.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:[r.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"Parameters:"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:E.map((C,t)=>r.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-sm bg-gray-200 dark:bg-gray-800 text-sm font-mono",children:[r.jsxs("span",{className:"text-purple-600 dark:text-purple-400 mr-1",children:["$",t+1,":"]}),r.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:C===null?r.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"NULL"}):typeof C=="string"?r.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["'",C,"'"]}):r.jsx("span",{className:"text-amber-600 dark:text-yellow-400",children:String(C)})})]},t))})]})]})}function oO(T){return T<1e3?`${T} ms`:`${(T/1e3).toFixed(2)} s`}function uO({entry:T}){const{payload:E,createdAt:R}=T;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"card",children:[r.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Query Details"})}),r.jsx("div",{className:"p-4",children:r.jsxs("dl",{className:"*:not-first:border-y-0",children:[r.jsx(K,{label:"Time",value:r.jsxs("span",{children:[nT(oE(R),"MMMM do yyyy, h:mm:ss a")," ",r.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",PT(oE(R),{addSuffix:!0}),")"]})]})}),r.jsx(K,{label:"Source",value:r.jsx(GE,{listType:"queries",filterType:"sources",filterValue:E.source,clickable:!!E.source,children:E.source||"unknown"})}),r.jsx(K,{label:"Connection",value:E.connection||"default"}),r.jsx(K,{label:"Duration",value:r.jsx("span",{className:E.slow?"text-red-600 dark:text-red-400 font-medium":"",children:oO(E.duration)})}),r.jsx(K,{label:"Status",value:E.slow?r.jsx(GE,{listType:"queries",children:"SLOW"}):r.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Normal"})})]})})]}),r.jsx(UO,{query:E.query,parameters:E.parameters,duration:E.duration,slow:E.slow}),E.stack&&r.jsxs("div",{className:"card",children:[r.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:r.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Call Stack"})}),r.jsx("div",{className:"p-4 bg-gray-900 dark:bg-gray-950 overflow-x-auto",children:r.jsx("pre",{className:"text-sm text-gray-300 font-mono whitespace-pre-wrap",children:E.stack})})]})]})}export{uO as default};
|
package/dist/dashboard/public/assets/{RedisDetailView-EHqxefP1.js → RedisDetailView-B2ckYL3H.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,D as u,b as f,C as y}from"./index-
|
|
1
|
+
import{j as e,D as u,b as f,C as y}from"./index-BaD1MX7a.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-BC_kcJT3.js";import{C as n}from"./types-BHYinjn2.js";import{u as x,C as m,T as C}from"./EntryDetailPage-DUWwJ_hP.js";import{C as w}from"./CopyButton-DaF0vYeo.js";import{C as T}from"./circle-check-big-DZttXeD-.js";import{C as g}from"./circle-x-CioeSSBA.js";import"./search-BtkJjUPF.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:"*:not-first:border-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-
|
|
1
|
+
import{j as a,D as l}from"./index-BaD1MX7a.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-Tnp0JBDF.js";import{u as I,k as K,C as c}from"./types-BHYinjn2.js";import{T as n,D as U,b as $}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.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};
|