Skip to content

The only tool you need to know what is happening and how to fix it.

feat: Symbolicator testing for js (#186)

narrow-adventurece18c1b5f1b9
diff --git a/CLAUDE.md b/CLAUDE.md
index bfe6a6d1..60d16ef8 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -851,15 +851,18 @@ The backend normalizes stack traces before hashing to group identical errors des
**Normalization Steps:**
1. Extract error type only (remove error message content)
-2. Remove absolute file paths (keep `filename:line` only)
-3. Replace hexadecimal addresses with `<hex>`
-4. Replace UUIDs with `<uuid>`
-5. Replace IP addresses with `<ip>`
-6. Replace timestamps with `<timestamp>`
-7. Replace numeric IDs in paths with `<id>`
-8. Normalize whitespace
-9. Remove ANSI color codes
-10. Hash the normalized string with SHA-256, truncate to 16 chars
+2. Collapse JS SDK function-name lines (ending in `()`, directly above a 4-space-indented `file:line:col` location line) to `<fn>` so resolved function names never affect grouping; anchoring on the location line keeps Go traces (tab-indented file lines) untouched
+3. Remove absolute file paths (keep `filename:line` only)
+4. Replace hexadecimal addresses with `<hex>`
+5. Replace UUIDs with `<uuid>`
+6. Replace IP addresses with `<ip>`
+7. Replace timestamps with `<timestamp>`
+8. Replace numeric IDs in paths with `<id>`
+9. Normalize whitespace
+10. Remove ANSI color codes
+11. Hash the normalized string with SHA-256, truncate to 16 chars
+
+**Note:** columns are intentionally kept in the hash. Minified bundles put everything on line 1, so the column is the only frame disambiguator when no source map matched. Function names are excluded (step 2) because they are derived from the location and change as symbolication improves.
**Result:** Same logical error gets same hash, even if:
- Error message contains different user IDs
diff --git a/backend/app/cache/sourcemap_cache.go b/backend/app/cache/sourcemap_cache.go
deleted file mode 100644
index 66d57cb7..00000000
--- a/backend/app/cache/sourcemap_cache.go
+++ /dev/null
@@ -1,102 +0,0 @@
-package cache
-
-import (
- "container/list"
- "sync"
-)
-
-type sourceMapCacheEntry struct {
- key string
- data []byte
-}
-
-type sourceMapCache struct {
- maxCount int
- maxBytes int64
- mu sync.Mutex
- items map[string]*list.Element
- order *list.List
- curBytes int64
- hits uint64
- misses uint64
- evictions uint64
-}
-
-type SourceMapCacheStats struct {
- Entries int
- Bytes int64
- MaxEntries int
- MaxBytes int64
- Hits uint64
- Misses uint64
- Evictions uint64
-}
-
-var SourceMapCache *sourceMapCache
-
-func InitSourceMapCache(maxCount int, maxBytes int64) {
- SourceMapCache = &sourceMapCache{
- maxCount: maxCount,
- maxBytes: maxBytes,
- items: make(map[string]*list.Element),
- order: list.New(),
- }
-}
-
-func (c *sourceMapCache) Get(key string) ([]byte, bool) {
- c.mu.Lock()
- defer c.mu.Unlock()
-
- if el, ok := c.items[key]; ok {
- c.hits++
- c.order.MoveToFront(el)
- return el.Value.(*sourceMapCacheEntry).data, true
- }
- c.misses++
- return nil, false
-}
-
-func (c *sourceMapCache) Put(key string, data []byte) {
- c.mu.Lock()
- defer c.mu.Unlock()
-
- dataSize := int64(len(data))
-
- if el, ok := c.items[key]; ok {
- c.curBytes -= int64(len(el.Value.(*sourceMapCacheEntry).data))
- el.Value.(*sourceMapCacheEntry).data = data
- c.curBytes += dataSize
- c.order.MoveToFront(el)
- } else {
- entry := &sourceMapCacheEntry{key: key, data: data}
- el := c.order.PushFront(entry)
- c.items[key] = el
- c.curBytes += dataSize
- }
-
- for c.order.Len() > c.maxCount || c.curBytes > c.maxBytes {
- back := c.order.Back()
- if back == nil {
- break
- }
- evicted := c.order.Remove(back).(*sourceMapCacheEntry)
- delete(c.items, evicted.key)
- c.curBytes -= int64(len(evicted.data))
- c.evictions++
- }
-}
-
-func (c *sourceMapCache) Stats() SourceMapCacheStats {
- c.mu.Lock()
- defer c.mu.Unlock()
-
- return SourceMapCacheStats{
- Entries: len(c.items),
- Bytes: c.curBytes,
- MaxEntries: c.maxCount,
- MaxBytes: c.maxBytes,
- Hits: c.hits,
- Misses: c.misses,
- Evictions: c.evictions,
- }
-}
diff --git a/backend/app/config/config.go b/backend/app/config/config.go
index 7f81af4c..3b08cc6c 100644
--- a/backend/app/config/config.go
+++ b/backend/app/config/config.go
@@ -35,7 +35,6 @@ type Cfg struct {
SourceMapCacheMaxEntries string
SourceMapCacheMaxBytesMB string
- SourceMapParsedCacheMax string
SMTPEnabled string
SMTPHost string
@@ -111,7 +110,6 @@ func LoadFromEnv() *Cfg {
SourceMapCacheMaxEntries: os.Getenv("SOURCEMAP_CACHE_MAX_ENTRIES"),
SourceMapCacheMaxBytesMB: os.Getenv("SOURCEMAP_CACHE_MAX_BYTES_MB"),
- SourceMapParsedCacheMax: os.Getenv("SOURCEMAP_PARSED_CACHE_MAX"),
SMTPEnabled: os.Getenv("SMTP_ENABLED"),
SMTPHost: os.Getenv("SMTP_HOST"),
diff --git a/backend/app/controllers/clientcontrollers/client.controller.go b/backend/app/controllers/clientcontrollers/client.controller.go
index d94ae2d3..3a9eccfd 100644
--- a/backend/app/controllers/clientcontrollers/client.controller.go
+++ b/backend/app/controllers/clientcontrollers/client.controller.go
@@ -340,6 +340,7 @@ func (e clientController) Report(c *gin.Context) {
var (
errorMessageRe = regexp.MustCompile(`(?m)^(\*?[\w.]+):\s*.+`)
causedByRe = regexp.MustCompile(`(?m)^(Caused by:\s*[\w.$]+):\s*.+`)
+ jsFuncLineRe = regexp.MustCompile(`(?m)^( {0,4})(.+)\(\)(\n {4}.+:\d+:\d+)$`)
absolutePathRe = regexp.MustCompile(`/[^\s:]+/([^/\s:]+:\d+)`)
versionRe = regexp.MustCompile(`@v[\d.]+`)
hexRe = regexp.MustCompile(`0x[0-9a-fA-F]+`)
@@ -360,6 +361,7 @@ func ComputeExceptionHash(stackTrace string, isMessage bool) string {
if !isMessage {
normalized = causedByRe.ReplaceAllString(normalized, "$1")
normalized = errorMessageRe.ReplaceAllString(normalized, "$1")
+ normalized = jsFuncLineRe.ReplaceAllString(normalized, "${1}<fn>${3}")
normalized = absolutePathRe.ReplaceAllString(normalized, "$1")
normalized = versionRe.ReplaceAllString(normalized, "")
normalized = hexRe.ReplaceAllString(normalized, "<hex>")
diff --git a/backend/app/controllers/clientcontrollers/client.controller_test.go b/backend/app/controllers/clientcontrollers/client.controller_test.go
index 6f6a747f..ab3f6b0c 100644
--- a/backend/app/controllers/clientcontrollers/client.controller_test.go
+++ b/backend/app/controllers/clientcontrollers/client.controller_test.go
@@ -50,6 +50,40 @@ func TestComputeExceptionHash_Java(t *testing.T) {
}
}
+func TestComputeExceptionHash_JsFunctionNames(t *testing.T) {
+ stackA := "Error: Test error\nanonymous()\n ../src/app.js:3:30\nbar()\n ../src/bar.js:4:3"
+ stackB := "Error: Test error\nbuttonCallback()\n ../src/app.js:3:30\nmodule.exports()\n ../src/bar.js:4:3"
+ if ComputeExceptionHash(stackA, false) != ComputeExceptionHash(stackB, false) {
+ t.Error("same locations with different resolved function names should have the same hash")
+ }
+
+ stackC := "Error: Test error\nanonymous()\n ../src/app.js:3:30"
+ stackD := "Error: Test error\nanonymous()\n ../src/other.js:7:12"
+ if ComputeExceptionHash(stackC, false) == ComputeExceptionHash(stackD, false) {
+ t.Error("different locations should have different hashes")
+ }
+
+ stackE := "Error: Test error\nanonymous()\n bundle.min.js:1:48211"
+ stackF := "Error: Test error\nanonymous()\n bundle.min.js:1:91567"
+ if ComputeExceptionHash(stackE, false) == ComputeExceptionHash(stackF, false) {
+ t.Error("different columns in minified frames should have different hashes")
+ }
+
+ indentedA := "Error: Test error\n anonymous()\n ../src/app.js:3:30"
+ indentedB := "Error: Test error\n buttonCallback()\n ../src/app.js:3:30"
+ if ComputeExceptionHash(indentedA, false) != ComputeExceptionHash(indentedB, false) {
+ t.Error("indented name lines should also be collapsed")
+ }
+}
+
+func TestComputeExceptionHash_JsFnCollapseDoesNotTouchGo(t *testing.T) {
+ goStackA := "runtime error: index out of range\nmain.main()\n\t/app/main.go:10 +0x20"
+ goStackB := "runtime error: index out of range\nmain.other()\n\t/app/main.go:10 +0x20"
+ if ComputeExceptionHash(goStackA, false) == ComputeExceptionHash(goStackB, false) {
+ t.Error("Go function-name lines must not be collapsed: tab-indented file lines are not JS frames")
+ }
+}
+
func TestIsEmptyRaw(t *testing.T) {
cases := []struct {
name string
diff --git a/backend/app/monitoring/backend_reporter.go b/backend/app/monitoring/backend_reporter.go
index 5f07604a..3469d5b7 100644
--- a/backend/app/monitoring/backend_reporter.go
+++ b/backend/app/monitoring/backend_reporter.go
@@ -14,12 +14,11 @@ import (
const backendReportInterval = 30 * time.Second
type backendBaselines struct {
- rawHits uint64
- rawMisses uint64
- rawEvictions uint64
- parsedHits uint64
- parsedMisses uint64
- first bool
+ smHits uint64
+ smMisses uint64
+ smEvictions uint64
+ smFailures uint64
+ first bool
}
func StartBackendReporter(ctx context.Context) {
@@ -51,26 +50,21 @@ func reportBackendOnce(b *backendBaselines) {
traceway.CaptureMetric("traceway.proc.rss_mb", float64(rss)/1024.0/1024.0)
}
- rawStats := cache.SourceMapCache.Stats()
- traceway.CaptureMetric("traceway.sourcemap.raw.entries", float64(rawStats.Entries))
- traceway.CaptureMetric("traceway.sourcemap.raw.bytes", float64(rawStats.Bytes))
-
- parsedStats := services.ParsedSourceMapStats()
- traceway.CaptureMetric("traceway.sourcemap.parsed.entries", float64(parsedStats.Entries))
- traceway.CaptureMetric("traceway.sourcemap.parsed.parse_ms", parsedStats.LastParseMs)
+ smStats := services.SourceMapStats()
+ traceway.CaptureMetric("traceway.sourcemap.entries", float64(smStats.Entries))
+ traceway.CaptureMetric("traceway.sourcemap.bytes", float64(smStats.Bytes))
+ traceway.CaptureMetric("traceway.sourcemap.parse_ms", smStats.LastParseMs)
if !b.first {
- traceway.CaptureMetric("traceway.sourcemap.raw.hits.delta", float64(safeDelta(b.rawHits, rawStats.Hits)))
- traceway.CaptureMetric("traceway.sourcemap.raw.misses.delta", float64(safeDelta(b.rawMisses, rawStats.Misses)))
- traceway.CaptureMetric("traceway.sourcemap.raw.evictions.delta", float64(safeDelta(b.rawEvictions, rawStats.Evictions)))
- traceway.CaptureMetric("traceway.sourcemap.parsed.hits.delta", float64(safeDelta(b.parsedHits, parsedStats.Hits)))
- traceway.CaptureMetric("traceway.sourcemap.parsed.misses.delta", float64(safeDelta(b.parsedMisses, parsedStats.Misses)))
+ traceway.CaptureMetric("traceway.sourcemap.hits.delta", float64(safeDelta(b.smHits, smStats.Hits)))
+ traceway.CaptureMetric("traceway.sourcemap.misses.delta", float64(safeDelta(b.smMisses, smStats.Misses)))
+ traceway.CaptureMetric("traceway.sourcemap.evictions.delta", float64(safeDelta(b.smEvictions, smStats.Evictions)))
+ traceway.CaptureMetric("traceway.sourcemap.load_failures.delta", float64(safeDelta(b.smFailures, smStats.Failures)))
}
- b.rawHits = rawStats.Hits
- b.rawMisses = rawStats.Misses
- b.rawEvictions = rawStats.Evictions
- b.parsedHits = parsedStats.Hits
- b.parsedMisses = parsedStats.Misses
+ b.smHits = smStats.Hits
+ b.smMisses = smStats.Misses
+ b.smEvictions = smStats.Evictions
+ b.smFailures = smStats.Failures
b.first = false
traceway.CaptureMetric("traceway.cache.projects.entries", float64(cache.ProjectCache.Entries()))
diff --git a/backend/app/services/sourcemap_cache_test.go b/backend/app/services/sourcemap_cache_test.go
new file mode 100644
index 00000000..81569cc2
--- /dev/null
+++ b/backend/app/services/sourcemap_cache_test.go
@@ -0,0 +1,315 @@
+package services
+
+import (
+ "container/list"
+ "context"
+ "errors"
+ "fmt"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/tracewayapp/traceway/backend/app/models"
+ "github.com/tracewayapp/traceway/backend/app/storage"
+
+ "github.com/google/uuid"
+)
+
+func newTestSourceMapCache(maxEntries int, maxBytes int64) *sourceMapCache {
+ return &sourceMapCache{
+ items: make(map[string]*list.Element),
+ order: list.New(),
+ loading: make(map[string]*sourceMapLoad),
+ maxEntries: maxEntries,
+ maxBytes: maxBytes,
+ }
+}
+
+type countingStorage struct {
+ mu sync.Mutex
+ reads map[string]int
+ data map[string][]byte
+}
+
+func (c *countingStorage) Write(_ context.Context, key string, data []byte) error {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.data[key] = data
+ return nil
+}
+
+func (c *countingStorage) Read(_ context.Context, key string) ([]byte, error) {
+ c.mu.Lock()
+ c.reads[key]++
+ c.mu.Unlock()
+ time.Sleep(10 * time.Millisecond)
+ d, ok := c.data[key]
+ if !ok {
+ return nil, errors.New("not found")
+ }
+ return d, nil
+}
+
+func TestSourceMapCacheSingleflight(t *testing.T) {
+ prev := storage.Store
+ defer func() { storage.Store = prev }()
+ cs := &countingStorage{reads: map[string]int{}, data: map[string][]byte{
+ "singleflight-test.js.map": []byte(`{"version":3,"sources":["a.js"],"names":[],"mappings":"AAAA"}`),
+ }}
+ storage.Store = cs
+ c := newTestSourceMapCache(10, 1<<20)
+
+ const n = 16
+ results := make([]*parsedSourceMap, n)
+ var wg sync.WaitGroup
+ start := make(chan struct{})
+ for i := range n {
+ wg.Go(func() {
+ <-start
+ sm, err := c.getOrLoad(context.Background(), "singleflight-test.js.map")
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ results[i] = sm
+ })
+ }
+ close(start)
+ wg.Wait()
+
+ if got := cs.reads["singleflight-test.js.map"]; got != 1 {
+ t.Errorf("expected 1 storage read for concurrent lookups, got %d", got)
+ }
+ for i := 1; i < n; i++ {
+ if results[i] != results[0] {
+ t.Fatal("expected all callers to share a single parsed instance")
+ }
+ }
+
+ if _, err := c.getOrLoad(context.Background(), "singleflight-test.js.map"); err != nil {
+ t.Fatal(err)
+ }
+ if got := cs.reads["singleflight-test.js.map"]; got != 1 {
+ t.Errorf("expected cached lookup to not hit storage, got %d reads", got)
+ }
+}
+
+func TestSourceMapCacheDistinctKeysConcurrent(t *testing.T) {
+ prev := storage.Store
+ defer func() { storage.Store = prev }()
+ cs := &countingStorage{reads: map[string]int{}, data: map[string][]byte{}}
+ const keys = 8
+ for i := range keys {
+ cs.data[fmt.Sprintf("distinct-%d.js.map", i)] = []byte(`{"version":3,"sources":["a.js"],"names":[],"mappings":"AAAA"}`)
+ }
+ storage.Store = cs
+ c := newTestSourceMapCache(keys, 1<<20)
+
+ var wg sync.WaitGroup
+ start := make(chan struct{})
+ results := make([]*parsedSourceMap, keys*4)
+ for i := range keys * 4 {
+ wg.Go(func() {
+ <-start
+ sm, err := c.getOrLoad(context.Background(), fmt.Sprintf("distinct-%d.js.map", i%keys))
+ if err != nil {
+ t.Error(err)
+ return
+ }
+ results[i] = sm
+ })
+ }
+ close(start)
+ wg.Wait()
+
+ for i := range keys {
+ key := fmt.Sprintf("distinct-%d.js.map", i)
+ if got := cs.reads[key]; got != 1 {
+ t.Errorf("key %s: expected 1 storage read, got %d", key, got)
+ }
+ }
+ for i := range keys * 4 {
+ if results[i] != results[i%keys] {
+ t.Fatal("callers of the same key should share one instance")
+ }
+ }
+}
+
+type flakyStorage struct {
+ mu sync.Mutex
+ reads int
+ failures int
+ data []byte
+}
+
+func (f *flakyStorage) Write(_ context.Context, _ string, _ []byte) error { return nil }
+
+func (f *flakyStorage) Read(_ context.Context, _ string) ([]byte, error) {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ f.reads++
+ if f.reads <= f.failures {
+ return nil, errors.New("storage down")
+ }
+ return f.data, nil
+}
+
+func TestSourceMapCacheFailedLoadRetries(t *testing.T) {
+ prev := storage.Store
+ defer func() { storage.Store = prev }()
+ fs := &flakyStorage{failures: 1, data: []byte(`{"version":3,"sources":["a.js"],"names":[],"mappings":"AAAA"}`)}
+ storage.Store = fs
+ c := newTestSourceMapCache(10, 1<<20)
+
+ if _, err := c.getOrLoad(context.Background(), "flaky.js.map"); err == nil {
+ t.Fatal("expected first load to fail")
+ }
+ c.mu.Lock()
+ if c.failures != 1 {
+ t.Errorf("expected 1 recorded failure, got %d", c.failures)
+ }
+ c.mu.Unlock()
+ sm, err := c.getOrLoad(context.Background(), "flaky.js.map")
+ if err != nil || sm == nil {
+ t.Fatalf("expected retry to succeed, got %v", err)
+ }
+ if fs.reads != 2 {
+ t.Errorf("expected 2 storage reads (fail then retry), got %d", fs.reads)
+ }
+ if _, err := c.getOrLoad(context.Background(), "flaky.js.map"); err != nil {
+ t.Fatal(err)
+ }
+ if fs.reads != 2 {
+ t.Errorf("expected cached lookup after retry, got %d reads", fs.reads)
+ }
+}
+
+type blockingPanicStorage struct {
+ release chan struct{}
+}
+
+func (b *blockingPanicStorage) Write(_ context.Context, _ string, _ []byte) error { return nil }
+
+func (b *blockingPanicStorage) Read(_ context.Context, _ string) ([]byte, error) {
+ <-b.release
+ panic("storage exploded")
+}
+
+func TestSourceMapCachePanicRecovery(t *testing.T) {
+ prev := storage.Store
+ defer func() { storage.Store = prev }()
+ release := make(chan struct{})
+ storage.Store = &blockingPanicStorage{release: release}
+ c := newTestSourceMapCache(10, 1<<20)
+
+ type result struct {
+ sm *parsedSourceMap
+ err error
+ }
+ leader := make(chan result, 1)
+ go func() {
+ sm, err := c.getOrLoad(context.Background(), "boom.js.map")
+ leader <- result{sm, err}
+ }()
+
+ deadline := time.Now().Add(2 * time.Second)
+ for {
+ c.mu.Lock()
+ _, loading := c.loading["boom.js.map"]
+ c.mu.Unlock()
+ if loading {
+ break
+ }
+ if time.Now().After(deadline) {
+ t.Fatal("load never started")
+ }
+ time.Sleep(time.Millisecond)
+ }
+
+ waiters := make(chan result, 2)
+ for range 2 {
+ go func() {
+ sm, err := c.getOrLoad(context.Background(), "boom.js.map")
+ waiters <- result{sm, err}
+ }()
+ }
+
+ close(release)
+
+ r := <-leader
+ if r.err == nil || r.sm != nil {
+ t.Fatalf("expected leader to receive panic error, got sm=%v err=%v", r.sm, r.err)
+ }
+ for range 2 {
+ r := <-waiters
+ if r.err == nil || r.sm != nil {
+ t.Fatalf("expected waiter to receive an error, got sm=%v err=%v", r.sm, r.err)
+ }
+ }
+
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ if len(c.loading) != 0 {
+ t.Error("loading entry leaked after panic")
+ }
+ if c.order.Len() != 0 {
+ t.Error("nothing should be cached after a failed load")
+ }
+ if c.failures == 0 {
+ t.Error("expected at least one recorded failure")
+ }
+}
+
+func TestResolveStackTraceFailedMapAttemptedOncePerTrace(t *testing.T) {
+ prev := storage.Store
+ defer func() { storage.Store = prev }()
+ cs := &countingStorage{reads: map[string]int{}, data: map[string][]byte{}}
+ storage.Store = cs
+
+ sourceMaps := []*models.SourceMap{{FileName: "dead.js.map", StorageKey: "dead.js.map"}}
+ trace := "Error: boom\n fn()\n dead.js:1:10\n fn2()\n dead.js:1:20\n fn3()\n dead.js:1:30"
+
+ resolved := ResolveStackTrace(context.Background(), uuid.New(), trace, sourceMaps)
+ if resolved != trace {
+ t.Error("trace should be stored as-is when its source map cannot be loaded")
+ }
+ if got := cs.reads["dead.js.map"]; got != 1 {
+ t.Errorf("expected 1 load attempt per trace for a failing map, got %d", got)
+ }
+}
+
+func TestSourceMapCacheByteCapEviction(t *testing.T) {
+ prev := storage.Store
+ defer func() { storage.Store = prev }()
+ cs := &countingStorage{reads: map[string]int{}, data: map[string][]byte{}}
+ storage.Store = cs
+
+ c := newTestSourceMapCache(10, 2000)
+
+ content := make([]byte, 700)
+ for i := range content {
+ content[i] = 'x'
+ }
+ for i := range 3 {
+ key := fmt.Sprintf("evict-%d.js.map", i)
+ cs.data[key] = fmt.Appendf(nil, `{"version":3,"sources":["a.js"],"sourcesContent":[%q],"names":[],"mappings":"AAAA"}`, content)
+ if _, err := c.getOrLoad(context.Background(), key); err != nil {
+ t.Fatal(err)
+ }
+ }
+
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ if c.curBytes > c.maxBytes {
+ t.Errorf("curBytes %d exceeds maxBytes %d", c.curBytes, c.maxBytes)
+ }
+ if c.evictions == 0 {
+ t.Error("expected at least one eviction")
+ }
+ if _, ok := c.items["evict-2.js.map"]; !ok {
+ t.Error("most recent entry should still be cached")
+ }
+ if _, ok := c.items["evict-0.js.map"]; ok {
+ t.Error("oldest entry should have been evicted")
+ }
+}
diff --git a/backend/app/services/sourcemap_parse.go b/backend/app/services/sourcemap_parse.go
new file mode 100644
index 00000000..3363bc82
--- /dev/null
+++ b/backend/app/services/sourcemap_parse.go
@@ -0,0 +1,352 @@
+package services
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/url"
+ "path"
+ "sort"
+ "strings"
+)
+
+type smMapping struct {
+ genLine int32
+ genCol int32
+ srcInd int32
+ srcLine int32
+ srcCol int32
+ nameInd int32
+}
+
+const smMappingBytes = 24
+
+type smSection struct {
+ offsetLine int
+ offsetCol int
+ sources []string
+ sourcesContent []string
+ names []string
+ mappings []smMapping
+}
+
+type parsedSourceMap struct {
+ sections []smSection
+ size int64
+}
+
+type smSourceMapJSON struct {
+ Version int `json:"version"`
+ SourceRoot string `json:"sourceRoot"`
+ Sources []string `json:"sources"`
+ SourcesContent []string `json:"sourcesContent"`
+ Names []json.RawMessage `json:"names"`
+ Mappings string `json:"mappings"`
+}
+
+type smSectionJSON struct {
+ Offset struct {
+ Line int `json:"line"`
+ Column int `json:"column"`
+ } `json:"offset"`
+ Map *smSourceMapJSON `json:"map"`
+}
+
+type smFileJSON struct {
+ smSourceMapJSON
+ Sections []smSectionJSON `json:"sections"`
+}
+
+func parseSourceMap(data []byte) (*parsedSourceMap, error) {
+ var f smFileJSON
+ if err := json.Unmarshal(data, &f); err != nil {
+ return nil, err
+ }
+ if err := checkSourceMapVersion(f.Version); err != nil {
+ return nil, err
+ }
+
+ sectionsJSON := f.Sections
+ if len(sectionsJSON) == 0 {
+ sectionsJSON = []smSectionJSON{{Map: &f.smSourceMapJSON}}
+ }
+
+ p := &parsedSourceMap{sections: make([]smSection, 0, len(sectionsJSON))}
+ for _, sj := range sectionsJSON {
+ if sj.Map == nil {
+ return nil, errors.New("sourcemap: section without map")
+ }
+ s, err := parseSourceMapSection(sj)
+ if err != nil {
+ return nil, err
+ }
+ p.sections = append(p.sections, s)
+ }
+ for i, j := 0, len(p.sections)-1; i < j; i, j = i+1, j-1 {
+ p.sections[i], p.sections[j] = p.sections[j], p.sections[i]
+ }
+ p.computeSize()
+ return p, nil
+}
+
+func parseSourceMapSection(sj smSectionJSON) (smSection, error) {
+ m := sj.Map
+ if err := checkSourceMapVersion(m.Version); err != nil {
+ return smSection{}, err
+ }
+
+ var rootURL *url.URL
+ if m.SourceRoot != "" {
+ u, err := url.Parse(m.SourceRoot)
+ if err != nil {
+ return smSection{}, err
+ }
+ if u.IsAbs() {
+ rootURL = u
+ }
+ }
+
+ sources := make([]string, len(m.Sources))
+ for i, src := range m.Sources {
+ sources[i] = absSourceName(rootURL, m.SourceRoot, src)
+ }
+
+ names := make([]string, len(m.Names))
+ for i, raw := range m.Names {
+ names[i] = decodeSourceMapName(raw)
+ }
+
+ mappings, err := parseSourceMapMappings(m.Mappings)
+ if err != nil {
+ return smSection{}, err
+ }
+
+ return smSection{
+ offsetLine: sj.Offset.Line,
+ offsetCol: sj.Offset.Column,
+ sources: sources,
+ sourcesContent: m.SourcesContent,
+ names: names,
+ mappings: mappings,
+ }, nil
+}
+
+func checkSourceMapVersion(version int) error {
+ if version == 3 || version == 0 {
+ return nil
+ }
+ return fmt.Errorf("sourcemap: got version=%d, but only 3rd version is supported", version)
+}
+
+func absSourceName(rootURL *url.URL, sourceRoot, source string) string {
+ if path.IsAbs(source) {
+ return source
+ }
+ if u, err := url.Parse(source); err == nil && u.IsAbs() {
+ return source
+ }
+ if rootURL != nil {
+ u := *rootURL
+ u.Path = path.Join(u.Path, source)
+ return u.String()
+ }
+ if sourceRoot != "" {
+ return path.Join(sourceRoot, source)
+ }
+ return source
+}
+
+func decodeSourceMapName(raw json.RawMessage) string {
+ if len(raw) == 0 {
+ return ""
+ }
+ if raw[0] == '"' && raw[len(raw)-1] == '"' {
+ var s string
+ if err := json.Unmarshal(raw, &s); err == nil {
+ return s
+ }
+ }
+ return string(raw)
+}
+
+var vlqDecodeMap [256]byte
+
+func init() {
+ const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
+ for i := range len(alphabet) {
+ vlqDecodeMap[alphabet[i]] = byte(i)
+ }
+}
+
+func decodeVLQ(s string, i int) (int32, int, error) {
+ var n int32
+ shift := uint(0)
+ for {
+ if i >= len(s) {
+ return 0, i, errors.New("sourcemap: unexpected end of mappings")
+ }
+ c := vlqDecodeMap[s[i]]
+ i++
+ n += int32(c&31) << shift
+ shift += 5
+ if c&32 == 0 {
+ break
+ }
+ }
+ if n&1 != 0 {
+ return -(n >> 1), i, nil
+ }
+ return n >> 1, i, nil
+}
+
+func parseSourceMapMappings(s string) ([]smMapping, error) {
+ if s == "" {
+ return nil, errors.New("sourcemap: mappings are empty")
+ }
+
+ values := make([]smMapping, 0, strings.Count(s, ",")+strings.Count(s, ";"))
+ cur := smMapping{genLine: 1, srcLine: 1}
+ hasValue := false
+ hasName := false
+ field := 0
+
+ push := func() {
+ if !hasValue {
+ return
+ }
+ hasValue = false
+ m := cur
+ if hasName {
+ hasName = false
+ } else {
+ m.nameInd = -1
+ }
+ values = append(values, m)
+ }
+
+ i := 0
+ for i < len(s) {
+ switch s[i] {
+ case ',':
+ push()
+ field = 0
+ i++
+ case ';':
+ push()
+ cur.genLine++
+ cur.genCol = 0
+ field = 0
+ i++
+ default:
+ n, next, err := decodeVLQ(s, i)
+ if err != nil {
+ return nil, err
+ }
+ i = next
+ switch field {
+ case 0:
+ cur.genCol += n
+ case 1:
+ cur.srcInd += n
+ case 2:
+ cur.srcLine += n
+ case 3:
+ cur.srcCol += n
+ case 4:
+ cur.nameInd += n
+ hasName = true
+ }
+ if field == 4 {
+ field = 0
+ } else {
+ field++
+ }
+ hasValue = true
+ }
+ }
+ push()
+ return values, nil
+}
+
+func (p *parsedSourceMap) source(genLine, genCol int) (string, string, int, int, bool) {
+ for i := range p.sections {
+ s := &p.sections[i]
+ if s.offsetLine < genLine || (s.offsetLine+1 == genLine && s.offsetCol <= genCol) {
+ return s.lookup(genLine-s.offsetLine, genCol-s.offsetCol)
+ }
+ }
+ return "", "", 0, 0, false
+}
+
+func (s *smSection) lookup(genLine, genCol int) (string, string, int, int, bool) {
+ if len(s.mappings) == 0 {
+ return "", "", 0, 0, false
+ }
+
+ i := sort.Search(len(s.mappings), func(i int) bool {
+ m := &s.mappings[i]
+ if int(m.genLine) == genLine {
+ return int(m.genCol) >= genCol
+ }
+ return int(m.genLine) >= genLine
+ })
+
+ var match *smMapping
+ if i == len(s.mappings) {
+ match = &s.mappings[i-1]
+ if int(match.genLine) != genLine {
+ return "", "", 0, 0, false
+ }
+ } else {
+ match = &s.mappings[i]
+ if int(match.genLine) > genLine || int(match.genCol) > genCol {
+ if i == 0 {
+ return "", "", 0, 0, false
+ }
+ match = &s.mappings[i-1]
+ }
+ }
+
+ source := ""
+ if match.srcInd >= 0 && int(match.srcInd) < len(s.sources) {
+ source = s.sources[match.srcInd]
+ }
+ name := ""
+ if match.nameInd >= 0 && int(match.nameInd) < len(s.names) {
+ name = s.names[match.nameInd]
+ }
+ return source, name, int(match.srcLine), int(match.srcCol), true
+}
+
+func (p *parsedSourceMap) sourceContent(file string) string {
+ for i := range p.sections {
+ s := &p.sections[i]
+ for j, src := range s.sources {
+ if src == file {
+ if j < len(s.sourcesContent) {
+ return s.sourcesContent[j]
+ }
+ break
+ }
+ }
+ }
+ return ""
+}
+
+func (p *parsedSourceMap) computeSize() {
+ size := int64(64)
+ for i := range p.sections {
+ s := &p.sections[i]
+ size += 64 + int64(len(s.mappings))*smMappingBytes
+ for _, v := range s.sources {
+ size += int64(len(v)) + 16
+ }
+ for _, v := range s.sourcesContent {
+ size += int64(len(v)) + 16
+ }
+ for _, v := range s.names {
+ size += int64(len(v)) + 16
+ }
+ }
+ p.size = size
+}
diff --git a/backend/app/services/sourcemap_parse_test.go b/backend/app/services/sourcemap_parse_test.go
new file mode 100644
index 00000000..da7a62e3
--- /dev/null
+++ b/backend/app/services/sourcemap_parse_test.go
@@ -0,0 +1,103 @@
+package services
+
+import (
+ "fmt"
+ "strings"
+ "testing"
+)
+
+func TestParseSourceMapSections(t *testing.T) {
+ data := []byte(`{"version":3,"sections":[
+ {"offset":{"line":0,"column":0},"map":{"version":3,"sources":["first.js"],"names":[],"mappings":"AAAA"}},
+ {"offset":{"line":5,"column":0},"map":{"version":3,"sources":["second.js"],"names":[],"mappings":"AAAA"}}]}`)
+ p, err := parseSourceMap(data)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ file, _, line, col, ok := p.source(1, 0)
+ if !ok || file != "first.js" || line != 1 || col != 0 {
+ t.Errorf("line 1 should resolve via the first section, got file=%q line=%d col=%d ok=%v", file, line, col, ok)
+ }
+
+ file, _, line, col, ok = p.source(6, 0)
+ if !ok || file != "second.js" || line != 1 || col != 0 {
+ t.Errorf("line 6 should resolve via the second section (offset 5), got file=%q line=%d col=%d ok=%v", file, line, col, ok)
+ }
+
+ if _, _, _, _, ok = p.source(7, 0); ok {
+ t.Error("line past the second section's mappings should not resolve")
+ }
+}
+
+func TestParseSourceMapErrors(t *testing.T) {
+ cases := []struct {
+ name string
+ data string
+ wantErr string
+ }{
+ {"version rejected", `{"version":2,"sources":[],"names":[],"mappings":"AAAA"}`, "version"},
+ {"empty mappings", `{"version":3,"sources":[],"names":[],"mappings":""}`, "mappings are empty"},
+ {"truncated vlq", `{"version":3,"sources":[],"names":[],"mappings":"g"}`, "unexpected end of mappings"},
+ {"section without map", `{"version":3,"sections":[{"offset":{"line":0,"column":0}}]}`, "section without map"},
+ {"section version rejected", `{"version":3,"sections":[{"offset":{"line":0,"column":0},"map":{"version":2,"sources":[],"names":[],"mappings":"AAAA"}}]}`, "version"},
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ _, err := parseSourceMap([]byte(tc.data))
+ if err == nil || !strings.Contains(err.Error(), tc.wantErr) {
+ t.Errorf("expected error containing %q, got %v", tc.wantErr, err)
+ }
+ })
+ }
+}
+
+func TestParseSourceMapNonStringNames(t *testing.T) {
+ p, err := parseSourceMap([]byte(`{"version":3,"sources":["a.js"],"names":[42],"mappings":"AAAAA"}`))
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, name, _, _, ok := p.source(1, 0)
+ if !ok || name != "42" {
+ t.Errorf("expected numeric name decoded to %q, got %q ok=%v", "42", name, ok)
+ }
+}
+
+func TestParseSourceMapSourceIndexOutOfBounds(t *testing.T) {
+ p, err := parseSourceMap([]byte(`{"version":3,"sources":["a.js"],"names":[],"mappings":"ACAA"}`))
+ if err != nil {
+ t.Fatal(err)
+ }
+ file, _, line, col, ok := p.source(1, 0)
+ if !ok || file != "" || line != 1 || col != 0 {
+ t.Errorf("out-of-bounds source index should resolve with empty file, got file=%q line=%d col=%d ok=%v", file, line, col, ok)
+ }
+}
+
+func TestParseSourceMapSourceRoot(t *testing.T) {
+ cases := []struct {
+ name string
+ sourceRoot string
+ source string
+ want string
+ }{
+ {"path join", "src", "a.js", "src/a.js"},
+ {"url join", "http://example.com/assets/", "a.js", "http://example.com/assets/a.js"},
+ {"absolute path kept", "src", "/abs/a.js", "/abs/a.js"},
+ {"absolute url kept", "src", "webpack:///./foo.js", "webpack:///./foo.js"},
+ {"no root", "", "../src/a.js", "../src/a.js"},
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ data := fmt.Sprintf(`{"version":3,"sourceRoot":%q,"sources":[%q],"names":[],"mappings":"AAAA"}`, tc.sourceRoot, tc.source)
+ p, err := parseSourceMap([]byte(data))
+ if err != nil {
+ t.Fatal(err)
+ }
+ file, _, _, _, ok := p.source(1, 0)
+ if !ok || file != tc.want {
+ t.Errorf("expected source %q, got %q ok=%v", tc.want, file, ok)
+ }
+ })
+ }
+}
diff --git a/backend/app/services/sourcemap_resolver.go b/backend/app/services/sourcemap_resolver.go
index 5e54c5ca..1e2f296d 100644
--- a/backend/app/services/sourcemap_resolver.go
+++ b/backend/app/services/sourcemap_resolver.go
@@ -11,103 +11,186 @@ import (
"sync"
"time"
- "github.com/tracewayapp/traceway/backend/app/cache"
"github.com/tracewayapp/traceway/backend/app/models"
"github.com/tracewayapp/traceway/backend/app/storage"
- "github.com/go-sourcemap/sourcemap"
"github.com/google/uuid"
traceway "go.tracewayapp.com"
)
-// parsedSourceMapCache holds already-parsed *sourcemap.Consumer values so
-// concurrent stack-trace resolutions can reuse one parse. A raw 20 MB
-// source map balloons to ~100-200 MB once parsed; re-parsing on every
-// stack frame (or every request) was the OOM cause on the 1 GB t4g.micro.
-//
-// Consumers are safe for concurrent reads per go-sourcemap docs.
-type parsedSourceMapCache struct {
- mu sync.Mutex
- items map[string]*list.Element
- order *list.List
- max int
- hits uint64
- misses uint64
- lastParseMs float64
+const sourceMapLoadTimeout = 5 * time.Second
+const sourceMapFailReportInterval = time.Minute
+
+type sourceMapCache struct {
+ mu sync.Mutex
+ items map[string]*list.Element
+ order *list.List
+ loading map[string]*sourceMapLoad
+ maxEntries int
+ maxBytes int64
+ curBytes int64
+ hits uint64
+ misses uint64
+ evictions uint64
+ failures uint64
+ lastParseMs float64
+ failuresSinceReport uint64
+ lastFailAt time.Time
}
-type parsedSourceMapEntry struct {
- key string
- consumer *sourcemap.Consumer
+type sourceMapCacheEntry struct {
+ key string
+ sm *parsedSourceMap
}
-var parsedSourceMaps = &parsedSourceMapCache{
- items: make(map[string]*list.Element),
- order: list.New(),
- max: 5,
+type sourceMapLoad struct {
+ done chan struct{}
+ sm *parsedSourceMap
+ err error
}
-func InitParsedSourceMapCache(max int) {
- parsedSourceMaps.mu.Lock()
- defer parsedSourceMaps.mu.Unlock()
- parsedSourceMaps.max = max
+var smCache = &sourceMapCache{
+ items: make(map[string]*list.Element),
+ order: list.New(),
+ loading: make(map[string]*sourceMapLoad),
+ maxEntries: 200,
+ maxBytes: 500 << 20,
}
-func (c *parsedSourceMapCache) get(key string) (*sourcemap.Consumer, bool) {
+func InitSourceMapCache(maxEntries int, maxBytes int64) {
+ smCache.mu.Lock()
+ defer smCache.mu.Unlock()
+ smCache.maxEntries = maxEntries
+ smCache.maxBytes = maxBytes
+ smCache.evictLocked()
+}
+
+func (c *sourceMapCache) getOrLoad(ctx context.Context, key string) (sm *parsedSourceMap, err error) {
c.mu.Lock()
- defer c.mu.Unlock()
if el, ok := c.items[key]; ok {
c.hits++
c.order.MoveToFront(el)
- return el.Value.(*parsedSourceMapEntry).consumer, true
+ cached := el.Value.(*sourceMapCacheEntry).sm
+ c.mu.Unlock()
+ return cached, nil
+ }
+ if l, ok := c.loading[key]; ok {
+ c.mu.Unlock()
+ <-l.done
+ if l.err == nil {
+ c.mu.Lock()
+ c.hits++
+ c.mu.Unlock()
+ }
+ return l.sm, l.err
}
c.misses++
- return nil, false
+ l := &sourceMapLoad{done: make(chan struct{})}
+ c.loading[key] = l
+ c.mu.Unlock()
+
+ var parseMs float64
+ defer func() {
+ if r := recover(); r != nil {
+ l.sm = nil
+ l.err = fmt.Errorf("source map load panicked (key=%s): %v", key, r)
+ c.reportLoadFailure(l.err)
+ sm, err = nil, l.err
+ }
+ c.mu.Lock()
+ delete(c.loading, key)
+ if l.err == nil && l.sm != nil {
+ c.lastParseMs = parseMs
+ c.insertLocked(key, l.sm)
+ } else {
+ c.failures++
+ }
+ c.mu.Unlock()
+ close(l.done)
+ }()
+
+ l.sm, parseMs, l.err = c.load(ctx, key)
+ return l.sm, l.err
}
-func (c *parsedSourceMapCache) recordParse(ms float64) {
- c.mu.Lock()
- defer c.mu.Unlock()
- c.lastParseMs = ms
+func (c *sourceMapCache) load(ctx context.Context, key string) (*parsedSourceMap, float64, error) {
+ readCtx, cancel := context.WithTimeout(context.WithoutCancel(ctx), sourceMapLoadTimeout)
+ defer cancel()
+ data, err := storage.Store.Read(readCtx, key)
+ if err != nil {
+ c.reportLoadFailure(fmt.Errorf("failed to read source map from storage (key=%s): %w", key, err))
+ return nil, 0, err
+ }
+
+ parseStart := time.Now()
+ sm, err := parseSourceMap(data)
+ if err != nil {
+ c.reportLoadFailure(fmt.Errorf("failed to parse source map (key=%s): %w", key, err))
+ return nil, 0, err
+ }
+ return sm, float64(time.Since(parseStart).Microseconds()) / 1000.0, nil
}
-func (c *parsedSourceMapCache) put(key string, consumer *sourcemap.Consumer) {
+func (c *sourceMapCache) reportLoadFailure(err error) {
+ var report uint64
c.mu.Lock()
- defer c.mu.Unlock()
- if el, ok := c.items[key]; ok {
- el.Value.(*parsedSourceMapEntry).consumer = consumer
- c.order.MoveToFront(el)
- return
+ c.failuresSinceReport++
+ if time.Since(c.lastFailAt) >= sourceMapFailReportInterval {
+ report = c.failuresSinceReport
+ c.failuresSinceReport = 0
+ c.lastFailAt = time.Now()
+ }
+ c.mu.Unlock()
+ if report > 0 {
+ traceway.CaptureException(fmt.Errorf("source map loads failed %d time(s) since last report: %w", report, err))
}
- el := c.order.PushFront(&parsedSourceMapEntry{key: key, consumer: consumer})
+}
+
+func (c *sourceMapCache) insertLocked(key string, sm *parsedSourceMap) {
+ el := c.order.PushFront(&sourceMapCacheEntry{key: key, sm: sm})
c.items[key] = el
- for c.order.Len() > c.max {
+ c.curBytes += sm.size
+ c.evictLocked()
+}
+
+func (c *sourceMapCache) evictLocked() {
+ for c.order.Len() > c.maxEntries || c.curBytes > c.maxBytes {
back := c.order.Back()
if back == nil {
break
}
- evicted := c.order.Remove(back).(*parsedSourceMapEntry)
+ evicted := c.order.Remove(back).(*sourceMapCacheEntry)
delete(c.items, evicted.key)
+ c.curBytes -= evicted.sm.size
+ c.evictions++
}
}
-type ParsedSourceMapCacheStats struct {
+type SourceMapCacheStats struct {
Entries int
- Max int
+ Bytes int64
+ MaxEntries int
+ MaxBytes int64
Hits uint64
Misses uint64
+ Evictions uint64
+ Failures uint64
LastParseMs float64
}
-func ParsedSourceMapStats() ParsedSourceMapCacheStats {
- parsedSourceMaps.mu.Lock()
- defer parsedSourceMaps.mu.Unlock()
- return ParsedSourceMapCacheStats{
- Entries: parsedSourceMaps.order.Len(),
- Max: parsedSourceMaps.max,
- Hits: parsedSourceMaps.hits,
- Misses: parsedSourceMaps.misses,
- LastParseMs: parsedSourceMaps.lastParseMs,
+func SourceMapStats() SourceMapCacheStats {
+ smCache.mu.Lock()
+ defer smCache.mu.Unlock()
+ return SourceMapCacheStats{
+ Entries: smCache.order.Len(),
+ Bytes: smCache.curBytes,
+ MaxEntries: smCache.maxEntries,
+ MaxBytes: smCache.maxBytes,
+ Hits: smCache.hits,
+ Misses: smCache.misses,
+ Evictions: smCache.evictions,
+ Failures: smCache.failures,
+ LastParseMs: smCache.lastParseMs,
}
}
@@ -128,12 +211,9 @@ func ResolveStackTrace(ctx context.Context, projectId uuid.UUID, stackTrace stri
return stackTrace
}
- // Build lookup: basename of source map's file_name (without .map) -> source map
- // Also keep a map of file_name -> storage_key for direct lookup
smByBasename := make(map[string]*models.SourceMap)
for _, sm := range sourceMaps {
smByBasename[sm.FileName] = sm
- // Also index by basename
base := filepath.Base(sm.FileName)
smByBasename[base] = sm
}
@@ -143,9 +223,7 @@ func ResolveStackTrace(ctx context.Context, projectId uuid.UUID, stackTrace stri
framesResolved := 0
maxFrames := 50
- // Per-call consumer map — a given source map is parsed at most once per
- // ResolveStackTrace invocation even if not in the global cache.
- localConsumers := make(map[string]*sourcemap.Consumer)
+ localMaps := make(map[string]*parsedSourceMap)
for _, line := range lines {
if framesResolved >= maxFrames {
@@ -170,25 +248,29 @@ func ResolveStackTrace(ctx context.Context, projectId uuid.UUID, stackTrace stri
continue
}
- consumer, err := getParsedSourceMap(ctx, sm.StorageKey, localConsumers)
- if err != nil || consumer == nil {
+ pm, err := getSourceMap(ctx, sm.StorageKey, localMaps)
+ if err != nil || pm == nil {
resolved = append(resolved, line)
continue
}
- origFile, origName, origLine, origCol, ok := consumer.Source(lineNum, colNum)
- if !ok || origFile == "" {
+ origFile, origName, origLine, origCol, ok := pm.source(lineNum, colNum-1)
+ if !ok {
resolved = append(resolved, line)
continue
}
- if content := consumer.SourceContent(origFile); content != "" {
+ if content := pm.sourceContent(origFile); content != "" {
if extracted := extractFunctionName(content, origLine); extracted != "" {
origName = extracted
}
}
- resolved = append(resolved, fmt.Sprintf("%s%s:%d:%d", indent, origFile, origLine, origCol))
+ if origFile == "" {
+ origFile = "<unknown>"
+ }
+
+ resolved = append(resolved, fmt.Sprintf("%s%s:%d:%d", indent, origFile, origLine, origCol+1))
framesResolved++
if origName != "" && len(resolved) >= 2 {
@@ -205,19 +287,16 @@ func ResolveStackTrace(ctx context.Context, projectId uuid.UUID, stackTrace stri
}
func findSourceMap(stackFile string, smByBasename map[string]*models.SourceMap) *models.SourceMap {
- // Try file.map directly
mapName := stackFile + ".map"
if sm, ok := smByBasename[mapName]; ok {
return sm
}
- // Try basename.map
base := filepath.Base(stackFile) + ".map"
if sm, ok := smByBasename[base]; ok {
return sm
}
- // Try without query params
cleanName := stackFile
if idx := strings.IndexAny(cleanName, "?#"); idx != -1 {
cleanName = cleanName[:idx]
@@ -230,44 +309,17 @@ func findSourceMap(stackFile string, smByBasename map[string]*models.SourceMap)
return nil
}
-// getParsedSourceMap returns a reusable *sourcemap.Consumer for the given
-// storage key, parsing at most once per unique source map. Lookup order:
-//
-// 1. Per-call localConsumers (same ResolveStackTrace invocation)
-// 2. Global parsedSourceMaps LRU (cross-request reuse, capped at 5 entries)
-// 3. Raw-bytes cache, then storage.Store.Read — then parse and populate.
-//
-// The raw-bytes cache is still populated so the parse only pays one storage
-// read even when the parsed cache evicts us.
-func getParsedSourceMap(ctx context.Context, storageKey string, localConsumers map[string]*sourcemap.Consumer) (*sourcemap.Consumer, error) {
- if c, ok := localConsumers[storageKey]; ok {
- return c, nil
- }
- if c, ok := parsedSourceMaps.get(storageKey); ok {
- localConsumers[storageKey] = c
- return c, nil
+func getSourceMap(ctx context.Context, storageKey string, localMaps map[string]*parsedSourceMap) (*parsedSourceMap, error) {
+ if m, ok := localMaps[storageKey]; ok {
+ return m, nil
}
-
- data, ok := cache.SourceMapCache.Get(storageKey)
- if !ok {
- var err error
- data, err = storage.Store.Read(ctx, storageKey)
- if err != nil {
- traceway.CaptureException(fmt.Errorf("failed to read source map from storage (key=%s): %w", storageKey, err))
- return nil, err
- }
- cache.SourceMapCache.Put(storageKey, data)
- }
-
- parseStart := time.Now()
- consumer, err := sourcemap.Parse("", data)
+ m, err := smCache.getOrLoad(ctx, storageKey)
if err != nil {
+ localMaps[storageKey] = nil
return nil, err
}
- parsedSourceMaps.recordParse(float64(time.Since(parseStart).Microseconds()) / 1000.0)
- parsedSourceMaps.put(storageKey, consumer)
- localConsumers[storageKey] = consumer
- return consumer, nil
+ localMaps[storageKey] = m
+ return m, nil
}
func extractFunctionName(sourceContent string, line int) string {
diff --git a/backend/app/services/sourcemap_resolver_symbolic_test.go b/backend/app/services/sourcemap_resolver_symbolic_test.go
new file mode 100644
index 00000000..07a41133
--- /dev/null
+++ b/backend/app/services/sourcemap_resolver_symbolic_test.go
@@ -0,0 +1,267 @@
+package services
+
+import (
+ "context"
+ "flag"
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/tracewayapp/traceway/backend/app/models"
+ "github.com/tracewayapp/traceway/backend/app/storage"
+
+ "github.com/google/uuid"
+)
+
+var recordSymbolic = flag.Bool("record-symbolic", false, "write testdata/symbolic_parity_results.txt")
+
+type symbolicFrame struct {
+ inFile string
+ inLine int
+ inCol int
+ file string
+ line int
+ col int
+ name string
+ pinnedName string
+ unresolved bool
+}
+
+type symbolicCase struct {
+ name string
+ maps []string
+ frames []symbolicFrame
+}
+
+type symbolicResult struct {
+ caseName string
+ input string
+ expectedLocation string
+ actualLocation string
+ locationPass bool
+ expectedName string
+ parityName string
+ actualName string
+ namePass bool
+ nameChecked bool
+ pinned bool
+}
+
+var symbolicCases = []symbolicCase{
+ {
+ name: "resolves_inlined_function",
+ maps: []string{"sourcemapcache/inlining/module.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "module.js", inLine: 1, inCol: 63, file: "../src/app.js", line: 3, col: 30, name: "buttonCallback"},
+ {inFile: "module.js", inLine: 1, inCol: 47, file: "../src/bar.js", line: 4, col: 3, name: "bar"},
+ {inFile: "module.js", inLine: 1, inCol: 34, file: "../src/foo.js", line: 2, col: 9},
+ {inFile: "module.js", inLine: 2, inCol: 18, unresolved: true},
+ },
+ },
+ {
+ name: "writes_simple_cache",
+ maps: []string{"sourcemapcache/simple/minified.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "minified.js", inLine: 1, inCol: 11, file: "tests/fixtures/simple/original.js", line: 2, col: 10, name: "abcd"},
+ },
+ },
+ {
+ name: "resolves_location_from_cache",
+ maps: []string{"sourcemapcache/preact.module.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "preact.module.js", inLine: 1, inCol: 50, file: "../src/constants.js", line: 3, col: 35},
+ {inFile: "preact.module.js", inLine: 1, inCol: 133, file: "../src/util.js", line: 12, col: 23, name: "assign"},
+ {inFile: "preact.module.js", inLine: 1, inCol: 482, file: "../src/create-element.js", line: 40, col: 9, name: "createElement", pinnedName: "normalizedProps"},
+ {inFile: "preact.module.js", inLine: 1, inCol: 9780, file: "../src/component.js", line: 182, col: 5},
+ {inFile: "preact.module.js", inLine: 1, inCol: 9795, file: "../src/create-context.js", line: 3, col: 12},
+ },
+ },
+ {
+ name: "missing_source_names",
+ maps: []string{"sourcemapcache/nofiles.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "nofiles.js", inLine: 1, inCol: 39, file: "<unknown>", line: 3, col: 9, name: "add"},
+ },
+ },
+ {
+ name: "missing_source_contents",
+ maps: []string{"sourcemapcache/preact-missing-source-contents.module.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "preact-missing-source-contents.module.js", inLine: 1, inCol: 133, file: "../src/util.js", line: 12, col: 23},
+ },
+ },
+ {
+ name: "hermes_scope_lookup",
+ maps: []string{"sourcemapcache/hermes-metro/react-native-hermes.map"},
+ frames: []symbolicFrame{
+ {inFile: "react-native-hermes", inLine: 1, inCol: 11940, file: "module.js", line: 2, col: 11, name: "foo"},
+ {inFile: "react-native-hermes", inLine: 1, inCol: 11858, file: "input.js", line: 3, col: 1, name: "<global>", pinnedName: "anonymous"},
+ },
+ },
+ {
+ name: "metro_scope_lookup",
+ maps: []string{"sourcemapcache/hermes-metro/react-native-metro.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "react-native-metro.js", inLine: 7, inCol: 101, file: "module.js", line: 2, col: 11, name: "foo"},
+ {inFile: "react-native-metro.js", inLine: 6, inCol: 44, file: "input.js", line: 3, col: 1, name: "<global>", pinnedName: "foo"},
+ },
+ },
+ {
+ name: "webpack_scope_lookup",
+ maps: []string{"sourcemapcache/webpack/bundle.js.map"},
+ frames: []symbolicFrame{
+ {inFile: "bundle.js", inLine: 1, inCol: 85, file: "webpack:///./foo.js", line: 2, col: 9, name: "module.exports", pinnedName: "foo"},
+ {inFile: "bundle.js", inLine: 1, inCol: 44, file: "webpack:///./bar.js", line: 2, col: 3, name: "module.exports", pinnedName: "bar"},
+ },
+ },
+}
+
+func TestResolveStackTraceSymbolicParity(t *testing.T) {
+ InitSourceMapCache(100, 64<<20)
+ store, err := storage.NewLocalStorage("testdata")
+ if err != nil {
+ t.Fatal(err)
+ }
+ storage.Store = store
+ projectId := uuid.New()
+
+ var results []symbolicResult
+
+ for _, tc := range symbolicCases {
+ t.Run(tc.name, func(t *testing.T) {
+ sourceMaps := make([]*models.SourceMap, 0, len(tc.maps))
+ for _, mapPath := range tc.maps {
+ sourceMaps = append(sourceMaps, &models.SourceMap{
+ ProjectId: projectId,
+ Version: "1.0.0",
+ FileName: filepath.Base(mapPath),
+ StorageKey: mapPath,
+ })
+ }
+
+ lines := []string{"Error: symbolic fixture test"}
+ for _, f := range tc.frames {
+ lines = append(lines, "anonymous()")
+ lines = append(lines, fmt.Sprintf(" %s:%d:%d", f.inFile, f.inLine, f.inCol))
+ }
+ input := strings.Join(lines, "\n")
+
+ resolved := ResolveStackTrace(context.Background(), projectId, input, sourceMaps)
+ outLines := strings.Split(resolved, "\n")
+ if len(outLines) != len(lines) {
+ t.Fatalf("expected %d output lines, got %d:\n%s", len(lines), len(outLines), resolved)
+ }
+
+ for i, f := range tc.frames {
+ nameLine := outLines[1+2*i]
+ locationLine := outLines[2+2*i]
+ inputFrame := fmt.Sprintf("%s:%d:%d", f.inFile, f.inLine, f.inCol)
+
+ var expectedLocation string
+ var expectedName string
+ parityName := ""
+ pinned := false
+ nameChecked := true
+ if f.unresolved {
+ expectedLocation = inputFrame
+ expectedName = "anonymous"
+ } else {
+ expectedLocation = fmt.Sprintf("%s:%d:%d", f.file, f.line, f.col)
+ expectedName = f.name
+ parityName = f.name
+ if f.pinnedName != "" {
+ expectedName = f.pinnedName
+ pinned = true
+ }
+ nameChecked = expectedName != ""
+ }
+
+ actualLocation := strings.TrimPrefix(locationLine, " ")
+ actualName := strings.TrimSuffix(strings.TrimPrefix(nameLine, " "), "()")
+
+ locationPass := actualLocation == expectedLocation
+ namePass := actualName == expectedName
+
+ if !locationPass {
+ t.Errorf("frame %s: location expected %q, got %q", inputFrame, expectedLocation, actualLocation)
+ }
+ if nameChecked && !namePass {
+ if pinned {
+ t.Errorf("frame %s: name expected %q (pinned deviation, parity target %q), got %q", inputFrame, expectedName, parityName, actualName)
+ } else {
+ t.Errorf("frame %s: name expected %q, got %q", inputFrame, expectedName, actualName)
+ }
+ }
+
+ results = append(results, symbolicResult{
+ caseName: tc.name,
+ input: inputFrame,
+ expectedLocation: expectedLocation,
+ actualLocation: actualLocation,
+ locationPass: locationPass,
+ expectedName: expectedName,
+ parityName: parityName,
+ actualName: actualName,
+ namePass: namePass,
+ nameChecked: nameChecked,
+ pinned: pinned,
+ })
+ }
+ })
+ }
+
+ if *recordSymbolic {
+ if err := writeSymbolicResults(results); err != nil {
+ t.Fatalf("failed to write results file: %v", err)
+ }
+ }
+}
+
+func writeSymbolicResults(results []symbolicResult) error {
+ var b strings.Builder
+ parity := 0
+ pinnedCount := 0
+ failed := 0
+ for _, r := range results {
+ switch {
+ case !r.locationPass || (r.nameChecked && !r.namePass):
+ failed++
+ case r.pinned:
+ pinnedCount++
+ default:
+ parity++
+ }
+ }
+
+ b.WriteString("symbolic parity results\n")
+ b.WriteString("fixtures: getsentry/symbolic 925230e878ea25f6a0af88171fce93b6272cd30d\n")
+ b.WriteString("regenerate: go test ./app/services/ -run TestResolveStackTraceSymbolicParity -record-symbolic\n")
+ b.WriteString("PINNED frames intentionally deviate from symbolic; see sourcemapcache/README.md\n")
+ fmt.Fprintf(&b, "frames: %d parity, %d pinned deviations, %d failing, %d total\n\n", parity, pinnedCount, failed, len(results))
+
+ for _, r := range results {
+ status := "PASS"
+ if !r.locationPass || (r.nameChecked && !r.namePass) {
+ status = "FAIL"
+ } else if r.pinned {
+ status = "PINNED"
+ }
+ fmt.Fprintf(&b, "[%s] %s :: %s\n", status, r.caseName, r.input)
+ fmt.Fprintf(&b, " location expected: %s\n", r.expectedLocation)
+ fmt.Fprintf(&b, " location actual: %s\n", r.actualLocation)
+ if r.pinned {
+ fmt.Fprintf(&b, " name parity target: %s\n", r.parityName)
+ fmt.Fprintf(&b, " name pinned: %s\n", r.expectedName)
+ } else if r.nameChecked {
+ fmt.Fprintf(&b, " name expected: %s\n", r.expectedName)
+ } else {
+ b.WriteString(" name expected: (not asserted)\n")
+ }
+ fmt.Fprintf(&b, " name actual: %s\n", r.actualName)
+ b.WriteString("\n")
+ }
+
+ return os.WriteFile("testdata/symbolic_parity_results.txt", []byte(b.String()), 0644)
+}
diff --git a/backend/app/services/testdata/sourcemapcache/README.md b/backend/app/services/testdata/sourcemapcache/README.md
new file mode 100644
index 00000000..b5c62ef1
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/README.md
@@ -0,0 +1,25 @@
+# sourcemapcache fixtures
+
+Copied from getsentry/symbolic, `symbolic-testutils/fixtures/sourcemapcache`, at commit `925230e878ea25f6a0af88171fce93b6272cd30d`.
+
+The expected resolutions asserted in `sourcemap_resolver_symbolic_test.go` are transcribed from `symbolic-sourcemapcache/tests/integration.rs` in that repo, converted from symbolic's 0-based line/column convention to the 1-based browser convention our resolver uses.
+
+Do not edit these files by hand: they are the fixed reference point that lets us detect when our symbolicator output drifts. The committed baseline of our resolver's behavior against them lives in `../symbolic_parity_results.txt` (regenerate with `go test ./app/services/ -run TestResolveStackTraceSymbolicParity -record-symbolic`).
+
+## Pinned deviations
+
+Five frames intentionally deviate from symbolic's expected function names: symbolic derives scope names by parsing the minified bundle (which Traceway does not store) while our resolver extracts names from `sourcesContent` with a regex heuristic. These frames carry a `pinnedName` in the test table: the assertion locks our current output (so any drift fails the test), and the symbolic value is kept as `name` and reported as the parity target in `../symbolic_parity_results.txt`. When scope analysis lands, remove the `pinnedName` to restore the strict parity assertion per frame.
+
+| Frame | Parity target (symbolic) | Pinned (ours) |
+|---|---|---|
+| preact.module.js:1:482 | createElement | normalizedProps |
+| react-native-hermes:1:11858 | `<global>` | anonymous |
+| react-native-metro.js:6:44 | `<global>` | foo |
+| bundle.js:1:85 | module.exports | foo |
+| bundle.js:1:44 | module.exports | bar |
+
+## Null sources (`nofiles` fixture)
+
+Source maps can carry `"sources": [null, ...]`: mappings and inlined `sourcesContent` are present but the original file names are not (seen with older uglify/Raven-era pipelines). Symbolic resolves these to a nameless file; our resolver emits the placeholder `<unknown>` as the file name (e.g. `<unknown>:3:9`) and still runs function-name extraction against the inlined source content. The parity test encodes symbolic's "no file name" as `<unknown>` to match that convention.
+
+Caveat: the resolver's source-content lookup is by file name, and `""` matches the first empty entry in `sources`, so with multiple null sources the content used for name extraction can belong to the wrong file. Acceptable for the extraction heuristic, but the lookup is ambiguous by nature.
diff --git a/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-hermes.map b/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-hermes.map
new file mode 100644
index 00000000..2bcee80e
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-hermes.map
@@ -0,0 +1 @@
+{"version":3,"sources":["node_modules/metro/src/lib/polyfills/require.js","node_modules/react-native/Libraries/polyfills/console.js","node_modules/react-native/Libraries/polyfills/error-guard.js","node_modules/react-native/Libraries/polyfills/Object.es7.js","input.js","module.js"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @polyfill\n *\n * @format\n */\n\"use strict\";\n/* eslint-disable no-bitwise */\n\nglobal.__r = metroRequire;\nglobal.__d = define;\nglobal.__c = clear;\nglobal.__registerSegment = registerSegment;\nvar modules = clear(); // Don't use a Symbol here, it would pull in an extra polyfill with all sorts of\n// additional stuff (e.g. Array.from).\n\nconst EMPTY = {};\nconst _ref = {},\n hasOwnProperty = _ref.hasOwnProperty;\n\nif (__DEV__) {\n global.$RefreshReg$ = () => {};\n\n global.$RefreshSig$ = () => type => type;\n}\n\nfunction clear() {\n modules = Object.create(null); // We return modules here so that we can assign an initial value to modules\n // when defining it. Otherwise, we would have to do \"let modules = null\",\n // which will force us to add \"nullthrows\" everywhere.\n\n return modules;\n}\n\nif (__DEV__) {\n var verboseNamesToModuleIds = Object.create(null);\n var initializingModuleIds = [];\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n if (modules[moduleId] != null) {\n if (__DEV__) {\n // (We take `inverseDependencies` from `arguments` to avoid an unused\n // named parameter in `define` in production.\n const inverseDependencies = arguments[4]; // If the module has already been defined and the define method has been\n // called with inverseDependencies, we can hot reload it.\n\n if (inverseDependencies) {\n global.__accept(moduleId, factory, dependencyMap, inverseDependencies);\n }\n } // prevent repeated calls to `global.nativeRequire` to overwrite modules\n // that are already loaded\n\n return;\n }\n\n const mod = {\n dependencyMap,\n factory,\n hasError: false,\n importedAll: EMPTY,\n importedDefault: EMPTY,\n isInitialized: false,\n publicModule: {\n exports: {}\n }\n };\n modules[moduleId] = mod;\n\n if (__DEV__) {\n // HMR\n mod.hot = createHotReloadingObject(); // DEBUGGABLE MODULES NAMES\n // we take `verboseName` from `arguments` to avoid an unused named parameter\n // in `define` in production.\n\n const verboseName = arguments[3];\n\n if (verboseName) {\n mod.verboseName = verboseName;\n verboseNamesToModuleIds[verboseName] = moduleId;\n }\n }\n}\n\nfunction metroRequire(moduleId) {\n if (__DEV__ && typeof moduleId === \"string\") {\n const verboseName = moduleId;\n moduleId = verboseNamesToModuleIds[verboseName];\n\n if (moduleId == null) {\n throw new Error(`Unknown named module: \"${verboseName}\"`);\n } else {\n console.warn(\n `Requiring module \"${verboseName}\" by name is only supported for ` +\n \"debugging purposes and will BREAK IN PRODUCTION!\"\n );\n }\n } //$FlowFixMe: at this point we know that moduleId is a number\n\n const moduleIdReallyIsNumber = moduleId;\n\n if (__DEV__) {\n const initializingIndex = initializingModuleIds.indexOf(\n moduleIdReallyIsNumber\n );\n\n if (initializingIndex !== -1) {\n const cycle = initializingModuleIds\n .slice(initializingIndex)\n .map(id => (modules[id] ? modules[id].verboseName : \"[unknown]\")); // We want to show A -> B -> A:\n\n cycle.push(cycle[0]);\n console.warn(\n `Require cycle: ${cycle.join(\" -> \")}\\n\\n` +\n \"Require cycles are allowed, but can result in uninitialized values. \" +\n \"Consider refactoring to remove the need for a cycle.\"\n );\n }\n }\n\n const module = modules[moduleIdReallyIsNumber];\n return module && module.isInitialized\n ? module.publicModule.exports\n : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction metroImportDefault(moduleId) {\n if (__DEV__ && typeof moduleId === \"string\") {\n const verboseName = moduleId;\n moduleId = verboseNamesToModuleIds[verboseName];\n } //$FlowFixMe: at this point we know that moduleId is a number\n\n const moduleIdReallyIsNumber = moduleId;\n\n if (\n modules[moduleIdReallyIsNumber] &&\n modules[moduleIdReallyIsNumber].importedDefault !== EMPTY\n ) {\n return modules[moduleIdReallyIsNumber].importedDefault;\n }\n\n const exports = metroRequire(moduleIdReallyIsNumber);\n const importedDefault =\n exports && exports.__esModule ? exports.default : exports; // $FlowFixMe The metroRequire call above will throw if modules[id] is null\n\n return (modules[moduleIdReallyIsNumber].importedDefault = importedDefault);\n}\n\nmetroRequire.importDefault = metroImportDefault;\n\nfunction metroImportAll(moduleId) {\n if (__DEV__ && typeof moduleId === \"string\") {\n const verboseName = moduleId;\n moduleId = verboseNamesToModuleIds[verboseName];\n } //$FlowFixMe: at this point we know that moduleId is a number\n\n const moduleIdReallyIsNumber = moduleId;\n\n if (\n modules[moduleIdReallyIsNumber] &&\n modules[moduleIdReallyIsNumber].importedAll !== EMPTY\n ) {\n return modules[moduleIdReallyIsNumber].importedAll;\n }\n\n const exports = metroRequire(moduleIdReallyIsNumber);\n let importedAll;\n\n if (exports && exports.__esModule) {\n importedAll = exports;\n } else {\n importedAll = {}; // Refrain from using Object.assign, it has to work in ES3 environments.\n\n if (exports) {\n for (const key in exports) {\n if (hasOwnProperty.call(exports, key)) {\n importedAll[key] = exports[key];\n }\n }\n }\n\n importedAll.default = exports;\n } // $FlowFixMe The metroRequire call above will throw if modules[id] is null\n\n return (modules[moduleIdReallyIsNumber].importedAll = importedAll);\n}\n\nmetroRequire.importAll = metroImportAll;\nlet inGuard = false;\n\nfunction guardedLoadModule(moduleId, module) {\n if (!inGuard && global.ErrorUtils) {\n inGuard = true;\n let returnValue;\n\n try {\n returnValue = loadModuleImplementation(moduleId, module);\n } catch (e) {\n // TODO: (moti) T48204692 Type this use of ErrorUtils.\n global.ErrorUtils.reportFatalError(e);\n }\n\n inGuard = false;\n return returnValue;\n } else {\n return loadModuleImplementation(moduleId, module);\n }\n}\n\nconst ID_MASK_SHIFT = 16;\nconst LOCAL_ID_MASK = ~0 >>> ID_MASK_SHIFT;\n\nfunction unpackModuleId(moduleId) {\n const segmentId = moduleId >>> ID_MASK_SHIFT;\n const localId = moduleId & LOCAL_ID_MASK;\n return {\n segmentId,\n localId\n };\n}\n\nmetroRequire.unpackModuleId = unpackModuleId;\n\nfunction packModuleId(value) {\n return (value.segmentId << ID_MASK_SHIFT) + value.localId;\n}\n\nmetroRequire.packModuleId = packModuleId;\nconst moduleDefinersBySegmentID = [];\n\nfunction registerSegment(segmentID, moduleDefiner) {\n moduleDefinersBySegmentID[segmentID] = moduleDefiner;\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n if (!module && moduleDefinersBySegmentID.length > 0) {\n const _unpackModuleId = unpackModuleId(moduleId),\n segmentId = _unpackModuleId.segmentId,\n localId = _unpackModuleId.localId;\n\n const definer = moduleDefinersBySegmentID[segmentId];\n\n if (definer != null) {\n definer(localId);\n module = modules[moduleId];\n }\n }\n\n const nativeRequire = global.nativeRequire;\n\n if (!module && nativeRequire) {\n const _unpackModuleId2 = unpackModuleId(moduleId),\n segmentId = _unpackModuleId2.segmentId,\n localId = _unpackModuleId2.localId;\n\n nativeRequire(localId, segmentId);\n module = modules[moduleId];\n }\n\n if (!module) {\n throw unknownModuleError(moduleId);\n }\n\n if (module.hasError) {\n throw moduleThrewError(moduleId, module.error);\n } // `metroRequire` calls into the require polyfill itself are not analyzed and\n // replaced so that they use numeric module IDs.\n // The systrace module will expose itself on the metroRequire function so that\n // it can be used here.\n // TODO(t9759686) Scan polyfills for dependencies, too\n\n if (__DEV__) {\n var Systrace = metroRequire.Systrace,\n Refresh = metroRequire.Refresh;\n } // We must optimistically mark module as initialized before running the\n // factory to keep any require cycles inside the factory from causing an\n // infinite require loop.\n\n module.isInitialized = true;\n const _module = module,\n factory = _module.factory,\n dependencyMap = _module.dependencyMap;\n\n if (__DEV__) {\n initializingModuleIds.push(moduleId);\n }\n\n try {\n if (__DEV__) {\n // $FlowFixMe: we know that __DEV__ is const and `Systrace` exists\n Systrace.beginEvent(\"JS_require_\" + (module.verboseName || moduleId));\n }\n\n const moduleObject = module.publicModule;\n\n if (__DEV__) {\n moduleObject.hot = module.hot;\n var prevRefreshReg = global.$RefreshReg$;\n var prevRefreshSig = global.$RefreshSig$;\n\n if (Refresh != null) {\n const RefreshRuntime = Refresh;\n\n global.$RefreshReg$ = (type, id) => {\n RefreshRuntime.register(type, moduleId + \" \" + id);\n };\n\n global.$RefreshSig$ =\n RefreshRuntime.createSignatureFunctionForTransform;\n }\n }\n\n moduleObject.id = moduleId; // keep args in sync with with defineModuleCode in\n // metro/src/Resolver/index.js\n // and metro/src/ModuleGraph/worker.js\n\n factory(\n global,\n metroRequire,\n metroImportDefault,\n metroImportAll,\n moduleObject,\n moduleObject.exports,\n dependencyMap\n ); // avoid removing factory in DEV mode as it breaks HMR\n\n if (!__DEV__) {\n // $FlowFixMe: This is only sound because we never access `factory` again\n module.factory = undefined;\n module.dependencyMap = undefined;\n }\n\n if (__DEV__) {\n // $FlowFixMe: we know that __DEV__ is const and `Systrace` exists\n Systrace.endEvent();\n\n if (Refresh != null) {\n registerExportsForReactRefresh(Refresh, moduleObject.exports, moduleId);\n }\n }\n\n return moduleObject.exports;\n } catch (e) {\n module.hasError = true;\n module.error = e;\n module.isInitialized = false;\n module.publicModule.exports = undefined;\n throw e;\n } finally {\n if (__DEV__) {\n if (initializingModuleIds.pop() !== moduleId) {\n throw new Error(\n \"initializingModuleIds is corrupt; something is terribly wrong\"\n );\n }\n\n global.$RefreshReg$ = prevRefreshReg;\n global.$RefreshSig$ = prevRefreshSig;\n }\n }\n}\n\nfunction unknownModuleError(id) {\n let message = 'Requiring unknown module \"' + id + '\".';\n\n if (__DEV__) {\n message +=\n \" If you are sure the module exists, try restarting Metro. \" +\n \"You may also want to run `yarn` or `npm install`.\";\n }\n\n return Error(message);\n}\n\nfunction moduleThrewError(id, error) {\n const displayName = (__DEV__ && modules[id] && modules[id].verboseName) || id;\n return Error(\n 'Requiring module \"' + displayName + '\", which threw an exception: ' + error\n );\n}\n\nif (__DEV__) {\n metroRequire.Systrace = {\n beginEvent: () => {},\n endEvent: () => {}\n };\n\n metroRequire.getModules = () => {\n return modules;\n }; // HOT MODULE RELOADING\n\n var createHotReloadingObject = function() {\n const hot = {\n _acceptCallback: null,\n _disposeCallback: null,\n _didAccept: false,\n accept: callback => {\n hot._didAccept = true;\n hot._acceptCallback = callback;\n },\n dispose: callback => {\n hot._disposeCallback = callback;\n }\n };\n return hot;\n };\n\n let reactRefreshTimeout = null;\n\n const metroHotUpdateModule = function(\n id,\n factory,\n dependencyMap,\n inverseDependencies\n ) {\n const mod = modules[id];\n\n if (!mod) {\n if (factory) {\n // New modules are going to be handled by the define() method.\n return;\n }\n\n throw unknownModuleError(id);\n }\n\n if (!mod.hasError && !mod.isInitialized) {\n // The module hasn't actually been executed yet,\n // so we can always safely replace it.\n mod.factory = factory;\n mod.dependencyMap = dependencyMap;\n return;\n }\n\n const Refresh = metroRequire.Refresh;\n const pendingModuleIDs = [id];\n const updatedModuleIDs = [];\n const seenModuleIDs = new Set();\n const refreshBoundaryIDs = new Set(); // In this loop, we will traverse the dependency tree upwards from the\n // changed module. Updates \"bubble\" up to the closest accepted parent.\n //\n // If we reach the module root and nothing along the way accepted the update,\n // we know hot reload is going to fail. In that case we return false.\n //\n // The main purpose of this loop is to figure out whether it's safe to apply\n // a hot update. It is only safe when the update was accepted somewhere\n // along the way upwards for each of its parent dependency module chains.\n //\n // If we didn't have this check, we'd risk re-evaluating modules that\n // have side effects and lead to confusing and meaningless crashes.\n\n while (pendingModuleIDs.length > 0) {\n const pendingID = pendingModuleIDs.pop(); // Don't process twice if we have a cycle.\n\n if (seenModuleIDs.has(pendingID)) {\n continue;\n }\n\n seenModuleIDs.add(pendingID); // If the module accepts itself, no need to bubble.\n // We can stop worrying about this module chain and pick the next one.\n\n const pendingModule = modules[pendingID];\n\n if (pendingModule != null) {\n const pendingHot = pendingModule.hot;\n\n if (pendingHot == null) {\n throw new Error(\n \"[Refresh] Expected module.hot to always exist in DEV.\"\n );\n } // A module can be accepted manually from within itself.\n\n let canAccept = pendingHot._didAccept;\n\n if (!canAccept && Refresh != null) {\n // Or React Refresh may mark it accepted based on exports.\n const isBoundary = isReactRefreshBoundary(\n Refresh,\n pendingModule.publicModule.exports\n );\n\n if (isBoundary) {\n canAccept = true;\n refreshBoundaryIDs.add(pendingID);\n }\n }\n\n if (canAccept) {\n updatedModuleIDs.push(pendingID);\n continue;\n }\n } // If we bubble through the roof, there is no way to do a hot update.\n // Bail out altogether. This is the failure case.\n\n const parentIDs = inverseDependencies[pendingID];\n\n if (parentIDs.length === 0) {\n // Reload the app because the hot reload can't succeed.\n // This should work both on web and React Native.\n performFullRefresh();\n return;\n } // This module didn't accept but maybe all its parents did?\n // Put them all in the queue to run the same set of checks.\n\n updatedModuleIDs.push(pendingID);\n parentIDs.forEach(parentID => pendingModuleIDs.push(parentID));\n } // If we reached here, it is likely that hot reload will be successful.\n // Run the actual factories.\n\n seenModuleIDs.clear();\n\n for (let i = 0; i < updatedModuleIDs.length; i++) {\n // Don't process twice if we have a cycle.\n const updatedID = updatedModuleIDs[i];\n\n if (seenModuleIDs.has(updatedID)) {\n continue;\n }\n\n seenModuleIDs.add(updatedID);\n const mod = modules[updatedID];\n\n if (mod == null) {\n throw new Error(\"[Refresh] Expected to find the updated module.\");\n }\n\n const prevExports = mod.publicModule.exports;\n const didError = runUpdatedModule(\n updatedID,\n updatedID === id ? factory : undefined,\n updatedID === id ? dependencyMap : undefined\n );\n const nextExports = mod.publicModule.exports;\n\n if (didError) {\n // The user was shown a redbox about module initialization.\n // There's nothing for us to do here until it's fixed.\n return;\n }\n\n if (refreshBoundaryIDs.has(updatedID)) {\n // Since we just executed the code for it, it's possible\n // that the new exports make it ineligible for being a boundary.\n const isNoLongerABoundary = !isReactRefreshBoundary(\n Refresh,\n nextExports\n ); // It can also become ineligible if its exports are incompatible\n // with the previous exports.\n // For example, if you add/remove/change exports, we'll want\n // to re-execute the importing modules, and force those components\n // to re-render. Similarly, if you convert a class component\n // to a function, we want to invalidate the boundary.\n\n const didInvalidate = shouldInvalidateReactRefreshBoundary(\n Refresh,\n prevExports,\n nextExports\n );\n\n if (isNoLongerABoundary || didInvalidate) {\n // We'll be conservative. The only case in which we won't do a full\n // reload is if all parent modules are also refresh boundaries.\n // In that case we'll add them to the current queue.\n const parentIDs = inverseDependencies[updatedID];\n\n if (parentIDs.length === 0) {\n // Looks like we bubbled to the root. Can't recover from that.\n performFullRefresh();\n return;\n } // Schedule all parent refresh boundaries to re-run in this loop.\n\n for (let j = 0; j < parentIDs.length; j++) {\n const parentID = parentIDs[j];\n const parentMod = modules[parentID];\n\n if (parentMod == null) {\n throw new Error(\"[Refresh] Expected to find parent module.\");\n }\n\n const canAcceptParent = isReactRefreshBoundary(\n Refresh,\n parentMod.publicModule.exports\n );\n\n if (canAcceptParent) {\n // All parents will have to re-run too.\n refreshBoundaryIDs.add(parentID);\n updatedModuleIDs.push(parentID);\n } else {\n performFullRefresh();\n return;\n }\n }\n }\n }\n }\n\n if (Refresh != null) {\n // Debounce a little in case there are multiple updates queued up.\n // This is also useful because __accept may be called multiple times.\n if (reactRefreshTimeout == null) {\n reactRefreshTimeout = setTimeout(() => {\n reactRefreshTimeout = null; // Update React components.\n\n Refresh.performReactRefresh();\n }, 30);\n }\n }\n };\n\n const runUpdatedModule = function(id, factory, dependencyMap) {\n const mod = modules[id];\n\n if (mod == null) {\n throw new Error(\"[Refresh] Expected to find the module.\");\n }\n\n const hot = mod.hot;\n\n if (!hot) {\n throw new Error(\"[Refresh] Expected module.hot to always exist in DEV.\");\n }\n\n if (hot._disposeCallback) {\n try {\n hot._disposeCallback();\n } catch (error) {\n console.error(\n `Error while calling dispose handler for module ${id}: `,\n error\n );\n }\n }\n\n if (factory) {\n mod.factory = factory;\n }\n\n if (dependencyMap) {\n mod.dependencyMap = dependencyMap;\n }\n\n mod.hasError = false;\n mod.error = undefined;\n mod.importedAll = EMPTY;\n mod.importedDefault = EMPTY;\n mod.isInitialized = false;\n const prevExports = mod.publicModule.exports;\n mod.publicModule.exports = {};\n hot._didAccept = false;\n hot._acceptCallback = null;\n hot._disposeCallback = null;\n metroRequire(id);\n\n if (mod.hasError) {\n // This error has already been reported via a redbox.\n // We know it's likely a typo or some mistake that was just introduced.\n // Our goal now is to keep the rest of the application working so that by\n // the time user fixes the error, the app isn't completely destroyed\n // underneath the redbox. So we'll revert the module object to the last\n // successful export and stop propagating this update.\n mod.hasError = false;\n mod.isInitialized = true;\n mod.error = null;\n mod.publicModule.exports = prevExports; // We errored. Stop the update.\n\n return true;\n }\n\n if (hot._acceptCallback) {\n try {\n hot._acceptCallback();\n } catch (error) {\n console.error(\n `Error while calling accept handler for module ${id}: `,\n error\n );\n }\n } // No error.\n\n return false;\n };\n\n const performFullRefresh = () => {\n /* global window */\n if (\n typeof window !== \"undefined\" &&\n window.location != null &&\n typeof window.location.reload === \"function\"\n ) {\n window.location.reload();\n } else {\n // This is attached in setUpDeveloperTools.\n const Refresh = metroRequire.Refresh;\n\n if (Refresh != null) {\n Refresh.performFullRefresh();\n } else {\n console.warn(\"Could not reload the application after an edit.\");\n }\n }\n }; // Modules that only export components become React Refresh boundaries.\n\n var isReactRefreshBoundary = function(Refresh, moduleExports) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n return true;\n }\n\n if (moduleExports == null || typeof moduleExports !== \"object\") {\n // Exit if we can't iterate over exports.\n return false;\n }\n\n let hasExports = false;\n let areAllExportsComponents = true;\n\n for (const key in moduleExports) {\n hasExports = true;\n\n if (key === \"__esModule\") {\n continue;\n }\n\n const desc = Object.getOwnPropertyDescriptor(moduleExports, key);\n\n if (desc && desc.get) {\n // Don't invoke getters as they may have side effects.\n return false;\n }\n\n const exportValue = moduleExports[key];\n\n if (!Refresh.isLikelyComponentType(exportValue)) {\n areAllExportsComponents = false;\n }\n }\n\n return hasExports && areAllExportsComponents;\n };\n\n var shouldInvalidateReactRefreshBoundary = (\n Refresh,\n prevExports,\n nextExports\n ) => {\n const prevSignature = getRefreshBoundarySignature(Refresh, prevExports);\n const nextSignature = getRefreshBoundarySignature(Refresh, nextExports);\n\n if (prevSignature.length !== nextSignature.length) {\n return true;\n }\n\n for (let i = 0; i < nextSignature.length; i++) {\n if (prevSignature[i] !== nextSignature[i]) {\n return true;\n }\n }\n\n return false;\n }; // When this signature changes, it's unsafe to stop at this refresh boundary.\n\n var getRefreshBoundarySignature = (Refresh, moduleExports) => {\n const signature = [];\n signature.push(Refresh.getFamilyByType(moduleExports));\n\n if (moduleExports == null || typeof moduleExports !== \"object\") {\n // Exit if we can't iterate over exports.\n // (This is important for legacy environments.)\n return signature;\n }\n\n for (const key in moduleExports) {\n if (key === \"__esModule\") {\n continue;\n }\n\n const desc = Object.getOwnPropertyDescriptor(moduleExports, key);\n\n if (desc && desc.get) {\n continue;\n }\n\n const exportValue = moduleExports[key];\n signature.push(key);\n signature.push(Refresh.getFamilyByType(exportValue));\n }\n\n return signature;\n };\n\n var registerExportsForReactRefresh = (Refresh, moduleExports, moduleID) => {\n Refresh.register(moduleExports, moduleID + \" %exports%\");\n\n if (moduleExports == null || typeof moduleExports !== \"object\") {\n // Exit if we can't iterate over exports.\n // (This is important for legacy environments.)\n return;\n }\n\n for (const key in moduleExports) {\n const desc = Object.getOwnPropertyDescriptor(moduleExports, key);\n\n if (desc && desc.get) {\n // Don't invoke getters as they may have side effects.\n continue;\n }\n\n const exportValue = moduleExports[key];\n const typeID = moduleID + \" %exports% \" + key;\n Refresh.register(exportValue, typeID);\n }\n };\n\n global.__accept = metroHotUpdateModule;\n}\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @polyfill\n * @nolint\n * @format\n */\n\n/* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void, no-control-regex */\n\n/**\n * This pipes all of our console logging functions to native logging so that\n * JavaScript errors in required modules show up in Xcode via NSLog.\n */\nconst inspect = (function() {\n // Copyright Joyent, Inc. and other Node contributors.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n //\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n //\n // https://github.com/joyent/node/blob/master/lib/util.js\n\n function inspect(obj, opts) {\n var ctx = {\n seen: [],\n formatValueCalls: 0,\n stylize: stylizeNoColor,\n };\n return formatValue(ctx, obj, opts.depth);\n }\n\n function stylizeNoColor(str, styleType) {\n return str;\n }\n\n function arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n }\n\n function formatValue(ctx, value, recurseTimes) {\n ctx.formatValueCalls++;\n if (ctx.formatValueCalls > 200) {\n return `[TOO BIG formatValueCalls ${\n ctx.formatValueCalls\n } exceeded limit of 200]`;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (\n isError(value) &&\n (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)\n ) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '',\n array = false,\n braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(\n ctx,\n value,\n recurseTimes,\n visibleKeys,\n key,\n array,\n );\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n }\n\n function formatPrimitive(ctx, value) {\n if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple =\n \"'\" +\n JSON.stringify(value)\n .replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') +\n \"'\";\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value)) return ctx.stylize('' + value, 'number');\n if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value)) return ctx.stylize('null', 'null');\n }\n\n function formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n }\n\n function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(\n formatProperty(\n ctx,\n value,\n recurseTimes,\n visibleKeys,\n String(i),\n true,\n ),\n );\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(\n formatProperty(ctx, value, recurseTimes, visibleKeys, key, true),\n );\n }\n });\n return output;\n }\n\n function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {value: value[key]};\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str\n .split('\\n')\n .map(function(line) {\n return ' ' + line;\n })\n .join('\\n')\n .substr(2);\n } else {\n str =\n '\\n' +\n str\n .split('\\n')\n .map(function(line) {\n return ' ' + line;\n })\n .join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n }\n\n function reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return (\n braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1]\n );\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n }\n\n // NOTE: These type checking functions intentionally don't use `instanceof`\n // because it is fragile and can be easily faked with `Object.create()`.\n function isArray(ar) {\n return Array.isArray(ar);\n }\n\n function isBoolean(arg) {\n return typeof arg === 'boolean';\n }\n\n function isNull(arg) {\n return arg === null;\n }\n\n function isNullOrUndefined(arg) {\n return arg == null;\n }\n\n function isNumber(arg) {\n return typeof arg === 'number';\n }\n\n function isString(arg) {\n return typeof arg === 'string';\n }\n\n function isSymbol(arg) {\n return typeof arg === 'symbol';\n }\n\n function isUndefined(arg) {\n return arg === void 0;\n }\n\n function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n }\n\n function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n }\n\n function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n }\n\n function isError(e) {\n return (\n isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error)\n );\n }\n\n function isFunction(arg) {\n return typeof arg === 'function';\n }\n\n function objectToString(o) {\n return Object.prototype.toString.call(o);\n }\n\n function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }\n\n return inspect;\n})();\n\nconst OBJECT_COLUMN_NAME = '(index)';\nconst LOG_LEVELS = {\n trace: 0,\n info: 1,\n warn: 2,\n error: 3,\n};\nconst INSPECTOR_LEVELS = [];\nINSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug';\nINSPECTOR_LEVELS[LOG_LEVELS.info] = 'log';\nINSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning';\nINSPECTOR_LEVELS[LOG_LEVELS.error] = 'error';\n\n// Strip the inner function in getNativeLogFunction(), if in dev also\n// strip method printing to originalConsole.\nconst INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1;\n\nfunction getNativeLogFunction(level) {\n return function() {\n let str;\n if (arguments.length === 1 && typeof arguments[0] === 'string') {\n str = arguments[0];\n } else {\n str = Array.prototype.map\n .call(arguments, function(arg) {\n return inspect(arg, {depth: 10});\n })\n .join(', ');\n }\n\n let logLevel = level;\n if (str.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) {\n // React warnings use console.error so that a stack trace is shown,\n // but we don't (currently) want these to show a redbox\n // (Note: Logic duplicated in ExceptionsManager.js.)\n logLevel = LOG_LEVELS.warn;\n }\n if (global.__inspectorLog) {\n global.__inspectorLog(\n INSPECTOR_LEVELS[logLevel],\n str,\n [].slice.call(arguments),\n INSPECTOR_FRAMES_TO_SKIP,\n );\n }\n if (groupStack.length) {\n str = groupFormat('', str);\n }\n global.nativeLoggingHook(str, logLevel);\n };\n}\n\nfunction repeat(element, n) {\n return Array.apply(null, Array(n)).map(function() {\n return element;\n });\n}\n\nfunction consoleTablePolyfill(rows) {\n // convert object -> array\n if (!Array.isArray(rows)) {\n var data = rows;\n rows = [];\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n var row = data[key];\n row[OBJECT_COLUMN_NAME] = key;\n rows.push(row);\n }\n }\n }\n if (rows.length === 0) {\n global.nativeLoggingHook('', LOG_LEVELS.info);\n return;\n }\n\n var columns = Object.keys(rows[0]).sort();\n var stringRows = [];\n var columnWidths = [];\n\n // Convert each cell to a string. Also\n // figure out max cell width for each column\n columns.forEach(function(k, i) {\n columnWidths[i] = k.length;\n for (var j = 0; j < rows.length; j++) {\n var cellStr = (rows[j][k] || '?').toString();\n stringRows[j] = stringRows[j] || [];\n stringRows[j][i] = cellStr;\n columnWidths[i] = Math.max(columnWidths[i], cellStr.length);\n }\n });\n\n // Join all elements in the row into a single string with | separators\n // (appends extra spaces to each cell to make separators | aligned)\n function joinRow(row, space) {\n var cells = row.map(function(cell, i) {\n var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join('');\n return cell + extraSpaces;\n });\n space = space || ' ';\n return cells.join(space + '|' + space);\n }\n\n var separators = columnWidths.map(function(columnWidth) {\n return repeat('-', columnWidth).join('');\n });\n var separatorRow = joinRow(separators, '-');\n var header = joinRow(columns);\n var table = [header, separatorRow];\n\n for (var i = 0; i < rows.length; i++) {\n table.push(joinRow(stringRows[i]));\n }\n\n // Notice extra empty line at the beginning.\n // Native logging hook adds \"RCTLog >\" at the front of every\n // logged string, which would shift the header and screw up\n // the table\n global.nativeLoggingHook('\\n' + table.join('\\n'), LOG_LEVELS.info);\n}\n\nconst GROUP_PAD = '\\u2502'; // Box light vertical\nconst GROUP_OPEN = '\\u2510'; // Box light down+left\nconst GROUP_CLOSE = '\\u2518'; // Box light up+left\n\nconst groupStack = [];\n\nfunction groupFormat(prefix, msg) {\n // Insert group formatting before the console message\n return groupStack.join('') + prefix + ' ' + (msg || '');\n}\n\nfunction consoleGroupPolyfill(label) {\n global.nativeLoggingHook(groupFormat(GROUP_OPEN, label), LOG_LEVELS.info);\n groupStack.push(GROUP_PAD);\n}\n\nfunction consoleGroupCollapsedPolyfill(label) {\n global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info);\n groupStack.push(GROUP_PAD);\n}\n\nfunction consoleGroupEndPolyfill() {\n groupStack.pop();\n global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info);\n}\n\nfunction consoleAssertPolyfill(expression, label) {\n if (!expression) {\n global.nativeLoggingHook('Assertion failed: ' + label, LOG_LEVELS.error);\n }\n}\n\nif (global.nativeLoggingHook) {\n const originalConsole = global.console;\n // Preserve the original `console` as `originalConsole`\n if (__DEV__ && originalConsole) {\n const descriptor = Object.getOwnPropertyDescriptor(global, 'console');\n if (descriptor) {\n Object.defineProperty(global, 'originalConsole', descriptor);\n }\n }\n\n global.console = {\n error: getNativeLogFunction(LOG_LEVELS.error),\n info: getNativeLogFunction(LOG_LEVELS.info),\n log: getNativeLogFunction(LOG_LEVELS.info),\n warn: getNativeLogFunction(LOG_LEVELS.warn),\n trace: getNativeLogFunction(LOG_LEVELS.trace),\n debug: getNativeLogFunction(LOG_LEVELS.trace),\n table: consoleTablePolyfill,\n group: consoleGroupPolyfill,\n groupEnd: consoleGroupEndPolyfill,\n groupCollapsed: consoleGroupCollapsedPolyfill,\n assert: consoleAssertPolyfill,\n };\n\n Object.defineProperty(console, '_isPolyfilled', {\n value: true,\n enumerable: false,\n });\n\n // If available, also call the original `console` method since that is\n // sometimes useful. Ex: on OS X, this will let you see rich output in\n // the Safari Web Inspector console.\n if (__DEV__ && originalConsole) {\n Object.keys(console).forEach(methodName => {\n const reactNativeMethod = console[methodName];\n if (originalConsole[methodName]) {\n console[methodName] = function() {\n // TODO(T43930203): remove this special case once originalConsole.assert properly checks\n // the condition\n if (methodName === 'assert') {\n if (!arguments[0]) {\n originalConsole.assert(...arguments);\n }\n } else {\n originalConsole[methodName](...arguments);\n }\n reactNativeMethod.apply(console, arguments);\n };\n }\n });\n\n // The following methods are not supported by this polyfill but\n // we still should pass them to original console if they are\n // supported by it.\n [\n 'clear',\n 'dir',\n 'dirxml',\n 'groupCollapsed',\n 'profile',\n 'profileEnd',\n ].forEach(methodName => {\n if (typeof originalConsole[methodName] === 'function') {\n console[methodName] = function() {\n originalConsole[methodName](...arguments);\n };\n }\n });\n }\n} else if (!global.console) {\n const log = global.print || function consoleLoggingStub() {};\n global.console = {\n error: log,\n info: log,\n log: log,\n warn: log,\n trace: log,\n debug: log,\n table: log,\n };\n\n Object.defineProperty(console, '_isPolyfilled', {\n value: true,\n enumerable: false,\n });\n}\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n * @polyfill\n */\n\nlet _inGuard = 0;\n\ntype ErrorHandler = (error: mixed, isFatal: boolean) => void;\ntype Fn<Args, Return> = (...Args) => Return;\n\n/**\n * This is the error handler that is called when we encounter an exception\n * when loading a module. This will report any errors encountered before\n * ExceptionsManager is configured.\n */\nlet _globalHandler: ErrorHandler = function onError(\n e: mixed,\n isFatal: boolean,\n) {\n throw e;\n};\n\n/**\n * The particular require runtime that we are using looks for a global\n * `ErrorUtils` object and if it exists, then it requires modules with the\n * error handler specified via ErrorUtils.setGlobalHandler by calling the\n * require function with applyWithGuard. Since the require module is loaded\n * before any of the modules, this ErrorUtils must be defined (and the handler\n * set) globally before requiring anything.\n */\nconst ErrorUtils = {\n setGlobalHandler(fun: ErrorHandler): void {\n _globalHandler = fun;\n },\n getGlobalHandler(): ErrorHandler {\n return _globalHandler;\n },\n reportError(error: mixed): void {\n _globalHandler && _globalHandler(error, false);\n },\n reportFatalError(error: mixed): void {\n // NOTE: This has an untyped call site in Metro.\n _globalHandler && _globalHandler(error, true);\n },\n applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(\n fun: Fn<TArgs, TOut>,\n context?: ?mixed,\n args?: ?TArgs,\n // Unused, but some code synced from www sets it to null.\n unused_onError?: null,\n // Some callers pass a name here, which we ignore.\n unused_name?: ?string,\n ): ?TOut {\n try {\n _inGuard++;\n // $FlowFixMe: TODO T48204745 (1) apply(context, null) is fine. (2) array -> rest array should work\n return fun.apply(context, args);\n } catch (e) {\n ErrorUtils.reportError(e);\n } finally {\n _inGuard--;\n }\n return null;\n },\n applyWithGuardIfNeeded<TArgs: $ReadOnlyArray<mixed>, TOut>(\n fun: Fn<TArgs, TOut>,\n context?: ?mixed,\n args?: ?TArgs,\n ): ?TOut {\n if (ErrorUtils.inGuard()) {\n // $FlowFixMe: TODO T48204745 (1) apply(context, null) is fine. (2) array -> rest array should work\n return fun.apply(context, args);\n } else {\n ErrorUtils.applyWithGuard(fun, context, args);\n }\n return null;\n },\n inGuard(): boolean {\n return !!_inGuard;\n },\n guard<TArgs: $ReadOnlyArray<mixed>, TOut>(\n fun: Fn<TArgs, TOut>,\n name?: ?string,\n context?: ?mixed,\n ): ?(...TArgs) => ?TOut {\n // TODO: (moti) T48204753 Make sure this warning is never hit and remove it - types\n // should be sufficient.\n if (typeof fun !== 'function') {\n console.warn('A function must be passed to ErrorUtils.guard, got ', fun);\n return null;\n }\n const guardName = name ?? fun.name ?? '<generated guard>';\n function guarded(...args: TArgs): ?TOut {\n return ErrorUtils.applyWithGuard(\n fun,\n context ?? this,\n args,\n null,\n guardName,\n );\n }\n\n return guarded;\n },\n};\n\nglobal.ErrorUtils = ErrorUtils;\n\nexport type ErrorUtilsT = typeof ErrorUtils;\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @polyfill\n * @nolint\n */\n\n(function() {\n 'use strict';\n\n const hasOwnProperty = Object.prototype.hasOwnProperty;\n\n /**\n * Returns an array of the given object's own enumerable entries.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries\n */\n if (typeof Object.entries !== 'function') {\n Object.entries = function(object) {\n // `null` and `undefined` values are not allowed.\n if (object == null) {\n throw new TypeError('Object.entries called on non-object');\n }\n\n const entries = [];\n for (const key in object) {\n if (hasOwnProperty.call(object, key)) {\n entries.push([key, object[key]]);\n }\n }\n return entries;\n };\n }\n\n /**\n * Returns an array of the given object's own enumerable entries.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values\n */\n if (typeof Object.values !== 'function') {\n Object.values = function(object) {\n // `null` and `undefined` values are not allowed.\n if (object == null) {\n throw new TypeError('Object.values called on non-object');\n }\n\n const values = [];\n for (const key in object) {\n if (hasOwnProperty.call(object, key)) {\n values.push(object[key]);\n }\n }\n return values;\n };\n }\n})();\n","import { foo } from \"./module.js\"\n\nfoo();\n","export function foo() {\n throw new Error(\"lets throw!\");\n}\n"],"names":["__DEV__","Object","metroRequire","metroImportDefault","metroImportAll","unpackModuleId","modules","EMPTY","createHotReloadingObject","verboseNamesToModuleIds","global","console","initializingModuleIds","module","guardedLoadModule","Error","exports","hasOwnProperty","inGuard","loadModuleImplementation","ID_MASK_SHIFT","moduleId","LOCAL_ID_MASK","value","moduleDefinersBySegmentID","unknownModuleError","RefreshRuntime","registerExportsForReactRefresh","moduleThrewError","hot","Set","pendingModuleIDs","isReactRefreshBoundary","performFullRefresh","runUpdatedModule","updatedID","shouldInvalidateReactRefreshBoundary","reactRefreshTimeout","setTimeout","Refresh","window","hasExports","getRefreshBoundarySignature","moduleID","LOG_LEVELS","Array","level","INSPECTOR_LEVELS","INSPECTOR_FRAMES_TO_SKIP","groupStack","groupFormat","inspect","element","OBJECT_COLUMN_NAME","rows","columnWidths","stringRows","space","repeat","cell","Math","msg","GROUP_OPEN","GROUP_PAD","GROUP_CLOSE","stylizeNoColor","formatValue","hash","formatPrimitive","arrayToHash","isError","isFunction","isRegExp","isDate","isArray","RegExp","Date","formatError","formatArray","reduceToSingleString","braces","formatProperty","ctx","recurseTimes","visibleKeys","array","isUndefined","isString","isNumber","isBoolean","isNull","JSON","String","output","name","base","numLinesEst","prev","arg","isObject","objectToString","e","originalConsole","methodName","reactNativeMethod","_globalHandler","_inGuard","ErrorUtils","fun","context","guardName","TypeError"],"mappings":"A,uB,K,K,M,K,I,I,Q,I,E,Q,M,K,G,E,M,K,K,K,G,E,M,K,K,K,K,K,M,M,K,O,I,K,G,I,K,M,I,M,E,M,E,M,O,K,K,G,I,K,G,I,K,M,I,M,E,M,E,M,K,K,K,G,I,K,G,I,K,G,I,M,E,M,E,M,K,K,K,G,I,K,G,I,K,G,I,M,E,M,E,M,K,K,M,O,gB,I,M,Q,Q,I,M,K,E,O,I,K,K,I,K,I,K,I,K,I,K,I,K,I,K,I,K,IAaA,M,KACA,MACA,M,KACA,MACmB,IAAR,IAGG,EAAH,IACE,EACU,KAAP,MAEZA,KAAJ,GACwB,KAAtB,MAEsB,KAAtB,MAWEA,KAAJ,GACgCC,MAAA,OAAA,KAAH,IACC,IAAH,IAgH3BC,IAA6BC,IAA7B,MAuCAD,IAAyBE,IAAzB,QACW,OAqBQ,MACG,GAAA,IAAH,IAWnBF,IAA8BG,IAA9B,MAMAH,I,KAAA,MACkC,IAAH,IAyJ3BF,KAAJ,wDACEE,IAAwB,EACV,KADU,IAEZ,KAFY,IAAxB,MA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KAAA,WAAA,IAAA,IAAN","x_facebook_sources":[[{"names":["<global>","global.$RefreshReg$","global.$RefreshSig$","<anonymous>","clear","define","metroRequire","initializingModuleIds.slice.map$argument_0","metroImportDefault","metroImportAll","guardedLoadModule","unpackModuleId","packModuleId","registerSegment","loadModuleImplementation","unknownModuleError","moduleThrewError","metroRequire.Systrace.beginEvent","metroRequire.Systrace.endEvent","metroRequire.getModules","createHotReloadingObject","hot.accept","hot.dispose","metroHotUpdateModule","parentIDs.forEach$argument_0","setTimeout$argument_0","runUpdatedModule","performFullRefresh","isReactRefreshBoundary","shouldInvalidateReactRefreshBoundary","getRefreshBoundarySignature","registerExportsForReactRefresh"],"mappings":"AAA;wBCyB,QD;wBEE,MC,YH;AIG;CJM;AKO;CL2C;AME;aCyB,2DD;CNe;AQE;CRoB;ASI;CTmC;AUK;CViB;AWK;CXO;AYI;CZE;AaK;CbE;AcE;8BbqE;SaE;CduD;AeE;CfU;AgBE;ChBK;gBiBI,QjB;ckBC,QlB;4BmBG;GnBE;iCoBE;cCK;ODG;eEC;OFE;GpBG;+BuBI;wBCgG,2CD;yCEgG;SFI;GvBG;2B0BE;G1BuE;6B2BE;G3BkB;+B4BE;G5BmC;6C6BE;G7BmB;oC8BE;G9B2B;uC+BE;G/BqB"}],[{"names":["<global>","<anonymous>","inspect","stylizeNoColor","arrayToHash","array.forEach$argument_0","formatValue","keys.map$argument_0","formatPrimitive","formatError","formatArray","keys.forEach$argument_0","formatProperty","str.split.map$argument_0","reduceToSingleString","output.reduce$argument_0","isArray","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isRegExp","isObject","isDate","isError","isFunction","objectToString","hasOwnProperty","getNativeLogFunction","Array.prototype.map.call$argument_1","repeat","Array.apply.map$argument_0","consoleTablePolyfill","columns.forEach$argument_0","joinRow","row.map$argument_0","columnWidths.map$argument_0","groupFormat","consoleGroupPolyfill","consoleGroupCollapsedPolyfill","consoleGroupEndPolyfill","consoleAssertPolyfill","Object.keys.forEach$argument_0","methodName","forEach$argument_0","consoleLoggingStub"],"mappings":"AAA;iBCiB;ECwB;GDO;EEE;GFE;EGE;kBCG;KDE;GHG;EKE;wBC6F;ODS;GLM;EOE;GPgB;EQE;GRE;ESE;iBCkB;KDM;GTE;EWE;mBC4B;eDE;qBCQ;iBDE;GX0B;EaE;+BCE;KDI;Gbc;EeI;GfE;EgBE;GhBE;EiBE;GjBE;EkBE;GlBE;EmBE;GnBE;EoBE;GpBE;EqBE;GrBE;EsBE;GtBE;EuBE;GvBE;EwBE;GxBE;EyBE;GzBE;E0BE;G1BK;E2BE;G3BE;E4BE;G5BE;E6BE;G7BE;CDG;A+BmB;S9BC;yB+BM;S/BE;G8BuB;C/BC;AiCE;yCCC;GDE;CjCC;AmCE;kBCwB;GDQ;EEI;wBCC;KDG;GFG;oCIE;GJE;CnCc;AwCQ;CxCG;AyCE;CzCG;A0CE;C1CG;A2CE;C3CG;A4CE;C5CI;iC6CmC;8BCG;SDW;K7CE;c+CY;8BDE;SCE;K/CE;8BgDG,gChD"}],[{"names":["<global>","onError","ErrorUtils.setGlobalHandler","ErrorUtils.getGlobalHandler","ErrorUtils.reportError","ErrorUtils.reportFatalError","ErrorUtils.applyWithGuard","ErrorUtils.applyWithGuardIfNeeded","ErrorUtils.inGuard","ErrorUtils.guard","guarded"],"mappings":"AAA;mCCqB;CDK;EEW;GFE;EGC;GHE;EIC;GJE;EKC;GLG;EMC;GNmB;EOC;GPY;EQC;GRE;ESC;ICY;KDQ;GTG"}],[{"names":["<global>","<anonymous>","entries","values"],"mappings":"AAA;CCW;qBCU;KDa;oBEQ;KFa;CDE"}],[{"names":["<global>"],"mappings":"AAA"}],[{"names":["<global>","foo"],"mappings":"AAA,OC;CDE"}]]}
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-metro.js b/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-metro.js
new file mode 100644
index 00000000..a33d4c63
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-metro.js
@@ -0,0 +1,9 @@
+var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=this.process||{};process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production";
+!(function(r){"use strict";r.__r=o,r.__d=function(r,i,n){if(null!=e[i])return;var o={dependencyMap:n,factory:r,hasError:!1,importedAll:t,importedDefault:t,isInitialized:!1,publicModule:{exports:{}}};e[i]=o},r.__c=n,r.__registerSegment=function(r,e){s[r]=e};var e=n(),t={},i={}.hasOwnProperty;function n(){return e=Object.create(null)}function o(r){var t=r,i=e[t];return i&&i.isInitialized?i.publicModule.exports:d(t,i)}function l(r){var i=r;if(e[i]&&e[i].importedDefault!==t)return e[i].importedDefault;var n=o(i),l=n&&n.__esModule?n.default:n;return e[i].importedDefault=l}function u(r){var n=r;if(e[n]&&e[n].importedAll!==t)return e[n].importedAll;var l,u=o(n);if(u&&u.__esModule)l=u;else{if(l={},u)for(var a in u)i.call(u,a)&&(l[a]=u[a]);l.default=u}return e[n].importedAll=l}o.importDefault=l,o.importAll=u;var a=!1;function d(e,t){if(!a&&r.ErrorUtils){var i;a=!0;try{i=v(e,t)}catch(e){r.ErrorUtils.reportFatalError(e)}return a=!1,i}return v(e,t)}var c=16,f=65535;function p(r){return{segmentId:r>>>c,localId:r&f}}o.unpackModuleId=p,o.packModuleId=function(r){return(r.segmentId<<c)+r.localId};var s=[];function v(t,i){if(!i&&s.length>0){var n=p(t),a=n.segmentId,d=n.localId,c=s[a];null!=c&&(c(d),i=e[t])}var f=r.nativeRequire;if(!i&&f){var v=p(t),h=v.segmentId;f(v.localId,h),i=e[t]}if(!i)throw Error('Requiring unknown module "'+t+'".');if(i.hasError)throw m(t,i.error);i.isInitialized=!0;var I=i,g=I.factory,y=I.dependencyMap;try{var _=i.publicModule;return _.id=t,g(r,o,l,u,_,_.exports,y),i.factory=void 0,i.dependencyMap=void 0,_.exports}catch(r){throw i.hasError=!0,i.error=r,i.isInitialized=!1,i.publicModule.exports=void 0,r}}function m(r,e){return Error('Requiring module "'+r+'", which threw an exception: '+e)}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
+!(function(n){var e=(function(){function n(n,e){return n}function e(n){var e={};return n.forEach(function(n,r){e[n]=!0}),e}function r(n,r,u){if(n.formatValueCalls++,n.formatValueCalls>200)return"[TOO BIG formatValueCalls "+n.formatValueCalls+" exceeded limit of 200]";var f=t(n,r);if(f)return f;var c=Object.keys(r),s=e(c);if(d(r)&&(c.indexOf('message')>=0||c.indexOf('description')>=0))return o(r);if(0===c.length){if(v(r)){var p=r.name?': '+r.name:'';return n.stylize('[Function'+p+']','special')}if(g(r))return n.stylize(RegExp.prototype.toString.call(r),'regexp');if(y(r))return n.stylize(Date.prototype.toString.call(r),'date');if(d(r))return o(r)}var h,b,m='',j=!1,O=['{','}'];(h=r,Array.isArray(h)&&(j=!0,O=['[',']']),v(r))&&(m=' [Function'+(r.name?': '+r.name:'')+']');return g(r)&&(m=' '+RegExp.prototype.toString.call(r)),y(r)&&(m=' '+Date.prototype.toUTCString.call(r)),d(r)&&(m=' '+o(r)),0!==c.length||j&&0!=r.length?u<0?g(r)?n.stylize(RegExp.prototype.toString.call(r),'regexp'):n.stylize('[Object]','special'):(n.seen.push(r),b=j?i(n,r,u,s,c):c.map(function(e){return a(n,r,u,s,e,j)}),n.seen.pop(),l(b,m,O)):O[0]+m+O[1]}function t(n,e){if(s(e))return n.stylize('undefined','undefined');if('string'==typeof e){var r="'"+JSON.stringify(e).replace(/^"|"$/g,'').replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(r,'string')}return c(e)?n.stylize(''+e,'number'):u(e)?n.stylize(''+e,'boolean'):f(e)?n.stylize('null','null'):void 0}function o(n){return'['+Error.prototype.toString.call(n)+']'}function i(n,e,r,t,o){for(var i=[],l=0,u=e.length;l<u;++l)b(e,String(l))?i.push(a(n,e,r,t,String(l),!0)):i.push('');return o.forEach(function(o){o.match(/^\d+$/)||i.push(a(n,e,r,t,o,!0))}),i}function a(n,e,t,o,i,a){var l,u,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?u=c.set?n.stylize('[Getter/Setter]','special'):n.stylize('[Getter]','special'):c.set&&(u=n.stylize('[Setter]','special')),b(o,i)||(l='['+i+']'),u||(n.seen.indexOf(c.value)<0?(u=f(t)?r(n,c.value,null):r(n,c.value,t-1)).indexOf('\n')>-1&&(u=a?u.split('\n').map(function(n){return' '+n}).join('\n').substr(2):'\n'+u.split('\n').map(function(n){return' '+n}).join('\n')):u=n.stylize('[Circular]','special')),s(l)){if(a&&i.match(/^\d+$/))return u;(l=JSON.stringify(''+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(l=l.substr(1,l.length-2),l=n.stylize(l,'name')):(l=l.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),l=n.stylize(l,'string'))}return l+': '+u}function l(n,e,r){return n.reduce(function(n,e){return 0,e.indexOf('\n')>=0&&0,n+e.replace(/\u001b\[\d\d?m/g,'').length+1},0)>60?r[0]+(''===e?'':e+'\n ')+' '+n.join(',\n ')+' '+r[1]:r[0]+e+' '+n.join(', ')+' '+r[1]}function u(n){return'boolean'==typeof n}function f(n){return null===n}function c(n){return'number'==typeof n}function s(n){return void 0===n}function g(n){return p(n)&&'[object RegExp]'===h(n)}function p(n){return'object'==typeof n&&null!==n}function y(n){return p(n)&&'[object Date]'===h(n)}function d(n){return p(n)&&('[object Error]'===h(n)||n instanceof Error)}function v(n){return'function'==typeof n}function h(n){return Object.prototype.toString.call(n)}function b(n,e){return Object.prototype.hasOwnProperty.call(n,e)}return function(e,t){return r({seen:[],formatValueCalls:0,stylize:n},e,t.depth)}})(),r='(index)',t={trace:0,info:1,warn:2,error:3},o=[];o[t.trace]='debug',o[t.info]='log',o[t.warn]='warning',o[t.error]='error';var i=1;function a(r){return function(){var a;a=1===arguments.length&&'string'==typeof arguments[0]?arguments[0]:Array.prototype.map.call(arguments,function(n){return e(n,{depth:10})}).join(', ');var l=r;'Warning: '===a.slice(0,9)&&l>=t.error&&(l=t.warn),n.__inspectorLog&&n.__inspectorLog(o[l],a,[].slice.call(arguments),i),s.length&&(a=g('',a)),n.nativeLoggingHook(a,l)}}function l(n,e){return Array.apply(null,Array(e)).map(function(){return n})}var u="\u2502",f="\u2510",c="\u2518",s=[];function g(n,e){return s.join('')+n+' '+(e||'')}if(n.nativeLoggingHook){n.console;n.console={error:a(t.error),info:a(t.info),log:a(t.info),warn:a(t.warn),trace:a(t.trace),debug:a(t.trace),table:function(e){if(!Array.isArray(e)){var o=e;for(var i in e=[],o)if(o.hasOwnProperty(i)){var a=o[i];a[r]=i,e.push(a)}}if(0!==e.length){var u=Object.keys(e[0]).sort(),f=[],c=[];u.forEach(function(n,r){c[r]=n.length;for(var t=0;t<e.length;t++){var o=(e[t][n]||'?').toString();f[t]=f[t]||[],f[t][r]=o,c[r]=Math.max(c[r],o.length)}});for(var s=y(c.map(function(n){return l('-',n).join('')}),'-'),g=[y(u),s],p=0;p<e.length;p++)g.push(y(f[p]));n.nativeLoggingHook('\n'+g.join('\n'),t.info)}else n.nativeLoggingHook('',t.info);function y(n,e){var r=n.map(function(n,e){return n+l(' ',c[e]-n.length).join('')});return e=e||' ',r.join(e+'|'+e)}},group:function(e){n.nativeLoggingHook(g(f,e),t.info),s.push(u)},groupEnd:function(){s.pop(),n.nativeLoggingHook(g(c),t.info)},groupCollapsed:function(e){n.nativeLoggingHook(g(c,e),t.info),s.push(u)},assert:function(e,r){e||n.nativeLoggingHook('Assertion failed: '+r,t.error)}},Object.defineProperty(console,'_isPolyfilled',{value:!0,enumerable:!1})}else if(!n.console){var p=n.print||function(){};n.console={error:p,info:p,log:p,warn:p,trace:p,debug:p,table:p},Object.defineProperty(console,'_isPolyfilled',{value:!0,enumerable:!1})}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
+!(function(n){var r=0,t=function(n,r){throw n},l={setGlobalHandler:function(n){t=n},getGlobalHandler:function(){return t},reportError:function(n){t&&t(n,!1)},reportFatalError:function(n){t&&t(n,!0)},applyWithGuard:function(n,t,u,o,e){try{return r++,n.apply(t,u)}catch(n){l.reportError(n)}finally{r--}return null},applyWithGuardIfNeeded:function(n,r,t){return l.inGuard()?n.apply(r,t):(l.applyWithGuard(n,r,t),null)},inGuard:function(){return!!r},guard:function(n,r,t){var u;if('function'!=typeof n)return console.warn('A function must be passed to ErrorUtils.guard, got ',n),null;var o=null!=(u=null!=r?r:n.name)?u:'<generated guard>';return function(){for(var r=arguments.length,u=new Array(r),e=0;e<r;e++)u[e]=arguments[e];return l.applyWithGuard(n,null!=t?t:this,u,null,o)}}};n.ErrorUtils=l})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this);
+'undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window&&window,(function(){'use strict';var e=Object.prototype.hasOwnProperty;'function'!=typeof Object.entries&&(Object.entries=function(n){if(null==n)throw new TypeError('Object.entries called on non-object');var o=[];for(var t in n)e.call(n,t)&&o.push([t,n[t]]);return o}),'function'!=typeof Object.values&&(Object.values=function(n){if(null==n)throw new TypeError('Object.values called on non-object');var o=[];for(var t in n)e.call(n,t)&&o.push(n[t]);return o})})();
+__d(function(g,r,i,a,m,e,d){(0,r(d[0]).foo)()},0,[1]);
+__d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.foo=function(){throw new Error("lets throw!")}},1,[]);
+__r(0);
+//# sourceMappingURL=react-native-metro.js.map
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-metro.js.map b/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-metro.js.map
new file mode 100644
index 00000000..54041da5
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/hermes-metro/react-native-metro.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["__prelude__","node_modules/metro/src/lib/polyfills/require.js","node_modules/react-native/Libraries/polyfills/console.js","node_modules/react-native/Libraries/polyfills/error-guard.js","node_modules/react-native/Libraries/polyfills/Object.es7.js","input.js","module.js"],"sourcesContent":["var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=this.process||{};process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||\"production\";","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @polyfill\n *\n * @format\n */\n\"use strict\";\n/* eslint-disable no-bitwise */\n\nglobal.__r = metroRequire;\nglobal.__d = define;\nglobal.__c = clear;\nglobal.__registerSegment = registerSegment;\nvar modules = clear(); // Don't use a Symbol here, it would pull in an extra polyfill with all sorts of\n// additional stuff (e.g. Array.from).\n\nconst EMPTY = {};\nconst _ref = {},\n hasOwnProperty = _ref.hasOwnProperty;\n\nif (__DEV__) {\n global.$RefreshReg$ = () => {};\n\n global.$RefreshSig$ = () => type => type;\n}\n\nfunction clear() {\n modules = Object.create(null); // We return modules here so that we can assign an initial value to modules\n // when defining it. Otherwise, we would have to do \"let modules = null\",\n // which will force us to add \"nullthrows\" everywhere.\n\n return modules;\n}\n\nif (__DEV__) {\n var verboseNamesToModuleIds = Object.create(null);\n var initializingModuleIds = [];\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n if (modules[moduleId] != null) {\n if (__DEV__) {\n // (We take `inverseDependencies` from `arguments` to avoid an unused\n // named parameter in `define` in production.\n const inverseDependencies = arguments[4]; // If the module has already been defined and the define method has been\n // called with inverseDependencies, we can hot reload it.\n\n if (inverseDependencies) {\n global.__accept(moduleId, factory, dependencyMap, inverseDependencies);\n }\n } // prevent repeated calls to `global.nativeRequire` to overwrite modules\n // that are already loaded\n\n return;\n }\n\n const mod = {\n dependencyMap,\n factory,\n hasError: false,\n importedAll: EMPTY,\n importedDefault: EMPTY,\n isInitialized: false,\n publicModule: {\n exports: {}\n }\n };\n modules[moduleId] = mod;\n\n if (__DEV__) {\n // HMR\n mod.hot = createHotReloadingObject(); // DEBUGGABLE MODULES NAMES\n // we take `verboseName` from `arguments` to avoid an unused named parameter\n // in `define` in production.\n\n const verboseName = arguments[3];\n\n if (verboseName) {\n mod.verboseName = verboseName;\n verboseNamesToModuleIds[verboseName] = moduleId;\n }\n }\n}\n\nfunction metroRequire(moduleId) {\n if (__DEV__ && typeof moduleId === \"string\") {\n const verboseName = moduleId;\n moduleId = verboseNamesToModuleIds[verboseName];\n\n if (moduleId == null) {\n throw new Error(`Unknown named module: \"${verboseName}\"`);\n } else {\n console.warn(\n `Requiring module \"${verboseName}\" by name is only supported for ` +\n \"debugging purposes and will BREAK IN PRODUCTION!\"\n );\n }\n } //$FlowFixMe: at this point we know that moduleId is a number\n\n const moduleIdReallyIsNumber = moduleId;\n\n if (__DEV__) {\n const initializingIndex = initializingModuleIds.indexOf(\n moduleIdReallyIsNumber\n );\n\n if (initializingIndex !== -1) {\n const cycle = initializingModuleIds\n .slice(initializingIndex)\n .map(id => (modules[id] ? modules[id].verboseName : \"[unknown]\")); // We want to show A -> B -> A:\n\n cycle.push(cycle[0]);\n console.warn(\n `Require cycle: ${cycle.join(\" -> \")}\\n\\n` +\n \"Require cycles are allowed, but can result in uninitialized values. \" +\n \"Consider refactoring to remove the need for a cycle.\"\n );\n }\n }\n\n const module = modules[moduleIdReallyIsNumber];\n return module && module.isInitialized\n ? module.publicModule.exports\n : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction metroImportDefault(moduleId) {\n if (__DEV__ && typeof moduleId === \"string\") {\n const verboseName = moduleId;\n moduleId = verboseNamesToModuleIds[verboseName];\n } //$FlowFixMe: at this point we know that moduleId is a number\n\n const moduleIdReallyIsNumber = moduleId;\n\n if (\n modules[moduleIdReallyIsNumber] &&\n modules[moduleIdReallyIsNumber].importedDefault !== EMPTY\n ) {\n return modules[moduleIdReallyIsNumber].importedDefault;\n }\n\n const exports = metroRequire(moduleIdReallyIsNumber);\n const importedDefault =\n exports && exports.__esModule ? exports.default : exports; // $FlowFixMe The metroRequire call above will throw if modules[id] is null\n\n return (modules[moduleIdReallyIsNumber].importedDefault = importedDefault);\n}\n\nmetroRequire.importDefault = metroImportDefault;\n\nfunction metroImportAll(moduleId) {\n if (__DEV__ && typeof moduleId === \"string\") {\n const verboseName = moduleId;\n moduleId = verboseNamesToModuleIds[verboseName];\n } //$FlowFixMe: at this point we know that moduleId is a number\n\n const moduleIdReallyIsNumber = moduleId;\n\n if (\n modules[moduleIdReallyIsNumber] &&\n modules[moduleIdReallyIsNumber].importedAll !== EMPTY\n ) {\n return modules[moduleIdReallyIsNumber].importedAll;\n }\n\n const exports = metroRequire(moduleIdReallyIsNumber);\n let importedAll;\n\n if (exports && exports.__esModule) {\n importedAll = exports;\n } else {\n importedAll = {}; // Refrain from using Object.assign, it has to work in ES3 environments.\n\n if (exports) {\n for (const key in exports) {\n if (hasOwnProperty.call(exports, key)) {\n importedAll[key] = exports[key];\n }\n }\n }\n\n importedAll.default = exports;\n } // $FlowFixMe The metroRequire call above will throw if modules[id] is null\n\n return (modules[moduleIdReallyIsNumber].importedAll = importedAll);\n}\n\nmetroRequire.importAll = metroImportAll;\nlet inGuard = false;\n\nfunction guardedLoadModule(moduleId, module) {\n if (!inGuard && global.ErrorUtils) {\n inGuard = true;\n let returnValue;\n\n try {\n returnValue = loadModuleImplementation(moduleId, module);\n } catch (e) {\n // TODO: (moti) T48204692 Type this use of ErrorUtils.\n global.ErrorUtils.reportFatalError(e);\n }\n\n inGuard = false;\n return returnValue;\n } else {\n return loadModuleImplementation(moduleId, module);\n }\n}\n\nconst ID_MASK_SHIFT = 16;\nconst LOCAL_ID_MASK = ~0 >>> ID_MASK_SHIFT;\n\nfunction unpackModuleId(moduleId) {\n const segmentId = moduleId >>> ID_MASK_SHIFT;\n const localId = moduleId & LOCAL_ID_MASK;\n return {\n segmentId,\n localId\n };\n}\n\nmetroRequire.unpackModuleId = unpackModuleId;\n\nfunction packModuleId(value) {\n return (value.segmentId << ID_MASK_SHIFT) + value.localId;\n}\n\nmetroRequire.packModuleId = packModuleId;\nconst moduleDefinersBySegmentID = [];\n\nfunction registerSegment(segmentID, moduleDefiner) {\n moduleDefinersBySegmentID[segmentID] = moduleDefiner;\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n if (!module && moduleDefinersBySegmentID.length > 0) {\n const _unpackModuleId = unpackModuleId(moduleId),\n segmentId = _unpackModuleId.segmentId,\n localId = _unpackModuleId.localId;\n\n const definer = moduleDefinersBySegmentID[segmentId];\n\n if (definer != null) {\n definer(localId);\n module = modules[moduleId];\n }\n }\n\n const nativeRequire = global.nativeRequire;\n\n if (!module && nativeRequire) {\n const _unpackModuleId2 = unpackModuleId(moduleId),\n segmentId = _unpackModuleId2.segmentId,\n localId = _unpackModuleId2.localId;\n\n nativeRequire(localId, segmentId);\n module = modules[moduleId];\n }\n\n if (!module) {\n throw unknownModuleError(moduleId);\n }\n\n if (module.hasError) {\n throw moduleThrewError(moduleId, module.error);\n } // `metroRequire` calls into the require polyfill itself are not analyzed and\n // replaced so that they use numeric module IDs.\n // The systrace module will expose itself on the metroRequire function so that\n // it can be used here.\n // TODO(t9759686) Scan polyfills for dependencies, too\n\n if (__DEV__) {\n var Systrace = metroRequire.Systrace,\n Refresh = metroRequire.Refresh;\n } // We must optimistically mark module as initialized before running the\n // factory to keep any require cycles inside the factory from causing an\n // infinite require loop.\n\n module.isInitialized = true;\n const _module = module,\n factory = _module.factory,\n dependencyMap = _module.dependencyMap;\n\n if (__DEV__) {\n initializingModuleIds.push(moduleId);\n }\n\n try {\n if (__DEV__) {\n // $FlowFixMe: we know that __DEV__ is const and `Systrace` exists\n Systrace.beginEvent(\"JS_require_\" + (module.verboseName || moduleId));\n }\n\n const moduleObject = module.publicModule;\n\n if (__DEV__) {\n moduleObject.hot = module.hot;\n var prevRefreshReg = global.$RefreshReg$;\n var prevRefreshSig = global.$RefreshSig$;\n\n if (Refresh != null) {\n const RefreshRuntime = Refresh;\n\n global.$RefreshReg$ = (type, id) => {\n RefreshRuntime.register(type, moduleId + \" \" + id);\n };\n\n global.$RefreshSig$ =\n RefreshRuntime.createSignatureFunctionForTransform;\n }\n }\n\n moduleObject.id = moduleId; // keep args in sync with with defineModuleCode in\n // metro/src/Resolver/index.js\n // and metro/src/ModuleGraph/worker.js\n\n factory(\n global,\n metroRequire,\n metroImportDefault,\n metroImportAll,\n moduleObject,\n moduleObject.exports,\n dependencyMap\n ); // avoid removing factory in DEV mode as it breaks HMR\n\n if (!__DEV__) {\n // $FlowFixMe: This is only sound because we never access `factory` again\n module.factory = undefined;\n module.dependencyMap = undefined;\n }\n\n if (__DEV__) {\n // $FlowFixMe: we know that __DEV__ is const and `Systrace` exists\n Systrace.endEvent();\n\n if (Refresh != null) {\n registerExportsForReactRefresh(Refresh, moduleObject.exports, moduleId);\n }\n }\n\n return moduleObject.exports;\n } catch (e) {\n module.hasError = true;\n module.error = e;\n module.isInitialized = false;\n module.publicModule.exports = undefined;\n throw e;\n } finally {\n if (__DEV__) {\n if (initializingModuleIds.pop() !== moduleId) {\n throw new Error(\n \"initializingModuleIds is corrupt; something is terribly wrong\"\n );\n }\n\n global.$RefreshReg$ = prevRefreshReg;\n global.$RefreshSig$ = prevRefreshSig;\n }\n }\n}\n\nfunction unknownModuleError(id) {\n let message = 'Requiring unknown module \"' + id + '\".';\n\n if (__DEV__) {\n message +=\n \" If you are sure the module exists, try restarting Metro. \" +\n \"You may also want to run `yarn` or `npm install`.\";\n }\n\n return Error(message);\n}\n\nfunction moduleThrewError(id, error) {\n const displayName = (__DEV__ && modules[id] && modules[id].verboseName) || id;\n return Error(\n 'Requiring module \"' + displayName + '\", which threw an exception: ' + error\n );\n}\n\nif (__DEV__) {\n metroRequire.Systrace = {\n beginEvent: () => {},\n endEvent: () => {}\n };\n\n metroRequire.getModules = () => {\n return modules;\n }; // HOT MODULE RELOADING\n\n var createHotReloadingObject = function() {\n const hot = {\n _acceptCallback: null,\n _disposeCallback: null,\n _didAccept: false,\n accept: callback => {\n hot._didAccept = true;\n hot._acceptCallback = callback;\n },\n dispose: callback => {\n hot._disposeCallback = callback;\n }\n };\n return hot;\n };\n\n let reactRefreshTimeout = null;\n\n const metroHotUpdateModule = function(\n id,\n factory,\n dependencyMap,\n inverseDependencies\n ) {\n const mod = modules[id];\n\n if (!mod) {\n if (factory) {\n // New modules are going to be handled by the define() method.\n return;\n }\n\n throw unknownModuleError(id);\n }\n\n if (!mod.hasError && !mod.isInitialized) {\n // The module hasn't actually been executed yet,\n // so we can always safely replace it.\n mod.factory = factory;\n mod.dependencyMap = dependencyMap;\n return;\n }\n\n const Refresh = metroRequire.Refresh;\n const pendingModuleIDs = [id];\n const updatedModuleIDs = [];\n const seenModuleIDs = new Set();\n const refreshBoundaryIDs = new Set(); // In this loop, we will traverse the dependency tree upwards from the\n // changed module. Updates \"bubble\" up to the closest accepted parent.\n //\n // If we reach the module root and nothing along the way accepted the update,\n // we know hot reload is going to fail. In that case we return false.\n //\n // The main purpose of this loop is to figure out whether it's safe to apply\n // a hot update. It is only safe when the update was accepted somewhere\n // along the way upwards for each of its parent dependency module chains.\n //\n // If we didn't have this check, we'd risk re-evaluating modules that\n // have side effects and lead to confusing and meaningless crashes.\n\n while (pendingModuleIDs.length > 0) {\n const pendingID = pendingModuleIDs.pop(); // Don't process twice if we have a cycle.\n\n if (seenModuleIDs.has(pendingID)) {\n continue;\n }\n\n seenModuleIDs.add(pendingID); // If the module accepts itself, no need to bubble.\n // We can stop worrying about this module chain and pick the next one.\n\n const pendingModule = modules[pendingID];\n\n if (pendingModule != null) {\n const pendingHot = pendingModule.hot;\n\n if (pendingHot == null) {\n throw new Error(\n \"[Refresh] Expected module.hot to always exist in DEV.\"\n );\n } // A module can be accepted manually from within itself.\n\n let canAccept = pendingHot._didAccept;\n\n if (!canAccept && Refresh != null) {\n // Or React Refresh may mark it accepted based on exports.\n const isBoundary = isReactRefreshBoundary(\n Refresh,\n pendingModule.publicModule.exports\n );\n\n if (isBoundary) {\n canAccept = true;\n refreshBoundaryIDs.add(pendingID);\n }\n }\n\n if (canAccept) {\n updatedModuleIDs.push(pendingID);\n continue;\n }\n } // If we bubble through the roof, there is no way to do a hot update.\n // Bail out altogether. This is the failure case.\n\n const parentIDs = inverseDependencies[pendingID];\n\n if (parentIDs.length === 0) {\n // Reload the app because the hot reload can't succeed.\n // This should work both on web and React Native.\n performFullRefresh();\n return;\n } // This module didn't accept but maybe all its parents did?\n // Put them all in the queue to run the same set of checks.\n\n updatedModuleIDs.push(pendingID);\n parentIDs.forEach(parentID => pendingModuleIDs.push(parentID));\n } // If we reached here, it is likely that hot reload will be successful.\n // Run the actual factories.\n\n seenModuleIDs.clear();\n\n for (let i = 0; i < updatedModuleIDs.length; i++) {\n // Don't process twice if we have a cycle.\n const updatedID = updatedModuleIDs[i];\n\n if (seenModuleIDs.has(updatedID)) {\n continue;\n }\n\n seenModuleIDs.add(updatedID);\n const mod = modules[updatedID];\n\n if (mod == null) {\n throw new Error(\"[Refresh] Expected to find the updated module.\");\n }\n\n const prevExports = mod.publicModule.exports;\n const didError = runUpdatedModule(\n updatedID,\n updatedID === id ? factory : undefined,\n updatedID === id ? dependencyMap : undefined\n );\n const nextExports = mod.publicModule.exports;\n\n if (didError) {\n // The user was shown a redbox about module initialization.\n // There's nothing for us to do here until it's fixed.\n return;\n }\n\n if (refreshBoundaryIDs.has(updatedID)) {\n // Since we just executed the code for it, it's possible\n // that the new exports make it ineligible for being a boundary.\n const isNoLongerABoundary = !isReactRefreshBoundary(\n Refresh,\n nextExports\n ); // It can also become ineligible if its exports are incompatible\n // with the previous exports.\n // For example, if you add/remove/change exports, we'll want\n // to re-execute the importing modules, and force those components\n // to re-render. Similarly, if you convert a class component\n // to a function, we want to invalidate the boundary.\n\n const didInvalidate = shouldInvalidateReactRefreshBoundary(\n Refresh,\n prevExports,\n nextExports\n );\n\n if (isNoLongerABoundary || didInvalidate) {\n // We'll be conservative. The only case in which we won't do a full\n // reload is if all parent modules are also refresh boundaries.\n // In that case we'll add them to the current queue.\n const parentIDs = inverseDependencies[updatedID];\n\n if (parentIDs.length === 0) {\n // Looks like we bubbled to the root. Can't recover from that.\n performFullRefresh();\n return;\n } // Schedule all parent refresh boundaries to re-run in this loop.\n\n for (let j = 0; j < parentIDs.length; j++) {\n const parentID = parentIDs[j];\n const parentMod = modules[parentID];\n\n if (parentMod == null) {\n throw new Error(\"[Refresh] Expected to find parent module.\");\n }\n\n const canAcceptParent = isReactRefreshBoundary(\n Refresh,\n parentMod.publicModule.exports\n );\n\n if (canAcceptParent) {\n // All parents will have to re-run too.\n refreshBoundaryIDs.add(parentID);\n updatedModuleIDs.push(parentID);\n } else {\n performFullRefresh();\n return;\n }\n }\n }\n }\n }\n\n if (Refresh != null) {\n // Debounce a little in case there are multiple updates queued up.\n // This is also useful because __accept may be called multiple times.\n if (reactRefreshTimeout == null) {\n reactRefreshTimeout = setTimeout(() => {\n reactRefreshTimeout = null; // Update React components.\n\n Refresh.performReactRefresh();\n }, 30);\n }\n }\n };\n\n const runUpdatedModule = function(id, factory, dependencyMap) {\n const mod = modules[id];\n\n if (mod == null) {\n throw new Error(\"[Refresh] Expected to find the module.\");\n }\n\n const hot = mod.hot;\n\n if (!hot) {\n throw new Error(\"[Refresh] Expected module.hot to always exist in DEV.\");\n }\n\n if (hot._disposeCallback) {\n try {\n hot._disposeCallback();\n } catch (error) {\n console.error(\n `Error while calling dispose handler for module ${id}: `,\n error\n );\n }\n }\n\n if (factory) {\n mod.factory = factory;\n }\n\n if (dependencyMap) {\n mod.dependencyMap = dependencyMap;\n }\n\n mod.hasError = false;\n mod.error = undefined;\n mod.importedAll = EMPTY;\n mod.importedDefault = EMPTY;\n mod.isInitialized = false;\n const prevExports = mod.publicModule.exports;\n mod.publicModule.exports = {};\n hot._didAccept = false;\n hot._acceptCallback = null;\n hot._disposeCallback = null;\n metroRequire(id);\n\n if (mod.hasError) {\n // This error has already been reported via a redbox.\n // We know it's likely a typo or some mistake that was just introduced.\n // Our goal now is to keep the rest of the application working so that by\n // the time user fixes the error, the app isn't completely destroyed\n // underneath the redbox. So we'll revert the module object to the last\n // successful export and stop propagating this update.\n mod.hasError = false;\n mod.isInitialized = true;\n mod.error = null;\n mod.publicModule.exports = prevExports; // We errored. Stop the update.\n\n return true;\n }\n\n if (hot._acceptCallback) {\n try {\n hot._acceptCallback();\n } catch (error) {\n console.error(\n `Error while calling accept handler for module ${id}: `,\n error\n );\n }\n } // No error.\n\n return false;\n };\n\n const performFullRefresh = () => {\n /* global window */\n if (\n typeof window !== \"undefined\" &&\n window.location != null &&\n typeof window.location.reload === \"function\"\n ) {\n window.location.reload();\n } else {\n // This is attached in setUpDeveloperTools.\n const Refresh = metroRequire.Refresh;\n\n if (Refresh != null) {\n Refresh.performFullRefresh();\n } else {\n console.warn(\"Could not reload the application after an edit.\");\n }\n }\n }; // Modules that only export components become React Refresh boundaries.\n\n var isReactRefreshBoundary = function(Refresh, moduleExports) {\n if (Refresh.isLikelyComponentType(moduleExports)) {\n return true;\n }\n\n if (moduleExports == null || typeof moduleExports !== \"object\") {\n // Exit if we can't iterate over exports.\n return false;\n }\n\n let hasExports = false;\n let areAllExportsComponents = true;\n\n for (const key in moduleExports) {\n hasExports = true;\n\n if (key === \"__esModule\") {\n continue;\n }\n\n const desc = Object.getOwnPropertyDescriptor(moduleExports, key);\n\n if (desc && desc.get) {\n // Don't invoke getters as they may have side effects.\n return false;\n }\n\n const exportValue = moduleExports[key];\n\n if (!Refresh.isLikelyComponentType(exportValue)) {\n areAllExportsComponents = false;\n }\n }\n\n return hasExports && areAllExportsComponents;\n };\n\n var shouldInvalidateReactRefreshBoundary = (\n Refresh,\n prevExports,\n nextExports\n ) => {\n const prevSignature = getRefreshBoundarySignature(Refresh, prevExports);\n const nextSignature = getRefreshBoundarySignature(Refresh, nextExports);\n\n if (prevSignature.length !== nextSignature.length) {\n return true;\n }\n\n for (let i = 0; i < nextSignature.length; i++) {\n if (prevSignature[i] !== nextSignature[i]) {\n return true;\n }\n }\n\n return false;\n }; // When this signature changes, it's unsafe to stop at this refresh boundary.\n\n var getRefreshBoundarySignature = (Refresh, moduleExports) => {\n const signature = [];\n signature.push(Refresh.getFamilyByType(moduleExports));\n\n if (moduleExports == null || typeof moduleExports !== \"object\") {\n // Exit if we can't iterate over exports.\n // (This is important for legacy environments.)\n return signature;\n }\n\n for (const key in moduleExports) {\n if (key === \"__esModule\") {\n continue;\n }\n\n const desc = Object.getOwnPropertyDescriptor(moduleExports, key);\n\n if (desc && desc.get) {\n continue;\n }\n\n const exportValue = moduleExports[key];\n signature.push(key);\n signature.push(Refresh.getFamilyByType(exportValue));\n }\n\n return signature;\n };\n\n var registerExportsForReactRefresh = (Refresh, moduleExports, moduleID) => {\n Refresh.register(moduleExports, moduleID + \" %exports%\");\n\n if (moduleExports == null || typeof moduleExports !== \"object\") {\n // Exit if we can't iterate over exports.\n // (This is important for legacy environments.)\n return;\n }\n\n for (const key in moduleExports) {\n const desc = Object.getOwnPropertyDescriptor(moduleExports, key);\n\n if (desc && desc.get) {\n // Don't invoke getters as they may have side effects.\n continue;\n }\n\n const exportValue = moduleExports[key];\n const typeID = moduleID + \" %exports% \" + key;\n Refresh.register(exportValue, typeID);\n }\n };\n\n global.__accept = metroHotUpdateModule;\n}\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @polyfill\n * @nolint\n * @format\n */\n\n/* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void, no-control-regex */\n\n/**\n * This pipes all of our console logging functions to native logging so that\n * JavaScript errors in required modules show up in Xcode via NSLog.\n */\nconst inspect = (function() {\n // Copyright Joyent, Inc. and other Node contributors.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n //\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n //\n // https://github.com/joyent/node/blob/master/lib/util.js\n\n function inspect(obj, opts) {\n var ctx = {\n seen: [],\n formatValueCalls: 0,\n stylize: stylizeNoColor,\n };\n return formatValue(ctx, obj, opts.depth);\n }\n\n function stylizeNoColor(str, styleType) {\n return str;\n }\n\n function arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n }\n\n function formatValue(ctx, value, recurseTimes) {\n ctx.formatValueCalls++;\n if (ctx.formatValueCalls > 200) {\n return `[TOO BIG formatValueCalls ${\n ctx.formatValueCalls\n } exceeded limit of 200]`;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (\n isError(value) &&\n (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)\n ) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '',\n array = false,\n braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(\n ctx,\n value,\n recurseTimes,\n visibleKeys,\n key,\n array,\n );\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n }\n\n function formatPrimitive(ctx, value) {\n if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple =\n \"'\" +\n JSON.stringify(value)\n .replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') +\n \"'\";\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value)) return ctx.stylize('' + value, 'number');\n if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value)) return ctx.stylize('null', 'null');\n }\n\n function formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n }\n\n function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(\n formatProperty(\n ctx,\n value,\n recurseTimes,\n visibleKeys,\n String(i),\n true,\n ),\n );\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(\n formatProperty(ctx, value, recurseTimes, visibleKeys, key, true),\n );\n }\n });\n return output;\n }\n\n function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || {value: value[key]};\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str\n .split('\\n')\n .map(function(line) {\n return ' ' + line;\n })\n .join('\\n')\n .substr(2);\n } else {\n str =\n '\\n' +\n str\n .split('\\n')\n .map(function(line) {\n return ' ' + line;\n })\n .join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n }\n\n function reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return (\n braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1]\n );\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n }\n\n // NOTE: These type checking functions intentionally don't use `instanceof`\n // because it is fragile and can be easily faked with `Object.create()`.\n function isArray(ar) {\n return Array.isArray(ar);\n }\n\n function isBoolean(arg) {\n return typeof arg === 'boolean';\n }\n\n function isNull(arg) {\n return arg === null;\n }\n\n function isNullOrUndefined(arg) {\n return arg == null;\n }\n\n function isNumber(arg) {\n return typeof arg === 'number';\n }\n\n function isString(arg) {\n return typeof arg === 'string';\n }\n\n function isSymbol(arg) {\n return typeof arg === 'symbol';\n }\n\n function isUndefined(arg) {\n return arg === void 0;\n }\n\n function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n }\n\n function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n }\n\n function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n }\n\n function isError(e) {\n return (\n isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error)\n );\n }\n\n function isFunction(arg) {\n return typeof arg === 'function';\n }\n\n function objectToString(o) {\n return Object.prototype.toString.call(o);\n }\n\n function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }\n\n return inspect;\n})();\n\nconst OBJECT_COLUMN_NAME = '(index)';\nconst LOG_LEVELS = {\n trace: 0,\n info: 1,\n warn: 2,\n error: 3,\n};\nconst INSPECTOR_LEVELS = [];\nINSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug';\nINSPECTOR_LEVELS[LOG_LEVELS.info] = 'log';\nINSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning';\nINSPECTOR_LEVELS[LOG_LEVELS.error] = 'error';\n\n// Strip the inner function in getNativeLogFunction(), if in dev also\n// strip method printing to originalConsole.\nconst INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1;\n\nfunction getNativeLogFunction(level) {\n return function() {\n let str;\n if (arguments.length === 1 && typeof arguments[0] === 'string') {\n str = arguments[0];\n } else {\n str = Array.prototype.map\n .call(arguments, function(arg) {\n return inspect(arg, {depth: 10});\n })\n .join(', ');\n }\n\n let logLevel = level;\n if (str.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) {\n // React warnings use console.error so that a stack trace is shown,\n // but we don't (currently) want these to show a redbox\n // (Note: Logic duplicated in ExceptionsManager.js.)\n logLevel = LOG_LEVELS.warn;\n }\n if (global.__inspectorLog) {\n global.__inspectorLog(\n INSPECTOR_LEVELS[logLevel],\n str,\n [].slice.call(arguments),\n INSPECTOR_FRAMES_TO_SKIP,\n );\n }\n if (groupStack.length) {\n str = groupFormat('', str);\n }\n global.nativeLoggingHook(str, logLevel);\n };\n}\n\nfunction repeat(element, n) {\n return Array.apply(null, Array(n)).map(function() {\n return element;\n });\n}\n\nfunction consoleTablePolyfill(rows) {\n // convert object -> array\n if (!Array.isArray(rows)) {\n var data = rows;\n rows = [];\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n var row = data[key];\n row[OBJECT_COLUMN_NAME] = key;\n rows.push(row);\n }\n }\n }\n if (rows.length === 0) {\n global.nativeLoggingHook('', LOG_LEVELS.info);\n return;\n }\n\n var columns = Object.keys(rows[0]).sort();\n var stringRows = [];\n var columnWidths = [];\n\n // Convert each cell to a string. Also\n // figure out max cell width for each column\n columns.forEach(function(k, i) {\n columnWidths[i] = k.length;\n for (var j = 0; j < rows.length; j++) {\n var cellStr = (rows[j][k] || '?').toString();\n stringRows[j] = stringRows[j] || [];\n stringRows[j][i] = cellStr;\n columnWidths[i] = Math.max(columnWidths[i], cellStr.length);\n }\n });\n\n // Join all elements in the row into a single string with | separators\n // (appends extra spaces to each cell to make separators | aligned)\n function joinRow(row, space) {\n var cells = row.map(function(cell, i) {\n var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join('');\n return cell + extraSpaces;\n });\n space = space || ' ';\n return cells.join(space + '|' + space);\n }\n\n var separators = columnWidths.map(function(columnWidth) {\n return repeat('-', columnWidth).join('');\n });\n var separatorRow = joinRow(separators, '-');\n var header = joinRow(columns);\n var table = [header, separatorRow];\n\n for (var i = 0; i < rows.length; i++) {\n table.push(joinRow(stringRows[i]));\n }\n\n // Notice extra empty line at the beginning.\n // Native logging hook adds \"RCTLog >\" at the front of every\n // logged string, which would shift the header and screw up\n // the table\n global.nativeLoggingHook('\\n' + table.join('\\n'), LOG_LEVELS.info);\n}\n\nconst GROUP_PAD = '\\u2502'; // Box light vertical\nconst GROUP_OPEN = '\\u2510'; // Box light down+left\nconst GROUP_CLOSE = '\\u2518'; // Box light up+left\n\nconst groupStack = [];\n\nfunction groupFormat(prefix, msg) {\n // Insert group formatting before the console message\n return groupStack.join('') + prefix + ' ' + (msg || '');\n}\n\nfunction consoleGroupPolyfill(label) {\n global.nativeLoggingHook(groupFormat(GROUP_OPEN, label), LOG_LEVELS.info);\n groupStack.push(GROUP_PAD);\n}\n\nfunction consoleGroupCollapsedPolyfill(label) {\n global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info);\n groupStack.push(GROUP_PAD);\n}\n\nfunction consoleGroupEndPolyfill() {\n groupStack.pop();\n global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info);\n}\n\nfunction consoleAssertPolyfill(expression, label) {\n if (!expression) {\n global.nativeLoggingHook('Assertion failed: ' + label, LOG_LEVELS.error);\n }\n}\n\nif (global.nativeLoggingHook) {\n const originalConsole = global.console;\n // Preserve the original `console` as `originalConsole`\n if (__DEV__ && originalConsole) {\n const descriptor = Object.getOwnPropertyDescriptor(global, 'console');\n if (descriptor) {\n Object.defineProperty(global, 'originalConsole', descriptor);\n }\n }\n\n global.console = {\n error: getNativeLogFunction(LOG_LEVELS.error),\n info: getNativeLogFunction(LOG_LEVELS.info),\n log: getNativeLogFunction(LOG_LEVELS.info),\n warn: getNativeLogFunction(LOG_LEVELS.warn),\n trace: getNativeLogFunction(LOG_LEVELS.trace),\n debug: getNativeLogFunction(LOG_LEVELS.trace),\n table: consoleTablePolyfill,\n group: consoleGroupPolyfill,\n groupEnd: consoleGroupEndPolyfill,\n groupCollapsed: consoleGroupCollapsedPolyfill,\n assert: consoleAssertPolyfill,\n };\n\n Object.defineProperty(console, '_isPolyfilled', {\n value: true,\n enumerable: false,\n });\n\n // If available, also call the original `console` method since that is\n // sometimes useful. Ex: on OS X, this will let you see rich output in\n // the Safari Web Inspector console.\n if (__DEV__ && originalConsole) {\n Object.keys(console).forEach(methodName => {\n const reactNativeMethod = console[methodName];\n if (originalConsole[methodName]) {\n console[methodName] = function() {\n // TODO(T43930203): remove this special case once originalConsole.assert properly checks\n // the condition\n if (methodName === 'assert') {\n if (!arguments[0]) {\n originalConsole.assert(...arguments);\n }\n } else {\n originalConsole[methodName](...arguments);\n }\n reactNativeMethod.apply(console, arguments);\n };\n }\n });\n\n // The following methods are not supported by this polyfill but\n // we still should pass them to original console if they are\n // supported by it.\n [\n 'clear',\n 'dir',\n 'dirxml',\n 'groupCollapsed',\n 'profile',\n 'profileEnd',\n ].forEach(methodName => {\n if (typeof originalConsole[methodName] === 'function') {\n console[methodName] = function() {\n originalConsole[methodName](...arguments);\n };\n }\n });\n }\n} else if (!global.console) {\n const log = global.print || function consoleLoggingStub() {};\n global.console = {\n error: log,\n info: log,\n log: log,\n warn: log,\n trace: log,\n debug: log,\n table: log,\n };\n\n Object.defineProperty(console, '_isPolyfilled', {\n value: true,\n enumerable: false,\n });\n}\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n * @polyfill\n */\n\nlet _inGuard = 0;\n\ntype ErrorHandler = (error: mixed, isFatal: boolean) => void;\ntype Fn<Args, Return> = (...Args) => Return;\n\n/**\n * This is the error handler that is called when we encounter an exception\n * when loading a module. This will report any errors encountered before\n * ExceptionsManager is configured.\n */\nlet _globalHandler: ErrorHandler = function onError(\n e: mixed,\n isFatal: boolean,\n) {\n throw e;\n};\n\n/**\n * The particular require runtime that we are using looks for a global\n * `ErrorUtils` object and if it exists, then it requires modules with the\n * error handler specified via ErrorUtils.setGlobalHandler by calling the\n * require function with applyWithGuard. Since the require module is loaded\n * before any of the modules, this ErrorUtils must be defined (and the handler\n * set) globally before requiring anything.\n */\nconst ErrorUtils = {\n setGlobalHandler(fun: ErrorHandler): void {\n _globalHandler = fun;\n },\n getGlobalHandler(): ErrorHandler {\n return _globalHandler;\n },\n reportError(error: mixed): void {\n _globalHandler && _globalHandler(error, false);\n },\n reportFatalError(error: mixed): void {\n // NOTE: This has an untyped call site in Metro.\n _globalHandler && _globalHandler(error, true);\n },\n applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(\n fun: Fn<TArgs, TOut>,\n context?: ?mixed,\n args?: ?TArgs,\n // Unused, but some code synced from www sets it to null.\n unused_onError?: null,\n // Some callers pass a name here, which we ignore.\n unused_name?: ?string,\n ): ?TOut {\n try {\n _inGuard++;\n // $FlowFixMe: TODO T48204745 (1) apply(context, null) is fine. (2) array -> rest array should work\n return fun.apply(context, args);\n } catch (e) {\n ErrorUtils.reportError(e);\n } finally {\n _inGuard--;\n }\n return null;\n },\n applyWithGuardIfNeeded<TArgs: $ReadOnlyArray<mixed>, TOut>(\n fun: Fn<TArgs, TOut>,\n context?: ?mixed,\n args?: ?TArgs,\n ): ?TOut {\n if (ErrorUtils.inGuard()) {\n // $FlowFixMe: TODO T48204745 (1) apply(context, null) is fine. (2) array -> rest array should work\n return fun.apply(context, args);\n } else {\n ErrorUtils.applyWithGuard(fun, context, args);\n }\n return null;\n },\n inGuard(): boolean {\n return !!_inGuard;\n },\n guard<TArgs: $ReadOnlyArray<mixed>, TOut>(\n fun: Fn<TArgs, TOut>,\n name?: ?string,\n context?: ?mixed,\n ): ?(...TArgs) => ?TOut {\n // TODO: (moti) T48204753 Make sure this warning is never hit and remove it - types\n // should be sufficient.\n if (typeof fun !== 'function') {\n console.warn('A function must be passed to ErrorUtils.guard, got ', fun);\n return null;\n }\n const guardName = name ?? fun.name ?? '<generated guard>';\n function guarded(...args: TArgs): ?TOut {\n return ErrorUtils.applyWithGuard(\n fun,\n context ?? this,\n args,\n null,\n guardName,\n );\n }\n\n return guarded;\n },\n};\n\nglobal.ErrorUtils = ErrorUtils;\n\nexport type ErrorUtilsT = typeof ErrorUtils;\n","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @polyfill\n * @nolint\n */\n\n(function() {\n 'use strict';\n\n const hasOwnProperty = Object.prototype.hasOwnProperty;\n\n /**\n * Returns an array of the given object's own enumerable entries.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries\n */\n if (typeof Object.entries !== 'function') {\n Object.entries = function(object) {\n // `null` and `undefined` values are not allowed.\n if (object == null) {\n throw new TypeError('Object.entries called on non-object');\n }\n\n const entries = [];\n for (const key in object) {\n if (hasOwnProperty.call(object, key)) {\n entries.push([key, object[key]]);\n }\n }\n return entries;\n };\n }\n\n /**\n * Returns an array of the given object's own enumerable entries.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values\n */\n if (typeof Object.values !== 'function') {\n Object.values = function(object) {\n // `null` and `undefined` values are not allowed.\n if (object == null) {\n throw new TypeError('Object.values called on non-object');\n }\n\n const values = [];\n for (const key in object) {\n if (hasOwnProperty.call(object, key)) {\n values.push(object[key]);\n }\n }\n return values;\n };\n }\n})();\n","import { foo } from \"./module.js\"\n\nfoo();\n","export function foo() {\n throw new Error(\"lets throw!\");\n}\n"],"x_facebook_sources":[null,[{"names":["<global>","global.$RefreshReg$","global.$RefreshSig$","<anonymous>","clear","define","metroRequire","initializingModuleIds.slice.map$argument_0","metroImportDefault","metroImportAll","guardedLoadModule","unpackModuleId","packModuleId","registerSegment","loadModuleImplementation","unknownModuleError","moduleThrewError","metroRequire.Systrace.beginEvent","metroRequire.Systrace.endEvent","metroRequire.getModules","createHotReloadingObject","hot.accept","hot.dispose","metroHotUpdateModule","parentIDs.forEach$argument_0","setTimeout$argument_0","runUpdatedModule","performFullRefresh","isReactRefreshBoundary","shouldInvalidateReactRefreshBoundary","getRefreshBoundarySignature","registerExportsForReactRefresh"],"mappings":"AAA;wBCyB,QD;wBEE,MC,YH;AIG;CJM;AKO;CL2C;AME;aCyB,2DD;CNe;AQE;CRoB;ASI;CTmC;AUK;CViB;AWK;CXO;AYI;CZE;AaK;CbE;AcE;8BbqE;SaE;CduD;AeE;CfU;AgBE;ChBK;gBiBI,QjB;ckBC,QlB;4BmBG;GnBE;iCoBE;cCK;ODG;eEC;OFE;GpBG;+BuBI;wBCgG,2CD;yCEgG;SFI;GvBG;2B0BE;G1BuE;6B2BE;G3BkB;+B4BE;G5BmC;6C6BE;G7BmB;oC8BE;G9B2B;uC+BE;G/BqB"}],[{"names":["<global>","<anonymous>","inspect","stylizeNoColor","arrayToHash","array.forEach$argument_0","formatValue","keys.map$argument_0","formatPrimitive","formatError","formatArray","keys.forEach$argument_0","formatProperty","str.split.map$argument_0","reduceToSingleString","output.reduce$argument_0","isArray","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isRegExp","isObject","isDate","isError","isFunction","objectToString","hasOwnProperty","getNativeLogFunction","Array.prototype.map.call$argument_1","repeat","Array.apply.map$argument_0","consoleTablePolyfill","columns.forEach$argument_0","joinRow","row.map$argument_0","columnWidths.map$argument_0","groupFormat","consoleGroupPolyfill","consoleGroupCollapsedPolyfill","consoleGroupEndPolyfill","consoleAssertPolyfill","Object.keys.forEach$argument_0","methodName","forEach$argument_0","consoleLoggingStub"],"mappings":"AAA;iBCiB;ECwB;GDO;EEE;GFE;EGE;kBCG;KDE;GHG;EKE;wBC6F;ODS;GLM;EOE;GPgB;EQE;GRE;ESE;iBCkB;KDM;GTE;EWE;mBC4B;eDE;qBCQ;iBDE;GX0B;EaE;+BCE;KDI;Gbc;EeI;GfE;EgBE;GhBE;EiBE;GjBE;EkBE;GlBE;EmBE;GnBE;EoBE;GpBE;EqBE;GrBE;EsBE;GtBE;EuBE;GvBE;EwBE;GxBE;EyBE;GzBE;E0BE;G1BK;E2BE;G3BE;E4BE;G5BE;E6BE;G7BE;CDG;A+BmB;S9BC;yB+BM;S/BE;G8BuB;C/BC;AiCE;yCCC;GDE;CjCC;AmCE;kBCwB;GDQ;EEI;wBCC;KDG;GFG;oCIE;GJE;CnCc;AwCQ;CxCG;AyCE;CzCG;A0CE;C1CG;A2CE;C3CG;A4CE;C5CI;iC6CmC;8BCG;SDW;K7CE;c+CY;8BDE;SCE;K/CE;8BgDG,gChD"}],[{"names":["<global>","onError","ErrorUtils.setGlobalHandler","ErrorUtils.getGlobalHandler","ErrorUtils.reportError","ErrorUtils.reportFatalError","ErrorUtils.applyWithGuard","ErrorUtils.applyWithGuardIfNeeded","ErrorUtils.inGuard","ErrorUtils.guard","guarded"],"mappings":"AAA;mCCqB;CDK;EEW;GFE;EGC;GHE;EIC;GJE;EKC;GLG;EMC;GNmB;EOC;GPY;EQC;GRE;ESC;ICY;KDQ;GTG"}],[{"names":["<global>","<anonymous>","entries","values"],"mappings":"AAA;CCW;qBCU;KDa;oBEQ;KFa;CDE"}],[{"names":["<global>"],"mappings":"AAA"}],[{"names":["<global>","foo"],"mappings":"AAA,OC;CDE"}]],"names":["global","__r","metroRequire","__d","factory","moduleId","dependencyMap","modules","mod","hasError","importedAll","EMPTY","importedDefault","isInitialized","publicModule","exports","__c","clear","__registerSegment","segmentID","moduleDefiner","moduleDefinersBySegmentID","hasOwnProperty","Object","create","moduleIdReallyIsNumber","module","guardedLoadModule","metroImportDefault","__esModule","default","metroImportAll","key","call","importDefault","importAll","inGuard","ErrorUtils","returnValue","loadModuleImplementation","e","reportFatalError","ID_MASK_SHIFT","LOCAL_ID_MASK","unpackModuleId","segmentId","localId","packModuleId","value","length","_unpackModuleId","definer","nativeRequire","_unpackModuleId2","Error","moduleThrewError","error","_module","moduleObject","id","undefined","inspect","stylizeNoColor","str","styleType","arrayToHash","array","hash","forEach","val","idx","formatValue","ctx","recurseTimes","formatValueCalls","primitive","formatPrimitive","keys","visibleKeys","isError","indexOf","formatError","isFunction","name","stylize","isRegExp","RegExp","prototype","toString","isDate","Date","ar","output","base","braces","Array","isArray","toUTCString","seen","push","formatArray","map","formatProperty","pop","reduceToSingleString","isUndefined","simple","JSON","stringify","replace","isNumber","isBoolean","isNull","i","l","String","match","desc","getOwnPropertyDescriptor","get","set","split","line","join","substr","reduce","prev","cur","numLinesEst","arg","re","isObject","objectToString","d","o","obj","prop","opts","depth","OBJECT_COLUMN_NAME","LOG_LEVELS","trace","info","warn","INSPECTOR_LEVELS","INSPECTOR_FRAMES_TO_SKIP","getNativeLogFunction","level","arguments","logLevel","slice","__inspectorLog","groupStack","groupFormat","nativeLoggingHook","repeat","element","n","apply","GROUP_PAD","GROUP_OPEN","GROUP_CLOSE","prefix","msg","console","log","debug","table","rows","data","row","columns","sort","stringRows","columnWidths","k","j","cellStr","Math","max","separatorRow","joinRow","columnWidth","space","cells","cell","group","label","groupEnd","groupCollapsed","assert","expression","defineProperty","enumerable","print","_inGuard","_globalHandler","isFatal","setGlobalHandler","fun","getGlobalHandler","reportError","applyWithGuard","context","args","unused_onError","unused_name","applyWithGuardIfNeeded","guard","_ref","guardName","_len","_key","this","entries","object","TypeError","values","r","foo"],"mappings":";cCUA,aAGAA,EAAOC,IAAMC,EACbF,EAAOG,IA6BP,SAAgBC,EAASC,EAAUC,GACjC,GAAyB,MAArBC,EAAQF,GAaV,OAGF,IAAMG,GACJF,cAAAA,EACAF,QAAAA,EACAK,UAAU,EACVC,YAAaC,EACbC,gBAAiBD,EACjBE,eAAe,EACfC,cACEC,aAGJR,EAAQF,GAAYG,GAxDtBR,EAAOgB,IAAMC,EACbjB,EAAOkB,kBA0NP,SAAyBC,EAAWC,GAClCC,EAA0BF,GAAaC,GA1NzC,IAAIb,EAAUU,IAGRN,KAEJW,KAAsBA,eAQxB,SAASL,IAKP,OAJAV,EAAUgB,OAAOC,OAAO,MAyD1B,SAAStB,EAAaG,GAepB,IAAMoB,EAAyBpB,EAqBzBqB,EAASnB,EAAQkB,GACvB,OAAOC,GAAUA,EAAOb,cACpBa,EAAOZ,aAAaC,QACpBY,EAAkBF,EAAwBC,GAGhD,SAASE,EAAmBvB,GAM1B,IAAMoB,EAAyBpB,EAE/B,GACEE,EAAQkB,IACRlB,EAAQkB,GAAwBb,kBAAoBD,EAEpD,OAAOJ,EAAQkB,GAAwBb,gBAGzC,IAAMG,EAAUb,EAAauB,GACvBb,EACJG,GAAWA,EAAQc,WAAad,EAAQe,QAAUf,EAEpD,OAAQR,EAAQkB,GAAwBb,gBAAkBA,EAK5D,SAASmB,EAAe1B,GAMtB,IAAMoB,EAAyBpB,EAE/B,GACEE,EAAQkB,IACRlB,EAAQkB,GAAwBf,cAAgBC,EAEhD,OAAOJ,EAAQkB,GAAwBf,YAGzC,IACIA,EADEK,EAAUb,EAAauB,GAG7B,GAAIV,GAAWA,EAAQc,WACrBnB,EAAcK,MACT,CAGL,GAFAL,KAEIK,EACF,IAAK,IAAMiB,KAAOjB,EACZO,EAAeW,KAAKlB,EAASiB,KAC/BtB,EAAYsB,GAAOjB,EAAQiB,IAKjCt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MzL,KAAOuL,EACZjM,EAAeW,KAAKsL,EAAQvL,IAC9ByL,EAAOtH,KAAKoH,EAAOvL,IAGvB,OAAOyL,KA3Cb;6BCTA,EAFAC,EAAArF,EAAA,IAEAsF;mFCFO,WACH,MAAM,IAAIrK,MAAM"}
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/inlining/module.js b/backend/app/services/testdata/sourcemapcache/inlining/module.js
new file mode 100644
index 00000000..b3292400
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/inlining/module.js
@@ -0,0 +1,2 @@
+function n(n){!function(n){throw new Error(n)}(n)}const t=()=>n("wat");window.addEventListener("load",(()=>{document.querySelector("button").addEventListener("click",t)}));
+//# sourceMappingURL=module.js.map
diff --git a/backend/app/services/testdata/sourcemapcache/inlining/module.js.map b/backend/app/services/testdata/sourcemapcache/inlining/module.js.map
new file mode 100644
index 00000000..5de18233
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/inlining/module.js.map
@@ -0,0 +1,26 @@
+{
+ "version": 3,
+ "file": "module.js",
+ "sources": [
+ "../src/bar.js",
+ "../src/foo.js",
+ "../src/app.js"
+ ],
+ "sourcesContent": [
+ "import foo from './foo';\n\nexport default function bar(msg) {\n foo(msg);\n}\n\n",
+ "export default function foo(msg) {\n throw new Error(msg);\n}\n",
+ "import bar from \"./bar\";\n\nconst buttonCallback = () => bar(\"wat\");\n\nwindow.addEventListener(\"load\", () => {\n document.querySelector(\"button\").addEventListener(\"click\", buttonCallback);\n});\n"
+ ],
+ "names": [
+ "bar",
+ "msg",
+ "Error",
+ "foo",
+ "buttonCallback",
+ "window",
+ "addEventListener",
+ "document",
+ "querySelector"
+ ],
+ "mappings": "AAEe,SAASA,EAAIC,ICFb,SAAaA,GAC1B,MAAM,IAAIC,MAAMD,EAClB,CDCEE,CAAIF,EACN,CEFA,MAAMG,EAAiB,IAAMJ,EAAI,OAEjCK,OAAOC,iBAAiB,QAAQ,KAC9BC,SAASC,cAAc,UAAUF,iBAAiB,QAASF,EAAe"
+}
diff --git a/backend/app/services/testdata/sourcemapcache/nofiles.js b/backend/app/services/testdata/sourcemapcache/nofiles.js
new file mode 100644
index 00000000..d448fdb3
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/nofiles.js
@@ -0,0 +1,17 @@
+function add(a, b) {
+ 'use strict';
+ return a + b;
+}
+function multiply(a, b) {
+ 'use strict';
+ return a * b;
+}
+function divide(a, b) {
+ 'use strict';
+ try {
+ return multiply(add(a, b), a, b) / c;
+ } catch (e) {
+ Raven.captureException(e);
+ }
+}
+//# sourceMappingURL=nofiles.js.map
diff --git a/backend/app/services/testdata/sourcemapcache/nofiles.js.map b/backend/app/services/testdata/sourcemapcache/nofiles.js.map
new file mode 100644
index 00000000..677a6fa3
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/nofiles.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":[null,null],"names":["add","a","b","multiply","divide","c","e","Raven","captureException"],"mappings":"AAAA,QAASA,KAAIC,EAAGC,GACf,YACA,OAAOD,GAAIC,ECFZ,QAASC,UAASF,EAAGC,GACpB,YACA,OAAOD,GAAIC,EAEZ,QAASE,QAAOH,EAAGC,GAClB,YACA,KACC,MAAOC,UAASH,IAAIC,EAAGC,GAAID,EAAGC,GAAKG,EAClC,MAAOC,GACRC,MAAMC,iBAAiBF","sourcesContent":["function add(a, b) {\n\t\"use strict\";\n\treturn a + b; // fôo\n}\n","function multiply(a, b) {\n\t\"use strict\";\n\treturn a * b;\n}\nfunction divide(a, b) {\n\t\"use strict\";\n\ttry {\n\t\treturn multiply(add(a, b), a, b) / c;\n\t} catch (e) {\n\t\tRaven.captureException(e);\n\t}\n}\n"]}
diff --git a/backend/app/services/testdata/sourcemapcache/preact-missing-source-contents.module.js.map b/backend/app/services/testdata/sourcemapcache/preact-missing-source-contents.module.js.map
new file mode 100644
index 00000000..1706d348
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/preact-missing-source-contents.module.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"preact.module.js","sources":["../src/constants.js","../src/util.js","../src/options.js","../src/create-element.js","../src/component.js","../src/create-context.js","../src/diff/children.js","../src/diff/props.js","../src/diff/index.js","../src/render.js","../src/clone-element.js","../src/diff/catch-error.js"],"sourcesContent":["contents of constants.js",null,"contents of options.js",null,"contents of component.js","contents of create-context.js","contents of children.js","contents of props.js","contents of index.js","contents of render.js","contents of clone-element.js"],"names":["slice","options","vnodeId","isValidElement","rerenderQueue","defer","prevDebounce","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","undefined","createVNode","original","vnode","constructor","createRef","current","Fragment","Component","context","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","c","push","process","debounceRendering","queue","sort","a","b","some","component","commitQueue","oldVNode","oldDom","parentDom","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","newDom","firstChildDom","refs","oldChildren","oldChildrenLength","Array","isArray","reorderChildren","placeChild","unmount","applyRef","tmp","toChildArray","out","nextDom","sibDom","outer","appendChild","nextSibling","insertBefore","diffProps","dom","newProps","oldProps","hydrate","setProperty","setStyle","style","value","test","name","oldValue","useCapture","o","cssText","replace","toLowerCase","_listeners","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","setAttribute","removeAttribute","event","newVNode","isNew","oldState","snapshot","clearProcessingException","provider","componentContext","newType","contextType","prototype","render","doRender","sub","state","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","diffed","root","cb","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","innerHTML","checked","parentVNode","skipRemove","r","componentWillUnmount","this","replaceNode","firstChild","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","splice","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","then","bind","resolve","setTimeout"],"mappings":"AAAO,IC0BMA,ECfPC,ECRFC,EA6FSC,EC0ETC,EAQEC,EAcFC,EC9LOC,ELFEC,EAAY,GACZC,EAAY,GACZC,EAAqB,oECO3B,SAASC,EAAOC,EAAKC,OAEtB,IAAIN,KAAKM,EAAOD,EAAIL,GAAKM,EAAMN,UACPK,EASvB,SAASE,EAAWC,OACtBC,EAAaD,EAAKC,WAClBA,GAAYA,EAAWC,YAAYF,GEVxC,SAAgBG,EAAcC,EAAMN,EAAOO,OAEzCC,EACAC,EACAf,EAHGgB,EAAkB,OAIjBhB,KAAKM,EACA,OAALN,EAAYc,EAAMR,EAAMN,GACd,OAALA,EAAYe,EAAMT,EAAMN,GAC5BgB,EAAgBhB,GAAKM,EAAMN,MAG7BiB,UAAUC,OAAS,IACtBF,EAAgBH,SACfI,UAAUC,OAAS,EAAIzB,EAAM0B,KAAKF,UAAW,GAAKJ,GAKjC,mBAARD,GAA2C,MAArBA,EAAKQ,iBAChCpB,KAAKY,EAAKQ,kBACaC,IAAvBL,EAAgBhB,KACnBgB,EAAgBhB,GAAKY,EAAKQ,aAAapB,WAKnCsB,EAAYV,EAAMI,EAAiBF,EAAKC,EAAK,MAe9C,SAASO,EAAYV,EAAMN,EAAOQ,EAAKC,EAAKQ,OAG5CC,EAAQ,CACbZ,KAAAA,EACAN,MAAAA,EACAQ,IAAAA,EACAC,IAAAA,MACW,QACF,SACD,MACF,cAKIM,MACE,SACA,KACZI,iBAAaJ,MACU,MAAZE,IAAqB5B,EAAU4B,UAI3B,MAAZA,GAAqC,MAAjB7B,EAAQ8B,OAAe9B,EAAQ8B,MAAMA,GAEtDA,EAGR,SAAgBE,UACR,CAAEC,QAAS,MAGZ,SAASC,EAAStB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EAAiB,SAAA4B,UACpB,MAATA,QAAuCH,IAAtBG,EAAMC,aCvExBI,EAAU4F,UAAUyD,SAAW,SAASE,EAAQC,OAE3CC,EAEHA,EADsB,MAAnBxB,UAA2BA,WAAoBA,KAAKjC,MACnDiC,SAEAA,SAAkB1J,EAAO,GAAI0J,KAAKjC,OAGlB,mBAAVuD,IAGVA,EAASA,EAAOhL,EAAO,GAAIkL,GAAIxB,KAAKxJ,QAGjC8K,GACHhL,EAAOkL,EAAGF,GAIG,MAAVA,GAEAtB,WACCuB,GAAUvB,SAAsBtH,KAAK6I,GACzC/I,EAAcwH,QAUhBjI,EAAU4F,UAAU8D,YAAc,SAASF,GACtCvB,qBAIW,EACVuB,GAAUvB,SAAsBtH,KAAK6I,GACzC/I,EAAcwH,QAchBjI,EAAU4F,UAAUC,OAAS9F,EAyFzB/B,EAAgB,GAQdC,EACa,mBAAX0L,QACJA,QAAQ/D,UAAUgE,KAAKC,KAAKF,QAAQG,WACpCC,WA2CJnJ,MAAyB,EC9NdzC,EAAI"}
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/preact.module.js b/backend/app/services/testdata/sourcemapcache/preact.module.js
new file mode 100644
index 00000000..b16d7688
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/preact.module.js
@@ -0,0 +1,2 @@
+var n,l,u,i,t,o,r,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y(l,f,t,o,null)}function y(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k(t):o,t.__h),z(u,t),t.__e!=o&&b(t)))})}function w(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}j(n,_,p=p||e,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h])}function x(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px"}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""))}if(C(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_||"option"===d&&_!==y.value)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1))}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var o,r,f;l.__&&l.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!o&&t||i).__k=v(d,null,[u]),r||e,e,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,o,r,f=a({},l.props);for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,o||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;export{S as render,q as hydrate,v as createElement,v as h,d as Fragment,p as createRef,i as isValidElement,_ as Component,B as cloneElement,D as createContext,A as toChildArray,l as options};
+//# sourceMappingURL=preact.module.js.map
diff --git a/backend/app/services/testdata/sourcemapcache/preact.module.js.map b/backend/app/services/testdata/sourcemapcache/preact.module.js.map
new file mode 100644
index 00000000..67996b1a
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/preact.module.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"preact.module.js","sources":["../src/constants.js","../src/util.js","../src/options.js","../src/create-element.js","../src/component.js","../src/create-context.js","../src/diff/children.js","../src/diff/props.js","../src/diff/index.js","../src/render.js","../src/clone-element.js","../src/diff/catch-error.js"],"sourcesContent":["export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from \"./constants\";\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-ignore We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (vnode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/**\n * Asynchronously schedule a callback\n * @type {(cb: () => void) => void}\n */\n/* istanbul ignore next */\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet queue;\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\trerenderQueue = [];\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\tqueue.some(c => {\n\t\t\tif (c._dirty) renderComponent(c);\n\t\t});\n\t}\n}\nprocess._rerenderCount = 0;\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {import('./internal').FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(enqueueRender);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array<import('../internal').PreactElement>} excessDomChildren\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tnull,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tnewDom = childVNode._dom;\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\t\tchildVNode._children === oldVNode._children\n\t\t\t) {\n\t\t\t\tchildVNode._nextDom = oldDom = reorderChildren(\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldDom,\n\t\t\t\t\tparentDom\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldVNode,\n\t\t\t\t\toldChildren,\n\t\t\t\t\tnewDom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) {\n\t\t\tif (\n\t\t\t\ttypeof newParentVNode.type == 'function' &&\n\t\t\t\toldChildren[i]._dom != null &&\n\t\t\t\toldChildren[i]._dom == newParentVNode._nextDom\n\t\t\t) {\n\t\t\t\t// If the newParentVNode.__nextDom points to a dom node that is about to\n\t\t\t\t// be unmounted, then get the next sibling of that vnode and set\n\t\t\t\t// _nextDom to it\n\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldParentVNode, i + 1);\n\t\t\t}\n\n\t\t\tunmount(oldChildren[i], oldChildren[i]);\n\t\t}\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\nfunction reorderChildren(childVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\tlet c = childVNode._children;\n\tlet tmp = 0;\n\tfor (; c && tmp < c.length; tmp++) {\n\t\tlet vnode = c[tmp];\n\t\tif (vnode) {\n\t\t\t// We typically enter this code path on sCU bailout, where we copy\n\t\t\t// oldVNode._children to newVNode._children. If that is the case, we need\n\t\t\t// to update the old children's _parent pointer to point to the newVNode\n\t\t\t// (childVNode here).\n\t\t\tvnode._parent = childVNode;\n\n\t\t\tif (typeof vnode.type == 'function') {\n\t\t\t\toldDom = reorderChildren(vnode, oldDom, parentDom);\n\t\t\t} else {\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tvnode,\n\t\t\t\t\tvnode,\n\t\t\t\t\tc,\n\t\t\t\t\tvnode._dom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nfunction placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\toldVNode == null ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j<oldChildrenLength; j+=2` is an alternative to `j++<oldChildrenLength/2`\n\t\t\tfor (\n\t\t\t\tlet sibDom = oldDom, j = 0;\n\t\t\t\t(sibDom = sibDom.nextSibling) && j < oldChildren.length;\n\t\t\t\tj += 2\n\t\t\t) {\n\t\t\t\tif (sibDom == newDom) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tparentDom.insertBefore(newDom, oldDom);\n\t\t\tnextDom = oldDom;\n\t\t}\n\t}\n\n\t// If we have pre-calculated the nextDOM node, use it. Else calculate it now\n\t// Strictly check for `undefined` here cuz `null` is a valid value of `nextDom`.\n\t// See more detail in create-element.js:createVNode\n\tif (nextDom !== undefined) {\n\t\toldDom = nextDom;\n\t} else {\n\t\toldDom = newDom.nextSibling;\n\t}\n\n\treturn oldDom;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\n/**\n * Diff the old and new properties of a VNode and apply changes to the DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to apply\n * changes to\n * @param {object} newProps The new props\n * @param {object} oldProps The old props\n * @param {boolean} isSvg Whether or not this node is an SVG node\n * @param {boolean} hydrate Whether or not we are in hydration mode\n */\nexport function diffProps(dom, newProps, oldProps, isSvg, hydrate) {\n\tlet i;\n\n\tfor (i in oldProps) {\n\t\tif (i !== 'children' && i !== 'key' && !(i in newProps)) {\n\t\t\tsetProperty(dom, i, null, oldProps[i], isSvg);\n\t\t}\n\t}\n\n\tfor (i in newProps) {\n\t\tif (\n\t\t\t(!hydrate || typeof newProps[i] == 'function') &&\n\t\t\ti !== 'children' &&\n\t\t\ti !== 'key' &&\n\t\t\ti !== 'value' &&\n\t\t\ti !== 'checked' &&\n\t\t\toldProps[i] !== newProps[i]\n\t\t) {\n\t\t\tsetProperty(dom, i, newProps[i], oldProps[i], isSvg);\n\t\t}\n\t}\n}\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture = name !== (name = name.replace(/Capture$/, ''));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else if (name !== 'dangerouslySetInnerHTML') {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// ARIA-attributes have a different notion of boolean values.\n\t\t// The value `false` is different from the attribute not\n\t\t// existing on the DOM, so we can't remove it. For non-boolean\n\t\t// ARIA-attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost us too many bytes. On top of\n\t\t// that other VDOM frameworks also always stringify `false`.\n\n\t\tif (typeof value === 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (\n\t\t\tvalue != null &&\n\t\t\t(value !== false || (name[0] === 'a' && name[1] === 'r'))\n\t\t) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tthis._listeners[e.type + false](options.event ? options.event(e) : e);\n}\n\nfunction eventProxyCapture(e) {\n\tthis._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import { EMPTY_OBJ } from '../constants';\nimport { Component, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { diffProps, setProperty } from './props';\nimport { assign, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array<import('../internal').PreactElement>} excessDomChildren\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').PreactElement} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\t// @ts-ignore The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-ignore Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\tc.props = newProps;\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\n\t\t\t\t\tc._vnode = newVNode;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\n\n\t\t\tc._dirty = false;\n\t\t\tc._vnode = newVNode;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n}\n\n/**\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-ignore Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-ignore See above ts-ignore on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = newVNode.type;\n\tlet i = 0;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tif (nodeType === 'svg') isSvg = true;\n\n\tif (excessDomChildren != null) {\n\t\tfor (; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild &&\n\t\t\t\t'setAttribute' in child === !!nodeType &&\n\t\t\t\t(nodeType ? child.localName === nodeType : child.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\t// @ts-ignore createTextNode returns Text, we expect PreactElement\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tif (isSvg) {\n\t\t\tdom = document.createElementNS(\n\t\t\t\t'http://www.w3.org/2000/svg',\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\tnodeType\n\t\t\t);\n\t\t} else {\n\t\t\tdom = document.createElement(\n\t\t\t\t// @ts-ignore We know `newVNode.type` is a string\n\t\t\t\tnodeType,\n\t\t\t\tnewProps.is && newProps\n\t\t\t);\n\t\t}\n\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value ||\n\t\t\t\t\t(nodeType === 'progress' && !i) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType === 'option' && i !== oldProps.value))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t'checked' in newProps &&\n\t\t\t\t(i = newProps.checked) !== undefined &&\n\t\t\t\ti !== dom.checked\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').VNode} vnode The virtual node to unmount\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\n * initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\n\t}\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(r[i], parentVNode, typeof vnode.type != 'function');\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove && vnode._dom != null) removeNode(vnode._dom);\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._dom = vnode._nextDom = undefined;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode === 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = (\n\t\t(!isHydrating && replaceNode) ||\n\t\tparentDom\n\t)._children = createElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.firstChild\n\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t? oldVNode._dom\n\t\t\t: parentDom.firstChild,\n\t\tisHydrating\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component, ctor, handled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n"],"names":["slice","options","vnodeId","isValidElement","rerenderQueue","defer","prevDebounce","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","undefined","createVNode","original","vnode","constructor","createRef","current","Fragment","Component","context","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","c","push","process","debounceRendering","queue","sort","a","b","some","component","commitQueue","oldVNode","oldDom","parentDom","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","newDom","firstChildDom","refs","oldChildren","oldChildrenLength","Array","isArray","reorderChildren","placeChild","unmount","applyRef","tmp","toChildArray","out","nextDom","sibDom","outer","appendChild","nextSibling","insertBefore","diffProps","dom","newProps","oldProps","hydrate","setProperty","setStyle","style","value","test","name","oldValue","useCapture","o","cssText","replace","toLowerCase","_listeners","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","setAttribute","removeAttribute","event","newVNode","isNew","oldState","snapshot","clearProcessingException","provider","componentContext","newType","contextType","prototype","render","doRender","sub","state","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","diffed","root","cb","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","innerHTML","checked","parentVNode","skipRemove","r","componentWillUnmount","this","replaceNode","firstChild","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","splice","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","Promise","then","bind","resolve","setTimeout"],"mappings":"AAAO,IC0BMA,ECfPC,ECRFC,EA6FSC,EC0ETC,EAQEC,EAcFC,EC9LOC,ELFEC,EAAY,GACZC,EAAY,GACZC,EAAqB,oECO3B,SAASC,EAAOC,EAAKC,OAEtB,IAAIN,KAAKM,EAAOD,EAAIL,GAAKM,EAAMN,UACPK,EASvB,SAASE,EAAWC,OACtBC,EAAaD,EAAKC,WAClBA,GAAYA,EAAWC,YAAYF,GEVxC,SAAgBG,EAAcC,EAAMN,EAAOO,OAEzCC,EACAC,EACAf,EAHGgB,EAAkB,OAIjBhB,KAAKM,EACA,OAALN,EAAYc,EAAMR,EAAMN,GACd,OAALA,EAAYe,EAAMT,EAAMN,GAC5BgB,EAAgBhB,GAAKM,EAAMN,MAG7BiB,UAA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 No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/simple/minified.js b/backend/app/services/testdata/sourcemapcache/simple/minified.js
new file mode 100644
index 00000000..46a3417b
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/simple/minified.js
@@ -0,0 +1 @@
+function t(){}export default t;
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/simple/minified.js.map b/backend/app/services/testdata/sourcemapcache/simple/minified.js.map
new file mode 100644
index 00000000..13ad226e
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/simple/minified.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["abcd"],"sources":["tests/fixtures/simple/original.js"],"sourcesContent":["// ./node_modules/.bin/terser -c -m --module tests/fixtures/simple/original.js --source-map includeSources -o tests/fixtures/simple/minified.js\nfunction abcd() {}\nexport default abcd;\n"],"mappings":"AACA,SAASA,oBACMA"}
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/simple/original.js b/backend/app/services/testdata/sourcemapcache/simple/original.js
new file mode 100644
index 00000000..6a2736b3
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/simple/original.js
@@ -0,0 +1,3 @@
+// ./node_modules/.bin/terser -c -m --module tests/fixtures/simple/original.js --source-map includeSources -o tests/fixtures/simple/minified.js
+function abcd() {}
+export default abcd;
diff --git a/backend/app/services/testdata/sourcemapcache/webpack/bundle.js b/backend/app/services/testdata/sourcemapcache/webpack/bundle.js
new file mode 100644
index 00000000..38e332ea
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/webpack/bundle.js
@@ -0,0 +1,2 @@
+(()=>{var r={562:r=>{r.exports=function(r){r()}},298:r=>{r.exports=function(){throw new Error("wat")}}},t={};function o(n){var e=t[n];if(void 0!==e)return e.exports;var s=t[n]={exports:{}};return r[n](s,s.exports,o),s.exports}(()=>{const r=o(298);o(562)(r)})()})();
+//# sourceMappingURL=bundle.js.map
\ No newline at end of file
diff --git a/backend/app/services/testdata/sourcemapcache/webpack/bundle.js.map b/backend/app/services/testdata/sourcemapcache/webpack/bundle.js.map
new file mode 100644
index 00000000..07767c24
--- /dev/null
+++ b/backend/app/services/testdata/sourcemapcache/webpack/bundle.js.map
@@ -0,0 +1,32 @@
+{
+ "version": 3,
+ "file": "bundle.js",
+ "mappings": "qBAAAA,EAAOC,QAAU,SAAaC,GAC5BA,M,QCDFF,EAAOC,QAAU,WACf,MAAM,IAAIE,MAAM,UCAdC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaN,QAGrB,IAAID,EAASI,EAAyBE,GAAY,CAGjDL,QAAS,IAOV,OAHAQ,EAAoBH,GAAUN,EAAQA,EAAOC,QAASI,GAG/CL,EAAOC,Q,MCrBf,MAAMS,EAAM,EAAQ,KACR,EAAQ,IAGlBC,CAGED,I",
+ "sources": [
+ "webpack:///./bar.js",
+ "webpack:///./foo.js",
+ "webpack:///webpack/bootstrap",
+ "webpack:///./app.js"
+ ],
+ "sourcesContent": [
+ "module.exports = function bar(f) {\n f();\n};\n",
+ "module.exports = function foo () {\n throw new Error(\"wat\");\n};\n",
+ "// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n",
+ "const foo = require(\"./foo\");\nconst bar = require(\"./bar\");\n\nfunction baz(f) {\n bar(f);\n}\n\nbaz(foo);\n"
+ ],
+ "names": [
+ "module",
+ "exports",
+ "f",
+ "Error",
+ "__webpack_module_cache__",
+ "__webpack_require__",
+ "moduleId",
+ "cachedModule",
+ "undefined",
+ "__webpack_modules__",
+ "foo",
+ "bar"
+ ],
+ "sourceRoot": ""
+}
diff --git a/backend/app/services/testdata/symbolic_parity_results.txt b/backend/app/services/testdata/symbolic_parity_results.txt
new file mode 100644
index 00000000..b15aeb3f
--- /dev/null
+++ b/backend/app/services/testdata/symbolic_parity_results.txt
@@ -0,0 +1,119 @@
+symbolic parity results
+fixtures: getsentry/symbolic 925230e878ea25f6a0af88171fce93b6272cd30d
+regenerate: go test ./app/services/ -run TestResolveStackTraceSymbolicParity -record-symbolic
+PINNED frames intentionally deviate from symbolic; see sourcemapcache/README.md
+frames: 13 parity, 5 pinned deviations, 0 failing, 18 total
+
+[PASS] resolves_inlined_function :: module.js:1:63
+ location expected: ../src/app.js:3:30
+ location actual: ../src/app.js:3:30
+ name expected: buttonCallback
+ name actual: buttonCallback
+
+[PASS] resolves_inlined_function :: module.js:1:47
+ location expected: ../src/bar.js:4:3
+ location actual: ../src/bar.js:4:3
+ name expected: bar
+ name actual: bar
+
+[PASS] resolves_inlined_function :: module.js:1:34
+ location expected: ../src/foo.js:2:9
+ location actual: ../src/foo.js:2:9
+ name expected: (not asserted)
+ name actual: foo
+
+[PASS] resolves_inlined_function :: module.js:2:18
+ location expected: module.js:2:18
+ location actual: module.js:2:18
+ name expected: anonymous
+ name actual: anonymous
+
+[PASS] writes_simple_cache :: minified.js:1:11
+ location expected: tests/fixtures/simple/original.js:2:10
+ location actual: tests/fixtures/simple/original.js:2:10
+ name expected: abcd
+ name actual: abcd
+
+[PASS] resolves_location_from_cache :: preact.module.js:1:50
+ location expected: ../src/constants.js:3:35
+ location actual: ../src/constants.js:3:35
+ name expected: (not asserted)
+ name actual: IS_NON_DIMENSIONAL
+
+[PASS] resolves_location_from_cache :: preact.module.js:1:133
+ location expected: ../src/util.js:12:23
+ location actual: ../src/util.js:12:23
+ name expected: assign
+ name actual: assign
+
+[PINNED] resolves_location_from_cache :: preact.module.js:1:482
+ location expected: ../src/create-element.js:40:9
+ location actual: ../src/create-element.js:40:9
+ name parity target: createElement
+ name pinned: normalizedProps
+ name actual: normalizedProps
+
+[PASS] resolves_location_from_cache :: preact.module.js:1:9780
+ location expected: ../src/component.js:182:5
+ location actual: ../src/component.js:182:5
+ name expected: (not asserted)
+ name actual: defer
+
+[PASS] resolves_location_from_cache :: preact.module.js:1:9795
+ location expected: ../src/create-context.js:3:12
+ location actual: ../src/create-context.js:3:12
+ name expected: (not asserted)
+ name actual: i
+
+[PASS] missing_source_names :: nofiles.js:1:39
+ location expected: <unknown>:3:9
+ location actual: <unknown>:3:9
+ name expected: add
+ name actual: add
+
+[PASS] missing_source_contents :: preact-missing-source-contents.module.js:1:133
+ location expected: ../src/util.js:12:23
+ location actual: ../src/util.js:12:23
+ name expected: (not asserted)
+ name actual: obj
+
+[PASS] hermes_scope_lookup :: react-native-hermes:1:11940
+ location expected: module.js:2:11
+ location actual: module.js:2:11
+ name expected: foo
+ name actual: foo
+
+[PINNED] hermes_scope_lookup :: react-native-hermes:1:11858
+ location expected: input.js:3:1
+ location actual: input.js:3:1
+ name parity target: <global>
+ name pinned: anonymous
+ name actual: anonymous
+
+[PASS] metro_scope_lookup :: react-native-metro.js:7:101
+ location expected: module.js:2:11
+ location actual: module.js:2:11
+ name expected: foo
+ name actual: foo
+
+[PINNED] metro_scope_lookup :: react-native-metro.js:6:44
+ location expected: input.js:3:1
+ location actual: input.js:3:1
+ name parity target: <global>
+ name pinned: foo
+ name actual: foo
+
+[PINNED] webpack_scope_lookup :: bundle.js:1:85
+ location expected: webpack:///./foo.js:2:9
+ location actual: webpack:///./foo.js:2:9
+ name parity target: module.exports
+ name pinned: foo
+ name actual: foo
+
+[PINNED] webpack_scope_lookup :: bundle.js:1:44
+ location expected: webpack:///./bar.js:2:3
+ location actual: webpack:///./bar.js:2:3
+ name parity target: module.exports
+ name pinned: bar
+ name actual: bar
+
diff --git a/backend/cmd/run.go b/backend/cmd/run.go
index 8f95b60c..a4fd6589 100644
--- a/backend/cmd/run.go
+++ b/backend/cmd/run.go
@@ -109,11 +109,10 @@ func Run(opts ...Option) {
if err := cache.ProjectCache.Init(ctx); err != nil {
panic(fmt.Errorf("projects cache could not be initialized: %w", err))
}
- cache.InitSourceMapCache(
+ services.InitSourceMapCache(
parsePositiveInt(cfg.SourceMapCacheMaxEntries, 200),
int64(parsePositiveInt(cfg.SourceMapCacheMaxBytesMB, 500))*1024*1024,
)
- services.InitParsedSourceMapCache(parsePositiveInt(cfg.SourceMapParsedCacheMax, 5))
middleware.InitUseClientAuth()
middleware.InitUseAppAuth()
diff --git a/backend/go.mod b/backend/go.mod
index bfe70082..256c5630 100644
--- a/backend/go.mod
+++ b/backend/go.mod
@@ -70,7 +70,6 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.27.0 // indirect
- github.com/go-sourcemap/sourcemap v2.1.4+incompatible
github.com/goccy/go-json v0.10.2 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
diff --git a/backend/go.sum b/backend/go.sum
index 85992cf0..261c6acb 100644
--- a/backend/go.sum
+++ b/backend/go.sum
@@ -111,8 +111,6 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4=
github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
-github.com/go-sourcemap/sourcemap v2.1.4+incompatible h1:a+iTbH5auLKxaNwQFg0B+TCYl6lbukKPc7b5x0n1s6Q=
-github.com/go-sourcemap/sourcemap v2.1.4+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
diff --git a/docs/pages/client/js-sdk/sourcemap-upload.mdx b/docs/pages/client/js-sdk/sourcemap-upload.mdx
index abd14d07..24e74661 100644
--- a/docs/pages/client/js-sdk/sourcemap-upload.mdx
+++ b/docs/pages/client/js-sdk/sourcemap-upload.mdx
@@ -46,6 +46,10 @@ Flags take precedence over environment variables when both are set.
Individual source map files must not exceed **50MB**.
+## Maps Without Source File Names
+
+Some build pipelines produce source maps where the `sources` array contains `null` entries: the mappings and embedded source content are intact, but the original file names are missing. Traceway still deobfuscates these frames, resolving the line, column, and function name, and shows `<unknown>` in place of the file name (e.g. `<unknown>:3:9`). To get real file names in stack traces, configure your bundler to emit `sources` entries in its source maps.
+
## CI/CD Example (GitHub Actions)
```yaml
diff --git a/docs/pages/learn/_meta.json b/docs/pages/learn/_meta.json
index 6e772709..fb7bbee0 100644
--- a/docs/pages/learn/_meta.json
+++ b/docs/pages/learn/_meta.json
@@ -4,6 +4,7 @@
"traces": "Traces",
"ai-tracing": "AI Tracing",
"issues": "Issues",
+ "symbolication-js": "Symbolication (JS)",
"sessions": "Sessions",
"attributes": "Attributes",
"spans": "Spans",
diff --git a/docs/pages/learn/symbolication-js.mdx b/docs/pages/learn/symbolication-js.mdx
new file mode 100644
index 00000000..b8811c13
--- /dev/null
+++ b/docs/pages/learn/symbolication-js.mdx
@@ -0,0 +1,286 @@
+# Symbolication (JS)
+
+import { Callout } from "nextra/components";
+
+<Callout type="info">
+ **This is actively being worked on.** If you have ideas or suggestions for how symbolication should evolve, we want to hear them: reach out on [Discord](https://discord.gg/RZq9NT62nc) or open an issue on [GitHub](https://github.com/tracewayapp/traceway).
+</Callout>
+
+Symbolication is the process of translating minified production stack traces back into the original source locations your team actually wrote. Browsers report errors against the shipped bundle, so without symbolication an exception looks like this:
+
+```
+TypeError: Cannot read properties of undefined (reading 'name')
+anonymous()
+ app.bundle.js:1:48211
+anonymous()
+ app.bundle.js:1:13377
+```
+
+With source maps uploaded, Traceway stores it like this instead:
+
+```
+TypeError: Cannot read properties of undefined (reading 'name')
+renderUserCard()
+ src/components/UserCard.tsx:42:17
+handleClick()
+ src/pages/Profile.tsx:108:5
+```
+
+This page explains exactly how that translation works today, what is cached and when, how the pipeline is observable through metrics, where the current heuristics fall short, and how we verify the output. For how to upload source maps in the first place, see [Source Maps](/client/js-sdk/sourcemap-upload).
+
+## When Symbolication Runs
+
+Symbolication happens **once, at ingest**, inside `POST /api/report`:
+
+1. The report arrives from the JS SDK. If the project is a JS framework, the backend loads the project's source maps from the database: the set matching the report's `version` if one was sent, otherwise the latest uploaded set. This is why the `--version` flag on upload must match the SDK's `version` option.
+2. Each stack trace in the report is resolved frame by frame.
+3. The **resolved** trace is what gets hashed for grouping and stored in ClickHouse.
+
+Nothing is re-resolved when you view an issue. The trade-off: traces are immutable snapshots of the symbolication quality at the moment they arrived. Uploading better source maps improves future events, not past ones.
+
+## The Frame Format
+
+The JS SDK does not send the browser's raw `error.stack` string. Stack formats are not standardized: V8 (Chrome, Edge, Hermes) emits ` at funcName (file:line:col)`, while Firefox and JavaScriptCore (Safari) emit `funcName@file:line:col`. The SDK parses both families and normalizes every frame into a canonical two-line wire format: a function name line ending in `()`, then a location line indented by four spaces:
+
+```
+anonymous()
+ app.bundle.js:1:48211
+```
+
+The resolver recognizes location lines with a single regex:
+
+```
+^(\s{4})(.+):(\d+):(\d+)$
+```
+
+Anything that does not match (the error message, the name lines, blank lines) passes through untouched. This is the first invariant of the pipeline: **the resolver can only rewrite a line or leave it exactly as it was**. There is no failure mode that drops or corrupts a frame.
+
+## The Resolution Pipeline
+
+For each location line, in order:
+
+### 1. Find the right source map
+
+The frame's file name is matched against the uploaded maps by appending `.map`:
+
+| Frame file | Lookup attempts |
+|---|---|
+| `app.bundle.js` | `app.bundle.js.map`, then basename `app.bundle.js.map` |
+| `https://cdn.example.com/assets/app.bundle.js` | full name, then basename `app.bundle.js.map` |
+| `app.bundle.js?v=abc123` | query/fragment stripped, then `app.bundle.js.map` |
+
+No match: the line passes through unchanged.
+
+### 2. Get the parsed map
+
+The map comes from the in-memory cache described below. First use pays a storage read plus a parse; everything after is a memory lookup.
+
+### 3. Look up the position
+
+Browser stack traces use 1-based columns; the source map spec uses 0-based. The resolver subtracts 1 before the lookup and adds 1 back when printing. This off-by-one matters more than it sounds: minified bundles put the entire program on line 1, so being one column off can land on a *different token entirely* and resolve to the wrong original file.
+
+Here is a real lookup, taken verbatim from our test fixtures. The original file:
+
+```js
+// built with: terser -c -m --module original.js --source-map includeSources
+function abcd() {}
+export default abcd;
+```
+
+terser renames `abcd` to `t` and emits:
+
+```js
+function t(){}export default t;
+```
+
+with this source map:
+
+```json
+{
+ "version": 3,
+ "names": ["abcd"],
+ "sources": ["tests/fixtures/simple/original.js"],
+ "sourcesContent": ["...the original file, embedded..."],
+ "mappings": "AACA,SAASA,oBACMA"
+}
+```
+
+A frame pointing at `minified.js:1:11` (the `t` in `function t`) resolves through the `mappings` (delta-encoded VLQ segments of generated position, source index, original position, name index) to `tests/fixtures/simple/original.js:2:10`, with the name token `abcd`.
+
+### 4. Rewrite the lines
+
+The location line becomes `original-file:line:column` (same indentation). If a function name was resolved, the *name line directly above it* (the `anonymous()` line) is rewritten to `abcd()`.
+
+If the source map carries `"sources": [null]` entries (older uglify pipelines), the file name is rendered as `<unknown>` but the line, column, and name still resolve.
+
+A maximum of **50 frames** per trace are resolved; deeper frames pass through minified.
+
+## Function Names: The Regex Heuristic
+
+Locations come straight from the source map and are exact. Function names are harder, because a source map's `names` token at a position is the identifier *at that token*, not the name of the *enclosing function* that a stack trace conventionally shows. Getting the enclosing function right requires scope analysis: parsing the minified bundle into an AST and mapping positions to function scopes, which is what Sentry's symbolic does. Traceway does not store the minified bundle, only the `.map`, so scope analysis is not possible today.
+
+Instead we use a heuristic. Since most maps embed the original source (`sourcesContent`), the resolver takes the resolved original line and scans **backwards up to 50 lines** for something that looks like a function declaration:
+
+```
+(?:export\s+(?:default\s+)?)?function\s+(\w+) match: function declarations
+(?:const|let|var)\s+(\w+)\s*= match: variable assignments
+^\s*(?:async\s+)?(\w+)\s*\([^)]*\)\s*\{ match: method shorthand
+```
+
+The first match wins, with control flow keywords (`if`, `for`, `while`, `switch`, `catch`, `return`, `throw`, `else`) filtered out. When the heuristic finds something, it overrides the source map's name token. When it finds nothing, the name token is used as-is.
+
+### Where it works
+
+```js
+export function assign(obj, props) {
+ for (let i in props) obj[i] = props[i]; // error thrown here
+ return obj;
+}
+```
+
+Scanning backwards from the error line immediately hits `function assign`, which is correct. Simple module-level functions, exported functions, and arrow functions assigned to `const` all resolve well.
+
+### Where it fails, concretely
+
+The middle alternation matches **any** variable assignment, not just function expressions, and the scan has no notion of scope boundaries. From preact's `create-element.js`:
+
+```js
+export function createElement(type, props, children) {
+ let normalizedProps = {},
+ key, ref, i;
+ for (i in props) { // error around here (line 40)
+ ...
+ }
+}
+```
+
+Scanning backwards from line 40, the first match is `let normalizedProps =`, so the frame is named `normalizedProps` instead of `createElement`. Similar failure shapes:
+
+| Case | Correct name | Heuristic produces |
+|---|---|---|
+| Nearest declaration is a local variable | `createElement` | `normalizedProps` |
+| Top-level/module code (Hermes, Metro bundles) | `<global>` | `anonymous` or a nearby declaration |
+| CommonJS export assignment | `module.exports` | the inner function's name |
+| Sibling function that closed above the error line | enclosing function | the sibling |
+
+These are known, pinned deviations in our test suite (more on that below). Two design decisions contain the blast radius:
+
+1. **Names never affect grouping.** See the next section.
+2. **Locations are never heuristic.** The file, line, and column shown are exact source map output, so the click-through is right even when the label is wrong.
+
+## How Symbolication Interacts with Grouping
+
+Issue grouping hashes a normalized form of the **resolved** trace. Two normalization rules exist specifically because of JS symbolication:
+
+**Function name lines are collapsed.** A line ending in `()` that sits directly above a frame location line becomes `<fn>` before hashing (anchoring on the location line below means Go traces, whose file lines are tab-indented, are never touched):
+
+```
+createElement() becomes: <fn>
+ ../src/create-element.js:40:9 stays: ../src/create-element.js:40:9
+```
+
+So these two traces, identical except for resolved names, produce the **same hash** and land in the same issue:
+
+```
+Error: boom Error: boom
+ normalizedProps() createElement()
+ ../src/create-element.js:40:9 ../src/create-element.js:40:9
+```
+
+This means name quality can keep improving (including the future scope-analysis work) without re-bucketing your existing issues.
+
+**Columns are kept.** Minified bundles put everything on line 1, so when no source map matched, the column is the only thing distinguishing two different errors. `bundle.min.js:1:48211` and `bundle.min.js:1:91567` therefore hash differently, on purpose.
+
+One consequence to be aware of: a trace that fails symbolication (storage outage, see below) hashes differently than its symbolicated twin. During an outage the same logical error can transiently open a second issue group, which stops growing once storage recovers.
+
+## What Is Cached, How, and When
+
+Source maps for real applications are large (a 20 MB `.map` is unremarkable), and the parsed lookup structure is what actually serves frames. Traceway keeps **one in-memory cache** of parsed maps, keyed by the map's storage key.
+
+### What a cache entry contains
+
+When a map is parsed, only the four things the resolver ever reads are kept:
+
+| Field | Used for |
+|---|---|
+| `mappings` (decoded to 24-byte segments) | position lookup via binary search |
+| `sources` | original file names |
+| `sourcesContent` | the function name heuristic |
+| `names` | function name tokens |
+
+Everything else in the JSON (raw VLQ text, `file`, `sourceRoot` after resolution) is discarded, and **the raw file bytes exist only for the duration of the parse**. A parsed entry is typically 2 to 5 times the raw file size, and its actual in-memory size is measured at parse time, which is what the byte cap counts.
+
+### Cache policy
+
+| Property | Value |
+|---|---|
+| Keying | storage key, one entry per uploaded map file |
+| Capacity | `SOURCEMAP_CACHE_MAX_ENTRIES` (default 200) and `SOURCEMAP_CACHE_MAX_BYTES_MB` (default 500, measured parsed size) |
+| Eviction | least recently used, whenever either cap is exceeded |
+| Loading | deduplicated (singleflight): concurrent requests for the same map share one storage read and one parse |
+| Load timeout | 5 seconds per storage read |
+| Failures | never cached globally; retried on the next exception |
+
+### The lifecycle, end to end
+
+Say two exceptions referencing `app.bundle.js.map` arrive at the same time, on a cold cache:
+
+1. Both miss the cache and race to a mutex. The winner registers itself as the **loader** for that key; the loser sees the in-flight registration and parks.
+2. The loader reads the `.map` from storage (S3 or local disk, 5 second budget), parses it, throws the raw bytes away, and inserts the slim parsed entry.
+3. The parked request wakes and receives the exact same parsed instance. One read, one parse, one copy in memory, no matter how many requests piled up.
+4. Every subsequent exception is a pure memory hit, which also bumps the entry to the front of the LRU.
+5. If the cache later exceeds a cap, the least recently used entries are dropped. A dropped map is not an error; the next exception that needs it repeats steps 1 to 3.
+
+### When loading fails
+
+If the read times out, storage errors, or the map fails to parse:
+
+- The affected frames pass through **unchanged**, and the trace is stored as-is. Ingest is never blocked beyond the 5 second budget and never errors because of symbolication.
+- The failure is **not cached**, so the next exception retries immediately; recovery after an outage is instant.
+- Within a single trace, a failed map is attempted **once**, not once per frame, so a 50-frame trace cannot stack fifty timeouts.
+- Traceway self-reports the failure into its own monitoring project, throttled to one exception per minute with a count of suppressed occurrences.
+
+## Observability
+
+The backend self-reports cache metrics every 30 seconds (see [Capacity Monitoring](/server/capacity-monitoring) for the full operations view):
+
+| Metric | Meaning |
+|---|---|
+| `traceway.sourcemap.entries` | parsed maps currently in memory |
+| `traceway.sourcemap.bytes` | measured total size of those entries |
+| `traceway.sourcemap.hits.delta` | cache hits since the last tick |
+| `traceway.sourcemap.misses.delta` | loads triggered since the last tick |
+| `traceway.sourcemap.evictions.delta` | LRU evictions since the last tick |
+| `traceway.sourcemap.load_failures.delta` | failed loads (storage error, 5s timeout, unparseable map); each one is a trace stored unsymbolicated |
+| `traceway.sourcemap.parse_ms` | duration of the most recent parse |
+
+What healthy looks like: `misses.delta` near zero in steady state (every miss is a storage read plus a re-parse), `load_failures.delta` at zero (anything above zero means minified traces are reaching your issues), and `bytes` comfortably under the cap. A useful alert is `load_failures.delta` max greater than 0 over 5 minutes.
+
+## Limitations Today
+
+Honest list, in rough order of impact:
+
+1. **Function names are heuristic.** No scope analysis; the regex picks the nearest declaration-looking line above the error, which is wrong in the patterns shown above. Locations are unaffected.
+2. **The minified bundle is not stored**, only the `.map`. This is what blocks real scope analysis (and is the prerequisite for fixing limitation 1).
+3. **Symbolication is ingest-only.** Maps uploaded after an event arrived do not improve that event.
+4. **The 5 second load budget trades completeness for latency.** A map that takes longer to fetch produces an unsymbolicated trace (recorded in `load_failures.delta`) rather than a slow ingest.
+5. **Outages split grouping transiently.** Unsymbolicated and symbolicated versions of the same error hash differently.
+6. **Maps with multiple `null` sources are ambiguous.** Frames resolve as `<unknown>`, and the name heuristic may read the wrong embedded source, since empty file names cannot be told apart.
+7. **50 resolved frames per trace.** Deeper frames stay minified.
+8. **Hermes/Metro global code** is labeled `anonymous` rather than `<global>`.
+
+## How We Verify It
+
+The resolver is tested for parity against [getsentry/symbolic](https://github.com/getsentry/symbolic), the symbolication engine behind Sentry, using its own fixture suite (webpack, Metro, Hermes, preact, inlined functions, null-source maps). Every frame's expected file, line, column, and name is asserted, and the committed baseline currently reads:
+
+```
+frames: 13 parity, 5 pinned deviations, 0 failing, 18 total
+```
+
+All 18 frames match symbolic on **location**. The 5 deviations are **name-only**, are exactly the heuristic failures documented above, and are pinned: the tests assert our current output, so any drift fails the build, and each pinned frame records the symbolic name as the parity target to restore once scope analysis lands.
+
+## Related Pages
+
+- [Source Maps](/client/js-sdk/sourcemap-upload): uploading maps from CI and matching versions
+- [Issues](/learn/issues): grouping, lifecycle, and archiving
+- [Capacity Monitoring](/server/capacity-monitoring): cache sizing and alerting
diff --git a/docs/pages/server/capacity-monitoring.mdx b/docs/pages/server/capacity-monitoring.mdx
index 27e8a291..a0d55831 100644
--- a/docs/pages/server/capacity-monitoring.mdx
+++ b/docs/pages/server/capacity-monitoring.mdx
@@ -72,31 +72,29 @@ Not emitted in SQLite mode.
| `traceway.recordings.dropped.delta` | Segments dropped (queue full) since the last tick — data loss |
| `traceway.recordings.failed.delta` | Upload/insert failures since the last tick |
-### Source map caches (every 30s)
+### Source map cache (every 30s)
| Metric | Meaning |
|--------|---------|
-| `traceway.sourcemap.raw.entries` / `traceway.sourcemap.raw.bytes` | Raw `.map` files held in memory |
-| `traceway.sourcemap.raw.hits.delta` / `misses.delta` / `evictions.delta` | Raw cache traffic since the last tick |
-| `traceway.sourcemap.parsed.entries` | Parsed source maps held in memory |
-| `traceway.sourcemap.parsed.hits.delta` / `misses.delta` | Parsed cache traffic since the last tick |
-| `traceway.sourcemap.parsed.parse_ms` | Duration of the most recent source map parse |
+| `traceway.sourcemap.entries` / `traceway.sourcemap.bytes` | Parsed source maps held in memory and their estimated total size |
+| `traceway.sourcemap.hits.delta` / `misses.delta` / `evictions.delta` | Cache traffic since the last tick |
+| `traceway.sourcemap.load_failures.delta` | Failed source map loads (storage error, 5s timeout, unparseable map) since the last tick; affected traces are stored unsymbolicated |
+| `traceway.sourcemap.parse_ms` | Duration of the most recent source map parse |
## Source map cache sizing
-Source maps are cached at two levels: raw file bytes, and parsed lookup structures. **A parsed source map is roughly 5–10× its raw size** — a 20 MB `.map` file becomes 100–200 MB in memory. The parsed cache is capped at 5 entries by default for exactly this reason; with five large maps that's still up to ~1 GB.
+Source maps are cached parsed, in a single LRU keyed by file. Only the fields the resolver uses are kept (mappings, source names, embedded source contents); the raw `.map` bytes are held only while parsing. Concurrent requests for the same map share one storage read and one parse, so a given map exists in memory at most once. A parsed map is typically 2-5x its raw size; the cache cap is on the estimated in-memory size, not the raw file size.
| Variable | Default | Description |
|----------|---------|-------------|
-| `SOURCEMAP_CACHE_MAX_ENTRIES` | `200` | Max raw `.map` files kept in memory |
-| `SOURCEMAP_CACHE_MAX_BYTES_MB` | `500` | Max total raw bytes kept in memory |
-| `SOURCEMAP_PARSED_CACHE_MAX` | `5` | Max parsed source maps kept in memory |
+| `SOURCEMAP_CACHE_MAX_ENTRIES` | `200` | Max parsed source maps kept in memory |
+| `SOURCEMAP_CACHE_MAX_BYTES_MB` | `500` | Max estimated in-memory size of all parsed maps |
Sizing guidance:
-- **Small box (1–2 GB RAM):** `SOURCEMAP_CACHE_MAX_BYTES_MB=100`, `SOURCEMAP_PARSED_CACHE_MAX=2`.
-- **Plenty of RAM, many active source maps:** raise `SOURCEMAP_PARSED_CACHE_MAX` until `traceway.sourcemap.parsed.misses.delta` stays near zero in steady state — every parsed-cache miss re-parses a map, which burns CPU and briefly doubles its memory footprint.
-- Watch `traceway.proc.rss_mb` against your host RAM; if it climbs after exception views with stack traces, the parsed cache is the usual suspect.
+- **Small box (1-2 GB RAM):** `SOURCEMAP_CACHE_MAX_BYTES_MB=100`.
+- **Plenty of RAM, many active source maps:** raise `SOURCEMAP_CACHE_MAX_BYTES_MB` until `traceway.sourcemap.misses.delta` stays near zero in steady state; every miss is a storage read plus a re-parse, which burns CPU and briefly doubles that map's memory footprint.
+- Watch `traceway.proc.rss_mb` against your host RAM; if it climbs after exception views with stack traces, the source map cache is the usual suspect.
## Alerting on these metrics
@@ -126,7 +124,7 @@ Two more rule types complete the picture:
| `traceway.recordings.dropped.delta` | max | gt | 0 | 5 | warning | Recording segments being dropped — ingestion overload |
| `cpu.used_pcnt` | avg | gt | 80 | 10 | warning | Backend CPU-bound |
| `traceway.proc.rss_mb` | avg | gt | 80% of host RAM | 10 | warning | Memory pressure / OOM risk (e.g. 800 on a 1 GB box) |
-| `traceway.sourcemap.raw.bytes` | avg | gt | ~half of `SOURCEMAP_CACHE_MAX_BYTES_MB`×1MB | 30 | info | Source map cache growing — revisit sizing |
+| `traceway.sourcemap.bytes` | avg | gt | ~half of `SOURCEMAP_CACHE_MAX_BYTES_MB`×1MB | 30 | info | Source map cache growing, revisit sizing |
Plus the two non-metric rules: **Endpoint P95 threshold** on `POST /api/report` (e.g. 1000 ms over 10 minutes) and **No data** on `metrics` with 10 minutes of silence.
diff --git a/examples/devtesting-embedded/go.mod b/examples/devtesting-embedded/go.mod
index ac745f7d..43865d40 100644
--- a/examples/devtesting-embedded/go.mod
+++ b/examples/devtesting-embedded/go.mod
@@ -57,7 +57,6 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.30.2 // indirect
- github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect
github.com/goccy/go-json v0.10.6 // indirect
github.com/goccy/go-yaml v1.19.2 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
diff --git a/examples/devtesting-embedded/go.sum b/examples/devtesting-embedded/go.sum
index 7833664b..c8415819 100644
--- a/examples/devtesting-embedded/go.sum
+++ b/examples/devtesting-embedded/go.sum
@@ -116,8 +116,6 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.30.2 h1:JiFIMtSSHb2/XBUbWM4i/MpeQm9ZK2xqPNk8vgvu5JQ=
github.com/go-playground/validator/v10 v10.30.2/go.mod h1:mAf2pIOVXjTEBrwUMGKkCWKKPs9NheYGabeB04txQSc=
-github.com/go-sourcemap/sourcemap v2.1.4+incompatible h1:a+iTbH5auLKxaNwQFg0B+TCYl6lbukKPc7b5x0n1s6Q=
-github.com/go-sourcemap/sourcemap v2.1.4+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM=