import{F as e,M as t,r as n,t as r}from"./dist-Cm9oLHSV.js";var i=12,a=/^\d{2}:\d{2}:\d{2}\.\d{3}/,o=/^\d{2}:\d{2}:\d{2}\.\d{3} (Slow )?(\d{3}) (GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS) (\S+)/,s=4,c=/^\d{2}:\d{2}:\d{2}\.\d{3} (?:JS Error|ERROR):/,l=/^\d{2}:\d{2}:\d{2}\.\d{3} JS Info:/,u=/^\d{2}:\d{2}:\d{2}\.\d{3} (Slow (?:recursive )?query)( took )(\d+ms)(?:: (.+))?/,d=3e4,f=r.mark({class:`cm-log-timestamp`}),p=r.mark({class:`cm-log-slow`}),m=r.mark({class:`cm-log-verb`}),h=r.mark({class:`cm-log-url`}),g=r.mark({class:`cm-log-query-verb`}),_=r.mark({class:`cm-log-sql`}),v=r.line({class:`cm-log-http`}),y=r.line({class:`cm-log-query`}),b=r.line({class:`cm-log-error`}),x=r.line({class:`cm-log-info`}),S={2:r.mark({class:`cm-log-status cm-log-status-2xx`}),3:r.mark({class:`cm-log-status cm-log-status-3xx`}),4:r.mark({class:`cm-log-status cm-log-status-4xx`}),5:r.mark({class:`cm-log-status cm-log-status-5xx`})},C=n.baseTheme({".cm-log-timestamp":{color:`var(--log-timestamp-color, var(--muted-text-color))`},".cm-log-http":{backgroundColor:`var(--log-http-line-background-color, color-mix(in srgb, var(--main-text-color) 3%, transparent))`},".cm-log-slow":{fontWeight:`bold`,color:`var(--log-slow-color, #d29922)`},".cm-log-verb":{fontWeight:`bold`,color:`var(--log-http-verb-color, #539bf5)`},".cm-log-url":{color:`var(--log-http-url-color, #268a8a)`},".cm-log-query":{backgroundColor:`var(--log-query-line-background-color, color-mix(in srgb, var(--main-text-color) 3%, transparent))`},".cm-log-query-verb":{fontWeight:`bold`,color:`var(--log-query-verb-color, #bf3989)`},".cm-log-sql":{color:`var(--log-sql-color, #8957e5)`},".cm-log-status":{fontWeight:`bold`},".cm-log-status-2xx":{color:`var(--log-status-success-color, #2ea043)`},".cm-log-status-3xx":{color:`var(--log-status-redirect-color, var(--muted-text-color))`},".cm-log-status-4xx":{color:`var(--log-status-client-error-color, #d29922)`},".cm-log-status-5xx":{color:`var(--log-status-server-error-color, #e5534b)`},".cm-log-error":{color:`var(--log-error-color, #e5534b)`,backgroundColor:`var(--log-error-line-background-color, transparent)`},".cm-log-info":{color:`var(--log-info-color, inherit)`}}),w=[e.define({create(e){return T(e)},update(e,t){return t.docChanged?T(t.state):e},provide:e=>n.decorations.from(e)}),C];function T(e){let n=new t,r=e.doc,i=Math.max(1,r.lines-d+1),a=null;for(let e=i;e<=r.lines;e++)a=D(n,r.line(e),a);return n.finish()}function E(e){return c.test(e)?b:l.test(e)?x:null}function D(e,t,n){let{from:r,text:c}=t;if(!a.test(c))return n&&e.add(r,r,n),n;let l=o.exec(c),d=l?null:u.exec(c),b=l?null:E(c);if(l?e.add(r,r,v):d?e.add(r,r,y):b&&e.add(r,r,b),e.add(r,r+i,f),l){let[,t=``,n,a,o]=l,c=r+i+1,u=c+t.length,d=u+4,f=d+a.length+1;t&&e.add(c,c+s,p);let g=S[n[0]];g&&e.add(u,u+3,g),e.add(d,d+a.length,m),e.add(f,f+o.length,h)}else if(d){let[,t,n,a,o]=d,s=r+i+1,c=s+t.length;if(e.add(s,c,g),o){let t=c+n.length+a.length+2;e.add(t,t+o.length,_)}}return b}export{w as n,d as t};