@spotlightjs/spotlight 2.6.1 → 2.6.2

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/bin/run.js CHANGED
@@ -3,10 +3,28 @@ import { setupSidecar } from '@spotlightjs/sidecar';
3
3
  import { inflateRawSync } from 'node:zlib';
4
4
  import { readFileSync } from 'node:fs';
5
5
  import { join } from 'node:path';
6
- import * as sea from 'node:sea';
7
6
  import { fileURLToPath } from 'node:url';
7
+ import Module from 'node:module';
8
+ const require = Module.createRequire(import.meta.url);
9
+ let sea = null;
10
+ try {
11
+ // This is to maintain compatibility with Node 20.11- as
12
+ // the `node:sea` module is added in Node 20.12+
13
+ sea = require('node:sea');
14
+ } catch {
15
+ sea = { isSea: () => false };
16
+ }
17
+
18
+ const readAsset = sea.isSea()
19
+ ? name => Buffer.from(sea.getRawAsset(name))
20
+ : (() => {
21
+ const ASSET_DIR = join(fileURLToPath(import.meta.url), '../../dist/overlay/');
22
+
23
+ return name => readFileSync(join(ASSET_DIR, name));
24
+ })();
8
25
 
9
- if (process.stdout.isTTY) {
26
+ const MAX_COLS = process.stdout.columns;
27
+ if (process.stdout.isTTY && MAX_COLS > 34) {
10
28
  const data = Uint8Array.from(
11
29
  inflateRawSync(
12
30
  Buffer.from(
@@ -38,7 +56,7 @@ if (process.stdout.isTTY) {
38
56
  lim = Math.round(lim * (1 + factor));
39
57
  r = Math.round(Math.random() * 18);
40
58
  } else {
41
- while (p-- >= 0) {
59
+ while (p-- >= 0 && col < MAX_COLS) {
42
60
  if (col < lim - 1) {
43
61
  process.stdout.write(M_COL);
44
62
  } else if (col === lim - 1) {
@@ -55,21 +73,13 @@ if (process.stdout.isTTY) {
55
73
  process.stdout.write(NL);
56
74
  }
57
75
 
58
- const readAsset = sea.isSea()
59
- ? name => Buffer.from(sea.getRawAsset(name))
60
- : (() => {
61
- const ASSET_DIR = join(fileURLToPath(import.meta.url), '../../dist/overlay/');
62
-
63
- return name => readFileSync(join(ASSET_DIR, name));
64
- })();
65
-
66
76
  const port = process.argv.length >= 3 ? Number(process.argv[2]) : undefined;
67
77
  const MANIFEST_NAME = 'manifest.json';
68
78
  const ENTRY_POINT_NAME = 'src/index.html';
69
79
  const basePath = process.cwd();
70
80
  const filesToServe = Object.create(null);
71
81
 
72
- // Following the guide here: https://vite.dev/guide/backend-integration.html
82
+ // Following the guide here: https://vite.dev/guide/backend-integration.html
73
83
  const manifest = JSON.parse(readAsset(MANIFEST_NAME));
74
84
  filesToServe[ENTRY_POINT_NAME] = readAsset(ENTRY_POINT_NAME);
75
85
  const entries = Object.values(manifest);
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const Te=require("fs"),nt=require("os"),Z=require("path"),Pe=require("child_process"),W=require("node:fs"),Ie=require("node:http"),I=require("node:path"),ce=require("node:zlib"),rt=require("node:os"),ot=require("node:sea"),it=require("node:url");var re=typeof document<"u"?document.currentScript:null;function ue(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const oe=ue(I),st=ue(rt),Ce=ue(ot);function at(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var pe={exports:{}},C=String,$e=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C,blackBright:C,redBright:C,greenBright:C,yellowBright:C,blueBright:C,magentaBright:C,cyanBright:C,whiteBright:C,bgBlackBright:C,bgRedBright:C,bgGreenBright:C,bgYellowBright:C,bgBlueBright:C,bgMagentaBright:C,bgCyanBright:C,bgWhiteBright:C}};pe.exports=$e();pe.exports.createColors=$e;var lt=pe.exports,de={},ct=function(e){return e.map(function(t){return t&&typeof t=="object"?t.op.replace(/(.)/g,"\\$1"):/["\s]/.test(t)&&!/'/.test(t)?"'"+t.replace(/(['\\])/g,"\\$1")+"'":/["'\s]/.test(t)?'"'+t.replace(/(["\\$`!])/g,"\\$1")+'"':String(t).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")},De="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",we=new RegExp("^"+De+"$"),Se="|&;()<> \\t",ut='"((\\\\"|[^"])*?)"',pt="'((\\\\'|[^'])*?)'",dt=/^#$/,be="'",ye='"',ie="$",P="",ft=4294967296;for(var Ee=0;Ee<4;Ee++)P+=(ft*Math.random()).toString(16);var ht=new RegExp("^"+P);function gt(o,e){for(var t=e.lastIndex,n=[],r;r=e.exec(o);)n.push(r),e.lastIndex===r.index&&(e.lastIndex+=1);return e.lastIndex=t,n}function mt(o,e,t){var n=typeof o=="function"?o(t):o[t];return typeof n>"u"&&t!=""?n="":typeof n>"u"&&(n="$"),typeof n=="object"?e+P+JSON.stringify(n)+P:e+n}function _t(o,e,t){t||(t={});var n=t.escape||"\\",r="(\\"+n+`['"`+Se+`]|[^\\s'"`+Se+"])+",i=new RegExp(["("+De+")","("+r+"|"+ut+"|"+pt+")+"].join("|"),"g"),a=gt(o,i);if(a.length===0)return[];e||(e={});var l=!1;return a.map(function(s){var c=s[0];if(!c||l)return;if(we.test(c))return{op:c};var g=!1,_=!1,f="",S=!1,w;function L(){w+=1;var A,R,B=c.charAt(w);if(B==="{"){if(w+=1,c.charAt(w)==="}")throw new Error("Bad substitution: "+c.slice(w-2,w+1));if(A=c.indexOf("}",w),A<0)throw new Error("Bad substitution: "+c.slice(w));R=c.slice(w,A),w=A}else if(/[*@#?$!_-]/.test(B))R=B,w+=1;else{var U=c.slice(w);A=U.match(/[^\w\d_]/),A?(R=U.slice(0,A.index),w+=A.index-1):(R=U,w=c.length)}return mt(e,"",R)}for(w=0;w<c.length;w++){var b=c.charAt(w);if(S=S||!g&&(b==="*"||b==="?"),_)f+=b,_=!1;else if(g)b===g?g=!1:g==be?f+=b:b===n?(w+=1,b=c.charAt(w),b===ye||b===n||b===ie?f+=b:f+=n+b):b===ie?f+=L():f+=b;else if(b===ye||b===be)g=b;else{if(we.test(b))return{op:c};if(dt.test(b)){l=!0;var V={comment:o.slice(s.index+w+1)};return f.length?[f,V]:[V]}else b===n?_=!0:b===ie?f+=L():f+=b}}return S?{op:"glob",pattern:f}:f}).reduce(function(s,c){return typeof c>"u"?s:s.concat(c)},[])}var Ct=function(e,t,n){var r=_t(e,t,n);return typeof t!="function"?r:r.reduce(function(i,a){if(typeof a=="object")return i.concat(a);var l=a.split(RegExp("("+P+".*?"+P+")","g"));return l.length===1?i.concat(l[0]):i.concat(l.filter(Boolean).map(function(s){return ht.test(s)?JSON.parse(s.split(P)[1]):s}))},[])};de.quote=ct;de.parse=Ct;var wt={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"},St={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider"},bt=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe"];const yt=Z,Et=de,se=Pe,J=wt,Ae=St,At=bt;var xt=function(e){if(e)return Et.parse(e);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if(process.platform==="darwin"){const t=se.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),n=Object.keys(J),r=t.split(`
3
- `);for(let i=0;i<n.length;i++){const a=n[i];if(r.includes(a))return[J[a]];const l=a.replace("/Applications","");if(t.indexOf(l)!==-1){if(a!==J[a])return[J[a]];const s=r.find(c=>c.endsWith(l));if(s!==void 0)return[s]}}}else if(process.platform==="win32"){const n=se.execSync('powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString().split(`\r
4
- `);for(let r=0;r<n.length;r++){const i=n[r].trim(),a=yt.basename(i);if(At.indexOf(a)!==-1)return[i]}}else if(process.platform==="linux"){const t=se.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),n=Object.keys(Ae);for(let r=0;r<n.length;r++){const i=n[r];if(t.indexOf(i)!==-1)return[Ae[i]]}}}catch{}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]};const Ot=Z;var Mt=function(e,t,n,r=1){switch(Ot.basename(e).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${t}:${n}:${r}`];case"notepad++":return["-n"+n,"-c"+r,t];case"vim":case"mvim":return[`+call cursor(${n}, ${r})`,t];case"joe":case"gvim":return[`+${n}`,t];case"emacs":case"emacsclient":return[`+${n}:${r}`,t];case"rmate":case"mate":case"mine":return["--line",n,t];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${t}:${n}:${r}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",n,"--column",r,t]}return process.env.LAUNCH_EDITOR?[t,n,r]:[t]};const vt=Te,Lt=nt,Be=Z,xe=lt,Oe=Pe,Rt=xt,Tt=Mt;function Pt(o){return(e,t)=>{console.log(),console.log(xe.red("Could not open "+Be.basename(e)+" in the editor.")),t&&(t[t.length-1]!=="."&&(t+="."),console.log(xe.red("The editor process exited with an error: "+t))),console.log(),o&&o(e,t)}}function It(o){switch(o){case"vim":case"emacs":case"nano":return!0}return!1}const Me=/:(\d+)(:(\d+))?$/;function $t(o){const e=o.replace(Me,""),t=o.match(Me),n=t&&t[1],r=t&&t[3];return{fileName:e,lineNumber:n,columnNumber:r}}let T=null;function Dt(o,e,t){const n=$t(o);let{fileName:r}=n;const{lineNumber:i,columnNumber:a}=n;if(!vt.existsSync(r))return;typeof e=="function"&&(t=e,e=void 0),t=Pt(t);const[l,...s]=Rt(e);if(!l){t(r,null);return}if(process.platform==="linux"&&r.startsWith("/mnt/")&&/Microsoft/i.test(Lt.release())&&(r=Be.relative("",r)),i){const c=Tt(l,r,i,a);s.push.apply(s,c)}else s.push(r);if(T&&It(l)&&T.kill("SIGKILL"),process.platform==="win32"){let c=function(f){return f.replace(/([&|<>,;=^])/g,"^$1")},g=function(f){return f.includes("^")?`^"${f}^"`:f.includes(" ")?`"${f}"`:f};const _=[l,...s.map(c)].map(g).join(" ");T=Oe.exec(_,{stdio:"inherit",shell:!0})}else T=Oe.spawn(l,s,{stdio:"inherit"});T.on("exit",function(c){T=null,c&&t(r,"(code "+c+")")}),T.on("error",function(c){let{code:g,message:_}=c;g==="ENOENT"&&(_=`${_} ('${l}' command does not exist in 'PATH')`),t(r,_)})}var Bt=Dt;const Ut=at(Bt);var Ue={},Ne={};const ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ne.encode=function(o){if(0<=o&&o<ve.length)return ve[o];throw new TypeError("Must be between 0 and 63: "+o)};const Nt=Ne,je=5,Ge=1<<je,jt=Ge-1,Gt=Ge;function kt(o){return o<0?(-o<<1)+1:(o<<1)+0}Ue.encode=function(e){let t="",n,r=kt(e);do n=r&jt,r>>>=je,r>0&&(n|=Gt),t+=Nt.encode(n);while(r>0);return t};var ee={};(function(o){function e(u,p,m){if(p in u)return u[p];if(arguments.length===3)return m;throw new Error('"'+p+'" is a required argument.')}o.getArg=e;const t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function r(u){const p=u.match(t);return p?{scheme:p[1],auth:p[2],host:p[3],port:p[4],path:p[5]}:null}o.urlParse=r;function i(u){let p="";return u.scheme&&(p+=u.scheme+":"),p+="//",u.auth&&(p+=u.auth+"@"),u.host&&(p+=u.host),u.port&&(p+=":"+u.port),u.path&&(p+=u.path),p}o.urlGenerate=i;const a=32;function l(u){const p=[];return function(m){for(let O=0;O<p.length;O++)if(p[O].input===m){const v=p[0];return p[0]=p[O],p[O]=v,p[0].result}const d=u(m);return p.unshift({input:m,result:d}),p.length>a&&p.pop(),d}}const s=l(function(p){let m=p;const d=r(p);if(d){if(!d.path)return p;m=d.path}const O=o.isAbsolute(m),v=[];let H=0,x=0;for(;;)if(H=x,x=m.indexOf("/",H),x===-1){v.push(m.slice(H));break}else for(v.push(m.slice(H,x));x<m.length&&m[x]==="/";)x++;let N=0;for(x=v.length-1;x>=0;x--){const ne=v[x];ne==="."?v.splice(x,1):ne===".."?N++:N>0&&(ne===""?(v.splice(x+1,N),N=0):(v.splice(x,2),N--))}return m=v.join("/"),m===""&&(m=O?"/":"."),d?(d.path=m,i(d)):m});o.normalize=s;function c(u,p){u===""&&(u="."),p===""&&(p=".");const m=r(p),d=r(u);if(d&&(u=d.path||"/"),m&&!m.scheme)return d&&(m.scheme=d.scheme),i(m);if(m||p.match(n))return p;if(d&&!d.host&&!d.path)return d.host=p,i(d);const O=p.charAt(0)==="/"?p:s(u.replace(/\/+$/,"")+"/"+p);return d?(d.path=O,i(d)):O}o.join=c,o.isAbsolute=function(u){return u.charAt(0)==="/"||t.test(u)};function g(u,p){u===""&&(u="."),u=u.replace(/\/$/,"");let m=0;for(;p.indexOf(u+"/")!==0;){const d=u.lastIndexOf("/");if(d<0||(u=u.slice(0,d),u.match(/^([^\/]+:\/)?\/*$/)))return p;++m}return Array(m+1).join("../")+p.substr(u.length+1)}o.relative=g;const _=function(){return!("__proto__"in Object.create(null))}();function f(u){return u}function S(u){return L(u)?"$"+u:u}o.toSetString=_?f:S;function w(u){return L(u)?u.slice(1):u}o.fromSetString=_?f:w;function L(u){if(!u)return!1;const p=u.length;if(p<9||u.charCodeAt(p-1)!==95||u.charCodeAt(p-2)!==95||u.charCodeAt(p-3)!==111||u.charCodeAt(p-4)!==116||u.charCodeAt(p-5)!==111||u.charCodeAt(p-6)!==114||u.charCodeAt(p-7)!==112||u.charCodeAt(p-8)!==95||u.charCodeAt(p-9)!==95)return!1;for(let m=p-10;m>=0;m--)if(u.charCodeAt(m)!==36)return!1;return!0}function b(u,p,m){let d=A(u.source,p.source);return d!==0||(d=u.originalLine-p.originalLine,d!==0)||(d=u.originalColumn-p.originalColumn,d!==0||m)||(d=u.generatedColumn-p.generatedColumn,d!==0)||(d=u.generatedLine-p.generatedLine,d!==0)?d:A(u.name,p.name)}o.compareByOriginalPositions=b;function V(u,p,m){let d=u.generatedLine-p.generatedLine;return d!==0||(d=u.generatedColumn-p.generatedColumn,d!==0||m)||(d=A(u.source,p.source),d!==0)||(d=u.originalLine-p.originalLine,d!==0)||(d=u.originalColumn-p.originalColumn,d!==0)?d:A(u.name,p.name)}o.compareByGeneratedPositionsDeflated=V;function A(u,p){return u===p?0:u===null?1:p===null?-1:u>p?1:-1}function R(u,p){let m=u.generatedLine-p.generatedLine;return m!==0||(m=u.generatedColumn-p.generatedColumn,m!==0)||(m=A(u.source,p.source),m!==0)||(m=u.originalLine-p.originalLine,m!==0)||(m=u.originalColumn-p.originalColumn,m!==0)?m:A(u.name,p.name)}o.compareByGeneratedPositionsInflated=R;function B(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))}o.parseSourceMapInput=B;function U(u,p,m){if(p=p||"",u&&(u[u.length-1]!=="/"&&p[0]!=="/"&&(u+="/"),p=u+p),m){const d=r(m);if(!d)throw new Error("sourceMapURL could not be parsed");if(d.path){const O=d.path.lastIndexOf("/");O>=0&&(d.path=d.path.substring(0,O+1))}p=c(i(d),p)}return s(p)}o.computeSourceURL=U})(ee);var fe={};let Ft=class ke{constructor(){this._array=[],this._set=new Map}static fromArray(e,t){const n=new ke;for(let r=0,i=e.length;r<i;r++)n.add(e[r],t);return n}size(){return this._set.size}add(e,t){const n=this.has(e),r=this._array.length;(!n||t)&&this._array.push(e),n||this._set.set(e,r)}has(e){return this._set.has(e)}indexOf(e){const t=this._set.get(e);if(t>=0)return t;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)}toArray(){return this._array.slice()}};fe.ArraySet=Ft;var Fe={};const ze=ee;function zt(o,e){const t=o.generatedLine,n=e.generatedLine,r=o.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=r||ze.compareByGeneratedPositionsInflated(o,e)<=0}let Wt=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(e,t){this._array.forEach(e,t)}add(e){zt(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))}toArray(){return this._sorted||(this._array.sort(ze.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};Fe.MappingList=Wt;const j=Ue,y=ee,Q=fe.ArraySet,Vt=Fe.MappingList;class he{constructor(e){e||(e={}),this._file=y.getArg(e,"file",null),this._sourceRoot=y.getArg(e,"sourceRoot",null),this._skipValidation=y.getArg(e,"skipValidation",!1),this._sources=new Q,this._names=new Q,this._mappings=new Vt,this._sourcesContents=null}static fromSourceMap(e){const t=e.sourceRoot,n=new he({file:e.file,sourceRoot:t});return e.eachMapping(function(r){const i={generated:{line:r.generatedLine,column:r.generatedColumn}};r.source!=null&&(i.source=r.source,t!=null&&(i.source=y.relative(t,i.source)),i.original={line:r.originalLine,column:r.originalColumn},r.name!=null&&(i.name=r.name)),n.addMapping(i)}),e.sources.forEach(function(r){let i=r;t!==null&&(i=y.relative(t,r)),n._sources.has(i)||n._sources.add(i);const a=e.sourceContentFor(r);a!=null&&n.setSourceContent(r,a)}),n}addMapping(e){const t=y.getArg(e,"generated"),n=y.getArg(e,"original",null);let r=y.getArg(e,"source",null),i=y.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:r,name:i})}setSourceContent(e,t){let n=e;this._sourceRoot!=null&&(n=y.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[y.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[y.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}applySourceMap(e,t,n){let r=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=e.file}const i=this._sourceRoot;i!=null&&(r=y.relative(i,r));const a=this._mappings.toArray().length>0?new Q:this._sources,l=new Q;this._mappings.unsortedForEach(function(s){if(s.source===r&&s.originalLine!=null){const _=e.originalPositionFor({line:s.originalLine,column:s.originalColumn});_.source!=null&&(s.source=_.source,n!=null&&(s.source=y.join(n,s.source)),i!=null&&(s.source=y.relative(i,s.source)),s.originalLine=_.line,s.originalColumn=_.column,_.name!=null&&(s.name=_.name))}const c=s.source;c!=null&&!a.has(c)&&a.add(c);const g=s.name;g!=null&&!l.has(g)&&l.add(g)},this),this._sources=a,this._names=l,e.sources.forEach(function(s){const c=e.sourceContentFor(s);c!=null&&(n!=null&&(s=y.join(n,s)),i!=null&&(s=y.relative(i,s)),this.setSourceContent(s,c))},this)}_validateMapping(e,t,n,r){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!r)){if(!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))}}_serializeMappings(){let e=0,t=1,n=0,r=0,i=0,a=0,l="",s,c,g,_;const f=this._mappings.toArray();for(let S=0,w=f.length;S<w;S++){if(c=f[S],s="",c.generatedLine!==t)for(e=0;c.generatedLine!==t;)s+=";",t++;else if(S>0){if(!y.compareByGeneratedPositionsInflated(c,f[S-1]))continue;s+=","}s+=j.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(_=this._sources.indexOf(c.source),s+=j.encode(_-a),a=_,s+=j.encode(c.originalLine-1-r),r=c.originalLine-1,s+=j.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(g=this._names.indexOf(c.name),s+=j.encode(g-i),i=g)),l+=s}return l}_generateSourcesContent(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=y.relative(t,n));const r=y.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)}toJSON(){const e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}he.prototype._version=3;var te={},We={};(function(o){o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2;function e(t,n,r,i,a,l){const s=Math.floor((n-t)/2)+t,c=a(r,i[s],!0);return c===0?s:c>0?n-s>1?e(s,n,r,i,a,l):l==o.LEAST_UPPER_BOUND?n<i.length?n:-1:s:s-t>1?e(t,s,r,i,a,l):l==o.LEAST_UPPER_BOUND?s:t<0?-1:t}o.search=function(n,r,i,a){if(r.length===0)return-1;let l=e(-1,r.length,n,r,i,a||o.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&i(r[l],r[l-1],!0)===0;)--l;return l}})(We);var F={exports:{}};const Ht=(function(){return typeof window<"u"&&this===window}).call();if(Ht){let o=null;F.exports=function(){if(typeof o=="string")return fetch(o).then(t=>t.arrayBuffer());if(o instanceof ArrayBuffer)return Promise.resolve(o);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},F.exports.initialize=e=>o=e}else{const o=Te,e=Z;F.exports=function(){return new Promise((n,r)=>{const i=e.join(__dirname,"mappings.wasm");o.readFile(i,null,(a,l)=>{if(a){r(a);return}n(l.buffer)})})},F.exports.initialize=t=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")}}var Ve=F.exports;const Jt=Ve;function Qt(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}let G=null;var qt=function(){if(G)return G;const e=[];return G=Jt().then(t=>WebAssembly.instantiate(t,{env:{mapping_callback(n,r,i,a,l,s,c,g,_,f){const S=new Qt;S.generatedLine=n+1,S.generatedColumn=r,i&&(S.lastGeneratedColumn=a-1),l&&(S.source=s,S.originalLine=c+1,S.originalColumn=g,_&&(S.name=f)),e[e.length-1](S)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(t=>({exports:t.instance.exports,withMappingCallback:(n,r)=>{e.push(n);try{r()}finally{e.pop()}}})).then(null,t=>{throw G=null,t}),G};const h=ee,ae=We,K=fe.ArraySet,Yt=Ve,Kt=qt,ge=Symbol("smcInternal");let E=class He{constructor(e,t){return e==ge?Promise.resolve(this):Xt(e,t)}static initialize(e){Yt.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,t){return Zt(e,t)}static async with(e,t,n){const r=await new He(e,t);try{return await n(r)}finally{r.destroy()}}_parseMappings(e,t){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,t,n){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}};E.prototype._version=3;E.GENERATED_ORDER=1;E.ORIGINAL_ORDER=2;E.GREATEST_LOWER_BOUND=1;E.LEAST_UPPER_BOUND=2;te.SourceMapConsumer=E;class D extends E{constructor(e,t){return super(ge).then(n=>{let r=e;typeof e=="string"&&(r=h.parseSourceMapInput(e));const i=h.getArg(r,"version");let a=h.getArg(r,"sources");const l=h.getArg(r,"names",[]);let s=h.getArg(r,"sourceRoot",null);const c=h.getArg(r,"sourcesContent",null),g=h.getArg(r,"mappings"),_=h.getArg(r,"file",null);if(i!=n._version)throw new Error("Unsupported version: "+i);return s&&(s=h.normalize(s)),a=a.map(String).map(h.normalize).map(function(f){return s&&h.isAbsolute(s)&&h.isAbsolute(f)?h.relative(s,f):f}),n._names=K.fromArray(l.map(String),!0),n._sources=K.fromArray(a,!0),n._absoluteSources=n._sources.toArray().map(function(f){return h.computeSourceURL(s,f,t)}),n.sourceRoot=s,n.sourcesContent=c,n._mappings=g,n._sourceMapURL=t,n.file=_,n._computedColumnSpans=!1,n._mappingsPtr=0,n._wasm=null,Kt().then(f=>(n._wasm=f,n))})}_findSourceIndex(e){let t=e;if(this.sourceRoot!=null&&(t=h.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);for(let n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==e)return n;return-1}static fromSourceMap(e,t){return new D(e.toString())}get sources(){return this._absoluteSources.slice()}_getMappingsPtr(){return this._mappingsPtr===0&&this._parseMappings(this._mappings,this.sourceRoot),this._mappingsPtr}_parseMappings(e,t){const n=e.length,r=this._wasm.exports.allocate_mappings(n),i=new Uint8Array(this._wasm.exports.memory.buffer,r,n);for(let l=0;l<n;l++)i[l]=e.charCodeAt(l);const a=this._wasm.exports.parse_mappings(r);if(!a){const l=this._wasm.exports.get_last_error();let s=`Error parsing mappings (code ${l}): `;switch(l){case 1:s+="the mappings contained a negative line, column, source index, or name index";break;case 2:s+="the mappings contained a number larger than 2**32";break;case 3:s+="reached EOF while in the middle of parsing a VLQ";break;case 4:s+="invalid base 64 character while parsing a VLQ";break;default:s+="unknown error code";break}throw new Error(s)}this._mappingsPtr=a}eachMapping(e,t,n){const r=t||null,i=n||E.GENERATED_ORDER,a=this.sourceRoot;this._wasm.withMappingCallback(l=>{l.source!==null&&(l.source=this._sources.at(l.source),l.source=h.computeSourceURL(a,l.source,this._sourceMapURL),l.name!==null&&(l.name=this._names.at(l.name))),e.call(r,l)},()=>{switch(i){case E.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case E.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let t=h.getArg(e,"source");const n=h.getArg(e,"line"),r=e.column||0;if(t=this._findSourceIndex(t),t<0)return[];if(n<1)throw new Error("Line numbers must be >= 1");if(r<0)throw new Error("Column numbers must be >= 0");const i=[];return this._wasm.withMappingCallback(a=>{let l=a.lastGeneratedColumn;this._computedColumnSpans&&l===null&&(l=1/0),i.push({line:a.generatedLine,column:a.generatedColumn,lastColumn:l})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),t,n-1,"column"in e,r)}),i}destroy(){this._mappingsPtr!==0&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const t={generatedLine:h.getArg(e,"line"),generatedColumn:h.getArg(e,"column")};if(t.generatedLine<1)throw new Error("Line numbers must be >= 1");if(t.generatedColumn<0)throw new Error("Column numbers must be >= 0");let n=h.getArg(e,"bias",E.GREATEST_LOWER_BOUND);n==null&&(n=E.GREATEST_LOWER_BOUND);let r;if(this._wasm.withMappingCallback(i=>r=i,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),t.generatedLine-1,t.generatedColumn,n)}),r&&r.generatedLine===t.generatedLine){let i=h.getArg(r,"source",null);i!==null&&(i=this._sources.at(i),i=h.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));let a=h.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:i,line:h.getArg(r,"originalLine",null),column:h.getArg(r,"originalColumn",null),name:a}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1}sourceContentFor(e,t){if(!this.sourcesContent)return null;const n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];let r=e;this.sourceRoot!=null&&(r=h.relative(this.sourceRoot,r));let i;if(this.sourceRoot!=null&&(i=h.urlParse(this.sourceRoot))){const a=r.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!i.path||i.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')}generatedPositionFor(e){let t=h.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};const n={source:t,originalLine:h.getArg(e,"line"),originalColumn:h.getArg(e,"column")};if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");let r=h.getArg(e,"bias",E.GREATEST_LOWER_BOUND);r==null&&(r=E.GREATEST_LOWER_BOUND);let i;if(this._wasm.withMappingCallback(a=>i=a,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),n.source,n.originalLine-1,n.originalColumn,r)}),i&&i.source===n.source){let a=i.lastGeneratedColumn;return this._computedColumnSpans&&a===null&&(a=1/0),{line:h.getArg(i,"generatedLine",null),column:h.getArg(i,"generatedColumn",null),lastColumn:a}}return{line:null,column:null,lastColumn:null}}}D.prototype.consumer=E;te.BasicSourceMapConsumer=D;class Je extends E{constructor(e,t){return super(ge).then(n=>{let r=e;typeof e=="string"&&(r=h.parseSourceMapInput(e));const i=h.getArg(r,"version"),a=h.getArg(r,"sections");if(i!=n._version)throw new Error("Unsupported version: "+i);n._sources=new K,n._names=new K,n.__generatedMappings=null,n.__originalMappings=null,n.__generatedMappingsUnsorted=null,n.__originalMappingsUnsorted=null;let l={line:-1,column:0};return Promise.all(a.map(s=>{if(s.url)throw new Error("Support for url field in sections not implemented.");const c=h.getArg(s,"offset"),g=h.getArg(c,"line"),_=h.getArg(c,"column");if(g<l.line||g===l.line&&_<l.column)throw new Error("Section offsets must be ordered and non-overlapping.");return l=c,new E(h.getArg(s,"map"),t).then(S=>({generatedOffset:{generatedLine:g+1,generatedColumn:_+1},consumer:S}))})).then(s=>(n._sections=s,n))})}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(h.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(h.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let t=0;t<this._sections.length;t++)for(let n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}originalPositionFor(e){const t={generatedLine:h.getArg(e,"line"),generatedColumn:h.getArg(e,"column")},n=ae.search(t,this._sections,function(i,a){const l=i.generatedLine-a.generatedOffset.generatedLine;return l||i.generatedColumn-a.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})}sourceContentFor(e,t){for(let n=0;n<this._sections.length;n++){const i=this._sections[n].consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')}generatedPositionFor(e){for(let t=0;t<this._sections.length;t++){const n=this._sections[t];if(n.consumer._findSourceIndex(h.getArg(e,"source"))===-1)continue;const r=n.consumer.generatedPositionFor(e);if(r)return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}return{line:null,column:null}}_parseMappings(e,t){const n=this.__generatedMappingsUnsorted=[],r=this.__originalMappingsUnsorted=[];for(let i=0;i<this._sections.length;i++){const a=this._sections[i],l=[];a.consumer.eachMapping(s=>l.push(s));for(let s=0;s<l.length;s++){const c=l[s];let g=h.computeSourceURL(a.consumer.sourceRoot,null,this._sourceMapURL);this._sources.add(g),g=this._sources.indexOf(g);let _=null;c.name&&(this._names.add(c.name),_=this._names.indexOf(c.name));const f={source:g,generatedLine:c.generatedLine+(a.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(a.generatedOffset.generatedLine===c.generatedLine?a.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:_};n.push(f),typeof f.originalLine=="number"&&r.push(f)}}}eachMapping(e,t,n){const r=t||null,i=n||E.GENERATED_ORDER;let a;switch(i){case E.GENERATED_ORDER:a=this._generatedMappings;break;case E.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}const l=this.sourceRoot;a.map(function(s){let c=null;return s.source!==null&&(c=this._sources.at(s.source),c=h.computeSourceURL(l,c,this._sourceMapURL)),{source:c,generatedLine:s.generatedLine,generatedColumn:s.generatedColumn,originalLine:s.originalLine,originalColumn:s.originalColumn,name:s.name===null?null:this._names.at(s.name)}},this).forEach(e,r)}_findMapping(e,t,n,r,i,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return ae.search(e,t,i,a)}allGeneratedPositionsFor(e){const t=h.getArg(e,"line"),n={source:h.getArg(e,"source"),originalLine:t,originalColumn:h.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");const r=[];let i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",h.compareByOriginalPositions,ae.LEAST_UPPER_BOUND);if(i>=0){let a=this._originalMappings[i];if(e.column===void 0){const l=a.originalLine;for(;a&&a.originalLine===l;){let s=a.lastGeneratedColumn;this._computedColumnSpans&&s===null&&(s=1/0),r.push({line:h.getArg(a,"generatedLine",null),column:h.getArg(a,"generatedColumn",null),lastColumn:s}),a=this._originalMappings[++i]}}else{const l=a.originalColumn;for(;a&&a.originalLine===t&&a.originalColumn==l;){let s=a.lastGeneratedColumn;this._computedColumnSpans&&s===null&&(s=1/0),r.push({line:h.getArg(a,"generatedLine",null),column:h.getArg(a,"generatedColumn",null),lastColumn:s}),a=this._originalMappings[++i]}}}return r}destroy(){for(let e=0;e<this._sections.length;e++)this._sections[e].consumer.destroy()}}te.IndexedSourceMapConsumer=Je;function Xt(o,e){let t=o;typeof o=="string"&&(t=h.parseSourceMapInput(o));const n=t.sections!=null?new Je(t,e):new D(t,e);return Promise.resolve(n)}function Zt(o,e){return D.fromSourceMap(o,e)}var Le=te.SourceMapConsumer,en=Object.defineProperty,tn=(o,e,t)=>e in o?en(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,$=(o,e,t)=>tn(o,typeof e!="symbol"?e+"":e,t);const nn=8969,rn="spotlight-by-sentry",on="/contextlines";async function sn(o){try{return(await fetch(o)).text()}catch{return}}function an(o){try{return JSON.parse(o)}catch{return}}async function ln(o,e){const t=await new Le(o),n=t.originalPositionFor({line:e.lineno,column:e.colno,bias:Le.LEAST_UPPER_BOUND});if(n.source&&n.line&&n.column){e.lineno=n.line,e.colno=n.column;const r=new URL(e.filename).pathname.slice(1);e.filename=oe.resolve(oe.join(oe.dirname(r),n.source));const i=t.sourceContentFor(n.source),a=(i==null?void 0:i.split(st.EOL))??[];Qe(a,e)}return n}function Qe(o,e,t=5){const n=o.length,r=Math.max(Math.min(n-1,e.lineno-1),0);e.pre_context=o.slice(Math.max(0,r-t),r).map(i=>le(i,0)),e.context_line=le(o[Math.min(n-1,r)],e.colno||0),e.post_context=o.slice(Math.min(r+1,n),r+1+t).map(i=>le(i,0))}function le(o,e){let t=o;const n=t.length;if(n<=150)return t;e>n&&(e=n);let r=Math.max(e-60,0);r<5&&(r=0);let i=Math.min(r+140,n);return i>n-5&&(i=n),i===n&&(r=Math.max(i-140,0)),t=t.slice(r,i),r>0&&(t=`'{snip} ${t}`),i<n&&(t+=" {snip}"),t}function cn(o){return!!o.filename&&!!o.lineno&&!!o.colno}function un(o,e){if(o.method!=="PUT"){e.writeHead(405),e.end();return}let t="";o.on("data",n=>{t+=n}),o.on("end",async()=>{const n=an(t);if(!n){e.writeHead(500),e.end();return}for(const i of n.frames??[]){if(!cn(i)||i.filename.includes("/node_modules/"))continue;const{filename:a}=i;if(a.includes("://")){const l=await sn(i.filename);if(!l)continue;const s=l.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.*)/);if(s&&s[1]){const c=s[1],g=Buffer.from(c,"base64").toString("utf-8");await ln(g,i)}}else if(!a.includes(":"))try{const l=W.readFileSync(a,{encoding:"utf-8"}).split(/\r?\n/);Qe(l,i)}catch(l){if(l.code!=="ENOENT")throw l}}const r=JSON.stringify(n);e.writeHead(200,{"Content-Type":"application/json"}),e.end(r)})}const q={info:o=>console.log("🔎 [Spotlight]",o),warn:o=>console.warn("🔎 [Spotlight]",o),error:o=>console.error("🔎 [Spotlight]",o),debug:o=>qe&&console.debug("🔎 [Spotlight]",o)};let z,qe=!1;function pn(o){z=o}function dn(o){qe=o}const M={info:o=>(z||q).info(o),warn:o=>(z||q).warn(o),error:o=>(z||q).error(o),debug:o=>(z||q).debug(o)};class fn{constructor(e=100){$(this,"size"),$(this,"items"),$(this,"writePos",0),$(this,"head",0),$(this,"timeout",10),$(this,"readers",new Map),this.size=e,this.items=new Array(e)}put(e){const t=new Date().getTime();this.items[this.writePos%this.size]=[t,e],this.writePos+=1,this.head===this.writePos&&(this.head+=1);const n=t-this.timeout*1e3;let r;for(;this.head<this.writePos&&(r=this.items[this.head%this.size],!(r===void 0||r[0]>n));)this.head+=1}subscribe(e){const t=hn();return this.readers.set(t,e),setTimeout(()=>this.stream(t)),t}unsubscribe(e){this.readers.delete(e)}stream(e,t=this.head){const n=this.readers.get(e);if(!n)return;let r=t,i;for(;i=this.items[r%this.size],!(typeof i>"u"||r>=this.writePos);)n(i[1]),r+=1;setTimeout(()=>this.stream(e,r),500)}clear(){this.items=new Array(this.size),this.writePos=0,this.head=0,this.readers=new Map}}function hn(){let o=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16;return t=(o+t)%16|0,o=Math.floor(o/16),(e==="x"?t:t&3|8).toString(16)})}function Ye(){return{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"*","Access-Control-Allow-Methods":"GET,POST,PUT,OPTIONS,DELETE,PATCH"}}function k(o){return function(t,n,r,i){const a={...Ye(),...Ke()};for(const[l,s]of Object.entries(a))n.setHeader(l,s);if(t.method==="OPTIONS"){n.writeHead(204,{"Cache-Control":"no-cache"}),n.end();return}return o(t,n,r,i)}}function Ke(){return{"X-Powered-by":rn}}function gn(o,e){return function(n,r,i,a){if(n.method==="GET"&&n.headers.accept&&n.headers.accept==="text/event-stream"&&i==="/stream"){r.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),r.flushHeaders(),r.write(`
2
+ "use strict";const Te=require("fs"),rt=require("os"),te=require("path"),Pe=require("child_process"),V=require("node:fs"),Ie=require("node:http"),I=require("node:path"),ue=require("node:zlib"),ot=require("node:os"),it=require("node:url"),st=require("node:module");var D=typeof document<"u"?document.currentScript:null;function $e(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const ie=$e(I),at=$e(ot);function lt(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var pe={exports:{}},C=String,De=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C,blackBright:C,redBright:C,greenBright:C,yellowBright:C,blueBright:C,magentaBright:C,cyanBright:C,whiteBright:C,bgBlackBright:C,bgRedBright:C,bgGreenBright:C,bgYellowBright:C,bgBlueBright:C,bgMagentaBright:C,bgCyanBright:C,bgWhiteBright:C}};pe.exports=De();pe.exports.createColors=De;var ct=pe.exports,de={},ut=function(e){return e.map(function(t){return t&&typeof t=="object"?t.op.replace(/(.)/g,"\\$1"):/["\s]/.test(t)&&!/'/.test(t)?"'"+t.replace(/(['\\])/g,"\\$1")+"'":/["'\s]/.test(t)?'"'+t.replace(/(["\\$`!])/g,"\\$1")+'"':String(t).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")},Ue="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",Ce=new RegExp("^"+Ue+"$"),we="|&;()<> \\t",pt='"((\\\\"|[^"])*?)"',dt="'((\\\\'|[^'])*?)'",ft=/^#$/,Se="'",be='"',se="$",P="",ht=4294967296;for(var ye=0;ye<4;ye++)P+=(ht*Math.random()).toString(16);var gt=new RegExp("^"+P);function mt(o,e){for(var t=e.lastIndex,n=[],r;r=e.exec(o);)n.push(r),e.lastIndex===r.index&&(e.lastIndex+=1);return e.lastIndex=t,n}function _t(o,e,t){var n=typeof o=="function"?o(t):o[t];return typeof n>"u"&&t!=""?n="":typeof n>"u"&&(n="$"),typeof n=="object"?e+P+JSON.stringify(n)+P:e+n}function Ct(o,e,t){t||(t={});var n=t.escape||"\\",r="(\\"+n+`['"`+we+`]|[^\\s'"`+we+"])+",i=new RegExp(["("+Ue+")","("+r+"|"+pt+"|"+dt+")+"].join("|"),"g"),a=mt(o,i);if(a.length===0)return[];e||(e={});var l=!1;return a.map(function(s){var c=s[0];if(!c||l)return;if(Ce.test(c))return{op:c};var f=!1,_=!1,h="",S=!1,w;function L(){w+=1;var A,R,B=c.charAt(w);if(B==="{"){if(w+=1,c.charAt(w)==="}")throw new Error("Bad substitution: "+c.slice(w-2,w+1));if(A=c.indexOf("}",w),A<0)throw new Error("Bad substitution: "+c.slice(w));R=c.slice(w,A),w=A}else if(/[*@#?$!_-]/.test(B))R=B,w+=1;else{var N=c.slice(w);A=N.match(/[^\w\d_]/),A?(R=N.slice(0,A.index),w+=A.index-1):(R=N,w=c.length)}return _t(e,"",R)}for(w=0;w<c.length;w++){var b=c.charAt(w);if(S=S||!f&&(b==="*"||b==="?"),_)h+=b,_=!1;else if(f)b===f?f=!1:f==Se?h+=b:b===n?(w+=1,b=c.charAt(w),b===be||b===n||b===se?h+=b:h+=n+b):b===se?h+=L():h+=b;else if(b===be||b===Se)f=b;else{if(Ce.test(b))return{op:c};if(ft.test(b)){l=!0;var q={comment:o.slice(s.index+w+1)};return h.length?[h,q]:[q]}else b===n?_=!0:b===se?h+=L():h+=b}}return S?{op:"glob",pattern:h}:h}).reduce(function(s,c){return typeof c>"u"?s:s.concat(c)},[])}var wt=function(e,t,n){var r=Ct(e,t,n);return typeof t!="function"?r:r.reduce(function(i,a){if(typeof a=="object")return i.concat(a);var l=a.split(RegExp("("+P+".*?"+P+")","g"));return l.length===1?i.concat(l[0]):i.concat(l.filter(Boolean).map(function(s){return gt.test(s)?JSON.parse(s.split(P)[1]):s}))},[])};de.quote=ut;de.parse=wt;var St={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"},bt={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider"},yt=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe"];const Et=te,At=de,ae=Pe,J=St,Ee=bt,xt=yt;var Ot=function(e){if(e)return At.parse(e);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if(process.platform==="darwin"){const t=ae.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),n=Object.keys(J),r=t.split(`
3
+ `);for(let i=0;i<n.length;i++){const a=n[i];if(r.includes(a))return[J[a]];const l=a.replace("/Applications","");if(t.indexOf(l)!==-1){if(a!==J[a])return[J[a]];const s=r.find(c=>c.endsWith(l));if(s!==void 0)return[s]}}}else if(process.platform==="win32"){const n=ae.execSync('powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString().split(`\r
4
+ `);for(let r=0;r<n.length;r++){const i=n[r].trim(),a=Et.basename(i);if(xt.indexOf(a)!==-1)return[i]}}else if(process.platform==="linux"){const t=ae.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),n=Object.keys(Ee);for(let r=0;r<n.length;r++){const i=n[r];if(t.indexOf(i)!==-1)return[Ee[i]]}}}catch{}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]};const Mt=te;var vt=function(e,t,n,r=1){switch(Mt.basename(e).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${t}:${n}:${r}`];case"notepad++":return["-n"+n,"-c"+r,t];case"vim":case"mvim":return[`+call cursor(${n}, ${r})`,t];case"joe":case"gvim":return[`+${n}`,t];case"emacs":case"emacsclient":return[`+${n}:${r}`,t];case"rmate":case"mate":case"mine":return["--line",n,t];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${t}:${n}:${r}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",n,"--column",r,t]}return process.env.LAUNCH_EDITOR?[t,n,r]:[t]};const Lt=Te,Rt=rt,Be=te,Ae=ct,xe=Pe,Tt=Ot,Pt=vt;function It(o){return(e,t)=>{console.log(),console.log(Ae.red("Could not open "+Be.basename(e)+" in the editor.")),t&&(t[t.length-1]!=="."&&(t+="."),console.log(Ae.red("The editor process exited with an error: "+t))),console.log(),o&&o(e,t)}}function $t(o){switch(o){case"vim":case"emacs":case"nano":return!0}return!1}const Oe=/:(\d+)(:(\d+))?$/;function Dt(o){const e=o.replace(Oe,""),t=o.match(Oe),n=t&&t[1],r=t&&t[3];return{fileName:e,lineNumber:n,columnNumber:r}}let T=null;function Ut(o,e,t){const n=Dt(o);let{fileName:r}=n;const{lineNumber:i,columnNumber:a}=n;if(!Lt.existsSync(r))return;typeof e=="function"&&(t=e,e=void 0),t=It(t);const[l,...s]=Tt(e);if(!l){t(r,null);return}if(process.platform==="linux"&&r.startsWith("/mnt/")&&/Microsoft/i.test(Rt.release())&&(r=Be.relative("",r)),i){const c=Pt(l,r,i,a);s.push.apply(s,c)}else s.push(r);if(T&&$t(l)&&T.kill("SIGKILL"),process.platform==="win32"){let c=function(h){return h.replace(/([&|<>,;=^])/g,"^$1")},f=function(h){return h.includes("^")?`^"${h}^"`:h.includes(" ")?`"${h}"`:h};const _=[l,...s.map(c)].map(f).join(" ");T=xe.exec(_,{stdio:"inherit",shell:!0})}else T=xe.spawn(l,s,{stdio:"inherit"});T.on("exit",function(c){T=null,c&&t(r,"(code "+c+")")}),T.on("error",function(c){let{code:f,message:_}=c;f==="ENOENT"&&(_=`${_} ('${l}' command does not exist in 'PATH')`),t(r,_)})}var Bt=Ut;const Nt=lt(Bt);var Ne={},je={};const Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");je.encode=function(o){if(0<=o&&o<Me.length)return Me[o];throw new TypeError("Must be between 0 and 63: "+o)};const jt=je,Ge=5,ke=1<<Ge,Gt=ke-1,kt=ke;function Ft(o){return o<0?(-o<<1)+1:(o<<1)+0}Ne.encode=function(e){let t="",n,r=Ft(e);do n=r&Gt,r>>>=Ge,r>0&&(n|=kt),t+=jt.encode(n);while(r>0);return t};var ne={};(function(o){function e(u,p,m){if(p in u)return u[p];if(arguments.length===3)return m;throw new Error('"'+p+'" is a required argument.')}o.getArg=e;const t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function r(u){const p=u.match(t);return p?{scheme:p[1],auth:p[2],host:p[3],port:p[4],path:p[5]}:null}o.urlParse=r;function i(u){let p="";return u.scheme&&(p+=u.scheme+":"),p+="//",u.auth&&(p+=u.auth+"@"),u.host&&(p+=u.host),u.port&&(p+=":"+u.port),u.path&&(p+=u.path),p}o.urlGenerate=i;const a=32;function l(u){const p=[];return function(m){for(let O=0;O<p.length;O++)if(p[O].input===m){const v=p[0];return p[0]=p[O],p[O]=v,p[0].result}const d=u(m);return p.unshift({input:m,result:d}),p.length>a&&p.pop(),d}}const s=l(function(p){let m=p;const d=r(p);if(d){if(!d.path)return p;m=d.path}const O=o.isAbsolute(m),v=[];let H=0,x=0;for(;;)if(H=x,x=m.indexOf("/",H),x===-1){v.push(m.slice(H));break}else for(v.push(m.slice(H,x));x<m.length&&m[x]==="/";)x++;let j=0;for(x=v.length-1;x>=0;x--){const oe=v[x];oe==="."?v.splice(x,1):oe===".."?j++:j>0&&(oe===""?(v.splice(x+1,j),j=0):(v.splice(x,2),j--))}return m=v.join("/"),m===""&&(m=O?"/":"."),d?(d.path=m,i(d)):m});o.normalize=s;function c(u,p){u===""&&(u="."),p===""&&(p=".");const m=r(p),d=r(u);if(d&&(u=d.path||"/"),m&&!m.scheme)return d&&(m.scheme=d.scheme),i(m);if(m||p.match(n))return p;if(d&&!d.host&&!d.path)return d.host=p,i(d);const O=p.charAt(0)==="/"?p:s(u.replace(/\/+$/,"")+"/"+p);return d?(d.path=O,i(d)):O}o.join=c,o.isAbsolute=function(u){return u.charAt(0)==="/"||t.test(u)};function f(u,p){u===""&&(u="."),u=u.replace(/\/$/,"");let m=0;for(;p.indexOf(u+"/")!==0;){const d=u.lastIndexOf("/");if(d<0||(u=u.slice(0,d),u.match(/^([^\/]+:\/)?\/*$/)))return p;++m}return Array(m+1).join("../")+p.substr(u.length+1)}o.relative=f;const _=function(){return!("__proto__"in Object.create(null))}();function h(u){return u}function S(u){return L(u)?"$"+u:u}o.toSetString=_?h:S;function w(u){return L(u)?u.slice(1):u}o.fromSetString=_?h:w;function L(u){if(!u)return!1;const p=u.length;if(p<9||u.charCodeAt(p-1)!==95||u.charCodeAt(p-2)!==95||u.charCodeAt(p-3)!==111||u.charCodeAt(p-4)!==116||u.charCodeAt(p-5)!==111||u.charCodeAt(p-6)!==114||u.charCodeAt(p-7)!==112||u.charCodeAt(p-8)!==95||u.charCodeAt(p-9)!==95)return!1;for(let m=p-10;m>=0;m--)if(u.charCodeAt(m)!==36)return!1;return!0}function b(u,p,m){let d=A(u.source,p.source);return d!==0||(d=u.originalLine-p.originalLine,d!==0)||(d=u.originalColumn-p.originalColumn,d!==0||m)||(d=u.generatedColumn-p.generatedColumn,d!==0)||(d=u.generatedLine-p.generatedLine,d!==0)?d:A(u.name,p.name)}o.compareByOriginalPositions=b;function q(u,p,m){let d=u.generatedLine-p.generatedLine;return d!==0||(d=u.generatedColumn-p.generatedColumn,d!==0||m)||(d=A(u.source,p.source),d!==0)||(d=u.originalLine-p.originalLine,d!==0)||(d=u.originalColumn-p.originalColumn,d!==0)?d:A(u.name,p.name)}o.compareByGeneratedPositionsDeflated=q;function A(u,p){return u===p?0:u===null?1:p===null?-1:u>p?1:-1}function R(u,p){let m=u.generatedLine-p.generatedLine;return m!==0||(m=u.generatedColumn-p.generatedColumn,m!==0)||(m=A(u.source,p.source),m!==0)||(m=u.originalLine-p.originalLine,m!==0)||(m=u.originalColumn-p.originalColumn,m!==0)?m:A(u.name,p.name)}o.compareByGeneratedPositionsInflated=R;function B(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))}o.parseSourceMapInput=B;function N(u,p,m){if(p=p||"",u&&(u[u.length-1]!=="/"&&p[0]!=="/"&&(u+="/"),p=u+p),m){const d=r(m);if(!d)throw new Error("sourceMapURL could not be parsed");if(d.path){const O=d.path.lastIndexOf("/");O>=0&&(d.path=d.path.substring(0,O+1))}p=c(i(d),p)}return s(p)}o.computeSourceURL=N})(ne);var fe={};let zt=class Fe{constructor(){this._array=[],this._set=new Map}static fromArray(e,t){const n=new Fe;for(let r=0,i=e.length;r<i;r++)n.add(e[r],t);return n}size(){return this._set.size}add(e,t){const n=this.has(e),r=this._array.length;(!n||t)&&this._array.push(e),n||this._set.set(e,r)}has(e){return this._set.has(e)}indexOf(e){const t=this._set.get(e);if(t>=0)return t;throw new Error('"'+e+'" is not in the set.')}at(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)}toArray(){return this._array.slice()}};fe.ArraySet=zt;var ze={};const We=ne;function Wt(o,e){const t=o.generatedLine,n=e.generatedLine,r=o.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=r||We.compareByGeneratedPositionsInflated(o,e)<=0}let Vt=class{constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(e,t){this._array.forEach(e,t)}add(e){Wt(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))}toArray(){return this._sorted||(this._array.sort(We.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};ze.MappingList=Vt;const G=Ne,y=ne,Q=fe.ArraySet,qt=ze.MappingList;class he{constructor(e){e||(e={}),this._file=y.getArg(e,"file",null),this._sourceRoot=y.getArg(e,"sourceRoot",null),this._skipValidation=y.getArg(e,"skipValidation",!1),this._sources=new Q,this._names=new Q,this._mappings=new qt,this._sourcesContents=null}static fromSourceMap(e){const t=e.sourceRoot,n=new he({file:e.file,sourceRoot:t});return e.eachMapping(function(r){const i={generated:{line:r.generatedLine,column:r.generatedColumn}};r.source!=null&&(i.source=r.source,t!=null&&(i.source=y.relative(t,i.source)),i.original={line:r.originalLine,column:r.originalColumn},r.name!=null&&(i.name=r.name)),n.addMapping(i)}),e.sources.forEach(function(r){let i=r;t!==null&&(i=y.relative(t,r)),n._sources.has(i)||n._sources.add(i);const a=e.sourceContentFor(r);a!=null&&n.setSourceContent(r,a)}),n}addMapping(e){const t=y.getArg(e,"generated"),n=y.getArg(e,"original",null);let r=y.getArg(e,"source",null),i=y.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:r,name:i})}setSourceContent(e,t){let n=e;this._sourceRoot!=null&&(n=y.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[y.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[y.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}applySourceMap(e,t,n){let r=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=e.file}const i=this._sourceRoot;i!=null&&(r=y.relative(i,r));const a=this._mappings.toArray().length>0?new Q:this._sources,l=new Q;this._mappings.unsortedForEach(function(s){if(s.source===r&&s.originalLine!=null){const _=e.originalPositionFor({line:s.originalLine,column:s.originalColumn});_.source!=null&&(s.source=_.source,n!=null&&(s.source=y.join(n,s.source)),i!=null&&(s.source=y.relative(i,s.source)),s.originalLine=_.line,s.originalColumn=_.column,_.name!=null&&(s.name=_.name))}const c=s.source;c!=null&&!a.has(c)&&a.add(c);const f=s.name;f!=null&&!l.has(f)&&l.add(f)},this),this._sources=a,this._names=l,e.sources.forEach(function(s){const c=e.sourceContentFor(s);c!=null&&(n!=null&&(s=y.join(n,s)),i!=null&&(s=y.relative(i,s)),this.setSourceContent(s,c))},this)}_validateMapping(e,t,n,r){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!r)){if(!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))}}_serializeMappings(){let e=0,t=1,n=0,r=0,i=0,a=0,l="",s,c,f,_;const h=this._mappings.toArray();for(let S=0,w=h.length;S<w;S++){if(c=h[S],s="",c.generatedLine!==t)for(e=0;c.generatedLine!==t;)s+=";",t++;else if(S>0){if(!y.compareByGeneratedPositionsInflated(c,h[S-1]))continue;s+=","}s+=G.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(_=this._sources.indexOf(c.source),s+=G.encode(_-a),a=_,s+=G.encode(c.originalLine-1-r),r=c.originalLine-1,s+=G.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(f=this._names.indexOf(c.name),s+=G.encode(f-i),i=f)),l+=s}return l}_generateSourcesContent(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=y.relative(t,n));const r=y.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)}toJSON(){const e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}toString(){return JSON.stringify(this.toJSON())}}he.prototype._version=3;var re={},Ve={};(function(o){o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2;function e(t,n,r,i,a,l){const s=Math.floor((n-t)/2)+t,c=a(r,i[s],!0);return c===0?s:c>0?n-s>1?e(s,n,r,i,a,l):l==o.LEAST_UPPER_BOUND?n<i.length?n:-1:s:s-t>1?e(t,s,r,i,a,l):l==o.LEAST_UPPER_BOUND?s:t<0?-1:t}o.search=function(n,r,i,a){if(r.length===0)return-1;let l=e(-1,r.length,n,r,i,a||o.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&i(r[l],r[l-1],!0)===0;)--l;return l}})(Ve);var z={exports:{}};const Ht=(function(){return typeof window<"u"&&this===window}).call();if(Ht){let o=null;z.exports=function(){if(typeof o=="string")return fetch(o).then(t=>t.arrayBuffer());if(o instanceof ArrayBuffer)return Promise.resolve(o);throw new Error("You must provide the string URL or ArrayBuffer contents of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer")},z.exports.initialize=e=>o=e}else{const o=Te,e=te;z.exports=function(){return new Promise((n,r)=>{const i=e.join(__dirname,"mappings.wasm");o.readFile(i,null,(a,l)=>{if(a){r(a);return}n(l.buffer)})})},z.exports.initialize=t=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")}}var qe=z.exports;const Jt=qe;function Qt(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}let k=null;var Yt=function(){if(k)return k;const e=[];return k=Jt().then(t=>WebAssembly.instantiate(t,{env:{mapping_callback(n,r,i,a,l,s,c,f,_,h){const S=new Qt;S.generatedLine=n+1,S.generatedColumn=r,i&&(S.lastGeneratedColumn=a-1),l&&(S.source=s,S.originalLine=c+1,S.originalColumn=f,_&&(S.name=h)),e[e.length-1](S)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(t=>({exports:t.instance.exports,withMappingCallback:(n,r)=>{e.push(n);try{r()}finally{e.pop()}}})).then(null,t=>{throw k=null,t}),k};const g=ne,le=Ve,X=fe.ArraySet,Kt=qe,Xt=Yt,ge=Symbol("smcInternal");let E=class He{constructor(e,t){return e==ge?Promise.resolve(this):Zt(e,t)}static initialize(e){Kt.initialize(e["lib/mappings.wasm"])}static fromSourceMap(e,t){return en(e,t)}static async with(e,t,n){const r=await new He(e,t);try{return await n(r)}finally{r.destroy()}}_parseMappings(e,t){throw new Error("Subclasses must implement _parseMappings")}eachMapping(e,t,n){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(e){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}};E.prototype._version=3;E.GENERATED_ORDER=1;E.ORIGINAL_ORDER=2;E.GREATEST_LOWER_BOUND=1;E.LEAST_UPPER_BOUND=2;re.SourceMapConsumer=E;class U extends E{constructor(e,t){return super(ge).then(n=>{let r=e;typeof e=="string"&&(r=g.parseSourceMapInput(e));const i=g.getArg(r,"version");let a=g.getArg(r,"sources");const l=g.getArg(r,"names",[]);let s=g.getArg(r,"sourceRoot",null);const c=g.getArg(r,"sourcesContent",null),f=g.getArg(r,"mappings"),_=g.getArg(r,"file",null);if(i!=n._version)throw new Error("Unsupported version: "+i);return s&&(s=g.normalize(s)),a=a.map(String).map(g.normalize).map(function(h){return s&&g.isAbsolute(s)&&g.isAbsolute(h)?g.relative(s,h):h}),n._names=X.fromArray(l.map(String),!0),n._sources=X.fromArray(a,!0),n._absoluteSources=n._sources.toArray().map(function(h){return g.computeSourceURL(s,h,t)}),n.sourceRoot=s,n.sourcesContent=c,n._mappings=f,n._sourceMapURL=t,n.file=_,n._computedColumnSpans=!1,n._mappingsPtr=0,n._wasm=null,Xt().then(h=>(n._wasm=h,n))})}_findSourceIndex(e){let t=e;if(this.sourceRoot!=null&&(t=g.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);for(let n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==e)return n;return-1}static fromSourceMap(e,t){return new U(e.toString())}get sources(){return this._absoluteSources.slice()}_getMappingsPtr(){return this._mappingsPtr===0&&this._parseMappings(this._mappings,this.sourceRoot),this._mappingsPtr}_parseMappings(e,t){const n=e.length,r=this._wasm.exports.allocate_mappings(n),i=new Uint8Array(this._wasm.exports.memory.buffer,r,n);for(let l=0;l<n;l++)i[l]=e.charCodeAt(l);const a=this._wasm.exports.parse_mappings(r);if(!a){const l=this._wasm.exports.get_last_error();let s=`Error parsing mappings (code ${l}): `;switch(l){case 1:s+="the mappings contained a negative line, column, source index, or name index";break;case 2:s+="the mappings contained a number larger than 2**32";break;case 3:s+="reached EOF while in the middle of parsing a VLQ";break;case 4:s+="invalid base 64 character while parsing a VLQ";break;default:s+="unknown error code";break}throw new Error(s)}this._mappingsPtr=a}eachMapping(e,t,n){const r=t||null,i=n||E.GENERATED_ORDER,a=this.sourceRoot;this._wasm.withMappingCallback(l=>{l.source!==null&&(l.source=this._sources.at(l.source),l.source=g.computeSourceURL(a,l.source,this._sourceMapURL),l.name!==null&&(l.name=this._names.at(l.name))),e.call(r,l)},()=>{switch(i){case E.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case E.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(e){let t=g.getArg(e,"source");const n=g.getArg(e,"line"),r=e.column||0;if(t=this._findSourceIndex(t),t<0)return[];if(n<1)throw new Error("Line numbers must be >= 1");if(r<0)throw new Error("Column numbers must be >= 0");const i=[];return this._wasm.withMappingCallback(a=>{let l=a.lastGeneratedColumn;this._computedColumnSpans&&l===null&&(l=1/0),i.push({line:a.generatedLine,column:a.generatedColumn,lastColumn:l})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),t,n-1,"column"in e,r)}),i}destroy(){this._mappingsPtr!==0&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(e){const t={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")};if(t.generatedLine<1)throw new Error("Line numbers must be >= 1");if(t.generatedColumn<0)throw new Error("Column numbers must be >= 0");let n=g.getArg(e,"bias",E.GREATEST_LOWER_BOUND);n==null&&(n=E.GREATEST_LOWER_BOUND);let r;if(this._wasm.withMappingCallback(i=>r=i,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),t.generatedLine-1,t.generatedColumn,n)}),r&&r.generatedLine===t.generatedLine){let i=g.getArg(r,"source",null);i!==null&&(i=this._sources.at(i),i=g.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));let a=g.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:i,line:g.getArg(r,"originalLine",null),column:g.getArg(r,"originalColumn",null),name:a}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1}sourceContentFor(e,t){if(!this.sourcesContent)return null;const n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];let r=e;this.sourceRoot!=null&&(r=g.relative(this.sourceRoot,r));let i;if(this.sourceRoot!=null&&(i=g.urlParse(this.sourceRoot))){const a=r.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!i.path||i.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')}generatedPositionFor(e){let t=g.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};const n={source:t,originalLine:g.getArg(e,"line"),originalColumn:g.getArg(e,"column")};if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");let r=g.getArg(e,"bias",E.GREATEST_LOWER_BOUND);r==null&&(r=E.GREATEST_LOWER_BOUND);let i;if(this._wasm.withMappingCallback(a=>i=a,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),n.source,n.originalLine-1,n.originalColumn,r)}),i&&i.source===n.source){let a=i.lastGeneratedColumn;return this._computedColumnSpans&&a===null&&(a=1/0),{line:g.getArg(i,"generatedLine",null),column:g.getArg(i,"generatedColumn",null),lastColumn:a}}return{line:null,column:null,lastColumn:null}}}U.prototype.consumer=E;re.BasicSourceMapConsumer=U;class Je extends E{constructor(e,t){return super(ge).then(n=>{let r=e;typeof e=="string"&&(r=g.parseSourceMapInput(e));const i=g.getArg(r,"version"),a=g.getArg(r,"sections");if(i!=n._version)throw new Error("Unsupported version: "+i);n._sources=new X,n._names=new X,n.__generatedMappings=null,n.__originalMappings=null,n.__generatedMappingsUnsorted=null,n.__originalMappingsUnsorted=null;let l={line:-1,column:0};return Promise.all(a.map(s=>{if(s.url)throw new Error("Support for url field in sections not implemented.");const c=g.getArg(s,"offset"),f=g.getArg(c,"line"),_=g.getArg(c,"column");if(f<l.line||f===l.line&&_<l.column)throw new Error("Section offsets must be ordered and non-overlapping.");return l=c,new E(g.getArg(s,"map"),t).then(S=>({generatedOffset:{generatedLine:f+1,generatedColumn:_+1},consumer:S}))})).then(s=>(n._sections=s,n))})}get _generatedMappings(){return this.__generatedMappings||this._sortGeneratedMappings(),this.__generatedMappings}get _originalMappings(){return this.__originalMappings||this._sortOriginalMappings(),this.__originalMappings}get _generatedMappingsUnsorted(){return this.__generatedMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappingsUnsorted}get _originalMappingsUnsorted(){return this.__originalMappingsUnsorted||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappingsUnsorted}_sortGeneratedMappings(){const e=this._generatedMappingsUnsorted;e.sort(g.compareByGeneratedPositionsDeflated),this.__generatedMappings=e}_sortOriginalMappings(){const e=this._originalMappingsUnsorted;e.sort(g.compareByOriginalPositions),this.__originalMappings=e}get sources(){const e=[];for(let t=0;t<this._sections.length;t++)for(let n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}originalPositionFor(e){const t={generatedLine:g.getArg(e,"line"),generatedColumn:g.getArg(e,"column")},n=le.search(t,this._sections,function(i,a){const l=i.generatedLine-a.generatedOffset.generatedLine;return l||i.generatedColumn-a.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})}sourceContentFor(e,t){for(let n=0;n<this._sections.length;n++){const i=this._sections[n].consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')}generatedPositionFor(e){for(let t=0;t<this._sections.length;t++){const n=this._sections[t];if(n.consumer._findSourceIndex(g.getArg(e,"source"))===-1)continue;const r=n.consumer.generatedPositionFor(e);if(r)return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}return{line:null,column:null}}_parseMappings(e,t){const n=this.__generatedMappingsUnsorted=[],r=this.__originalMappingsUnsorted=[];for(let i=0;i<this._sections.length;i++){const a=this._sections[i],l=[];a.consumer.eachMapping(s=>l.push(s));for(let s=0;s<l.length;s++){const c=l[s];let f=g.computeSourceURL(a.consumer.sourceRoot,null,this._sourceMapURL);this._sources.add(f),f=this._sources.indexOf(f);let _=null;c.name&&(this._names.add(c.name),_=this._names.indexOf(c.name));const h={source:f,generatedLine:c.generatedLine+(a.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(a.generatedOffset.generatedLine===c.generatedLine?a.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:_};n.push(h),typeof h.originalLine=="number"&&r.push(h)}}}eachMapping(e,t,n){const r=t||null,i=n||E.GENERATED_ORDER;let a;switch(i){case E.GENERATED_ORDER:a=this._generatedMappings;break;case E.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}const l=this.sourceRoot;a.map(function(s){let c=null;return s.source!==null&&(c=this._sources.at(s.source),c=g.computeSourceURL(l,c,this._sourceMapURL)),{source:c,generatedLine:s.generatedLine,generatedColumn:s.generatedColumn,originalLine:s.originalLine,originalColumn:s.originalColumn,name:s.name===null?null:this._names.at(s.name)}},this).forEach(e,r)}_findMapping(e,t,n,r,i,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return le.search(e,t,i,a)}allGeneratedPositionsFor(e){const t=g.getArg(e,"line"),n={source:g.getArg(e,"source"),originalLine:t,originalColumn:g.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");const r=[];let i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",g.compareByOriginalPositions,le.LEAST_UPPER_BOUND);if(i>=0){let a=this._originalMappings[i];if(e.column===void 0){const l=a.originalLine;for(;a&&a.originalLine===l;){let s=a.lastGeneratedColumn;this._computedColumnSpans&&s===null&&(s=1/0),r.push({line:g.getArg(a,"generatedLine",null),column:g.getArg(a,"generatedColumn",null),lastColumn:s}),a=this._originalMappings[++i]}}else{const l=a.originalColumn;for(;a&&a.originalLine===t&&a.originalColumn==l;){let s=a.lastGeneratedColumn;this._computedColumnSpans&&s===null&&(s=1/0),r.push({line:g.getArg(a,"generatedLine",null),column:g.getArg(a,"generatedColumn",null),lastColumn:s}),a=this._originalMappings[++i]}}}return r}destroy(){for(let e=0;e<this._sections.length;e++)this._sections[e].consumer.destroy()}}re.IndexedSourceMapConsumer=Je;function Zt(o,e){let t=o;typeof o=="string"&&(t=g.parseSourceMapInput(o));const n=t.sections!=null?new Je(t,e):new U(t,e);return Promise.resolve(n)}function en(o,e){return U.fromSourceMap(o,e)}var ve=re.SourceMapConsumer,tn=Object.defineProperty,nn=(o,e,t)=>e in o?tn(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,$=(o,e,t)=>nn(o,typeof e!="symbol"?e+"":e,t);const rn=8969,on="spotlight-by-sentry",sn="/contextlines";async function an(o){try{return(await fetch(o)).text()}catch{return}}function ln(o){try{return JSON.parse(o)}catch{return}}async function cn(o,e){const t=await new ve(o),n=t.originalPositionFor({line:e.lineno,column:e.colno,bias:ve.LEAST_UPPER_BOUND});if(n.source&&n.line&&n.column){e.lineno=n.line,e.colno=n.column;const r=new URL(e.filename).pathname.slice(1);e.filename=ie.resolve(ie.join(ie.dirname(r),n.source));const i=t.sourceContentFor(n.source),a=(i==null?void 0:i.split(at.EOL))??[];Qe(a,e)}return n}function Qe(o,e,t=5){const n=o.length,r=Math.max(Math.min(n-1,e.lineno-1),0);e.pre_context=o.slice(Math.max(0,r-t),r).map(i=>ce(i,0)),e.context_line=ce(o[Math.min(n-1,r)],e.colno||0),e.post_context=o.slice(Math.min(r+1,n),r+1+t).map(i=>ce(i,0))}function ce(o,e){let t=o;const n=t.length;if(n<=150)return t;e>n&&(e=n);let r=Math.max(e-60,0);r<5&&(r=0);let i=Math.min(r+140,n);return i>n-5&&(i=n),i===n&&(r=Math.max(i-140,0)),t=t.slice(r,i),r>0&&(t=`'{snip} ${t}`),i<n&&(t+=" {snip}"),t}function un(o){return!!o.filename&&!!o.lineno&&!!o.colno}function pn(o,e){if(o.method!=="PUT"){e.writeHead(405),e.end();return}let t="";o.on("data",n=>{t+=n}),o.on("end",async()=>{const n=ln(t);if(!n){e.writeHead(500),e.end();return}for(const i of n.frames??[]){if(!un(i)||i.filename.includes("/node_modules/"))continue;const{filename:a}=i;if(a.includes("://")){const l=await an(i.filename);if(!l)continue;const s=l.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.*)/);if(s&&s[1]){const c=s[1],f=Buffer.from(c,"base64").toString("utf-8");await cn(f,i)}}else if(!a.includes(":"))try{const l=V.readFileSync(a,{encoding:"utf-8"}).split(/\r?\n/);Qe(l,i)}catch(l){if(l.code!=="ENOENT")throw l}}const r=JSON.stringify(n);e.writeHead(200,{"Content-Type":"application/json"}),e.end(r)})}const Y={info:o=>console.log("🔎 [Spotlight]",o),warn:o=>console.warn("🔎 [Spotlight]",o),error:o=>console.error("🔎 [Spotlight]",o),debug:o=>Ye&&console.debug("🔎 [Spotlight]",o)};let W,Ye=!1;function dn(o){W=o}function fn(o){Ye=o}const M={info:o=>(W||Y).info(o),warn:o=>(W||Y).warn(o),error:o=>(W||Y).error(o),debug:o=>(W||Y).debug(o)};class hn{constructor(e=100){$(this,"size"),$(this,"items"),$(this,"writePos",0),$(this,"head",0),$(this,"timeout",10),$(this,"readers",new Map),this.size=e,this.items=new Array(e)}put(e){const t=new Date().getTime();this.items[this.writePos%this.size]=[t,e],this.writePos+=1,this.head===this.writePos&&(this.head+=1);const n=t-this.timeout*1e3;let r;for(;this.head<this.writePos&&(r=this.items[this.head%this.size],!(r===void 0||r[0]>n));)this.head+=1}subscribe(e){const t=gn();return this.readers.set(t,e),setTimeout(()=>this.stream(t)),t}unsubscribe(e){this.readers.delete(e)}stream(e,t=this.head){const n=this.readers.get(e);if(!n)return;let r=t,i;for(;i=this.items[r%this.size],!(typeof i>"u"||r>=this.writePos);)n(i[1]),r+=1;setTimeout(()=>this.stream(e,r),500)}clear(){this.items=new Array(this.size),this.writePos=0,this.head=0,this.readers=new Map}}function gn(){let o=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16;return t=(o+t)%16|0,o=Math.floor(o/16),(e==="x"?t:t&3|8).toString(16)})}function Ke(){return{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"*","Access-Control-Allow-Methods":"GET,POST,PUT,OPTIONS,DELETE,PATCH"}}function F(o){return function(t,n,r,i){const a={...Ke(),...Xe()};for(const[l,s]of Object.entries(a))n.setHeader(l,s);if(t.method==="OPTIONS"){n.writeHead(204,{"Cache-Control":"no-cache"}),n.end();return}return o(t,n,r,i)}}function Xe(){return{"X-Powered-by":on}}function mn(o,e){return function(n,r,i,a){if(n.method==="GET"&&n.headers.accept&&n.headers.accept==="text/event-stream"&&i==="/stream"){r.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),r.flushHeaders(),r.write(`
5
5
  `);const l=o.subscribe(([s,c])=>{M.debug("🕊️ sending to Spotlight"),r.write(`event:${s}
6
- `);for(const g of c.split(`
7
- `))r.write(`data:${g}
6
+ `);for(const f of c.split(`
7
+ `))r.write(`data:${f}
8
8
  `);r.write(`
9
- `)});n.on("close",()=>{o.unsubscribe(l),r.end()})}else if(n.method==="POST"){M.debug("📩 Received event");let l="",s=n;const c=n.headers["content-encoding"];c==="gzip"?s=n.pipe(ce.createGunzip()):c==="deflate"&&(s=n.pipe(ce.createInflate())),s.on("readable",()=>{let g;for(;(g=s.read())!==null;)l+=g}),s.on("end",()=>{var g,_;let f=(g=n.headers["content-type"])==null?void 0:g.split(";")[0].toLocaleLowerCase();if((_=a==null?void 0:a.get("sentry_client"))!=null&&_.startsWith("sentry.javascript.browser")&&n.headers.origin&&(f="application/x-sentry-envelope"),f?o.put([f,l]):M.warn("No content type, skipping payload..."),process.env.SPOTLIGHT_CAPTURE||e){const S=new Date().getTime(),w=`${(f==null?void 0:f.replace(/[^a-z0-9]/gi,"_"))||"no_content_type"}-${S}.txt`;e?e(l):(W.createWriteStream(w).write(l),M.info(`🗃️ Saved data to ${w}`))}r.writeHead(200,{"Cache-Control":"no-cache",Connection:"keep-alive"}),r.end()})}else{Ze(n,r);return}}}function mn(o){return function(t,n,r){let i=`${r||t.url}`;i==="/"&&(i="/src/index.html"),i=i.slice(1);const a=I.extname(i);let l="text/html";switch(a){case".js":l="text/javascript";break;case".css":l="text/css";break;case".json":l="application/json";break}Object.prototype.hasOwnProperty.call(o,i)?(n.writeHead(200,{"Content-Type":l}),n.end(o[i])):Y(t,n)}}function _n(o,e){e.writeHead(200,{"Content-Type":"text/plain",...Ye(),...Ke()}),e.end("OK")}function Cn(o,e){o.method==="DELETE"?(e.writeHead(200,{"Content-Type":"text/plain"}),An(),e.end("Cleared")):Ze(o,e)}function wn(o=process.cwd()){return(e,t)=>{if(e.method!=="POST"){t.writeHead(405),t.end();return}let n="";e.on("data",r=>{n+=r}),e.on("end",()=>{const r=I.resolve(o,n);M.debug(`Launching editor for ${r}`),Ut(r,(i,a)=>{M.error(`Failed to launch editor for ${i}: ${a}`)}),t.writeHead(204),t.end()})}}function Xe(o){return(e,t)=>{t.writeHead(o),t.end()}}const Y=Xe(404),Ze=Xe(405);function Sn(o,e,t,n,r){t&&!n&&(n={"/src/index.html":W.readFileSync(I.join(t,"src/index.html")),"/assets/main.js":W.readFileSync(I.join(t,"assets/main.js"))});const i=[[/^\/health$/,_n],[/^\/clear$/,k(Cn)],[/^\/stream$|^\/api\/\d+\/envelope\/?$/,k(gn(o,r))],[/^\/open$/,k(wn(t))],[RegExp(`^${on}$`),k(un)],[/^.+$/,n!=null?k(mn(n)):Y]],a=Ie.createServer((c,g)=>{const _=c.url;if(!_)return Y(c,g);const{pathname:f,searchParams:S}=new URL(_,`http://${c.headers.host||"localhost"}`),w=i.find(L=>L[0].test(f));return w?w[1](c,g,f,S):Y(c,g)});return a.on("error",l),a.listen(e,()=>{s(e,t)}),a;function l(c){"code"in c&&c.code==="EADDRINUSE"&&(M.info(`Port ${e} in use, retrying...`),setTimeout(()=>{a.close(),a.listen(e),M.info(`Port ${e} in use, retrying...`)},5e3))}function s(c,g){M.info(`Sidecar listening on ${c}`),g&&M.info(`You can open: http://localhost:${c} to see the Spotlight overlay directly`)}}let X;const et=new fn,bn=o=>{if(typeof o=="string"){const e=Number(o);return/^\d+$/.test(o)&&e>0&&e<=65535}return o>0&&o<=65535};function yn(o){return new Promise(e=>{const t={hostname:"localhost",port:o,path:"/health",method:"GET",timeout:2e3,headers:{Connection:"close"}},n=Ie.get(t,r=>{const i=r.headers["x-powered-by"];e(i==="spotlight-by-sentry")});n.on("error",()=>{e(!1)}),n.end()})}function En({port:o,logger:e,basePath:t,filesToServe:n,debug:r,incomingPayload:i}={}){let a=nn;e&&pn(e),(r||process.env.SPOTLIGHT_DEBUG)&&dn(!0),o&&!bn(o)?(M.info("Please provide a valid port."),process.exit(1)):o&&(a=typeof o=="string"?Number(o):o),yn(a).then(l=>{l?M.info(`Sidecar is already running on port ${a}`):X||(X=Sn(et,a,t,n,i))})}function An(){et.clear()}function tt(){X&&(M.info("Shutting down server..."),X.close())}process.on("SIGINT",tt);process.on("SIGTERM",tt);if(process.stdout.isTTY){const o=Uint8Array.from(ce.inflateRawSync(Buffer.from("bY7LCgMxFEK9L5MwDDSL9P//1DJMKGXowoUcUaFZOk8dU2Op9+qZVkYQoFsaEqA6PZxxma1AoMG+TiONTgcfAd741YxxVf8gCzCgWcYB7OSj9sjW7t2/eKxKAxkIYv8NqL3FpVY25CmjrBSuDw==","base64"))),e="\x1B[",t=`${e}38;5;`,n=`${t}96m`,r=`${t}61m`,i=`${e}1m`,a=`${e}0m`,l=`${a}
10
- `;let s=.22,c=0,g=0,_=0,f=26,S=0;for(let w of o)if(w===255)process.stdout.write(l),c=g=0,_++===5&&(s=s/-3),f=Math.round(f*(1+s)),S=Math.round(Math.random()*18);else{for(;w-->=0;)g<f-1?process.stdout.write(n):g===f-1?process.stdout.write(r):g===f+S&&process.stdout.write(`${a}${i}`),process.stdout.write(c?g>=35?"#":"s":" "),g++;c=!c}process.stdout.write(l)}const me=Ce.isSea()?o=>Buffer.from(Ce.getRawAsset(o)):(()=>{const o=I.join(it.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:re&&re.tagName.toUpperCase()==="SCRIPT"&&re.src||new URL("spotlight.cjs",document.baseURI).href),"../../dist/overlay/");return e=>W.readFileSync(I.join(o,e))})(),xn=process.argv.length>=3?Number(process.argv[2]):void 0,On="manifest.json",Re="src/index.html",Mn=process.cwd(),_e=Object.create(null),vn=JSON.parse(me(On));_e[Re]=me(Re);const Ln=Object.values(vn);for(const o of Ln)_e[o.file]=me(o.file);En({port:xn,basePath:Mn,filesToServe:_e});
9
+ `)});n.on("close",()=>{o.unsubscribe(l),r.end()})}else if(n.method==="POST"){M.debug("📩 Received event");let l="",s=n;const c=n.headers["content-encoding"];c==="gzip"?s=n.pipe(ue.createGunzip()):c==="deflate"&&(s=n.pipe(ue.createInflate())),s.on("readable",()=>{let f;for(;(f=s.read())!==null;)l+=f}),s.on("end",()=>{var f,_;let h=(f=n.headers["content-type"])==null?void 0:f.split(";")[0].toLocaleLowerCase();if((_=a==null?void 0:a.get("sentry_client"))!=null&&_.startsWith("sentry.javascript.browser")&&n.headers.origin&&(h="application/x-sentry-envelope"),h?o.put([h,l]):M.warn("No content type, skipping payload..."),process.env.SPOTLIGHT_CAPTURE||e){const S=new Date().getTime(),w=`${(h==null?void 0:h.replace(/[^a-z0-9]/gi,"_"))||"no_content_type"}-${S}.txt`;e?e(l):(V.createWriteStream(w).write(l),M.info(`🗃️ Saved data to ${w}`))}r.writeHead(200,{"Cache-Control":"no-cache",Connection:"keep-alive"}),r.end()})}else{et(n,r);return}}}function _n(o){return function(t,n,r){let i=`${r||t.url}`;i==="/"&&(i="/src/index.html"),i=i.slice(1);const a=I.extname(i);let l="text/html";switch(a){case".js":l="text/javascript";break;case".css":l="text/css";break;case".json":l="application/json";break}Object.prototype.hasOwnProperty.call(o,i)?(n.writeHead(200,{"Content-Type":l}),n.end(o[i])):K(t,n)}}function Cn(o,e){e.writeHead(200,{"Content-Type":"text/plain",...Ke(),...Xe()}),e.end("OK")}function wn(o,e){o.method==="DELETE"?(e.writeHead(200,{"Content-Type":"text/plain"}),xn(),e.end("Cleared")):et(o,e)}function Sn(o=process.cwd()){return(e,t)=>{if(e.method!=="POST"){t.writeHead(405),t.end();return}let n="";e.on("data",r=>{n+=r}),e.on("end",()=>{const r=I.resolve(o,n);M.debug(`Launching editor for ${r}`),Nt(r,(i,a)=>{M.error(`Failed to launch editor for ${i}: ${a}`)}),t.writeHead(204),t.end()})}}function Ze(o){return(e,t)=>{t.writeHead(o),t.end()}}const K=Ze(404),et=Ze(405);function bn(o,e,t,n,r){t&&!n&&(n={"/src/index.html":V.readFileSync(I.join(t,"src/index.html")),"/assets/main.js":V.readFileSync(I.join(t,"assets/main.js"))});const i=[[/^\/health$/,Cn],[/^\/clear$/,F(wn)],[/^\/stream$|^\/api\/\d+\/envelope\/?$/,F(mn(o,r))],[/^\/open$/,F(Sn(t))],[RegExp(`^${sn}$`),F(pn)],[/^.+$/,n!=null?F(_n(n)):K]],a=Ie.createServer((c,f)=>{const _=c.url;if(!_)return K(c,f);const{pathname:h,searchParams:S}=new URL(_,`http://${c.headers.host||"localhost"}`),w=i.find(L=>L[0].test(h));return w?w[1](c,f,h,S):K(c,f)});return a.on("error",l),a.listen(e,()=>{s(e,t)}),a;function l(c){"code"in c&&c.code==="EADDRINUSE"&&(M.info(`Port ${e} in use, retrying...`),setTimeout(()=>{a.close(),a.listen(e),M.info(`Port ${e} in use, retrying...`)},5e3))}function s(c,f){M.info(`Sidecar listening on ${c}`),f&&M.info(`You can open: http://localhost:${c} to see the Spotlight overlay directly`)}}let Z;const tt=new hn,yn=o=>{if(typeof o=="string"){const e=Number(o);return/^\d+$/.test(o)&&e>0&&e<=65535}return o>0&&o<=65535};function En(o){return new Promise(e=>{const t={hostname:"localhost",port:o,path:"/health",method:"GET",timeout:2e3,headers:{Connection:"close"}},n=Ie.get(t,r=>{const i=r.headers["x-powered-by"];e(i==="spotlight-by-sentry")});n.on("error",()=>{e(!1)}),n.end()})}function An({port:o,logger:e,basePath:t,filesToServe:n,debug:r,incomingPayload:i}={}){let a=rn;e&&dn(e),(r||process.env.SPOTLIGHT_DEBUG)&&fn(!0),o&&!yn(o)?(M.info("Please provide a valid port."),process.exit(1)):o&&(a=typeof o=="string"?Number(o):o),En(a).then(l=>{l?M.info(`Sidecar is already running on port ${a}`):Z||(Z=bn(tt,a,t,n,i))})}function xn(){tt.clear()}function nt(){Z&&(M.info("Shutting down server..."),Z.close())}process.on("SIGINT",nt);process.on("SIGTERM",nt);const On=st.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:D&&D.tagName.toUpperCase()==="SCRIPT"&&D.src||new URL("spotlight.cjs",document.baseURI).href);let ee=null;try{ee=On("node:sea")}catch{ee={isSea:()=>!1}}const me=ee.isSea()?o=>Buffer.from(ee.getRawAsset(o)):(()=>{const o=I.join(it.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:D&&D.tagName.toUpperCase()==="SCRIPT"&&D.src||new URL("spotlight.cjs",document.baseURI).href),"../../dist/overlay/");return e=>V.readFileSync(I.join(o,e))})(),Le=process.stdout.columns;if(process.stdout.isTTY&&Le>34){const o=Uint8Array.from(ue.inflateRawSync(Buffer.from("bY7LCgMxFEK9L5MwDDSL9P//1DJMKGXowoUcUaFZOk8dU2Op9+qZVkYQoFsaEqA6PZxxma1AoMG+TiONTgcfAd741YxxVf8gCzCgWcYB7OSj9sjW7t2/eKxKAxkIYv8NqL3FpVY25CmjrBSuDw==","base64"))),e="\x1B[",t=`${e}38;5;`,n=`${t}96m`,r=`${t}61m`,i=`${e}1m`,a=`${e}0m`,l=`${a}
10
+ `;let s=.22,c=0,f=0,_=0,h=26,S=0;for(let w of o)if(w===255)process.stdout.write(l),c=f=0,_++===5&&(s=s/-3),h=Math.round(h*(1+s)),S=Math.round(Math.random()*18);else{for(;w-->=0&&f<Le;)f<h-1?process.stdout.write(n):f===h-1?process.stdout.write(r):f===h+S&&process.stdout.write(`${a}${i}`),process.stdout.write(c?f>=35?"#":"s":" "),f++;c=!c}process.stdout.write(l)}const Mn=process.argv.length>=3?Number(process.argv[2]):void 0,vn="manifest.json",Re="src/index.html",Ln=process.cwd(),_e=Object.create(null),Rn=JSON.parse(me(vn));_e[Re]=me(Re);const Tn=Object.values(Rn);for(const o of Tn)_e[o.file]=me(o.file);An({port:Mn,basePath:Ln,filesToServe:_e});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotlightjs/spotlight",
3
3
  "description": "Spotlight - Sentry for development. Containing the overlay and the sidecar.",
4
- "version": "2.6.1",
4
+ "version": "2.6.2",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "files": [
@@ -36,8 +36,8 @@
36
36
  "macho-unsign": "^2.0.6",
37
37
  "portable-executable-signature": "^2.0.6",
38
38
  "postject": "1.0.0-alpha.6",
39
- "@spotlightjs/overlay": "2.7.1",
40
- "@spotlightjs/sidecar": "1.9.1"
39
+ "@spotlightjs/sidecar": "1.9.1",
40
+ "@spotlightjs/overlay": "2.7.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^18.19.55",