From 9ac8ced7ff4cb846bbe2d79e04688a66a117a31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 5 Jun 2025 09:48:38 -0400 Subject: [PATCH 001/136] Fix scenario shortcut multiple usage errors Closes grafana/k6-cloud#1056 --- lib/executor/execution_config_shortcuts.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/executor/execution_config_shortcuts.go b/lib/executor/execution_config_shortcuts.go index dd268c389fb..7b2ef5df8f7 100644 --- a/lib/executor/execution_config_shortcuts.go +++ b/lib/executor/execution_config_shortcuts.go @@ -56,12 +56,12 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( case opts.Iterations.Valid: if len(opts.Stages) > 0 { // stages isn't nil (not set) and isn't explicitly set to empty return result, ExecutionConflictError( - "using multiple execution config shortcuts (`iterations` and `stages`) simultaneously is not allowed", + "using the execution configuration shortcuts `iterations` and `stages` simultaneously is not allowed", ) } if opts.Scenarios != nil { return opts, ExecutionConflictError( - "using an execution configuration shortcut (`iterations`) and `scenarios` simultaneously is not allowed", + "using the execution configuration shortcuts `iterations` and `scenarios` simultaneously is not allowed", ) } result.Scenarios = getSharedIterationsScenario(opts.Iterations, opts.Duration, opts.VUs) @@ -69,12 +69,12 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( case opts.Duration.Valid: if len(opts.Stages) > 0 { // stages isn't nil (not set) and isn't explicitly set to empty return result, ExecutionConflictError( - "using multiple execution config shortcuts (`duration` and `stages`) simultaneously is not allowed", + "using the execution config shortcuts `duration` and `stages` simultaneously is not allowed", ) } if opts.Scenarios != nil { return result, ExecutionConflictError( - "using an execution configuration shortcut (`duration`) and `scenarios` simultaneously is not allowed", + "using the execution configuration shortcuts `duration` and `scenarios` simultaneously is not allowed", ) } if opts.Duration.Duration <= 0 { @@ -88,7 +88,7 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( case len(opts.Stages) > 0: // stages isn't nil (not set) and isn't explicitly set to empty if opts.Scenarios != nil { return opts, ExecutionConflictError( - "using an execution configuration shortcut (`stages`) and `scenarios` simultaneously is not allowed", + "using the execution configuration shortcuts `stages` and `scenarios` simultaneously is not allowed", ) } result.Scenarios = getRampingVUsScenario(opts.Stages, opts.VUs) From d3400a6fd3397d3f153c59d3eafd474d5201ed47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 5 Jun 2025 10:10:00 -0400 Subject: [PATCH 002/136] Use consistent error messages --- lib/executor/execution_config_shortcuts.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/executor/execution_config_shortcuts.go b/lib/executor/execution_config_shortcuts.go index 7b2ef5df8f7..5fdab4c6581 100644 --- a/lib/executor/execution_config_shortcuts.go +++ b/lib/executor/execution_config_shortcuts.go @@ -56,12 +56,12 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( case opts.Iterations.Valid: if len(opts.Stages) > 0 { // stages isn't nil (not set) and isn't explicitly set to empty return result, ExecutionConflictError( - "using the execution configuration shortcuts `iterations` and `stages` simultaneously is not allowed", + "using `iterations` and `stages` options simultaneously is not allowed", ) } if opts.Scenarios != nil { return opts, ExecutionConflictError( - "using the execution configuration shortcuts `iterations` and `scenarios` simultaneously is not allowed", + "using `iterations` and `scenarios` options simultaneously is not allowed", ) } result.Scenarios = getSharedIterationsScenario(opts.Iterations, opts.Duration, opts.VUs) @@ -69,18 +69,18 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( case opts.Duration.Valid: if len(opts.Stages) > 0 { // stages isn't nil (not set) and isn't explicitly set to empty return result, ExecutionConflictError( - "using the execution config shortcuts `duration` and `stages` simultaneously is not allowed", + "using `duration` and `stages` options simultaneously is not allowed", ) } if opts.Scenarios != nil { return result, ExecutionConflictError( - "using the execution configuration shortcuts `duration` and `scenarios` simultaneously is not allowed", + "using `duration` and `scenarios` options simultaneously is not allowed", ) } if opts.Duration.Duration <= 0 { // TODO: move this validation to Validate()? return result, ExecutionConflictError( - "`duration` should be more than 0, for infinite duration use the externally-controlled executor", + "`duration` option should be more than 0, for infinite duration use the externally-controlled executor", ) } result.Scenarios = getConstantVUsScenario(opts.Duration, opts.VUs) @@ -88,7 +88,7 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( case len(opts.Stages) > 0: // stages isn't nil (not set) and isn't explicitly set to empty if opts.Scenarios != nil { return opts, ExecutionConflictError( - "using the execution configuration shortcuts `stages` and `scenarios` simultaneously is not allowed", + "using `stages` and `scenarios` options simultaneously is not allowed", ) } result.Scenarios = getRampingVUsScenario(opts.Stages, opts.VUs) @@ -100,7 +100,7 @@ func DeriveScenariosFromShortcuts(opts lib.Options, logger logrus.FieldLogger) ( // Check if we should emit some warnings if opts.VUs.Valid && opts.VUs.Int64 != 1 { logger.Warnf( - "the `vus=%d` option will be ignored, it only works in conjunction with `iterations`, `duration`, or `stages`", + "`vus=%d` option will be ignored, it only works in conjunction with `iterations`, `duration`, or `stages`", opts.VUs.Int64, ) } From 5e7c8ddd138d45daafc44eadb158ec9cb0768ba8 Mon Sep 17 00:00:00 2001 From: Inanc Gumus Date: Mon, 2 Jun 2025 17:01:59 -0400 Subject: [PATCH 003/136] Use CODECOV_TOKEN from Vault instead of Github --- .github/workflows/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0d5aea7e8d..a590690728b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,6 +94,9 @@ jobs: matrix: go-version: [1.24.x] platform: [ubuntu-22.04, windows-latest] + permissions: # required for Vault + id-token: write + contents: read runs-on: ${{ matrix.platform }} steps: - name: Checkout code @@ -127,11 +130,17 @@ jobs: done grep -h -v "^mode:" *.coverage >> coverage.txt rm -f *.coverage + # Sets CODECOV_TOKEN as an environment variable for the next step + - name: Get Codecov token + uses: grafana/shared-workflows/actions/get-vault-secrets@main + id: get-codecov-token + with: + repo_secrets: | + CODECOV_TOKEN=CODECOV_TOKEN:CODECOV_TOKEN - name: Upload coverage to Codecov env: CODECOV_BASH_VERSION: 1.0.1 CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | if [[ "${{ matrix.platform }}" == macos* ]]; then shopt -s expand_aliases From d9170f6e4948377c7e83f2ff1c62d69c3468168b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 5 Jun 2025 09:04:51 -0400 Subject: [PATCH 004/136] Tidy up test.yml vault steps Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com> --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a590690728b..404854667c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,8 +132,7 @@ jobs: rm -f *.coverage # Sets CODECOV_TOKEN as an environment variable for the next step - name: Get Codecov token - uses: grafana/shared-workflows/actions/get-vault-secrets@main - id: get-codecov-token + uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets/v1.2.1 with: repo_secrets: | CODECOV_TOKEN=CODECOV_TOKEN:CODECOV_TOKEN From a36a31bcb02cf66704f5324cd1857fa2f6f38f75 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 10:58:01 +0100 Subject: [PATCH 005/136] Add a count method in the injected script This will be used to retrieve the count of all elements that match the given selector. --- internal/js/modules/k6/browser/common/js/injected_script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/js/modules/k6/browser/common/js/injected_script.js b/internal/js/modules/k6/browser/common/js/injected_script.js index 46fef02a832..626608b4620 100644 --- a/internal/js/modules/k6/browser/common/js/injected_script.js +++ b/internal/js/modules/k6/browser/common/js/injected_script.js @@ -1041,4 +1041,9 @@ class InjectedScript { return this.waitForPredicateFunction(predicate, polling, timeout, ...args); } + + count(selector, root) { + const elements = this.querySelectorAll(selector, root || document); + return elements.length; + } } From a31cf6328d058ed12f6bae71403c2207202cfa69 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 11:04:36 +0100 Subject: [PATCH 006/136] Add count method on ElementHandle This performs the count call on the ElementHandle with the specified selector to look for within the element's DOM. Count will currently be called on the document itself (the whole DOM). --- .../k6/browser/common/element_handle.go | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/internal/js/modules/k6/browser/common/element_handle.go b/internal/js/modules/k6/browser/common/element_handle.go index 6ab10bc7776..c0b5e1cdad8 100644 --- a/internal/js/modules/k6/browser/common/element_handle.go +++ b/internal/js/modules/k6/browser/common/element_handle.go @@ -758,6 +758,36 @@ func (h *ElementHandle) waitForSelector( } } +func (h *ElementHandle) count(apiCtx context.Context, selector string) (int, error) { + parsedSelector, err := NewSelector(selector) + if err != nil { + return 0, err + } + + fn := ` + (node, injected, selector) => { + return injected.count(selector, node); + } + ` + eopts := evalOptions{ + forceCallable: true, + returnByValue: true, + } + result, err := h.evalWithScript( + apiCtx, + eopts, fn, parsedSelector, + ) + if err != nil { + return 0, err + } + switch r := result.(type) { + case float64: + return int(r), nil + default: + return 0, fmt.Errorf("unexpected value %v of type %T", r, r) + } +} + // AsElement returns this element handle. func (h *ElementHandle) AsElement() *ElementHandle { return h From 0eb10e56bc5e7e7798465d0b79f9f9f67f2058f5 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 11:07:02 +0100 Subject: [PATCH 007/136] Add count on Frame --- internal/js/modules/k6/browser/common/frame.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index 03d6785fe33..ef094569ed2 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -602,6 +602,22 @@ func (f *Frame) click(selector string, opts *FrameClickOptions) error { return nil } +func (f *Frame) count(selector string) (int, error) { + f.log.Debugf("Frame:count", "fid:%s furl:%q sel:%q", f.ID(), f.URL(), selector) + + document, err := f.document() + if err != nil { + return 0, fmt.Errorf("getting document: %w", err) + } + + c, err := document.count(f.ctx, selector) + if err != nil { + return 0, fmt.Errorf("counting elements: %w", err) + } + + return c, nil +} + // Check clicks the first element found that matches selector. func (f *Frame) Check(selector string, popts *FrameCheckOptions) error { f.log.Debugf("Frame:Check", "fid:%s furl:%q sel:%q", f.ID(), f.URL(), selector) From 261d39c4ec6cbb35a804e6a0d2c4358a47139197 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 11:09:23 +0100 Subject: [PATCH 008/136] Add count to the locator --- internal/js/modules/k6/browser/common/locator.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go index 3350a85f739..a5fe5b0e0b0 100644 --- a/internal/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -80,6 +80,13 @@ func (l *Locator) click(opts *FrameClickOptions) error { return l.frame.click(l.selector, opts) } +// Count APIs do not wait for the element to be present. It also does not set +// strict to true, allowing it to return the total number of elements matching +// the selector. +func (l *Locator) Count() (int, error) { + return l.frame.count(l.selector) +} + // Dblclick double clicks on an element using locator's selector with strict mode on. func (l *Locator) Dblclick(opts sobek.Value) error { l.log.Debugf("Locator:Dblclick", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts) From d1618217d794cf443c249c65cd06661602414d01 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 11:09:43 +0100 Subject: [PATCH 009/136] Add count to the locator mapping file --- internal/js/modules/k6/browser/browser/locator_mapping.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/locator_mapping.go b/internal/js/modules/k6/browser/browser/locator_mapping.go index a822a832033..3a71e3b23a1 100644 --- a/internal/js/modules/k6/browser/browser/locator_mapping.go +++ b/internal/js/modules/k6/browser/browser/locator_mapping.go @@ -31,6 +31,11 @@ func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen return nil, lo.Click(popts) //nolint:wrapcheck }), nil }, + "count": func() *sobek.Promise { + return k6ext.Promise(vu.Context(), func() (any, error) { + return lo.Count() //nolint:wrapcheck + }) + }, "dblclick": func(opts sobek.Value) *sobek.Promise { return k6ext.Promise(vu.Context(), func() (any, error) { return nil, lo.Dblclick(opts) //nolint:wrapcheck From 8ac0ee6ce9ca97d51b9a62b91fd01e39113e6b74 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 12:25:23 +0100 Subject: [PATCH 010/136] Add a test for locator.count --- .../modules/k6/browser/tests/locator_test.go | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/internal/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go index d1e1ae43654..85628c93b50 100644 --- a/internal/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -719,3 +719,54 @@ func TestSelectOption(t *testing.T) { `, tb.staticURL("select_options.html")) assert.Equal(t, sobek.Undefined(), got.Result()) } + +func TestCount(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + do func(*testBrowser, *common.Page) + }{ + { + "0", func(_ *testBrowser, p *common.Page) { + l := p.Locator("#NOTEXIST", nil) + c, err := l.Count() + require.NoError(t, err) + require.Equal(t, 0, c) + }, + }, + { + "1", func(_ *testBrowser, p *common.Page) { + l := p.Locator("#link", nil) + c, err := l.Count() + require.NoError(t, err) + require.Equal(t, 1, c) + }, + }, + { + "3", func(_ *testBrowser, p *common.Page) { + l := p.Locator("a", nil) + c, err := l.Count() + require.NoError(t, err) + require.Equal(t, 3, c) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + tb := newTestBrowser(t, withFileServer()) + p := tb.NewPage(nil) + opts := &common.FrameGotoOptions{ + Timeout: common.DefaultTimeout, + } + _, err := p.Goto( + tb.staticURL("locators.html"), + opts, + ) + tt.do(tb, p) + require.NoError(t, err) + }) + } +} From 2e73028aebd73a9d9bb2097ccd2e2717a5cd09f9 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 19 May 2025 14:24:59 +0100 Subject: [PATCH 011/136] Add Count to TestMappings --- internal/js/modules/k6/browser/browser/mapping_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go index 9c1b006bc25..ea5fa951972 100644 --- a/internal/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -518,6 +518,7 @@ type responseAPI interface { //nolint:interfacebloat type locatorAPI interface { //nolint:interfacebloat Clear(opts *common.FrameFillOptions) error Click(opts sobek.Value) error + Count() (int, error) Dblclick(opts sobek.Value) error SetChecked(checked bool, opts sobek.Value) error Check(opts sobek.Value) error From bf6a2debdd4dbe843f236503f7247b29f88fd8fc Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 5 Jun 2025 14:43:05 +0100 Subject: [PATCH 012/136] Fix user in dockerfile This fix helps those who are working with the image in k8s. Before this change the user had to work with runAsUser in the pod manifest file, which could lead to issues if the correct user wasn't used (which is only 12345). This will mitigate that risk since we default to working with 12345 and not k6. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c03b090b33e..e768de0adc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,10 @@ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -o /usr/b # Runtime stage FROM alpine:3.21 as release -RUN adduser -D -u 12345 -g 12345 k6 +RUN adduser -D -u 12345 -g 12345 COPY --from=builder /usr/bin/k6 /usr/bin/k6 -USER k6 +USER 12345 WORKDIR /home/k6 ENTRYPOINT ["k6"] @@ -24,7 +24,7 @@ USER root COPY --from=release /usr/bin/k6 /usr/bin/k6 RUN apk --no-cache add chromium-swiftshader -USER k6 +USER 12345 ENV CHROME_BIN=/usr/bin/chromium-browser ENV CHROME_PATH=/usr/lib/chromium/ From 5a19bb596999900aa344d45876c8a3e754013d14 Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 5 Jun 2025 14:53:07 +0100 Subject: [PATCH 013/136] Update Dockerfile Co-authored-by: Nadia Santalla --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e768de0adc6..790052ceda1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -o /usr/b # Runtime stage FROM alpine:3.21 as release -RUN adduser -D -u 12345 -g 12345 +RUN adduser -D -u 12345 -g 12345 k6 COPY --from=builder /usr/bin/k6 /usr/bin/k6 USER 12345 From 563bc4647e0c72289bcf3a38f7578345fe5b5f31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:27:20 +0200 Subject: [PATCH 014/136] build(deps): bump the googles group across 1 directory with 3 updates (#4835) Bumps the googles group with 1 update in the / directory: [google.golang.org/grpc](https://github.com/grpc/grpc-go). Updates `google.golang.org/grpc` from 1.72.1 to 1.73.0 - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.72.1...v1.73.0) Updates `google.golang.org/genproto/googleapis/api` from 0.0.0-20250218202821-56aae31c358a to 0.0.0-20250324211829-b45e905df463 - [Commits](https://github.com/googleapis/go-genproto/commits) Updates `google.golang.org/genproto/googleapis/rpc` from 0.0.0-20250218202821-56aae31c358a to 0.0.0-20250324211829-b45e905df463 - [Commits](https://github.com/googleapis/go-genproto/commits) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.73.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: googles - dependency-name: google.golang.org/genproto/googleapis/api dependency-version: 0.0.0-20250324211829-b45e905df463 dependency-type: indirect update-type: version-update:semver-patch dependency-group: googles - dependency-name: google.golang.org/genproto/googleapis/rpc dependency-version: 0.0.0-20250324211829-b45e905df463 dependency-type: indirect update-type: version-update:semver-patch dependency-group: googles ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +- go.sum | 12 +- .../googleapis/api/httpbody/httpbody.pb.go | 2 +- .../rpc/errdetails/error_details.pb.go | 2 +- .../googleapis/rpc/status/status.pb.go | 2 +- vendor/google.golang.org/grpc/CONTRIBUTING.md | 129 +++++++----- vendor/google.golang.org/grpc/README.md | 1 + .../grpc_binarylog_v1/binarylog.pb.go | 191 ++++++------------ vendor/google.golang.org/grpc/clientconn.go | 25 ++- .../grpc/credentials/credentials.go | 34 +++- .../grpc/credentials/insecure/insecure.go | 8 +- .../google.golang.org/grpc/credentials/tls.go | 16 ++ vendor/google.golang.org/grpc/dialoptions.go | 2 +- .../grpc/health/grpc_health_v1/health.pb.go | 82 +++----- .../grpc/internal/credentials/credentials.go | 14 -- .../grpc/internal/envconfig/envconfig.go | 6 +- .../grpc/internal/envconfig/xds.go | 5 + .../grpc/internal/grpcsync/event.go | 19 +- .../grpc/internal/internal.go | 7 + .../delegatingresolver/delegatingresolver.go | 49 +++-- .../grpc/internal/status/status.go | 8 + .../grpc/internal/transport/http2_client.go | 24 ++- .../grpc/internal/transport/http2_server.go | 5 +- .../grpc/internal/transport/http_util.go | 7 +- .../grpc/internal/transport/transport.go | 5 + .../grpc_reflection_v1/reflection.pb.go | 152 ++++---------- .../grpc_reflection_v1alpha/reflection.pb.go | 157 ++++---------- vendor/google.golang.org/grpc/rpc_util.go | 31 +++ .../google.golang.org/grpc/stats/handlers.go | 9 + vendor/google.golang.org/grpc/stream.go | 55 ++--- vendor/google.golang.org/grpc/version.go | 2 +- vendor/modules.txt | 12 +- 32 files changed, 513 insertions(+), 566 deletions(-) diff --git a/go.mod b/go.mod index 0f44082e076..cad2c9503a5 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( golang.org/x/sync v0.14.0 golang.org/x/term v0.32.0 golang.org/x/time v0.11.0 - google.golang.org/grpc v1.72.1 + google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 gopkg.in/guregu/null.v3 v3.3.0 gopkg.in/yaml.v3 v3.0.1 @@ -100,7 +100,7 @@ require ( go.opentelemetry.io/auto/sdk v1.1.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.25.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index bc3343ec5ba..34bb306d97e 100644 --- a/go.sum +++ b/go.sum @@ -326,17 +326,17 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= -google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= +google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= +google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= -google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= +google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y= diff --git a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go index f388426b08f..d083dde3ed7 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go index 3cd9a5bb8e6..bed9216d8d8 100644 --- a/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go index 6ad1b1c1df0..06a3f710633 100644 --- a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md index d9bfa6e1e7c..1de0ce66691 100644 --- a/vendor/google.golang.org/grpc/CONTRIBUTING.md +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -1,73 +1,102 @@ # How to contribute -We definitely welcome your patches and contributions to gRPC! Please read the gRPC -organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md) -and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding. +We welcome your patches and contributions to gRPC! Please read the gRPC +organization's [governance +rules](https://github.com/grpc/grpc-community/blob/master/governance.md) before +proceeding. If you are new to GitHub, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/) ## Legal requirements In order to protect both you and ourselves, you will need to sign the -[Contributor License Agreement](https://identity.linuxfoundation.org/projects/cncf). +[Contributor License +Agreement](https://identity.linuxfoundation.org/projects/cncf). When you create +your first PR, a link will be added as a comment that contains the steps needed +to complete this process. -## Guidelines for Pull Requests -How to get your contributions merged smoothly and quickly. +## Getting Started -- Create **small PRs** that are narrowly focused on **addressing a single - concern**. We often times receive PRs that are trying to fix several things at - a time, but only one fix is considered acceptable, nothing gets merged and - both author's & review's time is wasted. Create more PRs to address different - concerns and everyone will be happy. +A great way to start is by searching through our open issues. [Unassigned issues +labeled as "help +wanted"](https://github.com/grpc/grpc-go/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20label%3A%22Status%3A%20Help%20Wanted%22%20no%3Aassignee) +are especially nice for first-time contributors, as they should be well-defined +problems that already have agreed-upon solutions. -- If you are searching for features to work on, issues labeled [Status: Help - Wanted](https://github.com/grpc/grpc-go/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Status%3A+Help+Wanted%22) - is a great place to start. These issues are well-documented and usually can be - resolved with a single pull request. +## Code Style -- If you are adding a new file, make sure it has the copyright message template - at the top as a comment. You can copy over the message from an existing file - and update the year. +We follow [Google's published Go style +guide](https://google.github.io/styleguide/go/). Note that there are three +primary documents that make up this style guide; please follow them as closely +as possible. If a reviewer recommends something that contradicts those +guidelines, there may be valid reasons to do so, but it should be rare. -- The grpc package should only depend on standard Go packages and a small number - of exceptions. If your contribution introduces new dependencies which are NOT - in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a - discussion with gRPC-Go authors and consultants. +## Guidelines for Pull Requests -- For speculative changes, consider opening an issue and discussing it first. If - you are suggesting a behavioral or API change, consider starting with a [gRFC - proposal](https://github.com/grpc/proposal). +How to get your contributions merged smoothly and quickly: + +- Create **small PRs** that are narrowly focused on **addressing a single + concern**. We often receive PRs that attempt to fix several things at the same + time, and if one part of the PR has a problem, that will hold up the entire + PR. + +- For **speculative changes**, consider opening an issue and discussing it + first. If you are suggesting a behavioral or API change, consider starting + with a [gRFC proposal](https://github.com/grpc/proposal). Many new features + that are not bug fixes will require cross-language agreement. + +- If you want to fix **formatting or style**, consider whether your changes are + an obvious improvement or might be considered a personal preference. If a + style change is based on preference, it likely will not be accepted. If it + corrects widely agreed-upon anti-patterns, then please do create a PR and + explain the benefits of the change. + +- For correcting **misspellings**, please be aware that we use some terms that + are sometimes flagged by spell checkers. As an example, "if an only if" is + often written as "iff". Please do not make spelling correction changes unless + you are certain they are misspellings. - Provide a good **PR description** as a record of **what** change is being made and **why** it was made. Link to a GitHub issue if it exists. -- If you want to fix formatting or style, consider whether your changes are an - obvious improvement or might be considered a personal preference. If a style - change is based on preference, it likely will not be accepted. If it corrects - widely agreed-upon anti-patterns, then please do create a PR and explain the - benefits of the change. +- Maintain a **clean commit history** and use **meaningful commit messages**. + PRs with messy commit histories are difficult to review and won't be merged. + Before sending your PR, ensure your changes are based on top of the latest + `upstream/master` commits, and avoid rebasing in the middle of a code review. + You should **never use `git push -f`** unless absolutely necessary during a + review, as it can interfere with GitHub's tracking of comments. -- Unless your PR is trivial, you should expect there will be reviewer comments - that you'll need to address before merging. We'll mark it as `Status: Requires - Reporter Clarification` if we expect you to respond to these comments in a - timely manner. If the PR remains inactive for 6 days, it will be marked as - `stale` and automatically close 7 days after that if we don't hear back from - you. +- **All tests need to be passing** before your change can be merged. We + recommend you run tests locally before creating your PR to catch breakages + early on: -- Maintain **clean commit history** and use **meaningful commit messages**. PRs - with messy commit history are difficult to review and won't be merged. Use - `rebase -i upstream/master` to curate your commit history and/or to bring in - latest changes from master (but avoid rebasing in the middle of a code - review). + - `./scripts/vet.sh` to catch vet errors. + - `go test -cpu 1,4 -timeout 7m ./...` to run the tests. + - `go test -race -cpu 1,4 -timeout 7m ./...` to run tests in race mode. -- Keep your PR up to date with upstream/master (if there are merge conflicts, we - can't really merge your change). + Note that we have a multi-module repo, so `go test` commands may need to be + run from the root of each module in order to cause all tests to run. -- **All tests need to be passing** before your change can be merged. We - recommend you **run tests locally** before creating your PR to catch breakages - early on. - - `./scripts/vet.sh` to catch vet errors - - `go test -cpu 1,4 -timeout 7m ./...` to run the tests - - `go test -race -cpu 1,4 -timeout 7m ./...` to run tests in race mode + *Alternatively*, you may find it easier to push your changes to your fork on + GitHub, which will trigger a GitHub Actions run that you can use to verify + everything is passing. + +- If you are adding a new file, make sure it has the **copyright message** + template at the top as a comment. You can copy the message from an existing + file and update the year. + +- The grpc package should only depend on standard Go packages and a small number + of exceptions. **If your contribution introduces new dependencies**, you will + need a discussion with gRPC-Go maintainers. A GitHub action check will run on + every PR, and will flag any transitive dependency changes from any public + package. + +- Unless your PR is trivial, you should **expect reviewer comments** that you + will need to address before merging. We'll label the PR as `Status: Requires + Reporter Clarification` if we expect you to respond to these comments in a + timely manner. If the PR remains inactive for 6 days, it will be marked as + `stale`, and we will automatically close it after 7 days if we don't hear back + from you. Please feel free to ping issues or bugs if you do not get a response + within a week. -- Exceptions to the rules can be made if there's a compelling reason for doing so. +- Exceptions to the rules can be made if there's a compelling reason to do so. diff --git a/vendor/google.golang.org/grpc/README.md b/vendor/google.golang.org/grpc/README.md index b572707c623..f9a88d597ec 100644 --- a/vendor/google.golang.org/grpc/README.md +++ b/vendor/google.golang.org/grpc/README.md @@ -32,6 +32,7 @@ import "google.golang.org/grpc" - [Low-level technical docs](Documentation) from this repository - [Performance benchmark][] - [Examples](examples) +- [Contribution guidelines](CONTRIBUTING.md) ## FAQ diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index 825c31795f0..b1364a03252 100644 --- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc v5.27.1 // source: grpc/binlog/v1/binarylog.proto @@ -858,133 +858,68 @@ func (x *Address) GetIpPort() uint32 { var File_grpc_binlog_v1_binarylog_proto protoreflect.FileDescriptor -var file_grpc_binlog_v1_binarylog_proto_rawDesc = string([]byte{ - 0x0a, 0x1e, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x2f, 0x76, 0x31, - 0x2f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x11, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, - 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x07, 0x0a, 0x0c, 0x47, 0x72, 0x70, 0x63, 0x4c, 0x6f, 0x67, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x17, 0x0a, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x17, 0x73, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x5f, 0x63, - 0x61, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x73, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x65, 0x49, 0x64, 0x57, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, - 0x3d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3e, - 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, - 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x46, - 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, - 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, - 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x36, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, - 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x69, - 0x6c, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x2b, - 0x0a, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x54, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x70, - 0x65, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x22, 0xf5, 0x01, 0x0a, 0x09, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, - 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, - 0x52, 0x56, 0x45, 0x52, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x02, 0x12, 0x1d, 0x0a, - 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, - 0x4e, 0x54, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, - 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, - 0x52, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x04, 0x12, 0x20, 0x0a, 0x1c, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, - 0x5f, 0x48, 0x41, 0x4c, 0x46, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x05, 0x12, 0x1d, 0x0a, - 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, - 0x45, 0x52, 0x5f, 0x54, 0x52, 0x41, 0x49, 0x4c, 0x45, 0x52, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, - 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, - 0x4c, 0x10, 0x07, 0x22, 0x42, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x0e, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x43, 0x4c, 0x49, 0x45, - 0x4e, 0x54, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x53, - 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0xbb, 0x01, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, - 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x33, 0x0a, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x22, 0x47, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, - 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xb1, 0x01, 0x0a, 0x07, 0x54, 0x72, - 0x61, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x35, 0x0a, - 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x22, 0x42, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x36, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x37, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, - 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x69, - 0x70, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x45, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, - 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x50, 0x56, 0x34, 0x10, 0x01, 0x12, 0x0d, - 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x50, 0x56, 0x36, 0x10, 0x02, 0x12, 0x0d, 0x0a, - 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x58, 0x10, 0x03, 0x42, 0x5c, 0x0a, 0x14, - 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, - 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x67, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, - 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x62, 0x69, - 0x6e, 0x61, 0x72, 0x79, 0x6c, 0x6f, 0x67, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -}) +const file_grpc_binlog_v1_binarylog_proto_rawDesc = "" + + "\n" + + "\x1egrpc/binlog/v1/binarylog.proto\x12\x11grpc.binarylog.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbb\a\n" + + "\fGrpcLogEntry\x128\n" + + "\ttimestamp\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x17\n" + + "\acall_id\x18\x02 \x01(\x04R\x06callId\x125\n" + + "\x17sequence_id_within_call\x18\x03 \x01(\x04R\x14sequenceIdWithinCall\x12=\n" + + "\x04type\x18\x04 \x01(\x0e2).grpc.binarylog.v1.GrpcLogEntry.EventTypeR\x04type\x12>\n" + + "\x06logger\x18\x05 \x01(\x0e2&.grpc.binarylog.v1.GrpcLogEntry.LoggerR\x06logger\x12F\n" + + "\rclient_header\x18\x06 \x01(\v2\x1f.grpc.binarylog.v1.ClientHeaderH\x00R\fclientHeader\x12F\n" + + "\rserver_header\x18\a \x01(\v2\x1f.grpc.binarylog.v1.ServerHeaderH\x00R\fserverHeader\x126\n" + + "\amessage\x18\b \x01(\v2\x1a.grpc.binarylog.v1.MessageH\x00R\amessage\x126\n" + + "\atrailer\x18\t \x01(\v2\x1a.grpc.binarylog.v1.TrailerH\x00R\atrailer\x12+\n" + + "\x11payload_truncated\x18\n" + + " \x01(\bR\x10payloadTruncated\x12.\n" + + "\x04peer\x18\v \x01(\v2\x1a.grpc.binarylog.v1.AddressR\x04peer\"\xf5\x01\n" + + "\tEventType\x12\x16\n" + + "\x12EVENT_TYPE_UNKNOWN\x10\x00\x12\x1c\n" + + "\x18EVENT_TYPE_CLIENT_HEADER\x10\x01\x12\x1c\n" + + "\x18EVENT_TYPE_SERVER_HEADER\x10\x02\x12\x1d\n" + + "\x19EVENT_TYPE_CLIENT_MESSAGE\x10\x03\x12\x1d\n" + + "\x19EVENT_TYPE_SERVER_MESSAGE\x10\x04\x12 \n" + + "\x1cEVENT_TYPE_CLIENT_HALF_CLOSE\x10\x05\x12\x1d\n" + + "\x19EVENT_TYPE_SERVER_TRAILER\x10\x06\x12\x15\n" + + "\x11EVENT_TYPE_CANCEL\x10\a\"B\n" + + "\x06Logger\x12\x12\n" + + "\x0eLOGGER_UNKNOWN\x10\x00\x12\x11\n" + + "\rLOGGER_CLIENT\x10\x01\x12\x11\n" + + "\rLOGGER_SERVER\x10\x02B\t\n" + + "\apayload\"\xbb\x01\n" + + "\fClientHeader\x127\n" + + "\bmetadata\x18\x01 \x01(\v2\x1b.grpc.binarylog.v1.MetadataR\bmetadata\x12\x1f\n" + + "\vmethod_name\x18\x02 \x01(\tR\n" + + "methodName\x12\x1c\n" + + "\tauthority\x18\x03 \x01(\tR\tauthority\x123\n" + + "\atimeout\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"G\n" + + "\fServerHeader\x127\n" + + "\bmetadata\x18\x01 \x01(\v2\x1b.grpc.binarylog.v1.MetadataR\bmetadata\"\xb1\x01\n" + + "\aTrailer\x127\n" + + "\bmetadata\x18\x01 \x01(\v2\x1b.grpc.binarylog.v1.MetadataR\bmetadata\x12\x1f\n" + + "\vstatus_code\x18\x02 \x01(\rR\n" + + "statusCode\x12%\n" + + "\x0estatus_message\x18\x03 \x01(\tR\rstatusMessage\x12%\n" + + "\x0estatus_details\x18\x04 \x01(\fR\rstatusDetails\"5\n" + + "\aMessage\x12\x16\n" + + "\x06length\x18\x01 \x01(\rR\x06length\x12\x12\n" + + "\x04data\x18\x02 \x01(\fR\x04data\"B\n" + + "\bMetadata\x126\n" + + "\x05entry\x18\x01 \x03(\v2 .grpc.binarylog.v1.MetadataEntryR\x05entry\"7\n" + + "\rMetadataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\fR\x05value\"\xb8\x01\n" + + "\aAddress\x123\n" + + "\x04type\x18\x01 \x01(\x0e2\x1f.grpc.binarylog.v1.Address.TypeR\x04type\x12\x18\n" + + "\aaddress\x18\x02 \x01(\tR\aaddress\x12\x17\n" + + "\aip_port\x18\x03 \x01(\rR\x06ipPort\"E\n" + + "\x04Type\x12\x10\n" + + "\fTYPE_UNKNOWN\x10\x00\x12\r\n" + + "\tTYPE_IPV4\x10\x01\x12\r\n" + + "\tTYPE_IPV6\x10\x02\x12\r\n" + + "\tTYPE_UNIX\x10\x03B\\\n" + + "\x14io.grpc.binarylog.v1B\x0eBinaryLogProtoP\x01Z2google.golang.org/grpc/binarylog/grpc_binarylog_v1b\x06proto3" var ( file_grpc_binlog_v1_binarylog_proto_rawDescOnce sync.Once diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 4f350ca56ad..cd3eaf8ddcb 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -689,22 +689,31 @@ func (cc *ClientConn) Connect() { cc.mu.Unlock() } -// waitForResolvedAddrs blocks until the resolver has provided addresses or the -// context expires. Returns nil unless the context expires first; otherwise -// returns a status error based on the context. -func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error { +// waitForResolvedAddrs blocks until the resolver provides addresses or the +// context expires, whichever happens first. +// +// Error is nil unless the context expires first; otherwise returns a status +// error based on the context. +// +// The returned boolean indicates whether it did block or not. If the +// resolution has already happened once before, it returns false without +// blocking. Otherwise, it wait for the resolution and return true if +// resolution has succeeded or return false along with error if resolution has +// failed. +func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) (bool, error) { // This is on the RPC path, so we use a fast path to avoid the // more-expensive "select" below after the resolver has returned once. if cc.firstResolveEvent.HasFired() { - return nil + return false, nil } + internal.NewStreamWaitingForResolver() select { case <-cc.firstResolveEvent.Done(): - return nil + return true, nil case <-ctx.Done(): - return status.FromContextError(ctx.Err()).Err() + return false, status.FromContextError(ctx.Err()).Err() case <-cc.ctx.Done(): - return ErrClientConnClosing + return false, ErrClientConnClosing } } diff --git a/vendor/google.golang.org/grpc/credentials/credentials.go b/vendor/google.golang.org/grpc/credentials/credentials.go index 665e790bb0f..a63ab606e66 100644 --- a/vendor/google.golang.org/grpc/credentials/credentials.go +++ b/vendor/google.golang.org/grpc/credentials/credentials.go @@ -120,6 +120,20 @@ type AuthInfo interface { AuthType() string } +// AuthorityValidator validates the authority used to override the `:authority` +// header. This is an optional interface that implementations of AuthInfo can +// implement if they support per-RPC authority overrides. It is invoked when the +// application attempts to override the HTTP/2 `:authority` header using the +// CallAuthority call option. +type AuthorityValidator interface { + // ValidateAuthority checks the authority value used to override the + // `:authority` header. The authority parameter is the override value + // provided by the application via the CallAuthority option. This value + // typically corresponds to the server hostname or endpoint the RPC is + // targeting. It returns non-nil error if the validation fails. + ValidateAuthority(authority string) error +} + // ErrConnDispatched indicates that rawConn has been dispatched out of gRPC // and the caller should not close rawConn. var ErrConnDispatched = errors.New("credentials: rawConn is dispatched out of gRPC") @@ -207,14 +221,32 @@ type RequestInfo struct { AuthInfo AuthInfo } +// requestInfoKey is a struct to be used as the key to store RequestInfo in a +// context. +type requestInfoKey struct{} + // RequestInfoFromContext extracts the RequestInfo from the context if it exists. // // This API is experimental. func RequestInfoFromContext(ctx context.Context) (ri RequestInfo, ok bool) { - ri, ok = icredentials.RequestInfoFromContext(ctx).(RequestInfo) + ri, ok = ctx.Value(requestInfoKey{}).(RequestInfo) return ri, ok } +// NewContextWithRequestInfo creates a new context from ctx and attaches ri to it. +// +// This RequestInfo will be accessible via RequestInfoFromContext. +// +// Intended to be used from tests for PerRPCCredentials implementations (that +// often need to check connection's SecurityLevel). Should not be used from +// non-test code: the gRPC client already prepares a context with the correct +// RequestInfo attached when calling PerRPCCredentials.GetRequestMetadata. +// +// This API is experimental. +func NewContextWithRequestInfo(ctx context.Context, ri RequestInfo) context.Context { + return context.WithValue(ctx, requestInfoKey{}, ri) +} + // ClientHandshakeInfo holds data to be passed to ClientHandshake. This makes // it possible to pass arbitrary data to the handshaker from gRPC, resolver, // balancer etc. Individual credential implementations control the actual diff --git a/vendor/google.golang.org/grpc/credentials/insecure/insecure.go b/vendor/google.golang.org/grpc/credentials/insecure/insecure.go index 4c805c64462..93156c0f345 100644 --- a/vendor/google.golang.org/grpc/credentials/insecure/insecure.go +++ b/vendor/google.golang.org/grpc/credentials/insecure/insecure.go @@ -30,7 +30,7 @@ import ( // NewCredentials returns a credentials which disables transport security. // // Note that using this credentials with per-RPC credentials which require -// transport security is incompatible and will cause grpc.Dial() to fail. +// transport security is incompatible and will cause RPCs to fail. func NewCredentials() credentials.TransportCredentials { return insecureTC{} } @@ -71,6 +71,12 @@ func (info) AuthType() string { return "insecure" } +// ValidateAuthority allows any value to be overridden for the :authority +// header. +func (info) ValidateAuthority(string) error { + return nil +} + // insecureBundle implements an insecure bundle. // An insecure bundle provides a thin wrapper around insecureTC to support // the credentials.Bundle interface. diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go index bd5fe22b6af..20f65f7bd95 100644 --- a/vendor/google.golang.org/grpc/credentials/tls.go +++ b/vendor/google.golang.org/grpc/credentials/tls.go @@ -22,6 +22,7 @@ import ( "context" "crypto/tls" "crypto/x509" + "errors" "fmt" "net" "net/url" @@ -50,6 +51,21 @@ func (t TLSInfo) AuthType() string { return "tls" } +// ValidateAuthority validates the provided authority being used to override the +// :authority header by verifying it against the peer certificates. It returns a +// non-nil error if the validation fails. +func (t TLSInfo) ValidateAuthority(authority string) error { + var errs []error + for _, cert := range t.State.PeerCertificates { + var err error + if err = cert.VerifyHostname(authority); err == nil { + return nil + } + errs = append(errs, err) + } + return fmt.Errorf("credentials: invalid authority %q: %v", authority, errors.Join(errs...)) +} + // cipherSuiteLookup returns the string version of a TLS cipher suite ID. func cipherSuiteLookup(cipherSuiteID uint16) string { for _, s := range tls.CipherSuites() { diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index 405a2ffeb39..050ba0f1611 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -360,7 +360,7 @@ func WithReturnConnectionError() DialOption { // // Note that using this DialOption with per-RPC credentials (through // WithCredentialsBundle or WithPerRPCCredentials) which require transport -// security is incompatible and will cause grpc.Dial() to fail. +// security is incompatible and will cause RPCs to fail. // // Deprecated: use WithTransportCredentials and insecure.NewCredentials() // instead. Will be supported throughout 1.x. diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go index faa59e4182b..22d263fb94b 100644 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go +++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc v5.27.1 // source: grpc/health/v1/health.proto @@ -261,63 +261,29 @@ func (x *HealthListResponse) GetStatuses() map[string]*HealthCheckResponse { var File_grpc_health_v1_health_proto protoreflect.FileDescriptor -var file_grpc_health_v1_health_proto_rawDesc = string([]byte{ - 0x0a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x22, 0x2e, 0x0a, - 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xb1, 0x01, - 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, - 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, - 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, - 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x03, 0x22, 0x13, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc4, 0x01, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, - 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x30, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, - 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0x60, 0x0a, 0x0d, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x39, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xfd, 0x01, - 0x0a, 0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x50, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x04, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x05, 0x57, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x70, 0x0a, - 0x11, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x42, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x76, 0x31, 0xa2, - 0x02, 0x0c, 0x47, 0x72, 0x70, 0x63, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x56, 0x31, 0xaa, 0x02, - 0x0e, 0x47, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +const file_grpc_health_v1_health_proto_rawDesc = "" + + "\n" + + "\x1bgrpc/health/v1/health.proto\x12\x0egrpc.health.v1\".\n" + + "\x12HealthCheckRequest\x12\x18\n" + + "\aservice\x18\x01 \x01(\tR\aservice\"\xb1\x01\n" + + "\x13HealthCheckResponse\x12I\n" + + "\x06status\x18\x01 \x01(\x0e21.grpc.health.v1.HealthCheckResponse.ServingStatusR\x06status\"O\n" + + "\rServingStatus\x12\v\n" + + "\aUNKNOWN\x10\x00\x12\v\n" + + "\aSERVING\x10\x01\x12\x0f\n" + + "\vNOT_SERVING\x10\x02\x12\x13\n" + + "\x0fSERVICE_UNKNOWN\x10\x03\"\x13\n" + + "\x11HealthListRequest\"\xc4\x01\n" + + "\x12HealthListResponse\x12L\n" + + "\bstatuses\x18\x01 \x03(\v20.grpc.health.v1.HealthListResponse.StatusesEntryR\bstatuses\x1a`\n" + + "\rStatusesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x129\n" + + "\x05value\x18\x02 \x01(\v2#.grpc.health.v1.HealthCheckResponseR\x05value:\x028\x012\xfd\x01\n" + + "\x06Health\x12P\n" + + "\x05Check\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponse\x12M\n" + + "\x04List\x12!.grpc.health.v1.HealthListRequest\x1a\".grpc.health.v1.HealthListResponse\x12R\n" + + "\x05Watch\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponse0\x01Bp\n" + + "\x11io.grpc.health.v1B\vHealthProtoP\x01Z,google.golang.org/grpc/health/grpc_health_v1\xa2\x02\fGrpcHealthV1\xaa\x02\x0eGrpc.Health.V1b\x06proto3" var ( file_grpc_health_v1_health_proto_rawDescOnce sync.Once diff --git a/vendor/google.golang.org/grpc/internal/credentials/credentials.go b/vendor/google.golang.org/grpc/internal/credentials/credentials.go index 9deee7f6513..48b22d9cf07 100644 --- a/vendor/google.golang.org/grpc/internal/credentials/credentials.go +++ b/vendor/google.golang.org/grpc/internal/credentials/credentials.go @@ -20,20 +20,6 @@ import ( "context" ) -// requestInfoKey is a struct to be used as the key to store RequestInfo in a -// context. -type requestInfoKey struct{} - -// NewRequestInfoContext creates a context with ri. -func NewRequestInfoContext(ctx context.Context, ri any) context.Context { - return context.WithValue(ctx, requestInfoKey{}, ri) -} - -// RequestInfoFromContext extracts the RequestInfo from ctx. -func RequestInfoFromContext(ctx context.Context) any { - return ctx.Value(requestInfoKey{}) -} - // clientHandshakeInfoKey is a struct used as the key to store // ClientHandshakeInfo in a context. type clientHandshakeInfoKey struct{} diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index cc5713fd9d5..f5f2bdeb864 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -36,7 +36,7 @@ var ( // LeastRequestLB is set if we should support the least_request_experimental // LB policy, which can be enabled by setting the environment variable // "GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST" to "true". - LeastRequestLB = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST", false) + LeastRequestLB = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST", true) // ALTSMaxConcurrentHandshakes is the maximum number of concurrent ALTS // handshakes that can be performed. ALTSMaxConcurrentHandshakes = uint64FromEnv("GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES", 100, 1, 100) @@ -69,6 +69,10 @@ var ( // to gRFC A76. It can be enabled by setting the environment variable // "GRPC_EXPERIMENTAL_RING_HASH_SET_REQUEST_HASH_KEY" to "true". RingHashSetRequestHashKey = boolFromEnv("GRPC_EXPERIMENTAL_RING_HASH_SET_REQUEST_HASH_KEY", false) + + // ALTSHandshakerKeepaliveParams is set if we should add the + // KeepaliveParams when dial the ALTS handshaker service. + ALTSHandshakerKeepaliveParams = boolFromEnv("GRPC_EXPERIMENTAL_ALTS_HANDSHAKER_KEEPALIVE_PARAMS", false) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/vendor/google.golang.org/grpc/internal/envconfig/xds.go b/vendor/google.golang.org/grpc/internal/envconfig/xds.go index 2eb97f832b1..e87551552ad 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/xds.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/xds.go @@ -63,4 +63,9 @@ var ( // For more details, see: // https://github.com/grpc/proposal/blob/master/A82-xds-system-root-certs.md. XDSSystemRootCertsEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_SYSTEM_ROOT_CERTS", false) + + // XDSSPIFFEEnabled controls if SPIFFE Bundle Maps can be used as roots of + // trust. For more details, see: + // https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md + XDSSPIFFEEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_MTLS_SPIFFE", false) ) diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/event.go b/vendor/google.golang.org/grpc/internal/grpcsync/event.go index fbe697c3768..d788c249300 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/event.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/event.go @@ -21,28 +21,25 @@ package grpcsync import ( - "sync" "sync/atomic" ) // Event represents a one-time event that may occur in the future. type Event struct { - fired int32 + fired atomic.Bool c chan struct{} - o sync.Once } // Fire causes e to complete. It is safe to call multiple times, and // concurrently. It returns true iff this call to Fire caused the signaling -// channel returned by Done to close. +// channel returned by Done to close. If Fire returns false, it is possible +// the Done channel has not been closed yet. func (e *Event) Fire() bool { - ret := false - e.o.Do(func() { - atomic.StoreInt32(&e.fired, 1) + if e.fired.CompareAndSwap(false, true) { close(e.c) - ret = true - }) - return ret + return true + } + return false } // Done returns a channel that will be closed when Fire is called. @@ -52,7 +49,7 @@ func (e *Event) Done() <-chan struct{} { // HasFired returns true if Fire has been called. func (e *Event) HasFired() bool { - return atomic.LoadInt32(&e.fired) == 1 + return e.fired.Load() } // NewEvent returns a new, ready-to-use Event. diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 2ce012cda13..3ac798e8e60 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -266,6 +266,13 @@ var ( TimeAfterFunc = func(d time.Duration, f func()) Timer { return time.AfterFunc(d, f) } + + // NewStreamWaitingForResolver is a test hook that is triggered when a + // new stream blocks while waiting for name resolution. This can be + // used in tests to synchronize resolver updates and avoid race conditions. + // When set, the function will be called before the stream enters + // the blocking state. + NewStreamWaitingForResolver = func() {} ) // HealthChecker defines the signature of the client-side LB channel health diff --git a/vendor/google.golang.org/grpc/internal/resolver/delegatingresolver/delegatingresolver.go b/vendor/google.golang.org/grpc/internal/resolver/delegatingresolver/delegatingresolver.go index c0e22757727..20b8fb098ac 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/delegatingresolver/delegatingresolver.go +++ b/vendor/google.golang.org/grpc/internal/resolver/delegatingresolver/delegatingresolver.go @@ -186,23 +186,15 @@ func (r *delegatingResolver) Close() { r.proxyResolver = nil } -func networkTypeFromAddr(addr resolver.Address) string { - networkType, ok := networktype.Get(addr) - if !ok { - networkType, _ = transport.ParseDialTarget(addr.Addr) - } - return networkType -} - -func isTCPAddressPresent(state *resolver.State) bool { +func needsProxyResolver(state *resolver.State) bool { for _, addr := range state.Addresses { - if networkType := networkTypeFromAddr(addr); networkType == "tcp" { + if !skipProxy(addr) { return true } } for _, endpoint := range state.Endpoints { for _, addr := range endpoint.Addresses { - if networktype := networkTypeFromAddr(addr); networktype == "tcp" { + if !skipProxy(addr) { return true } } @@ -210,6 +202,29 @@ func isTCPAddressPresent(state *resolver.State) bool { return false } +func skipProxy(address resolver.Address) bool { + // Avoid proxy when network is not tcp. + networkType, ok := networktype.Get(address) + if !ok { + networkType, _ = transport.ParseDialTarget(address.Addr) + } + if networkType != "tcp" { + return true + } + + req := &http.Request{URL: &url.URL{ + Scheme: "https", + Host: address.Addr, + }} + // Avoid proxy when address included in `NO_PROXY` environment variable or + // fails to get the proxy address. + url, err := HTTPSProxyFromEnvironment(req) + if err != nil || url == nil { + return true + } + return false +} + // updateClientConnStateLocked constructs a combined list of addresses by // pairing each proxy address with every target address of type TCP. For each // pair, it creates a new [resolver.Address] using the proxy address and @@ -240,8 +255,7 @@ func (r *delegatingResolver) updateClientConnStateLocked() error { } var addresses []resolver.Address for _, targetAddr := range (*r.targetResolverState).Addresses { - // Avoid proxy when network is not tcp. - if networkType := networkTypeFromAddr(targetAddr); networkType != "tcp" { + if skipProxy(targetAddr) { addresses = append(addresses, targetAddr) continue } @@ -259,7 +273,7 @@ func (r *delegatingResolver) updateClientConnStateLocked() error { var addrs []resolver.Address for _, targetAddr := range endpt.Addresses { // Avoid proxy when network is not tcp. - if networkType := networkTypeFromAddr(targetAddr); networkType != "tcp" { + if skipProxy(targetAddr) { addrs = append(addrs, targetAddr) continue } @@ -340,9 +354,10 @@ func (r *delegatingResolver) updateTargetResolverState(state resolver.State) err logger.Infof("Addresses received from target resolver: %v", state.Addresses) } r.targetResolverState = &state - // If no addresses returned by resolver have network type as tcp , do not - // wait for proxy update. - if !isTCPAddressPresent(r.targetResolverState) { + // If all addresses returned by the target resolver have a non-TCP network + // type, or are listed in the `NO_PROXY` environment variable, do not wait + // for proxy update. + if !needsProxyResolver(r.targetResolverState) { return r.cc.UpdateState(*r.targetResolverState) } diff --git a/vendor/google.golang.org/grpc/internal/status/status.go b/vendor/google.golang.org/grpc/internal/status/status.go index 1186f1e9a9a..aad171cd027 100644 --- a/vendor/google.golang.org/grpc/internal/status/status.go +++ b/vendor/google.golang.org/grpc/internal/status/status.go @@ -236,3 +236,11 @@ func IsRestrictedControlPlaneCode(s *Status) bool { } return false } + +// RawStatusProto returns the internal protobuf message for use by gRPC itself. +func RawStatusProto(s *Status) *spb.Status { + if s == nil { + return nil + } + return s.s +} diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 171e690a3f2..ef56592b944 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -545,7 +545,7 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) Method: callHdr.Method, AuthInfo: t.authInfo, } - ctxWithRequestInfo := icredentials.NewRequestInfoContext(ctx, ri) + ctxWithRequestInfo := credentials.NewContextWithRequestInfo(ctx, ri) authData, err := t.getTrAuthData(ctxWithRequestInfo, aud) if err != nil { return nil, err @@ -592,6 +592,9 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) // Send out timeout regardless its value. The server can detect timeout context by itself. // TODO(mmukhi): Perhaps this field should be updated when actually writing out to the wire. timeout := time.Until(dl) + if timeout <= 0 { + return nil, status.Error(codes.DeadlineExceeded, context.DeadlineExceeded.Error()) + } headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-timeout", Value: grpcutil.EncodeDuration(timeout)}) } for k, v := range authData { @@ -749,6 +752,25 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*ClientS callHdr = &newCallHdr } + // The authority specified via the `CallAuthority` CallOption takes the + // highest precedence when determining the `:authority` header. It overrides + // any value present in the Host field of CallHdr. Before applying this + // override, the authority string is validated. If the credentials do not + // implement the AuthorityValidator interface, or if validation fails, the + // RPC is failed with a status code of `UNAVAILABLE`. + if callHdr.Authority != "" { + auth, ok := t.authInfo.(credentials.AuthorityValidator) + if !ok { + return nil, &NewStreamError{Err: status.Errorf(codes.Unavailable, "credentials type %q does not implement the AuthorityValidator interface, but authority override specified with CallAuthority call option", t.authInfo.AuthType())} + } + if err := auth.ValidateAuthority(callHdr.Authority); err != nil { + return nil, &NewStreamError{Err: status.Errorf(codes.Unavailable, "failed to validate authority %q : %v", callHdr.Authority, err)} + } + newCallHdr := *callHdr + newCallHdr.Host = callHdr.Authority + callHdr = &newCallHdr + } + headerFields, err := t.createHeaderFields(ctx, callHdr) if err != nil { return nil, &NewStreamError{Err: err, AllowTransparentRetry: false} diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 7e53eb1735e..e4c3731bdb0 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -39,6 +39,7 @@ import ( "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/pretty" + istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/mem" "google.golang.org/protobuf/proto" @@ -1055,7 +1056,7 @@ func (t *http2Server) writeHeaderLocked(s *ServerStream) error { return nil } -// WriteStatus sends stream status to the client and terminates the stream. +// writeStatus sends stream status to the client and terminates the stream. // There is no further I/O operations being able to perform on this stream. // TODO(zhaoq): Now it indicates the end of entire stream. Revisit if early // OK is adopted. @@ -1083,7 +1084,7 @@ func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status", Value: strconv.Itoa(int(st.Code()))}) headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-message", Value: encodeGrpcMessage(st.Message())}) - if p := st.Proto(); p != nil && len(p.Details) > 0 { + if p := istatus.RawStatusProto(st); len(p.GetDetails()) > 0 { // Do not use the user's grpc-status-details-bin (if present) if we are // even attempting to set our own. delete(s.trailer, grpcStatusDetailsBinHeader) diff --git a/vendor/google.golang.org/grpc/internal/transport/http_util.go b/vendor/google.golang.org/grpc/internal/transport/http_util.go index f997f9fdb5d..607d2c4cee0 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -196,11 +196,14 @@ func decodeTimeout(s string) (time.Duration, error) { if !ok { return 0, fmt.Errorf("transport: timeout unit is not recognized: %q", s) } - t, err := strconv.ParseInt(s[:size-1], 10, 64) + t, err := strconv.ParseUint(s[:size-1], 10, 64) if err != nil { return 0, err } - const maxHours = math.MaxInt64 / int64(time.Hour) + if t == 0 { + return 0, fmt.Errorf("transport: timeout must be positive: %q", s) + } + const maxHours = math.MaxInt64 / uint64(time.Hour) if d == time.Hour && t > maxHours { // This timeout would overflow math.MaxInt64; clamp it. return time.Duration(math.MaxInt64), nil diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index af4a4aeab14..1730a639f9d 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -540,6 +540,11 @@ type CallHdr struct { PreviousAttempts int // value of grpc-previous-rpc-attempts header to set DoneFunc func() // called when the stream is finished + + // Authority is used to explicitly override the `:authority` header. If set, + // this value takes precedence over the Host field and will be used as the + // value for the `:authority` header. + Authority string } // ClientTransport is the common interface for all gRPC client-side transport diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1/reflection.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1/reflection.pb.go index e0e9ca45e11..92f52922115 100644 --- a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1/reflection.pb.go +++ b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1/reflection.pb.go @@ -21,7 +21,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc v5.27.1 // source: grpc/reflection/v1/reflection.proto @@ -659,117 +659,45 @@ func (x *ErrorResponse) GetErrorMessage() string { var File_grpc_reflection_v1_reflection_proto protoreflect.FileDescriptor -var file_grpc_reflection_v1_reflection_proto_rawDesc = string([]byte{ - 0x0a, 0x23, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xf3, 0x02, 0x0a, 0x17, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c, - 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x62, 0x0a, - 0x19, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x42, 0x0a, 0x1d, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x4f, - 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, - 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x66, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, - 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xae, 0x04, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x6f, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x48, - 0x6f, 0x73, 0x74, 0x12, 0x56, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x66, 0x0a, 0x18, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x16, 0x66, 0x69, 0x6c, - 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x1e, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x61, 0x6c, 0x6c, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, - 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x48, 0x00, 0x52, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x46, 0x69, 0x6c, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x22, 0x54, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x53, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x32, 0x89, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x75, 0x0a, 0x14, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, - 0x42, 0x66, 0x0a, 0x15, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, - 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +const file_grpc_reflection_v1_reflection_proto_rawDesc = "" + + "\n" + + "#grpc/reflection/v1/reflection.proto\x12\x12grpc.reflection.v1\"\xf3\x02\n" + + "\x17ServerReflectionRequest\x12\x12\n" + + "\x04host\x18\x01 \x01(\tR\x04host\x12*\n" + + "\x10file_by_filename\x18\x03 \x01(\tH\x00R\x0efileByFilename\x126\n" + + "\x16file_containing_symbol\x18\x04 \x01(\tH\x00R\x14fileContainingSymbol\x12b\n" + + "\x19file_containing_extension\x18\x05 \x01(\v2$.grpc.reflection.v1.ExtensionRequestH\x00R\x17fileContainingExtension\x12B\n" + + "\x1dall_extension_numbers_of_type\x18\x06 \x01(\tH\x00R\x19allExtensionNumbersOfType\x12%\n" + + "\rlist_services\x18\a \x01(\tH\x00R\flistServicesB\x11\n" + + "\x0fmessage_request\"f\n" + + "\x10ExtensionRequest\x12'\n" + + "\x0fcontaining_type\x18\x01 \x01(\tR\x0econtainingType\x12)\n" + + "\x10extension_number\x18\x02 \x01(\x05R\x0fextensionNumber\"\xae\x04\n" + + "\x18ServerReflectionResponse\x12\x1d\n" + + "\n" + + "valid_host\x18\x01 \x01(\tR\tvalidHost\x12V\n" + + "\x10original_request\x18\x02 \x01(\v2+.grpc.reflection.v1.ServerReflectionRequestR\x0foriginalRequest\x12f\n" + + "\x18file_descriptor_response\x18\x04 \x01(\v2*.grpc.reflection.v1.FileDescriptorResponseH\x00R\x16fileDescriptorResponse\x12r\n" + + "\x1eall_extension_numbers_response\x18\x05 \x01(\v2+.grpc.reflection.v1.ExtensionNumberResponseH\x00R\x1ballExtensionNumbersResponse\x12_\n" + + "\x16list_services_response\x18\x06 \x01(\v2'.grpc.reflection.v1.ListServiceResponseH\x00R\x14listServicesResponse\x12J\n" + + "\x0eerror_response\x18\a \x01(\v2!.grpc.reflection.v1.ErrorResponseH\x00R\rerrorResponseB\x12\n" + + "\x10message_response\"L\n" + + "\x16FileDescriptorResponse\x122\n" + + "\x15file_descriptor_proto\x18\x01 \x03(\fR\x13fileDescriptorProto\"j\n" + + "\x17ExtensionNumberResponse\x12$\n" + + "\x0ebase_type_name\x18\x01 \x01(\tR\fbaseTypeName\x12)\n" + + "\x10extension_number\x18\x02 \x03(\x05R\x0fextensionNumber\"T\n" + + "\x13ListServiceResponse\x12=\n" + + "\aservice\x18\x01 \x03(\v2#.grpc.reflection.v1.ServiceResponseR\aservice\"%\n" + + "\x0fServiceResponse\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"S\n" + + "\rErrorResponse\x12\x1d\n" + + "\n" + + "error_code\x18\x01 \x01(\x05R\terrorCode\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage2\x89\x01\n" + + "\x10ServerReflection\x12u\n" + + "\x14ServerReflectionInfo\x12+.grpc.reflection.v1.ServerReflectionRequest\x1a,.grpc.reflection.v1.ServerReflectionResponse(\x010\x01Bf\n" + + "\x15io.grpc.reflection.v1B\x15ServerReflectionProtoP\x01Z4google.golang.org/grpc/reflection/grpc_reflection_v1b\x06proto3" var ( file_grpc_reflection_v1_reflection_proto_rawDescOnce sync.Once diff --git a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go index fd31ebfbf14..5253e862f0a 100644 --- a/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go +++ b/vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha/reflection.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.6 // protoc v5.27.1 // grpc/reflection/v1alpha/reflection.proto is a deprecated file. @@ -729,122 +729,45 @@ func (x *ErrorResponse) GetErrorMessage() string { var File_grpc_reflection_v1alpha_reflection_proto protoreflect.FileDescriptor -var file_grpc_reflection_v1alpha_reflection_proto_rawDesc = string([]byte{ - 0x0a, 0x28, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x22, 0xf8, 0x02, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, - 0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x36, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, - 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, - 0x67, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x67, 0x0a, 0x19, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x42, 0x0a, 0x1d, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x4f, 0x66, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x6c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x66, - 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xc7, 0x04, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x6f, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x6f, - 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0f, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x6b, 0x0a, 0x18, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x48, 0x00, 0x52, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77, 0x0a, 0x1e, - 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x4c, 0x0a, 0x16, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x66, 0x69, - 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, - 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x61, 0x73, - 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x29, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x42, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x0d, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x32, 0x93, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7f, 0x0a, 0x14, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x73, 0x0a, 0x1a, 0x69, 0x6f, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x42, 0x15, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, - 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xb8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -}) +const file_grpc_reflection_v1alpha_reflection_proto_rawDesc = "" + + "\n" + + "(grpc/reflection/v1alpha/reflection.proto\x12\x17grpc.reflection.v1alpha\"\xf8\x02\n" + + "\x17ServerReflectionRequest\x12\x12\n" + + "\x04host\x18\x01 \x01(\tR\x04host\x12*\n" + + "\x10file_by_filename\x18\x03 \x01(\tH\x00R\x0efileByFilename\x126\n" + + "\x16file_containing_symbol\x18\x04 \x01(\tH\x00R\x14fileContainingSymbol\x12g\n" + + "\x19file_containing_extension\x18\x05 \x01(\v2).grpc.reflection.v1alpha.ExtensionRequestH\x00R\x17fileContainingExtension\x12B\n" + + "\x1dall_extension_numbers_of_type\x18\x06 \x01(\tH\x00R\x19allExtensionNumbersOfType\x12%\n" + + "\rlist_services\x18\a \x01(\tH\x00R\flistServicesB\x11\n" + + "\x0fmessage_request\"f\n" + + "\x10ExtensionRequest\x12'\n" + + "\x0fcontaining_type\x18\x01 \x01(\tR\x0econtainingType\x12)\n" + + "\x10extension_number\x18\x02 \x01(\x05R\x0fextensionNumber\"\xc7\x04\n" + + "\x18ServerReflectionResponse\x12\x1d\n" + + "\n" + + "valid_host\x18\x01 \x01(\tR\tvalidHost\x12[\n" + + "\x10original_request\x18\x02 \x01(\v20.grpc.reflection.v1alpha.ServerReflectionRequestR\x0foriginalRequest\x12k\n" + + "\x18file_descriptor_response\x18\x04 \x01(\v2/.grpc.reflection.v1alpha.FileDescriptorResponseH\x00R\x16fileDescriptorResponse\x12w\n" + + "\x1eall_extension_numbers_response\x18\x05 \x01(\v20.grpc.reflection.v1alpha.ExtensionNumberResponseH\x00R\x1ballExtensionNumbersResponse\x12d\n" + + "\x16list_services_response\x18\x06 \x01(\v2,.grpc.reflection.v1alpha.ListServiceResponseH\x00R\x14listServicesResponse\x12O\n" + + "\x0eerror_response\x18\a \x01(\v2&.grpc.reflection.v1alpha.ErrorResponseH\x00R\rerrorResponseB\x12\n" + + "\x10message_response\"L\n" + + "\x16FileDescriptorResponse\x122\n" + + "\x15file_descriptor_proto\x18\x01 \x03(\fR\x13fileDescriptorProto\"j\n" + + "\x17ExtensionNumberResponse\x12$\n" + + "\x0ebase_type_name\x18\x01 \x01(\tR\fbaseTypeName\x12)\n" + + "\x10extension_number\x18\x02 \x03(\x05R\x0fextensionNumber\"Y\n" + + "\x13ListServiceResponse\x12B\n" + + "\aservice\x18\x01 \x03(\v2(.grpc.reflection.v1alpha.ServiceResponseR\aservice\"%\n" + + "\x0fServiceResponse\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"S\n" + + "\rErrorResponse\x12\x1d\n" + + "\n" + + "error_code\x18\x01 \x01(\x05R\terrorCode\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage2\x93\x01\n" + + "\x10ServerReflection\x12\x7f\n" + + "\x14ServerReflectionInfo\x120.grpc.reflection.v1alpha.ServerReflectionRequest\x1a1.grpc.reflection.v1alpha.ServerReflectionResponse(\x010\x01Bs\n" + + "\x1aio.grpc.reflection.v1alphaB\x15ServerReflectionProtoP\x01Z9google.golang.org/grpc/reflection/grpc_reflection_v1alpha\xb8\x01\x01b\x06proto3" var ( file_grpc_reflection_v1alpha_reflection_proto_rawDescOnce sync.Once diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index ad20e9dff20..47ea09f5c9b 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -160,6 +160,7 @@ type callInfo struct { codec baseCodec maxRetryRPCBufferSize int onFinish []func(err error) + authority string } func defaultCallInfo() *callInfo { @@ -365,6 +366,36 @@ func (o MaxRecvMsgSizeCallOption) before(c *callInfo) error { } func (o MaxRecvMsgSizeCallOption) after(*callInfo, *csAttempt) {} +// CallAuthority returns a CallOption that sets the HTTP/2 :authority header of +// an RPC to the specified value. When using CallAuthority, the credentials in +// use must implement the AuthorityValidator interface. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a later +// release. +func CallAuthority(authority string) CallOption { + return AuthorityOverrideCallOption{Authority: authority} +} + +// AuthorityOverrideCallOption is a CallOption that indicates the HTTP/2 +// :authority header value to use for the call. +// +// # Experimental +// +// Notice: This type is EXPERIMENTAL and may be changed or removed in a later +// release. +type AuthorityOverrideCallOption struct { + Authority string +} + +func (o AuthorityOverrideCallOption) before(c *callInfo) error { + c.authority = o.Authority + return nil +} + +func (o AuthorityOverrideCallOption) after(*callInfo, *csAttempt) {} + // MaxCallSendMsgSize returns a CallOption which sets the maximum message size // in bytes the client can send. If this is not set, gRPC uses the default // `math.MaxInt32`. diff --git a/vendor/google.golang.org/grpc/stats/handlers.go b/vendor/google.golang.org/grpc/stats/handlers.go index dc03731e45e..67194a592f2 100644 --- a/vendor/google.golang.org/grpc/stats/handlers.go +++ b/vendor/google.golang.org/grpc/stats/handlers.go @@ -38,6 +38,15 @@ type RPCTagInfo struct { // FailFast indicates if this RPC is failfast. // This field is only valid on client side, it's always false on server side. FailFast bool + // NameResolutionDelay indicates if the RPC needed to wait for the + // initial name resolver update before it could begin. This should only + // happen if the channel is IDLE when the RPC is started. Note that + // all retry or hedging attempts for an RPC that experienced a delay + // will have it set. + // + // This field is only valid on the client side; it is always false on + // the server side. + NameResolutionDelay bool } // Handler defines the interface for the related stats handling (e.g., RPCs, connections). diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 12163150ba7..d58bb6471a8 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -101,9 +101,9 @@ type ClientStream interface { // It must only be called after stream.CloseAndRecv has returned, or // stream.Recv has returned a non-nil error (including io.EOF). Trailer() metadata.MD - // CloseSend closes the send direction of the stream. It closes the stream - // when non-nil error is met. It is also not safe to call CloseSend - // concurrently with SendMsg. + // CloseSend closes the send direction of the stream. This method always + // returns a nil error. The status of the stream may be discovered using + // RecvMsg. It is also not safe to call CloseSend concurrently with SendMsg. CloseSend() error // Context returns the context for this stream. // @@ -212,14 +212,15 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth } // Provide an opportunity for the first RPC to see the first service config // provided by the resolver. - if err := cc.waitForResolvedAddrs(ctx); err != nil { + nameResolutionDelayed, err := cc.waitForResolvedAddrs(ctx) + if err != nil { return nil, err } var mc serviceconfig.MethodConfig var onCommit func() newStream := func(ctx context.Context, done func()) (iresolver.ClientStream, error) { - return newClientStreamWithParams(ctx, desc, cc, method, mc, onCommit, done, opts...) + return newClientStreamWithParams(ctx, desc, cc, method, mc, onCommit, done, nameResolutionDelayed, opts...) } rpcInfo := iresolver.RPCInfo{Context: ctx, Method: method} @@ -257,7 +258,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth return newStream(ctx, func() {}) } -func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc serviceconfig.MethodConfig, onCommit, doneFunc func(), opts ...CallOption) (_ iresolver.ClientStream, err error) { +func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc serviceconfig.MethodConfig, onCommit, doneFunc func(), nameResolutionDelayed bool, opts ...CallOption) (_ iresolver.ClientStream, err error) { callInfo := defaultCallInfo() if mc.WaitForReady != nil { callInfo.failFast = !*mc.WaitForReady @@ -296,6 +297,7 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client Method: method, ContentSubtype: callInfo.contentSubtype, DoneFunc: doneFunc, + Authority: callInfo.authority, } // Set our outgoing compression according to the UseCompressor CallOption, if @@ -321,19 +323,20 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client } cs := &clientStream{ - callHdr: callHdr, - ctx: ctx, - methodConfig: &mc, - opts: opts, - callInfo: callInfo, - cc: cc, - desc: desc, - codec: callInfo.codec, - compressorV0: compressorV0, - compressorV1: compressorV1, - cancel: cancel, - firstAttempt: true, - onCommit: onCommit, + callHdr: callHdr, + ctx: ctx, + methodConfig: &mc, + opts: opts, + callInfo: callInfo, + cc: cc, + desc: desc, + codec: callInfo.codec, + compressorV0: compressorV0, + compressorV1: compressorV1, + cancel: cancel, + firstAttempt: true, + onCommit: onCommit, + nameResolutionDelay: nameResolutionDelayed, } if !cc.dopts.disableRetry { cs.retryThrottler = cc.retryThrottler.Load().(*retryThrottler) @@ -417,7 +420,7 @@ func (cs *clientStream) newAttemptLocked(isTransparent bool) (*csAttempt, error) var beginTime time.Time shs := cs.cc.dopts.copts.StatsHandlers for _, sh := range shs { - ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method, FailFast: cs.callInfo.failFast}) + ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method, FailFast: cs.callInfo.failFast, NameResolutionDelay: cs.nameResolutionDelay}) beginTime = time.Now() begin := &stats.Begin{ Client: true, @@ -573,6 +576,9 @@ type clientStream struct { onCommit func() replayBuffer []replayOp // operations to replay on retry replayBufferSize int // current size of replayBuffer + // nameResolutionDelay indicates if there was a delay in the name resolution. + // This field is only valid on client side, it's always false on server side. + nameResolutionDelay bool } type replayOp struct { @@ -987,7 +993,7 @@ func (cs *clientStream) RecvMsg(m any) error { func (cs *clientStream) CloseSend() error { if cs.sentLast { - // TODO: return an error and finish the stream instead, due to API misuse? + // Return a nil error on repeated calls to this method. return nil } cs.sentLast = true @@ -1008,7 +1014,10 @@ func (cs *clientStream) CloseSend() error { binlog.Log(cs.ctx, chc) } } - // We never returned an error here for reasons. + // We don't return an error here as we expect users to read all messages + // from the stream and get the RPC status from RecvMsg(). Note that + // SendMsg() must return an error when one occurs so the application + // knows to stop sending messages, but that does not apply here. return nil } @@ -1372,7 +1381,7 @@ func (as *addrConnStream) Trailer() metadata.MD { func (as *addrConnStream) CloseSend() error { if as.sentLast { - // TODO: return an error and finish the stream instead, due to API misuse? + // Return a nil error on repeated calls to this method. return nil } as.sentLast = true diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 51da8ed5908..bd82673dc9f 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.72.1" +const Version = "1.73.0" diff --git a/vendor/modules.txt b/vendor/modules.txt index 153d3e678c1..765b42afdea 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -497,15 +497,15 @@ golang.org/x/text/unicode/rangetable # golang.org/x/time v0.11.0 ## explicit; go 1.23.0 golang.org/x/time/rate -# google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a -## explicit; go 1.22 +# google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 +## explicit; go 1.23.0 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a -## explicit; go 1.22 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 +## explicit; go 1.23.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.72.1 -## explicit; go 1.23 +# google.golang.org/grpc v1.73.0 +## explicit; go 1.23.0 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff From 249a4fe591618ba1105694dd63b10a28bed97c10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:28:56 +0000 Subject: [PATCH 015/136] build(deps): bump the otel group with 6 updates Bumps the otel group with 6 updates: | Package | From | To | | --- | --- | --- | | [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` | | [go.opentelemetry.io/otel/exporters/otlp/otlptrace](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` | | [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` | | [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` | | [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` | | [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) | `1.35.0` | `1.36.0` | Updates `go.opentelemetry.io/otel` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...v1.36.0) Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...v1.36.0) Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...v1.36.0) Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...v1.36.0) Updates `go.opentelemetry.io/otel/sdk` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...v1.36.0) Updates `go.opentelemetry.io/otel/trace` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...v1.36.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: otel - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: otel - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: otel - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: otel - dependency-name: go.opentelemetry.io/otel/sdk dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: otel - dependency-name: go.opentelemetry.io/otel/trace dependency-version: 1.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: otel ... Signed-off-by: dependabot[bot] --- go.mod | 24 +- go.sum | 46 +-- .../github.com/cenkalti/backoff/v5/.gitignore | 25 ++ .../cenkalti/backoff/v5/CHANGELOG.md | 29 ++ vendor/github.com/cenkalti/backoff/v5/LICENSE | 20 ++ .../github.com/cenkalti/backoff/v5/README.md | 31 ++ .../github.com/cenkalti/backoff/v5/backoff.go | 66 ++++ .../github.com/cenkalti/backoff/v5/error.go | 46 +++ .../cenkalti/backoff/v5/exponential.go | 125 +++++++ .../github.com/cenkalti/backoff/v5/retry.go | 139 ++++++++ .../github.com/cenkalti/backoff/v5/ticker.go | 83 +++++ .../github.com/cenkalti/backoff/v5/timer.go | 35 ++ .../grpc-gateway/v2/runtime/errors.go | 32 +- .../grpc-gateway/v2/runtime/handler.go | 10 +- vendor/go.opentelemetry.io/otel/CHANGELOG.md | 54 ++- .../go.opentelemetry.io/otel/CONTRIBUTING.md | 1 + vendor/go.opentelemetry.io/otel/README.md | 8 +- vendor/go.opentelemetry.io/otel/RELEASING.md | 18 + .../otel/attribute/filter.go | 4 +- .../internal}/attribute.go | 2 +- .../otel/attribute/rawhelpers.go | 37 +++ .../otel/attribute/value.go | 15 +- .../otel/dependencies.Dockerfile | 5 +- .../internal/tracetransform/attribute.go | 2 + .../internal/envconfig/envconfig.go | 4 +- .../otlptrace/otlptracegrpc/internal/gen.go | 1 + .../internal/otlpconfig/envconfig.go | 14 +- .../internal/otlpconfig/options.go | 14 +- .../internal/otlpconfig/optiontypes.go | 2 +- .../otlptracegrpc/internal/otlpconfig/tls.go | 2 +- .../otlptracegrpc/internal/partialsuccess.go | 2 +- .../otlptracegrpc/internal/retry/retry.go | 28 +- .../otlp/otlptrace/otlptracegrpc/options.go | 5 +- .../otlp/otlptrace/otlptracehttp/client.go | 30 +- .../internal/envconfig/envconfig.go | 4 +- .../otlptrace/otlptracehttp/internal/gen.go | 1 + .../internal/otlpconfig/envconfig.go | 14 +- .../internal/otlpconfig/options.go | 14 +- .../internal/otlpconfig/optiontypes.go | 2 +- .../otlptracehttp/internal/otlpconfig/tls.go | 2 +- .../otlptracehttp/internal/partialsuccess.go | 2 +- .../otlptracehttp/internal/retry/retry.go | 28 +- .../otlp/otlptrace/otlptracehttp/options.go | 16 + .../otel/exporters/otlp/otlptrace/version.go | 2 +- .../go.opentelemetry.io/otel/get_main_pkgs.sh | 30 -- .../go.opentelemetry.io/otel/internal/gen.go | 18 - .../otel/internal/global/handler.go | 1 + .../otel/internal/global/meter.go | 45 ++- .../otel/internal/global/trace.go | 13 +- .../otel/internal/rawhelpers.go | 48 --- .../otel/metric/asyncfloat64.go | 12 +- .../otel/metric/asyncint64.go | 8 +- .../otel/metric/instrument.go | 16 +- .../go.opentelemetry.io/otel/metric/meter.go | 10 +- .../otel/metric/noop/noop.go | 25 +- .../otel/propagation/baggage.go | 36 +- .../otel/propagation/propagation.go | 30 +- .../otel/sdk/internal/env/env.go | 2 + .../otel/sdk/trace/id_generator.go | 26 +- .../otel/sdk/trace/provider.go | 12 +- .../otel/sdk/trace/tracer.go | 13 +- .../go.opentelemetry.io/otel/sdk/version.go | 3 +- vendor/go.opentelemetry.io/otel/trace/auto.go | 5 +- .../otel/trace/internal/telemetry/span.go | 56 ++-- .../otel/trace/internal/telemetry/status.go | 12 +- .../otel/trace/internal/telemetry/traces.go | 4 +- .../otel/trace/internal/telemetry/value.go | 2 +- vendor/go.opentelemetry.io/otel/trace/noop.go | 2 + .../otel/verify_readmes.sh | 21 -- vendor/go.opentelemetry.io/otel/version.go | 2 +- .../metrics/v1/metrics_service_grpc.pb.go | 4 - .../trace/v1/trace_service_grpc.pb.go | 4 - .../proto/otlp/common/v1/common.pb.go | 138 +++++++- .../proto/otlp/metrics/v1/metrics.pb.go | 11 +- .../proto/otlp/resource/v1/resource.pb.go | 56 +++- .../rpc/errdetails/error_details.pb.go | 313 ++++++++++++------ vendor/modules.txt | 46 +-- 77 files changed, 1566 insertions(+), 502 deletions(-) create mode 100644 vendor/github.com/cenkalti/backoff/v5/.gitignore create mode 100644 vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md create mode 100644 vendor/github.com/cenkalti/backoff/v5/LICENSE create mode 100644 vendor/github.com/cenkalti/backoff/v5/README.md create mode 100644 vendor/github.com/cenkalti/backoff/v5/backoff.go create mode 100644 vendor/github.com/cenkalti/backoff/v5/error.go create mode 100644 vendor/github.com/cenkalti/backoff/v5/exponential.go create mode 100644 vendor/github.com/cenkalti/backoff/v5/retry.go create mode 100644 vendor/github.com/cenkalti/backoff/v5/ticker.go create mode 100644 vendor/github.com/cenkalti/backoff/v5/timer.go rename vendor/go.opentelemetry.io/otel/{internal/attribute => attribute/internal}/attribute.go (97%) create mode 100644 vendor/go.opentelemetry.io/otel/attribute/rawhelpers.go delete mode 100644 vendor/go.opentelemetry.io/otel/get_main_pkgs.sh delete mode 100644 vendor/go.opentelemetry.io/otel/internal/gen.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/rawhelpers.go delete mode 100644 vendor/go.opentelemetry.io/otel/verify_readmes.sh diff --git a/go.mod b/go.mod index cad2c9503a5..0390f3fcb18 100644 --- a/go.mod +++ b/go.mod @@ -43,17 +43,17 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 - go.opentelemetry.io/otel v1.35.0 + go.opentelemetry.io/otel v1.36.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 - go.opentelemetry.io/otel/metric v1.35.0 - go.opentelemetry.io/otel/sdk v1.35.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 + go.opentelemetry.io/otel/metric v1.36.0 + go.opentelemetry.io/otel/sdk v1.36.0 go.opentelemetry.io/otel/sdk/metric v1.35.0 - go.opentelemetry.io/otel/trace v1.35.0 - go.opentelemetry.io/proto/otlp v1.5.0 + go.opentelemetry.io/otel/trace v1.36.0 + go.opentelemetry.io/proto/otlp v1.6.0 go.uber.org/goleak v1.3.0 golang.org/x/crypto v0.38.0 golang.org/x/crypto/x509roots/fallback v0.0.0-20250414110644-0091fc8e7c69 @@ -67,6 +67,8 @@ require ( gopkg.in/yaml.v3 v3.0.1 ) +require github.com/cenkalti/backoff/v5 v5.0.2 // indirect + require ( buf.build/gen/go/gogo/protobuf/protocolbuffers/go v1.36.5-20210810001428-4df00b267f94.1 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect @@ -82,7 +84,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6 // indirect github.com/grafana/k6build v0.5.11 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -100,7 +102,7 @@ require ( go.opentelemetry.io/auto/sdk v1.1.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.25.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 34bb306d97e..e2ad5a0993d 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,8 @@ github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/ github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= +github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -99,8 +101,8 @@ github.com/grafana/xk6-redis v0.3.3 h1:9QiS4OUjYMzvriGzbqrhCn9i/kENmCkibZE+xCJSd github.com/grafana/xk6-redis v0.3.3/go.mod h1:YL1qfBZXW4o2aAF6/gRa/N9oGoumUg7cJzzCHLxoCOw= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc h1:KpMgaYJRieDkHZJWY3LMafvtqS/U8xX6+lUN+OKpl/Y= @@ -200,28 +202,28 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= +go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 h1:QcFwRrZLc82r8wODjvyCbP7Ifp3UANaBSmhDSFjnqSc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0/go.mod h1:CXIWhUomyWBG/oY2/r/kLp6K/cmx9e/7DLpBuuGdLCA= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 h1:0NIXxOCFx+SKbhCVxwl3ETG8ClLPAa0KuKV6p3yhxP8= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0/go.mod h1:ChZSJbbfbl/DcRZNc9Gqh6DYGlfjw4PvO1pEOZH1ZsE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 h1:xJ2qHD0C1BeYVTLLR9sX12+Qb95kfeD/byKj6Ky1pXg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0/go.mod h1:u5BF1xyjstDowA1R5QAO9JHzqK+ublenEW/dyqTjBVk= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= -go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= -go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 h1:nRVXXvf78e00EwY6Wp0YII8ww2JVWshZ20HfTlE11AM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0/go.mod h1:r49hO7CgrxY9Voaj3Xe8pANWtr0Oq916d0XAmOoCZAQ= +go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= +go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= +go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs= +go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY= go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= -go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= -go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= +go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= +go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= +go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= +go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -326,10 +328,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= -google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 h1:Kog3KlB4xevJlAcbbbzPfRG0+X9fdoGM+UBRKVz6Wr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237/go.mod h1:ezi0AVyMKDWy5xAncvjLWH7UcLBB5n7y2fQ8MzjJcto= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 h1:cJfm9zPbe1e873mHJzmQ1nwVEeRDU/T1wXDK2kUSU34= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/vendor/github.com/cenkalti/backoff/v5/.gitignore b/vendor/github.com/cenkalti/backoff/v5/.gitignore new file mode 100644 index 00000000000..50d95c548b6 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe + +# IDEs +.idea/ diff --git a/vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md b/vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md new file mode 100644 index 00000000000..658c37436d9 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [5.0.0] - 2024-12-19 + +### Added + +- RetryAfterError can be returned from an operation to indicate how long to wait before the next retry. + +### Changed + +- Retry function now accepts additional options for specifying max number of tries and max elapsed time. +- Retry function now accepts a context.Context. +- Operation function signature changed to return result (any type) and error. + +### Removed + +- RetryNotify* and RetryWithData functions. Only single Retry function remains. +- Optional arguments from ExponentialBackoff constructor. +- Clock and Timer interfaces. + +### Fixed + +- The original error is returned from Retry if there's a PermanentError. (#144) +- The Retry function respects the wrapped PermanentError. (#140) diff --git a/vendor/github.com/cenkalti/backoff/v5/LICENSE b/vendor/github.com/cenkalti/backoff/v5/LICENSE new file mode 100644 index 00000000000..89b81799655 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Cenk Altı + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/cenkalti/backoff/v5/README.md b/vendor/github.com/cenkalti/backoff/v5/README.md new file mode 100644 index 00000000000..4611b1d1701 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/README.md @@ -0,0 +1,31 @@ +# Exponential Backoff [![GoDoc][godoc image]][godoc] + +This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client]. + +[Exponential backoff][exponential backoff wiki] +is an algorithm that uses feedback to multiplicatively decrease the rate of some process, +in order to gradually find an acceptable rate. +The retries exponentially increase and stop increasing when a certain threshold is met. + +## Usage + +Import path is `github.com/cenkalti/backoff/v5`. Please note the version part at the end. + +For most cases, use `Retry` function. See [example_test.go][example] for an example. + +If you have specific needs, copy `Retry` function (from [retry.go][retry-src]) into your code and modify it as needed. + +## Contributing + +* I would like to keep this library as small as possible. +* Please don't send a PR without opening an issue and discussing it first. +* If proposed change is not a common use case, I will probably not accept it. + +[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v5 +[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png + +[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java +[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff + +[retry-src]: https://github.com/cenkalti/backoff/blob/v5/retry.go +[example]: https://github.com/cenkalti/backoff/blob/v5/example_test.go diff --git a/vendor/github.com/cenkalti/backoff/v5/backoff.go b/vendor/github.com/cenkalti/backoff/v5/backoff.go new file mode 100644 index 00000000000..dd2b24ca735 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/backoff.go @@ -0,0 +1,66 @@ +// Package backoff implements backoff algorithms for retrying operations. +// +// Use Retry function for retrying operations that may fail. +// If Retry does not meet your needs, +// copy/paste the function into your project and modify as you wish. +// +// There is also Ticker type similar to time.Ticker. +// You can use it if you need to work with channels. +// +// See Examples section below for usage examples. +package backoff + +import "time" + +// BackOff is a backoff policy for retrying an operation. +type BackOff interface { + // NextBackOff returns the duration to wait before retrying the operation, + // backoff.Stop to indicate that no more retries should be made. + // + // Example usage: + // + // duration := backoff.NextBackOff() + // if duration == backoff.Stop { + // // Do not retry operation. + // } else { + // // Sleep for duration and retry operation. + // } + // + NextBackOff() time.Duration + + // Reset to initial state. + Reset() +} + +// Stop indicates that no more retries should be made for use in NextBackOff(). +const Stop time.Duration = -1 + +// ZeroBackOff is a fixed backoff policy whose backoff time is always zero, +// meaning that the operation is retried immediately without waiting, indefinitely. +type ZeroBackOff struct{} + +func (b *ZeroBackOff) Reset() {} + +func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 } + +// StopBackOff is a fixed backoff policy that always returns backoff.Stop for +// NextBackOff(), meaning that the operation should never be retried. +type StopBackOff struct{} + +func (b *StopBackOff) Reset() {} + +func (b *StopBackOff) NextBackOff() time.Duration { return Stop } + +// ConstantBackOff is a backoff policy that always returns the same backoff delay. +// This is in contrast to an exponential backoff policy, +// which returns a delay that grows longer as you call NextBackOff() over and over again. +type ConstantBackOff struct { + Interval time.Duration +} + +func (b *ConstantBackOff) Reset() {} +func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval } + +func NewConstantBackOff(d time.Duration) *ConstantBackOff { + return &ConstantBackOff{Interval: d} +} diff --git a/vendor/github.com/cenkalti/backoff/v5/error.go b/vendor/github.com/cenkalti/backoff/v5/error.go new file mode 100644 index 00000000000..beb2b38a23d --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/error.go @@ -0,0 +1,46 @@ +package backoff + +import ( + "fmt" + "time" +) + +// PermanentError signals that the operation should not be retried. +type PermanentError struct { + Err error +} + +// Permanent wraps the given err in a *PermanentError. +func Permanent(err error) error { + if err == nil { + return nil + } + return &PermanentError{ + Err: err, + } +} + +// Error returns a string representation of the Permanent error. +func (e *PermanentError) Error() string { + return e.Err.Error() +} + +// Unwrap returns the wrapped error. +func (e *PermanentError) Unwrap() error { + return e.Err +} + +// RetryAfterError signals that the operation should be retried after the given duration. +type RetryAfterError struct { + Duration time.Duration +} + +// RetryAfter returns a RetryAfter error that specifies how long to wait before retrying. +func RetryAfter(seconds int) error { + return &RetryAfterError{Duration: time.Duration(seconds) * time.Second} +} + +// Error returns a string representation of the RetryAfter error. +func (e *RetryAfterError) Error() string { + return fmt.Sprintf("retry after %s", e.Duration) +} diff --git a/vendor/github.com/cenkalti/backoff/v5/exponential.go b/vendor/github.com/cenkalti/backoff/v5/exponential.go new file mode 100644 index 00000000000..c1f3e442d36 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/exponential.go @@ -0,0 +1,125 @@ +package backoff + +import ( + "math/rand" + "time" +) + +/* +ExponentialBackOff is a backoff implementation that increases the backoff +period for each retry attempt using a randomization function that grows exponentially. + +NextBackOff() is calculated using the following formula: + + randomized interval = + RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor]) + +In other words NextBackOff() will range between the randomization factor +percentage below and above the retry interval. + +For example, given the following parameters: + + RetryInterval = 2 + RandomizationFactor = 0.5 + Multiplier = 2 + +the actual backoff period used in the next retry attempt will range between 1 and 3 seconds, +multiplied by the exponential, that is, between 2 and 6 seconds. + +Note: MaxInterval caps the RetryInterval and not the randomized interval. + +If the time elapsed since an ExponentialBackOff instance is created goes past the +MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop. + +The elapsed time can be reset by calling Reset(). + +Example: Given the following default arguments, for 10 tries the sequence will be, +and assuming we go over the MaxElapsedTime on the 10th try: + + Request # RetryInterval (seconds) Randomized Interval (seconds) + + 1 0.5 [0.25, 0.75] + 2 0.75 [0.375, 1.125] + 3 1.125 [0.562, 1.687] + 4 1.687 [0.8435, 2.53] + 5 2.53 [1.265, 3.795] + 6 3.795 [1.897, 5.692] + 7 5.692 [2.846, 8.538] + 8 8.538 [4.269, 12.807] + 9 12.807 [6.403, 19.210] + 10 19.210 backoff.Stop + +Note: Implementation is not thread-safe. +*/ +type ExponentialBackOff struct { + InitialInterval time.Duration + RandomizationFactor float64 + Multiplier float64 + MaxInterval time.Duration + + currentInterval time.Duration +} + +// Default values for ExponentialBackOff. +const ( + DefaultInitialInterval = 500 * time.Millisecond + DefaultRandomizationFactor = 0.5 + DefaultMultiplier = 1.5 + DefaultMaxInterval = 60 * time.Second +) + +// NewExponentialBackOff creates an instance of ExponentialBackOff using default values. +func NewExponentialBackOff() *ExponentialBackOff { + return &ExponentialBackOff{ + InitialInterval: DefaultInitialInterval, + RandomizationFactor: DefaultRandomizationFactor, + Multiplier: DefaultMultiplier, + MaxInterval: DefaultMaxInterval, + } +} + +// Reset the interval back to the initial retry interval and restarts the timer. +// Reset must be called before using b. +func (b *ExponentialBackOff) Reset() { + b.currentInterval = b.InitialInterval +} + +// NextBackOff calculates the next backoff interval using the formula: +// +// Randomized interval = RetryInterval * (1 ± RandomizationFactor) +func (b *ExponentialBackOff) NextBackOff() time.Duration { + if b.currentInterval == 0 { + b.currentInterval = b.InitialInterval + } + + next := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval) + b.incrementCurrentInterval() + return next +} + +// Increments the current interval by multiplying it with the multiplier. +func (b *ExponentialBackOff) incrementCurrentInterval() { + // Check for overflow, if overflow is detected set the current interval to the max interval. + if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier { + b.currentInterval = b.MaxInterval + } else { + b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier) + } +} + +// Returns a random value from the following interval: +// +// [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval]. +func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration { + if randomizationFactor == 0 { + return currentInterval // make sure no randomness is used when randomizationFactor is 0. + } + var delta = randomizationFactor * float64(currentInterval) + var minInterval = float64(currentInterval) - delta + var maxInterval = float64(currentInterval) + delta + + // Get a random value from the range [minInterval, maxInterval]. + // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then + // we want a 33% chance for selecting either 1, 2 or 3. + return time.Duration(minInterval + (random * (maxInterval - minInterval + 1))) +} diff --git a/vendor/github.com/cenkalti/backoff/v5/retry.go b/vendor/github.com/cenkalti/backoff/v5/retry.go new file mode 100644 index 00000000000..e43f47fb8a5 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/retry.go @@ -0,0 +1,139 @@ +package backoff + +import ( + "context" + "errors" + "time" +) + +// DefaultMaxElapsedTime sets a default limit for the total retry duration. +const DefaultMaxElapsedTime = 15 * time.Minute + +// Operation is a function that attempts an operation and may be retried. +type Operation[T any] func() (T, error) + +// Notify is a function called on operation error with the error and backoff duration. +type Notify func(error, time.Duration) + +// retryOptions holds configuration settings for the retry mechanism. +type retryOptions struct { + BackOff BackOff // Strategy for calculating backoff periods. + Timer timer // Timer to manage retry delays. + Notify Notify // Optional function to notify on each retry error. + MaxTries uint // Maximum number of retry attempts. + MaxElapsedTime time.Duration // Maximum total time for all retries. +} + +type RetryOption func(*retryOptions) + +// WithBackOff configures a custom backoff strategy. +func WithBackOff(b BackOff) RetryOption { + return func(args *retryOptions) { + args.BackOff = b + } +} + +// withTimer sets a custom timer for managing delays between retries. +func withTimer(t timer) RetryOption { + return func(args *retryOptions) { + args.Timer = t + } +} + +// WithNotify sets a notification function to handle retry errors. +func WithNotify(n Notify) RetryOption { + return func(args *retryOptions) { + args.Notify = n + } +} + +// WithMaxTries limits the number of retry attempts. +func WithMaxTries(n uint) RetryOption { + return func(args *retryOptions) { + args.MaxTries = n + } +} + +// WithMaxElapsedTime limits the total duration for retry attempts. +func WithMaxElapsedTime(d time.Duration) RetryOption { + return func(args *retryOptions) { + args.MaxElapsedTime = d + } +} + +// Retry attempts the operation until success, a permanent error, or backoff completion. +// It ensures the operation is executed at least once. +// +// Returns the operation result or error if retries are exhausted or context is cancelled. +func Retry[T any](ctx context.Context, operation Operation[T], opts ...RetryOption) (T, error) { + // Initialize default retry options. + args := &retryOptions{ + BackOff: NewExponentialBackOff(), + Timer: &defaultTimer{}, + MaxElapsedTime: DefaultMaxElapsedTime, + } + + // Apply user-provided options to the default settings. + for _, opt := range opts { + opt(args) + } + + defer args.Timer.Stop() + + startedAt := time.Now() + args.BackOff.Reset() + for numTries := uint(1); ; numTries++ { + // Execute the operation. + res, err := operation() + if err == nil { + return res, nil + } + + // Stop retrying if maximum tries exceeded. + if args.MaxTries > 0 && numTries >= args.MaxTries { + return res, err + } + + // Handle permanent errors without retrying. + var permanent *PermanentError + if errors.As(err, &permanent) { + return res, err + } + + // Stop retrying if context is cancelled. + if cerr := context.Cause(ctx); cerr != nil { + return res, cerr + } + + // Calculate next backoff duration. + next := args.BackOff.NextBackOff() + if next == Stop { + return res, err + } + + // Reset backoff if RetryAfterError is encountered. + var retryAfter *RetryAfterError + if errors.As(err, &retryAfter) { + next = retryAfter.Duration + args.BackOff.Reset() + } + + // Stop retrying if maximum elapsed time exceeded. + if args.MaxElapsedTime > 0 && time.Since(startedAt)+next > args.MaxElapsedTime { + return res, err + } + + // Notify on error if a notifier function is provided. + if args.Notify != nil { + args.Notify(err, next) + } + + // Wait for the next backoff period or context cancellation. + args.Timer.Start(next) + select { + case <-args.Timer.C(): + case <-ctx.Done(): + return res, context.Cause(ctx) + } + } +} diff --git a/vendor/github.com/cenkalti/backoff/v5/ticker.go b/vendor/github.com/cenkalti/backoff/v5/ticker.go new file mode 100644 index 00000000000..f0d4b2ae721 --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/ticker.go @@ -0,0 +1,83 @@ +package backoff + +import ( + "sync" + "time" +) + +// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff. +// +// Ticks will continue to arrive when the previous operation is still running, +// so operations that take a while to fail could run in quick succession. +type Ticker struct { + C <-chan time.Time + c chan time.Time + b BackOff + timer timer + stop chan struct{} + stopOnce sync.Once +} + +// NewTicker returns a new Ticker containing a channel that will send +// the time at times specified by the BackOff argument. Ticker is +// guaranteed to tick at least once. The channel is closed when Stop +// method is called or BackOff stops. It is not safe to manipulate the +// provided backoff policy (notably calling NextBackOff or Reset) +// while the ticker is running. +func NewTicker(b BackOff) *Ticker { + c := make(chan time.Time) + t := &Ticker{ + C: c, + c: c, + b: b, + timer: &defaultTimer{}, + stop: make(chan struct{}), + } + t.b.Reset() + go t.run() + return t +} + +// Stop turns off a ticker. After Stop, no more ticks will be sent. +func (t *Ticker) Stop() { + t.stopOnce.Do(func() { close(t.stop) }) +} + +func (t *Ticker) run() { + c := t.c + defer close(c) + + // Ticker is guaranteed to tick at least once. + afterC := t.send(time.Now()) + + for { + if afterC == nil { + return + } + + select { + case tick := <-afterC: + afterC = t.send(tick) + case <-t.stop: + t.c = nil // Prevent future ticks from being sent to the channel. + return + } + } +} + +func (t *Ticker) send(tick time.Time) <-chan time.Time { + select { + case t.c <- tick: + case <-t.stop: + return nil + } + + next := t.b.NextBackOff() + if next == Stop { + t.Stop() + return nil + } + + t.timer.Start(next) + return t.timer.C() +} diff --git a/vendor/github.com/cenkalti/backoff/v5/timer.go b/vendor/github.com/cenkalti/backoff/v5/timer.go new file mode 100644 index 00000000000..a895309747d --- /dev/null +++ b/vendor/github.com/cenkalti/backoff/v5/timer.go @@ -0,0 +1,35 @@ +package backoff + +import "time" + +type timer interface { + Start(duration time.Duration) + Stop() + C() <-chan time.Time +} + +// defaultTimer implements Timer interface using time.Timer +type defaultTimer struct { + timer *time.Timer +} + +// C returns the timers channel which receives the current time when the timer fires. +func (t *defaultTimer) C() <-chan time.Time { + return t.timer.C +} + +// Start starts the timer to fire after the given duration +func (t *defaultTimer) Start(duration time.Duration) { + if t.timer == nil { + t.timer = time.NewTimer(duration) + } else { + t.timer.Reset(duration) + } +} + +// Stop is called when the timer is not used anymore and resources may be freed. +func (t *defaultTimer) Stop() { + if t.timer != nil { + t.timer.Stop() + } +} diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go index 41cd4f5030e..bbe7decf09b 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go @@ -148,22 +148,20 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh } md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Error("Failed to extract ServerMetadata from context") - } - - handleForwardResponseServerMetadata(w, mux, md) - - // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2 - // Unless the request includes a TE header field indicating "trailers" - // is acceptable, as described in Section 4.3, a server SHOULD NOT - // generate trailer fields that it believes are necessary for the user - // agent to receive. - doForwardTrailers := requestAcceptsTrailers(r) - - if doForwardTrailers { - handleForwardResponseTrailerHeader(w, mux, md) - w.Header().Set("Transfer-Encoding", "chunked") + if ok { + handleForwardResponseServerMetadata(w, mux, md) + + // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2 + // Unless the request includes a TE header field indicating "trailers" + // is acceptable, as described in Section 4.3, a server SHOULD NOT + // generate trailer fields that it believes are necessary for the user + // agent to receive. + doForwardTrailers := requestAcceptsTrailers(r) + + if doForwardTrailers { + handleForwardResponseTrailerHeader(w, mux, md) + w.Header().Set("Transfer-Encoding", "chunked") + } } st := HTTPStatusFromCode(s.Code()) @@ -176,7 +174,7 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh grpclog.Errorf("Failed to write response: %v", err) } - if doForwardTrailers { + if ok && requestAcceptsTrailers(r) { handleForwardResponseTrailer(w, mux, md) } } diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go index f0727cf7c06..2f0b9e9e0f8 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go @@ -153,12 +153,10 @@ type responseBody interface { // ForwardResponseMessage forwards the message "resp" from gRPC server to REST client. func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) { md, ok := ServerMetadataFromContext(ctx) - if !ok { - grpclog.Error("Failed to extract ServerMetadata from context") + if ok { + handleForwardResponseServerMetadata(w, mux, md) } - handleForwardResponseServerMetadata(w, mux, md) - // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2 // Unless the request includes a TE header field indicating "trailers" // is acceptable, as described in Section 4.3, a server SHOULD NOT @@ -166,7 +164,7 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha // agent to receive. doForwardTrailers := requestAcceptsTrailers(req) - if doForwardTrailers { + if ok && doForwardTrailers { handleForwardResponseTrailerHeader(w, mux, md) w.Header().Set("Transfer-Encoding", "chunked") } @@ -204,7 +202,7 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha grpclog.Errorf("Failed to write response: %v", err) } - if doForwardTrailers { + if ok && doForwardTrailers { handleForwardResponseTrailer(w, mux, md) } } diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md index c076db2823f..648e4abab8c 100644 --- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md +++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -11,6 +11,57 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## [1.36.0/0.58.0/0.12.0] 2025-05-20 + +### Added + +- Add exponential histogram support in `go.opentelemetry.io/otel/exporters/prometheus`. (#6421) +- The `go.opentelemetry.io/otel/semconv/v1.31.0` package. + The package contains semantic conventions from the `v1.31.0` version of the OpenTelemetry Semantic Conventions. + See the [migration documentation](./semconv/v1.31.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.30.0`. (#6479) +- Add `Recording`, `Scope`, and `Record` types in `go.opentelemetry.io/otel/log/logtest`. (#6507) +- Add `WithHTTPClient` option to configure the `http.Client` used by `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#6751) +- Add `WithHTTPClient` option to configure the `http.Client` used by `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#6752) +- Add `WithHTTPClient` option to configure the `http.Client` used by `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6688) +- Add `ValuesGetter` in `go.opentelemetry.io/otel/propagation`, a `TextMapCarrier` that supports retrieving multiple values for a single key. (#5973) +- Add `Values` method to `HeaderCarrier` to implement the new `ValuesGetter` interface in `go.opentelemetry.io/otel/propagation`. (#5973) +- Update `Baggage` in `go.opentelemetry.io/otel/propagation` to retrieve multiple values for a key when the carrier implements `ValuesGetter`. (#5973) +- Add `AssertEqual` function in `go.opentelemetry.io/otel/log/logtest`. (#6662) +- The `go.opentelemetry.io/otel/semconv/v1.32.0` package. + The package contains semantic conventions from the `v1.32.0` version of the OpenTelemetry Semantic Conventions. + See the [migration documentation](./semconv/v1.32.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.31.0`(#6782) +- Add `Transform` option in `go.opentelemetry.io/otel/log/logtest`. (#6794) +- Add `Desc` option in `go.opentelemetry.io/otel/log/logtest`. (#6796) + +### Removed + +- Drop support for [Go 1.22]. (#6381, #6418) +- Remove `Resource` field from `EnabledParameters` in `go.opentelemetry.io/otel/sdk/log`. (#6494) +- Remove `RecordFactory` type from `go.opentelemetry.io/otel/log/logtest`. (#6492) +- Remove `ScopeRecords`, `EmittedRecord`, and `RecordFactory` types from `go.opentelemetry.io/otel/log/logtest`. (#6507) +- Remove `AssertRecordEqual` function in `go.opentelemetry.io/otel/log/logtest`, use `AssertEqual` instead. (#6662) + +### Changed + +- ⚠️ Update `github.com/prometheus/client_golang` to `v1.21.1`, which changes the `NameValidationScheme` to `UTF8Validation`. + This allows metrics names to keep original delimiters (e.g. `.`), rather than replacing with underscores. + This can be reverted by setting `github.com/prometheus/common/model.NameValidationScheme` to `LegacyValidation` in `github.com/prometheus/common/model`. (#6433) +- Initialize map with `len(keys)` in `NewAllowKeysFilter` and `NewDenyKeysFilter` to avoid unnecessary allocations in `go.opentelemetry.io/otel/attribute`. (#6455) +- `go.opentelemetry.io/otel/log/logtest` is now a separate Go module. (#6465) +- `go.opentelemetry.io/otel/sdk/log/logtest` is now a separate Go module. (#6466) +- `Recorder` in `go.opentelemetry.io/otel/log/logtest` no longer separately stores records emitted by loggers with the same instrumentation scope. (#6507) +- Improve performance of `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` by not exporting when exporter cannot accept more. (#6569, #6641) + +### Deprecated + +- Deprecate support for `model.LegacyValidation` for `go.opentelemetry.io/otel/exporters/prometheus`. (#6449) + +### Fixes + +- Stop percent encoding header environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6392) +- Ensure the `noopSpan.tracerProvider` method is not inlined in `go.opentelemetry.io/otel/trace` so the `go.opentelemetry.io/auto` instrumentation can instrument non-recording spans. (#6456) +- Use a `sync.Pool` instead of allocating `metricdata.ResourceMetrics` in `go.opentelemetry.io/otel/exporters/prometheus`. (#6472) + ## [1.35.0/0.57.0/0.11.0] 2025-03-05 This release is the last to support [Go 1.22]. @@ -3237,7 +3288,8 @@ It contains api and sdk for trace and meter. - CircleCI build CI manifest files. - CODEOWNERS file to track owners of this project. -[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.35.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.36.0...HEAD +[1.36.0/0.58.0/0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.36.0 [1.35.0/0.57.0/0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.35.0 [1.34.0/0.56.0/0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.34.0 [1.33.0/0.55.0/0.9.0/0.0.12]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.33.0 diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md index 7b8af585aab..1902dac057a 100644 --- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md +++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -643,6 +643,7 @@ should be canceled. ### Triagers +- [Alex Kats](https://github.com/akats7), Capital One - [Cheng-Zhen Yang](https://github.com/scorpionknifes), Independent ### Approvers diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md index 8421cd7e597..b6007881212 100644 --- a/vendor/go.opentelemetry.io/otel/README.md +++ b/vendor/go.opentelemetry.io/otel/README.md @@ -6,6 +6,7 @@ [![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/open-telemetry/opentelemetry-go/badge)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-go) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9996/badge)](https://www.bestpractices.dev/projects/9996) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/opentelemetry-go.svg)](https://issues.oss-fuzz.com/issues?q=project:opentelemetry-go) [![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/). @@ -53,25 +54,18 @@ Currently, this project supports the following environments. |----------|------------|--------------| | Ubuntu | 1.24 | amd64 | | Ubuntu | 1.23 | amd64 | -| Ubuntu | 1.22 | amd64 | | Ubuntu | 1.24 | 386 | | Ubuntu | 1.23 | 386 | -| Ubuntu | 1.22 | 386 | | Ubuntu | 1.24 | arm64 | | Ubuntu | 1.23 | arm64 | -| Ubuntu | 1.22 | arm64 | | macOS 13 | 1.24 | amd64 | | macOS 13 | 1.23 | amd64 | -| macOS 13 | 1.22 | amd64 | | macOS | 1.24 | arm64 | | macOS | 1.23 | arm64 | -| macOS | 1.22 | arm64 | | Windows | 1.24 | amd64 | | Windows | 1.23 | amd64 | -| Windows | 1.22 | amd64 | | Windows | 1.24 | 386 | | Windows | 1.23 | 386 | -| Windows | 1.22 | 386 | While this project should work for other systems, no compatibility guarantees are made for those systems currently. diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md index 1e13ae54f71..7c1a9119dcc 100644 --- a/vendor/go.opentelemetry.io/otel/RELEASING.md +++ b/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -1,5 +1,9 @@ # Release Process +## Create a `Version Release` issue + +Create a `Version Release` issue to track the release process. + ## Semantic Convention Generation New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. @@ -123,6 +127,16 @@ Importantly, bump any package versions referenced to be the latest one you just [Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/ [content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go +### Close the milestone + +Once a release is made, ensure all issues that were fixed and PRs that were merged as part of this release are added to the corresponding milestone. +This helps track what changes were included in each release. + +- To find issues that haven't been included in a milestone, use this [GitHub search query](https://github.com/open-telemetry/opentelemetry-go/issues?q=is%3Aissue%20no%3Amilestone%20is%3Aclosed%20sort%3Aupdated-desc%20reason%3Acompleted%20-label%3AStale%20linked%3Apr) +- To find merged PRs that haven't been included in a milestone, use this [GitHub search query](https://github.com/open-telemetry/opentelemetry-go/pulls?q=is%3Apr+no%3Amilestone+is%3Amerged). + +Once all related issues and PRs have been added to the milestone, close the milestone. + ### Demo Repository Bump the dependencies in the following Go services: @@ -130,3 +144,7 @@ Bump the dependencies in the following Go services: - [`accounting`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accounting) - [`checkoutservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkout) - [`productcatalogservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/product-catalog) + +### Close the `Version Release` issue + +Once the todo list in the `Version Release` issue is complete, close the issue. diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go index be9cd922d87..3eeaa5d4426 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/filter.go +++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go @@ -19,7 +19,7 @@ func NewAllowKeysFilter(keys ...Key) Filter { return func(kv KeyValue) bool { return false } } - allowed := make(map[Key]struct{}) + allowed := make(map[Key]struct{}, len(keys)) for _, k := range keys { allowed[k] = struct{}{} } @@ -38,7 +38,7 @@ func NewDenyKeysFilter(keys ...Key) Filter { return func(kv KeyValue) bool { return true } } - forbid := make(map[Key]struct{}) + forbid := make(map[Key]struct{}, len(keys)) for _, k := range keys { forbid[k] = struct{}{} } diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go similarity index 97% rename from vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go rename to vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go index 691d96c7554..b76d2bbfdbd 100644 --- a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go +++ b/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go @@ -5,7 +5,7 @@ Package attribute provide several helper functions for some commonly used logic of processing attributes. */ -package attribute // import "go.opentelemetry.io/otel/internal/attribute" +package attribute // import "go.opentelemetry.io/otel/attribute/internal" import ( "reflect" diff --git a/vendor/go.opentelemetry.io/otel/attribute/rawhelpers.go b/vendor/go.opentelemetry.io/otel/attribute/rawhelpers.go new file mode 100644 index 00000000000..5791c6e7aaa --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/rawhelpers.go @@ -0,0 +1,37 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "math" +) + +func boolToRaw(b bool) uint64 { // nolint:revive // b is not a control flag. + if b { + return 1 + } + return 0 +} + +func rawToBool(r uint64) bool { + return r != 0 +} + +func int64ToRaw(i int64) uint64 { + // Assumes original was a valid int64 (overflow not checked). + return uint64(i) // nolint: gosec +} + +func rawToInt64(r uint64) int64 { + // Assumes original was a valid int64 (overflow not checked). + return int64(r) // nolint: gosec +} + +func float64ToRaw(f float64) uint64 { + return math.Float64bits(f) +} + +func rawToFloat64(r uint64) float64 { + return math.Float64frombits(r) +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go index 9ea0ecbbd27..817eecacf11 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/value.go +++ b/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -9,8 +9,7 @@ import ( "reflect" "strconv" - "go.opentelemetry.io/otel/internal" - "go.opentelemetry.io/otel/internal/attribute" + attribute "go.opentelemetry.io/otel/attribute/internal" ) //go:generate stringer -type=Type @@ -51,7 +50,7 @@ const ( func BoolValue(v bool) Value { return Value{ vtype: BOOL, - numeric: internal.BoolToRaw(v), + numeric: boolToRaw(v), } } @@ -82,7 +81,7 @@ func IntSliceValue(v []int) Value { func Int64Value(v int64) Value { return Value{ vtype: INT64, - numeric: internal.Int64ToRaw(v), + numeric: int64ToRaw(v), } } @@ -95,7 +94,7 @@ func Int64SliceValue(v []int64) Value { func Float64Value(v float64) Value { return Value{ vtype: FLOAT64, - numeric: internal.Float64ToRaw(v), + numeric: float64ToRaw(v), } } @@ -125,7 +124,7 @@ func (v Value) Type() Type { // AsBool returns the bool value. Make sure that the Value's type is // BOOL. func (v Value) AsBool() bool { - return internal.RawToBool(v.numeric) + return rawToBool(v.numeric) } // AsBoolSlice returns the []bool value. Make sure that the Value's type is @@ -144,7 +143,7 @@ func (v Value) asBoolSlice() []bool { // AsInt64 returns the int64 value. Make sure that the Value's type is // INT64. func (v Value) AsInt64() int64 { - return internal.RawToInt64(v.numeric) + return rawToInt64(v.numeric) } // AsInt64Slice returns the []int64 value. Make sure that the Value's type is @@ -163,7 +162,7 @@ func (v Value) asInt64Slice() []int64 { // AsFloat64 returns the float64 value. Make sure that the Value's // type is FLOAT64. func (v Value) AsFloat64() float64 { - return internal.RawToFloat64(v.numeric) + return rawToFloat64(v.numeric) } // AsFloat64Slice returns the []float64 value. Make sure that the Value's type is diff --git a/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile b/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile index e4c4a753c88..51fb76b30d0 100644 --- a/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile +++ b/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile @@ -1,3 +1,4 @@ # This is a renovate-friendly source of Docker images. -FROM python:3.13.2-slim-bullseye@sha256:31b581c8218e1f3c58672481b3b7dba8e898852866b408c6a984c22832523935 AS python -FROM otel/weaver:v0.13.2@sha256:ae7346b992e477f629ea327e0979e8a416a97f7956ab1f7e95ac1f44edf1a893 AS weaver +FROM python:3.13.3-slim-bullseye@sha256:9e3f9243e06fd68eb9519074b49878eda20ad39a855fac51aaffb741de20726e AS python +FROM otel/weaver:v0.15.0@sha256:1cf1c72eaed57dad813c2e359133b8a15bd4facf305aae5b13bdca6d3eccff56 AS weaver +FROM avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee AS markdown diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go index 4571a5ca397..ca4544f0dae 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go @@ -1,6 +1,8 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package tracetransform provides conversion functionality for the otlptrace +// exporters. package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform" import ( diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go index 4abf48d1f62..6eacdf311d2 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go @@ -1,9 +1,11 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/envconfig/envconfig.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package envconfig provides functionality to parse configuration from +// environment variables. package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig" import ( diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go index 97cd6c54f70..b6e6b10fbf1 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package internal provides internal functionally for the otlptracegrpc package. package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal" //go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go index 7bb189a94bc..1d840be205b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl // Copyright The OpenTelemetry Authors @@ -77,8 +77,16 @@ func getOptionsFromEnv() []GenericOption { }), envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), - envconfig.WithClientCert("CLIENT_CERTIFICATE", "CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }), - envconfig.WithClientCert("TRACES_CLIENT_CERTIFICATE", "TRACES_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }), + envconfig.WithClientCert( + "CLIENT_CERTIFICATE", + "CLIENT_KEY", + func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }, + ), + envconfig.WithClientCert( + "TRACES_CLIENT_CERTIFICATE", + "TRACES_CLIENT_KEY", + func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }, + ), withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }), envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }), envconfig.WithBool("TRACES_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }), diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go index 0a317d92637..506ca00b61f 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go @@ -1,9 +1,10 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package otlpconfig provides configuration for the otlptrace exporters. package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" import ( @@ -52,7 +53,9 @@ type ( // gRPC configurations GRPCCredentials credentials.TransportCredentials - Proxy HTTPTransportProxyFunc + // HTTP configurations + Proxy HTTPTransportProxyFunc + HTTPClient *http.Client } Config struct { @@ -349,3 +352,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption { return cfg }) } + +func WithHTTPClient(c *http.Client) GenericOption { + return newGenericOption(func(cfg Config) Config { + cfg.Traces.HTTPClient = c + return cfg + }) +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go index 3d4f699d477..91849038722 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl // Copyright The OpenTelemetry Authors diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go index 38b97a01313..ba6e411835f 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl // Copyright The OpenTelemetry Authors diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go index a12ea4c48eb..1c465942336 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/partialsuccess.go // Copyright The OpenTelemetry Authors diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go index 1c5450ab62d..777e68a7bbd 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/retry/retry.go.tmpl // Copyright The OpenTelemetry Authors @@ -14,7 +14,7 @@ import ( "fmt" "time" - "github.com/cenkalti/backoff/v4" + "github.com/cenkalti/backoff/v5" ) // DefaultConfig are the recommended defaults to use. @@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { RandomizationFactor: backoff.DefaultRandomizationFactor, Multiplier: backoff.DefaultMultiplier, MaxInterval: c.MaxInterval, - MaxElapsedTime: c.MaxElapsedTime, - Stop: backoff.Stop, - Clock: backoff.SystemClock, } b.Reset() + maxElapsedTime := c.MaxElapsedTime + startTime := time.Now() + for { err := fn(ctx) if err == nil { @@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { return err } - bOff := b.NextBackOff() - if bOff == backoff.Stop { + if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime { return fmt.Errorf("max retry time elapsed: %w", err) } // Wait for the greater of the backoff or throttle delay. - var delay time.Duration - if bOff > throttle { - delay = bOff - } else { - elapsed := b.GetElapsedTime() - if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime { - return fmt.Errorf("max retry time would elapse: %w", err) - } - delay = throttle + bOff := b.NextBackOff() + delay := max(throttle, bOff) + + elapsed := time.Since(startTime) + if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime { + return fmt.Errorf("max retry time would elapse: %w", err) } if ctxErr := waitFunc(ctx, delay); ctxErr != nil { diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go index 00ab1f20c6d..2da2298701b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go @@ -199,8 +199,9 @@ func WithTimeout(duration time.Duration) Option { // explicitly returns a backoff time in the response. That time will take // precedence over these settings. // -// These settings do not define any network retry strategy. That is entirely -// handled by the gRPC ClientConn. +// These settings define the retry strategy implemented by the exporter. +// These settings do not define any network retry strategy. +// That is handled by the gRPC ClientConn. // // If unset, the default retry policy will be used. It will retry the export // 5 seconds after receiving a retryable error and increase exponentially diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go index 16c006b2cfd..583a8f86757 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go @@ -71,20 +71,24 @@ var _ otlptrace.Client = (*client)(nil) func NewClient(opts ...Option) otlptrace.Client { cfg := otlpconfig.NewHTTPConfig(asHTTPOptions(opts)...) - httpClient := &http.Client{ - Transport: ourTransport, - Timeout: cfg.Traces.Timeout, - } - - if cfg.Traces.TLSCfg != nil || cfg.Traces.Proxy != nil { - clonedTransport := ourTransport.Clone() - httpClient.Transport = clonedTransport + httpClient := cfg.Traces.HTTPClient - if cfg.Traces.TLSCfg != nil { - clonedTransport.TLSClientConfig = cfg.Traces.TLSCfg + if httpClient == nil { + httpClient = &http.Client{ + Transport: ourTransport, + Timeout: cfg.Traces.Timeout, } - if cfg.Traces.Proxy != nil { - clonedTransport.Proxy = cfg.Traces.Proxy + + if cfg.Traces.TLSCfg != nil || cfg.Traces.Proxy != nil { + clonedTransport := ourTransport.Clone() + httpClient.Transport = clonedTransport + + if cfg.Traces.TLSCfg != nil { + clonedTransport.TLSClientConfig = cfg.Traces.TLSCfg + } + if cfg.Traces.Proxy != nil { + clonedTransport.Proxy = cfg.Traces.Proxy + } } } @@ -300,7 +304,7 @@ type request struct { // reset reinitializes the request Body and uses ctx for the request. func (r *request) reset(ctx context.Context) { r.Body = r.bodyReader() - r.Request = r.Request.WithContext(ctx) + r.Request = r.WithContext(ctx) } // retryableError represents a request failure that can be retried. diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig/envconfig.go index f30bb66aeda..f4385fb4e9e 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig/envconfig.go @@ -1,9 +1,11 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/envconfig/envconfig.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package envconfig provides functionality to parse configuration from +// environment variables. package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig" import ( diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/gen.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/gen.go index e4142b9d7c5..3d344dc85ee 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/gen.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/gen.go @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package internal provides internal functionally for the otlptracehttp package. package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal" //go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/envconfig.go index ff4141b6dc8..121b02f5cd3 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/envconfig.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl // Copyright The OpenTelemetry Authors @@ -77,8 +77,16 @@ func getOptionsFromEnv() []GenericOption { }), envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), - envconfig.WithClientCert("CLIENT_CERTIFICATE", "CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }), - envconfig.WithClientCert("TRACES_CLIENT_CERTIFICATE", "TRACES_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }), + envconfig.WithClientCert( + "CLIENT_CERTIFICATE", + "CLIENT_KEY", + func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }, + ), + envconfig.WithClientCert( + "TRACES_CLIENT_CERTIFICATE", + "TRACES_CLIENT_KEY", + func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }, + ), withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }), envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }), envconfig.WithBool("TRACES_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }), diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go index 6a9c4d3a652..c857db05692 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go @@ -1,9 +1,10 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package otlpconfig provides configuration for the otlptrace exporters. package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig" import ( @@ -52,7 +53,9 @@ type ( // gRPC configurations GRPCCredentials credentials.TransportCredentials - Proxy HTTPTransportProxyFunc + // HTTP configurations + Proxy HTTPTransportProxyFunc + HTTPClient *http.Client } Config struct { @@ -349,3 +352,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption { return cfg }) } + +func WithHTTPClient(c *http.Client) GenericOption { + return newGenericOption(func(cfg Config) Config { + cfg.Traces.HTTPClient = c + return cfg + }) +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/optiontypes.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/optiontypes.go index bc4db059524..6a52b58cc0b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/optiontypes.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/optiontypes.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl // Copyright The OpenTelemetry Authors diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/tls.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/tls.go index dd6f12b220b..5b389cb03fa 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/tls.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/tls.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl // Copyright The OpenTelemetry Authors diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/partialsuccess.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/partialsuccess.go index 9e04a9bc196..418e66428ae 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/partialsuccess.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/partialsuccess.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/partialsuccess.go // Copyright The OpenTelemetry Authors diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry/retry.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry/retry.go index 86c4819f449..e9d35c7fae3 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry/retry.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry/retry.go @@ -1,4 +1,4 @@ -// Code created by gotmpl. DO NOT MODIFY. +// Code generated by gotmpl. DO NOT MODIFY. // source: internal/shared/otlp/retry/retry.go.tmpl // Copyright The OpenTelemetry Authors @@ -14,7 +14,7 @@ import ( "fmt" "time" - "github.com/cenkalti/backoff/v4" + "github.com/cenkalti/backoff/v5" ) // DefaultConfig are the recommended defaults to use. @@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { RandomizationFactor: backoff.DefaultRandomizationFactor, Multiplier: backoff.DefaultMultiplier, MaxInterval: c.MaxInterval, - MaxElapsedTime: c.MaxElapsedTime, - Stop: backoff.Stop, - Clock: backoff.SystemClock, } b.Reset() + maxElapsedTime := c.MaxElapsedTime + startTime := time.Now() + for { err := fn(ctx) if err == nil { @@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { return err } - bOff := b.NextBackOff() - if bOff == backoff.Stop { + if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime { return fmt.Errorf("max retry time elapsed: %w", err) } // Wait for the greater of the backoff or throttle delay. - var delay time.Duration - if bOff > throttle { - delay = bOff - } else { - elapsed := b.GetElapsedTime() - if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime { - return fmt.Errorf("max retry time would elapse: %w", err) - } - delay = throttle + bOff := b.NextBackOff() + delay := max(throttle, bOff) + + elapsed := time.Since(startTime) + if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime { + return fmt.Errorf("max retry time would elapse: %w", err) } if ctxErr := waitFunc(ctx, delay); ctxErr != nil { diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go index 3559c5664f4..cfe21dbfb05 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go @@ -153,3 +153,19 @@ func WithRetry(rc RetryConfig) Option { func WithProxy(pf HTTPTransportProxyFunc) Option { return wrappedOption{otlpconfig.WithProxy(otlpconfig.HTTPTransportProxyFunc(pf))} } + +// WithHTTPClient sets the HTTP client to used by the exporter. +// +// This option will take precedence over [WithProxy], [WithTimeout], +// [WithTLSClientConfig] options as well as OTEL_EXPORTER_OTLP_CERTIFICATE, +// OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE, OTEL_EXPORTER_OTLP_TIMEOUT, +// OTEL_EXPORTER_OTLP_TRACES_TIMEOUT environment variables. +// +// Timeout and all other fields of the passed [http.Client] are left intact. +// +// Be aware that passing an HTTP client with transport like +// [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewTransport] can +// cause the client to be instrumented twice and cause infinite recursion. +func WithHTTPClient(c *http.Client) Option { + return wrappedOption{otlpconfig.WithHTTPClient(c)} +} diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go index f5cad46b74d..5f78bfdfb06 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go @@ -5,5 +5,5 @@ package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" // Version is the current release version of the OpenTelemetry OTLP trace exporter in use. func Version() string { - return "1.35.0" + return "1.36.0" } diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh deleted file mode 100644 index 93e80ea306c..00000000000 --- a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -set -euo pipefail - -top_dir='.' -if [[ $# -gt 0 ]]; then - top_dir="${1}" -fi - -p=$(pwd) -mod_dirs=() - -# Note `mapfile` does not exist in older bash versions: -# https://stackoverflow.com/questions/41475261/need-alternative-to-readarray-mapfile-for-script-on-older-version-of-bash - -while IFS= read -r line; do - mod_dirs+=("$line") -done < <(find "${top_dir}" -type f -name 'go.mod' -exec dirname {} \; | sort) - -for mod_dir in "${mod_dirs[@]}"; do - cd "${mod_dir}" - - while IFS= read -r line; do - echo ".${line#${p}}" - done < <(go list --find -f '{{.Name}}|{{.Dir}}' ./... | grep '^main|' | cut -f 2- -d '|') - cd "${p}" -done diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go deleted file mode 100644 index 4259f0320d4..00000000000 --- a/vendor/go.opentelemetry.io/otel/internal/gen.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package internal // import "go.opentelemetry.io/otel/internal" - -//go:generate gotmpl --body=./shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go -//go:generate gotmpl --body=./shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go -//go:generate gotmpl --body=./shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go - -//go:generate gotmpl --body=./shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go -//go:generate gotmpl --body=./shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go -//go:generate gotmpl --body=./shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go -//go:generate gotmpl --body=./shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go -//go:generate gotmpl --body=./shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/internal/matchers\"}" --out=internaltest/harness.go -//go:generate gotmpl --body=./shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go -//go:generate gotmpl --body=./shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go -//go:generate gotmpl --body=./shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go -//go:generate gotmpl --body=./shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go index c657ff8e755..2e47b2964c8 100644 --- a/vendor/go.opentelemetry.io/otel/internal/global/handler.go +++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package global provides the OpenTelemetry global API. package global // import "go.opentelemetry.io/otel/internal/global" import ( diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go index a6acd8dca66..adb37b5b0e7 100644 --- a/vendor/go.opentelemetry.io/otel/internal/global/meter.go +++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -169,7 +169,10 @@ func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) return i, nil } -func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { +func (m *meter) Int64UpDownCounter( + name string, + options ...metric.Int64UpDownCounterOption, +) (metric.Int64UpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -238,7 +241,10 @@ func (m *meter) Int64Gauge(name string, options ...metric.Int64GaugeOption) (met return i, nil } -func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { +func (m *meter) Int64ObservableCounter( + name string, + options ...metric.Int64ObservableCounterOption, +) (metric.Int64ObservableCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -261,7 +267,10 @@ func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64Obser return i, nil } -func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { +func (m *meter) Int64ObservableUpDownCounter( + name string, + options ...metric.Int64ObservableUpDownCounterOption, +) (metric.Int64ObservableUpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -284,7 +293,10 @@ func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int6 return i, nil } -func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { +func (m *meter) Int64ObservableGauge( + name string, + options ...metric.Int64ObservableGaugeOption, +) (metric.Int64ObservableGauge, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -330,7 +342,10 @@ func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOpti return i, nil } -func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { +func (m *meter) Float64UpDownCounter( + name string, + options ...metric.Float64UpDownCounterOption, +) (metric.Float64UpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -353,7 +368,10 @@ func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDow return i, nil } -func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { +func (m *meter) Float64Histogram( + name string, + options ...metric.Float64HistogramOption, +) (metric.Float64Histogram, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -399,7 +417,10 @@ func (m *meter) Float64Gauge(name string, options ...metric.Float64GaugeOption) return i, nil } -func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { +func (m *meter) Float64ObservableCounter( + name string, + options ...metric.Float64ObservableCounterOption, +) (metric.Float64ObservableCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -422,7 +443,10 @@ func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64O return i, nil } -func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { +func (m *meter) Float64ObservableUpDownCounter( + name string, + options ...metric.Float64ObservableUpDownCounterOption, +) (metric.Float64ObservableUpDownCounter, error) { m.mtx.Lock() defer m.mtx.Unlock() @@ -445,7 +469,10 @@ func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Fl return i, nil } -func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { +func (m *meter) Float64ObservableGauge( + name string, + options ...metric.Float64ObservableGaugeOption, +) (metric.Float64ObservableGauge, error) { m.mtx.Lock() defer m.mtx.Unlock() diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go index 8982aa0dc56..49e4ac4faab 100644 --- a/vendor/go.opentelemetry.io/otel/internal/global/trace.go +++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go @@ -158,7 +158,18 @@ func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStart // a nonRecordingSpan by default. var autoInstEnabled = new(bool) -func (t *tracer) newSpan(ctx context.Context, autoSpan *bool, name string, opts []trace.SpanStartOption) (context.Context, trace.Span) { +// newSpan is called by tracer.Start so auto-instrumentation can attach an eBPF +// uprobe to this code. +// +// "noinline" pragma prevents the method from ever being inlined. +// +//go:noinline +func (t *tracer) newSpan( + ctx context.Context, + autoSpan *bool, + name string, + opts []trace.SpanStartOption, +) (context.Context, trace.Span) { // autoInstEnabled is passed to newSpan via the autoSpan parameter. This is // so the auto-instrumentation can define a uprobe for (*t).newSpan and be // provided with the address of the bool autoInstEnabled points to. It diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go deleted file mode 100644 index b2fe3e41d3b..00000000000 --- a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package internal // import "go.opentelemetry.io/otel/internal" - -import ( - "math" - "unsafe" -) - -func BoolToRaw(b bool) uint64 { // nolint:revive // b is not a control flag. - if b { - return 1 - } - return 0 -} - -func RawToBool(r uint64) bool { - return r != 0 -} - -func Int64ToRaw(i int64) uint64 { - // Assumes original was a valid int64 (overflow not checked). - return uint64(i) // nolint: gosec -} - -func RawToInt64(r uint64) int64 { - // Assumes original was a valid int64 (overflow not checked). - return int64(r) // nolint: gosec -} - -func Float64ToRaw(f float64) uint64 { - return math.Float64bits(f) -} - -func RawToFloat64(r uint64) float64 { - return math.Float64frombits(r) -} - -func RawPtrToFloat64Ptr(r *uint64) *float64 { - // Assumes original was a valid *float64 (overflow not checked). - return (*float64)(unsafe.Pointer(r)) // nolint: gosec -} - -func RawPtrToInt64Ptr(r *uint64) *int64 { - // Assumes original was a valid *int64 (overflow not checked). - return (*int64)(unsafe.Pointer(r)) // nolint: gosec -} diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go index f8435d8f288..b7fc973a66c 100644 --- a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go +++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go @@ -106,7 +106,9 @@ type Float64ObservableUpDownCounterConfig struct { // NewFloat64ObservableUpDownCounterConfig returns a new // [Float64ObservableUpDownCounterConfig] with all opts applied. -func NewFloat64ObservableUpDownCounterConfig(opts ...Float64ObservableUpDownCounterOption) Float64ObservableUpDownCounterConfig { +func NewFloat64ObservableUpDownCounterConfig( + opts ...Float64ObservableUpDownCounterOption, +) Float64ObservableUpDownCounterConfig { var config Float64ObservableUpDownCounterConfig for _, o := range opts { config = o.applyFloat64ObservableUpDownCounter(config) @@ -239,12 +241,16 @@ type float64CallbackOpt struct { cback Float64Callback } -func (o float64CallbackOpt) applyFloat64ObservableCounter(cfg Float64ObservableCounterConfig) Float64ObservableCounterConfig { +func (o float64CallbackOpt) applyFloat64ObservableCounter( + cfg Float64ObservableCounterConfig, +) Float64ObservableCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } -func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter(cfg Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { +func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter( + cfg Float64ObservableUpDownCounterConfig, +) Float64ObservableUpDownCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go index e079aaef169..4404b71a22f 100644 --- a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go +++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go @@ -105,7 +105,9 @@ type Int64ObservableUpDownCounterConfig struct { // NewInt64ObservableUpDownCounterConfig returns a new // [Int64ObservableUpDownCounterConfig] with all opts applied. -func NewInt64ObservableUpDownCounterConfig(opts ...Int64ObservableUpDownCounterOption) Int64ObservableUpDownCounterConfig { +func NewInt64ObservableUpDownCounterConfig( + opts ...Int64ObservableUpDownCounterOption, +) Int64ObservableUpDownCounterConfig { var config Int64ObservableUpDownCounterConfig for _, o := range opts { config = o.applyInt64ObservableUpDownCounter(config) @@ -242,7 +244,9 @@ func (o int64CallbackOpt) applyInt64ObservableCounter(cfg Int64ObservableCounter return cfg } -func (o int64CallbackOpt) applyInt64ObservableUpDownCounter(cfg Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { +func (o int64CallbackOpt) applyInt64ObservableUpDownCounter( + cfg Int64ObservableUpDownCounterConfig, +) Int64ObservableUpDownCounterConfig { cfg.callbacks = append(cfg.callbacks, o.cback) return cfg } diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go index a535782e1d9..9f48d5f117c 100644 --- a/vendor/go.opentelemetry.io/otel/metric/instrument.go +++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go @@ -63,7 +63,9 @@ func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) return c } -func (o descOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { +func (o descOpt) applyFloat64ObservableUpDownCounter( + c Float64ObservableUpDownCounterConfig, +) Float64ObservableUpDownCounterConfig { c.description = string(o) return c } @@ -98,7 +100,9 @@ func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int return c } -func (o descOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { +func (o descOpt) applyInt64ObservableUpDownCounter( + c Int64ObservableUpDownCounterConfig, +) Int64ObservableUpDownCounterConfig { c.description = string(o) return c } @@ -138,7 +142,9 @@ func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) return c } -func (o unitOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { +func (o unitOpt) applyFloat64ObservableUpDownCounter( + c Float64ObservableUpDownCounterConfig, +) Float64ObservableUpDownCounterConfig { c.unit = string(o) return c } @@ -173,7 +179,9 @@ func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int return c } -func (o unitOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { +func (o unitOpt) applyInt64ObservableUpDownCounter( + c Int64ObservableUpDownCounterConfig, +) Int64ObservableUpDownCounterConfig { c.unit = string(o) return c } diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go index 14e08c24a4b..fdd2a7011c3 100644 --- a/vendor/go.opentelemetry.io/otel/metric/meter.go +++ b/vendor/go.opentelemetry.io/otel/metric/meter.go @@ -110,7 +110,10 @@ type Meter interface { // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. - Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error) + Int64ObservableUpDownCounter( + name string, + options ...Int64ObservableUpDownCounterOption, + ) (Int64ObservableUpDownCounter, error) // Int64ObservableGauge returns a new Int64ObservableGauge instrument // identified by name and configured with options. The instrument is used @@ -194,7 +197,10 @@ type Meter interface { // The name needs to conform to the OpenTelemetry instrument name syntax. // See the Instrument Name section of the package documentation for more // information. - Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error) + Float64ObservableUpDownCounter( + name string, + options ...Float64ObservableUpDownCounterOption, + ) (Float64ObservableUpDownCounter, error) // Float64ObservableGauge returns a new Float64ObservableGauge instrument // identified by name and configured with options. The instrument is used diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go index ca6fcbdc099..9afb69e583b 100644 --- a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go +++ b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go @@ -86,13 +86,19 @@ func (Meter) Int64Gauge(string, ...metric.Int64GaugeOption) (metric.Int64Gauge, // Int64ObservableCounter returns an ObservableCounter used to record int64 // measurements that produces no telemetry. -func (Meter) Int64ObservableCounter(string, ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { +func (Meter) Int64ObservableCounter( + string, + ...metric.Int64ObservableCounterOption, +) (metric.Int64ObservableCounter, error) { return Int64ObservableCounter{}, nil } // Int64ObservableUpDownCounter returns an ObservableUpDownCounter used to // record int64 measurements that produces no telemetry. -func (Meter) Int64ObservableUpDownCounter(string, ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { +func (Meter) Int64ObservableUpDownCounter( + string, + ...metric.Int64ObservableUpDownCounterOption, +) (metric.Int64ObservableUpDownCounter, error) { return Int64ObservableUpDownCounter{}, nil } @@ -128,19 +134,28 @@ func (Meter) Float64Gauge(string, ...metric.Float64GaugeOption) (metric.Float64G // Float64ObservableCounter returns an ObservableCounter used to record int64 // measurements that produces no telemetry. -func (Meter) Float64ObservableCounter(string, ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { +func (Meter) Float64ObservableCounter( + string, + ...metric.Float64ObservableCounterOption, +) (metric.Float64ObservableCounter, error) { return Float64ObservableCounter{}, nil } // Float64ObservableUpDownCounter returns an ObservableUpDownCounter used to // record int64 measurements that produces no telemetry. -func (Meter) Float64ObservableUpDownCounter(string, ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { +func (Meter) Float64ObservableUpDownCounter( + string, + ...metric.Float64ObservableUpDownCounterOption, +) (metric.Float64ObservableUpDownCounter, error) { return Float64ObservableUpDownCounter{}, nil } // Float64ObservableGauge returns an ObservableGauge used to record int64 // measurements that produces no telemetry. -func (Meter) Float64ObservableGauge(string, ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { +func (Meter) Float64ObservableGauge( + string, + ...metric.Float64ObservableGaugeOption, +) (metric.Float64ObservableGauge, error) { return Float64ObservableGauge{}, nil } diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go index 552263ba734..ebda5026d6b 100644 --- a/vendor/go.opentelemetry.io/otel/propagation/baggage.go +++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go @@ -28,7 +28,21 @@ func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) { } // Extract returns a copy of parent with the baggage from the carrier added. +// If carrier implements [ValuesGetter] (e.g. [HeaderCarrier]), Values is invoked +// for multiple values extraction. Otherwise, Get is called. func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context { + if multiCarrier, ok := carrier.(ValuesGetter); ok { + return extractMultiBaggage(parent, multiCarrier) + } + return extractSingleBaggage(parent, carrier) +} + +// Fields returns the keys who's values are set with Inject. +func (b Baggage) Fields() []string { + return []string{baggageHeader} +} + +func extractSingleBaggage(parent context.Context, carrier TextMapCarrier) context.Context { bStr := carrier.Get(baggageHeader) if bStr == "" { return parent @@ -41,7 +55,23 @@ func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context return baggage.ContextWithBaggage(parent, bag) } -// Fields returns the keys who's values are set with Inject. -func (b Baggage) Fields() []string { - return []string{baggageHeader} +func extractMultiBaggage(parent context.Context, carrier ValuesGetter) context.Context { + bVals := carrier.Values(baggageHeader) + if len(bVals) == 0 { + return parent + } + var members []baggage.Member + for _, bStr := range bVals { + currBag, err := baggage.Parse(bStr) + if err != nil { + continue + } + members = append(members, currBag.Members()...) + } + + b, err := baggage.New(members...) + if err != nil || b.Len() == 0 { + return parent + } + return baggage.ContextWithBaggage(parent, b) } diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go index 8c8286aab4d..5c8c26ea2eb 100644 --- a/vendor/go.opentelemetry.io/otel/propagation/propagation.go +++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go @@ -9,6 +9,7 @@ import ( ) // TextMapCarrier is the storage medium used by a TextMapPropagator. +// See ValuesGetter for how a TextMapCarrier can get multiple values for a key. type TextMapCarrier interface { // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. @@ -29,6 +30,18 @@ type TextMapCarrier interface { // must never be done outside of a new major release. } +// ValuesGetter can return multiple values for a single key, +// with contrast to TextMapCarrier.Get which returns a single value. +type ValuesGetter interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Values returns all values associated with the passed key. + Values(key string) []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + // MapCarrier is a TextMapCarrier that uses a map held in memory as a storage // medium for propagated key-value pairs. type MapCarrier map[string]string @@ -55,14 +68,25 @@ func (c MapCarrier) Keys() []string { return keys } -// HeaderCarrier adapts http.Header to satisfy the TextMapCarrier interface. +// HeaderCarrier adapts http.Header to satisfy the TextMapCarrier and ValuesGetter interfaces. type HeaderCarrier http.Header -// Get returns the value associated with the passed key. +// Compile time check that HeaderCarrier implements ValuesGetter. +var _ TextMapCarrier = HeaderCarrier{} + +// Compile time check that HeaderCarrier implements TextMapCarrier. +var _ ValuesGetter = HeaderCarrier{} + +// Get returns the first value associated with the passed key. func (hc HeaderCarrier) Get(key string) string { return http.Header(hc).Get(key) } +// Values returns all values associated with the passed key. +func (hc HeaderCarrier) Values(key string) []string { + return http.Header(hc).Values(key) +} + // Set stores the key-value pair. func (hc HeaderCarrier) Set(key string, value string) { http.Header(hc).Set(key, value) @@ -89,6 +113,8 @@ type TextMapPropagator interface { // must never be done outside of a new major release. // Extract reads cross-cutting concerns from the carrier into a Context. + // Implementations may check if the carrier implements ValuesGetter, + // to support extraction of multiple values per key. Extract(ctx context.Context, carrier TextMapCarrier) context.Context // DO NOT CHANGE: any modification will not be backwards compatible and // must never be done outside of a new major release. diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go b/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go index 07923ed8d94..e3309231d42 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go +++ b/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go @@ -1,6 +1,8 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package env provides types and functionality for environment variable support +// in the OpenTelemetry SDK. package env // import "go.opentelemetry.io/otel/sdk/internal/env" import ( diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go index 925bcf99305..c8d3fb7e3cf 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go @@ -5,10 +5,8 @@ package trace // import "go.opentelemetry.io/otel/sdk/trace" import ( "context" - crand "crypto/rand" "encoding/binary" - "math/rand" - "sync" + "math/rand/v2" "go.opentelemetry.io/otel/trace" ) @@ -29,20 +27,15 @@ type IDGenerator interface { // must never be done outside of a new major release. } -type randomIDGenerator struct { - sync.Mutex - randSource *rand.Rand -} +type randomIDGenerator struct{} var _ IDGenerator = &randomIDGenerator{} // NewSpanID returns a non-zero span ID from a randomly-chosen sequence. func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.TraceID) trace.SpanID { - gen.Lock() - defer gen.Unlock() sid := trace.SpanID{} for { - _, _ = gen.randSource.Read(sid[:]) + binary.NativeEndian.PutUint64(sid[:], rand.Uint64()) if sid.IsValid() { break } @@ -53,18 +46,17 @@ func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.Trace // NewIDs returns a non-zero trace ID and a non-zero span ID from a // randomly-chosen sequence. func (gen *randomIDGenerator) NewIDs(ctx context.Context) (trace.TraceID, trace.SpanID) { - gen.Lock() - defer gen.Unlock() tid := trace.TraceID{} sid := trace.SpanID{} for { - _, _ = gen.randSource.Read(tid[:]) + binary.NativeEndian.PutUint64(tid[:8], rand.Uint64()) + binary.NativeEndian.PutUint64(tid[8:], rand.Uint64()) if tid.IsValid() { break } } for { - _, _ = gen.randSource.Read(sid[:]) + binary.NativeEndian.PutUint64(sid[:], rand.Uint64()) if sid.IsValid() { break } @@ -73,9 +65,5 @@ func (gen *randomIDGenerator) NewIDs(ctx context.Context) (trace.TraceID, trace. } func defaultIDGenerator() IDGenerator { - gen := &randomIDGenerator{} - var rngSeed int64 - _ = binary.Read(crand.Reader, binary.LittleEndian, &rngSeed) - gen.randSource = rand.New(rand.NewSource(rngSeed)) - return gen + return &randomIDGenerator{} } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go index 185aa7c08f7..0e2a2e7c60d 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go @@ -169,7 +169,17 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T // slowing down all tracing consumers. // - Logging code may be instrumented with tracing and deadlock because it could try // acquiring the same non-reentrant mutex. - global.Info("Tracer created", "name", name, "version", is.Version, "schemaURL", is.SchemaURL, "attributes", is.Attributes) + global.Info( + "Tracer created", + "name", + name, + "version", + is.Version, + "schemaURL", + is.SchemaURL, + "attributes", + is.Attributes, + ) } return t } diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go index 43419d3b541..0b65ae9ab70 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go +++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go @@ -26,7 +26,11 @@ var _ trace.Tracer = &tracer{} // The Span is created with the provided name and as a child of any existing // span context found in the passed context. The created Span will be // configured appropriately by any SpanOption passed. -func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanStartOption) (context.Context, trace.Span) { +func (tr *tracer) Start( + ctx context.Context, + name string, + options ...trace.SpanStartOption, +) (context.Context, trace.Span) { config := trace.NewSpanStartConfig(options...) if ctx == nil { @@ -112,7 +116,12 @@ func (tr *tracer) newSpan(ctx context.Context, name string, config *trace.SpanCo } // newRecordingSpan returns a new configured recordingSpan. -func (tr *tracer) newRecordingSpan(psc, sc trace.SpanContext, name string, sr SamplingResult, config *trace.SpanConfig) *recordingSpan { +func (tr *tracer) newRecordingSpan( + psc, sc trace.SpanContext, + name string, + sr SamplingResult, + config *trace.SpanConfig, +) *recordingSpan { startTime := config.Timestamp() if startTime.IsZero() { startTime = time.Now() diff --git a/vendor/go.opentelemetry.io/otel/sdk/version.go b/vendor/go.opentelemetry.io/otel/sdk/version.go index 2b797fbdea2..1af257449ac 100644 --- a/vendor/go.opentelemetry.io/otel/sdk/version.go +++ b/vendor/go.opentelemetry.io/otel/sdk/version.go @@ -1,9 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Package sdk provides the OpenTelemetry default SDK for Go. package sdk // import "go.opentelemetry.io/otel/sdk" // Version is the current release version of the OpenTelemetry SDK in use. func Version() string { - return "1.35.0" + return "1.36.0" } diff --git a/vendor/go.opentelemetry.io/otel/trace/auto.go b/vendor/go.opentelemetry.io/otel/trace/auto.go index 7e2910025a9..d90af8f673c 100644 --- a/vendor/go.opentelemetry.io/otel/trace/auto.go +++ b/vendor/go.opentelemetry.io/otel/trace/auto.go @@ -57,14 +57,15 @@ type autoTracer struct { var _ Tracer = autoTracer{} func (t autoTracer) Start(ctx context.Context, name string, opts ...SpanStartOption) (context.Context, Span) { - var psc SpanContext + var psc, sc SpanContext sampled := true span := new(autoSpan) // Ask eBPF for sampling decision and span context info. - t.start(ctx, span, &psc, &sampled, &span.spanContext) + t.start(ctx, span, &psc, &sampled, &sc) span.sampled.Store(sampled) + span.spanContext = sc ctx = ContextWithSpan(ctx, span) diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go index 3c5e1cdb1b3..e7ca62c660c 100644 --- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go +++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go @@ -251,13 +251,20 @@ func (s *Span) UnmarshalJSON(data []byte) error { type SpanFlags int32 const ( + // SpanFlagsTraceFlagsMask is a mask for trace-flags. + // // Bits 0-7 are used for trace flags. SpanFlagsTraceFlagsMask SpanFlags = 255 - // Bits 8 and 9 are used to indicate that the parent span or link span is remote. - // Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. - // Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote. + // SpanFlagsContextHasIsRemoteMask is a mask for HAS_IS_REMOTE status. + // + // Bits 8 and 9 are used to indicate that the parent span or link span is + // remote. Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. SpanFlagsContextHasIsRemoteMask SpanFlags = 256 - // SpanFlagsContextHasIsRemoteMask indicates the Span is remote. + // SpanFlagsContextIsRemoteMask is a mask for IS_REMOTE status. + // + // Bits 8 and 9 are used to indicate that the parent span or link span is + // remote. Bit 9 (`IS_REMOTE`) indicates whether the span or link is + // remote. SpanFlagsContextIsRemoteMask SpanFlags = 512 ) @@ -266,27 +273,31 @@ const ( type SpanKind int32 const ( - // Indicates that the span represents an internal operation within an application, - // as opposed to an operation happening at the boundaries. Default value. + // SpanKindInternal indicates that the span represents an internal + // operation within an application, as opposed to an operation happening at + // the boundaries. SpanKindInternal SpanKind = 1 - // Indicates that the span covers server-side handling of an RPC or other - // remote network request. + // SpanKindServer indicates that the span covers server-side handling of an + // RPC or other remote network request. SpanKindServer SpanKind = 2 - // Indicates that the span describes a request to some remote service. + // SpanKindClient indicates that the span describes a request to some + // remote service. SpanKindClient SpanKind = 3 - // Indicates that the span describes a producer sending a message to a broker. - // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship - // between producer and consumer spans. A PRODUCER span ends when the message was accepted - // by the broker while the logical processing of the message might span a much longer time. + // SpanKindProducer indicates that the span describes a producer sending a + // message to a broker. Unlike SpanKindClient and SpanKindServer, there is + // often no direct critical path latency relationship between producer and + // consumer spans. A SpanKindProducer span ends when the message was + // accepted by the broker while the logical processing of the message might + // span a much longer time. SpanKindProducer SpanKind = 4 - // Indicates that the span describes consumer receiving a message from a broker. - // Like the PRODUCER kind, there is often no direct critical path latency relationship - // between producer and consumer spans. + // SpanKindConsumer indicates that the span describes a consumer receiving + // a message from a broker. Like SpanKindProducer, there is often no direct + // critical path latency relationship between producer and consumer spans. SpanKindConsumer SpanKind = 5 ) -// Event is a time-stamped annotation of the span, consisting of user-supplied -// text description and key-value pairs. +// SpanEvent is a time-stamped annotation of the span, consisting of +// user-supplied text description and key-value pairs. type SpanEvent struct { // time_unix_nano is the time the event occurred. Time time.Time `json:"timeUnixNano,omitempty"` @@ -369,10 +380,11 @@ func (se *SpanEvent) UnmarshalJSON(data []byte) error { return nil } -// A pointer from the current span to another span in the same trace or in a -// different trace. For example, this can be used in batching operations, -// where a single batch handler processes multiple requests from different -// traces or when the handler receives a request from a different project. +// SpanLink is a reference from the current span to another span in the same +// trace or in a different trace. For example, this can be used in batching +// operations, where a single batch handler processes multiple requests from +// different traces or when the handler receives a request from a different +// project. type SpanLink struct { // A unique identifier of a trace that this linked span is part of. The ID is a // 16-byte array. diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/status.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/status.go index 1d013a8fa80..1039bf40cda 100644 --- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/status.go +++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/status.go @@ -3,17 +3,19 @@ package telemetry // import "go.opentelemetry.io/otel/trace/internal/telemetry" +// StatusCode is the status of a Span. +// // For the semantics of status codes see // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status type StatusCode int32 const ( - // The default status. + // StatusCodeUnset is the default status. StatusCodeUnset StatusCode = 0 - // The Span has been validated by an Application developer or Operator to - // have completed successfully. + // StatusCodeOK is used when the Span has been validated by an Application + // developer or Operator to have completed successfully. StatusCodeOK StatusCode = 1 - // The Span contains an error. + // StatusCodeError is used when the Span contains an error. StatusCodeError StatusCode = 2 ) @@ -30,7 +32,7 @@ func (s StatusCode) String() string { return "" } -// The Status type defines a logical error model that is suitable for different +// Status defines a logical error model that is suitable for different // programming environments, including REST APIs and RPC APIs. type Status struct { // A developer-facing human readable error message. diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/traces.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/traces.go index b0394070814..e5f10767ca3 100644 --- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/traces.go +++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/traces.go @@ -71,7 +71,7 @@ func (td *Traces) UnmarshalJSON(data []byte) error { return nil } -// A collection of ScopeSpans from a Resource. +// ResourceSpans is a collection of ScopeSpans from a Resource. type ResourceSpans struct { // The resource for the spans in this message. // If this field is not set then no resource info is known. @@ -128,7 +128,7 @@ func (rs *ResourceSpans) UnmarshalJSON(data []byte) error { return nil } -// A collection of Spans produced by an InstrumentationScope. +// ScopeSpans is a collection of Spans produced by an InstrumentationScope. type ScopeSpans struct { // The instrumentation scope information for the spans in this message. // Semantically when InstrumentationScope isn't set, it is equivalent with diff --git a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go index 7251492da06..ae9ce102a9a 100644 --- a/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go +++ b/vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go @@ -316,7 +316,7 @@ func (v Value) String() string { case ValueKindBool: return strconv.FormatBool(v.asBool()) case ValueKindBytes: - return fmt.Sprint(v.asBytes()) + return string(v.asBytes()) case ValueKindMap: return fmt.Sprint(v.asMap()) case ValueKindSlice: diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go index c8b1ae5d67e..0f56e4dbb34 100644 --- a/vendor/go.opentelemetry.io/otel/trace/noop.go +++ b/vendor/go.opentelemetry.io/otel/trace/noop.go @@ -95,6 +95,8 @@ var autoInstEnabled = new(bool) // tracerProvider return a noopTracerProvider if autoEnabled is false, // otherwise it will return a TracerProvider from the sdk package used in // auto-instrumentation. +// +//go:noinline func (noopSpan) tracerProvider(autoEnabled *bool) TracerProvider { if *autoEnabled { return newAutoTracerProvider() diff --git a/vendor/go.opentelemetry.io/otel/verify_readmes.sh b/vendor/go.opentelemetry.io/otel/verify_readmes.sh deleted file mode 100644 index 1e87855eeaa..00000000000 --- a/vendor/go.opentelemetry.io/otel/verify_readmes.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -set -euo pipefail - -dirs=$(find . -type d -not -path "*/internal*" -not -path "*/test*" -not -path "*/example*" -not -path "*/.*" | sort) - -missingReadme=false -for dir in $dirs; do - if [ ! -f "$dir/README.md" ]; then - echo "couldn't find README.md for $dir" - missingReadme=true - fi -done - -if [ "$missingReadme" = true ] ; then - echo "Error: some READMEs couldn't be found." - exit 1 -fi diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go index d5fa71f6745..ac3c0b15da2 100644 --- a/vendor/go.opentelemetry.io/otel/version.go +++ b/vendor/go.opentelemetry.io/otel/version.go @@ -5,5 +5,5 @@ package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { - return "1.35.0" + return "1.36.0" } diff --git a/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go b/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go index 31d25fc15ac..fc668643c11 100644 --- a/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go +++ b/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go @@ -22,8 +22,6 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MetricsServiceClient interface { - // For performance reasons, it is recommended to keep this RPC - // alive for the entire life of the application. Export(ctx context.Context, in *ExportMetricsServiceRequest, opts ...grpc.CallOption) (*ExportMetricsServiceResponse, error) } @@ -48,8 +46,6 @@ func (c *metricsServiceClient) Export(ctx context.Context, in *ExportMetricsServ // All implementations must embed UnimplementedMetricsServiceServer // for forward compatibility type MetricsServiceServer interface { - // For performance reasons, it is recommended to keep this RPC - // alive for the entire life of the application. Export(context.Context, *ExportMetricsServiceRequest) (*ExportMetricsServiceResponse, error) mustEmbedUnimplementedMetricsServiceServer() } diff --git a/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go b/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go index dd1b73f1e99..892864ea629 100644 --- a/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go +++ b/vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go @@ -22,8 +22,6 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TraceServiceClient interface { - // For performance reasons, it is recommended to keep this RPC - // alive for the entire life of the application. Export(ctx context.Context, in *ExportTraceServiceRequest, opts ...grpc.CallOption) (*ExportTraceServiceResponse, error) } @@ -48,8 +46,6 @@ func (c *traceServiceClient) Export(ctx context.Context, in *ExportTraceServiceR // All implementations must embed UnimplementedTraceServiceServer // for forward compatibility type TraceServiceServer interface { - // For performance reasons, it is recommended to keep this RPC - // alive for the entire life of the application. Export(context.Context, *ExportTraceServiceRequest) (*ExportTraceServiceResponse, error) mustEmbedUnimplementedTraceServiceServer() } diff --git a/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go b/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go index 852209b097b..a7c5d19bff3 100644 --- a/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go +++ b/vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go @@ -430,6 +430,101 @@ func (x *InstrumentationScope) GetDroppedAttributesCount() uint32 { return 0 } +// A reference to an Entity. +// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs. +// +// Status: [Development] +type EntityRef struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The Schema URL, if known. This is the identifier of the Schema that the entity data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + // + // This schema_url applies to the data in this message and to the Resource attributes + // referenced by id_keys and description_keys. + // TODO: discuss if we are happy with this somewhat complicated definition of what + // the schema_url applies to. + // + // This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs. + SchemaUrl string `protobuf:"bytes,1,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` + // Defines the type of the entity. MUST not change during the lifetime of the entity. + // For example: "service" or "host". This field is required and MUST not be empty + // for valid entities. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Attribute Keys that identify the entity. + // MUST not change during the lifetime of the entity. The Id must contain at least one attribute. + // These keys MUST exist in the containing {message}.attributes. + IdKeys []string `protobuf:"bytes,3,rep,name=id_keys,json=idKeys,proto3" json:"id_keys,omitempty"` + // Descriptive (non-identifying) attribute keys of the entity. + // MAY change over the lifetime of the entity. MAY be empty. + // These attribute keys are not part of entity's identity. + // These keys MUST exist in the containing {message}.attributes. + DescriptionKeys []string `protobuf:"bytes,4,rep,name=description_keys,json=descriptionKeys,proto3" json:"description_keys,omitempty"` +} + +func (x *EntityRef) Reset() { + *x = EntityRef{} + if protoimpl.UnsafeEnabled { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntityRef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntityRef) ProtoMessage() {} + +func (x *EntityRef) ProtoReflect() protoreflect.Message { + mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EntityRef.ProtoReflect.Descriptor instead. +func (*EntityRef) Descriptor() ([]byte, []int) { + return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{5} +} + +func (x *EntityRef) GetSchemaUrl() string { + if x != nil { + return x.SchemaUrl + } + return "" +} + +func (x *EntityRef) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *EntityRef) GetIdKeys() []string { + if x != nil { + return x.IdKeys + } + return nil +} + +func (x *EntityRef) GetDescriptionKeys() []string { + if x != nil { + return x.DescriptionKeys + } + return nil +} + var File_opentelemetry_proto_common_v1_common_proto protoreflect.FileDescriptor var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{ @@ -488,15 +583,23 @@ var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{ 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x7b, 0x0a, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, - 0x76, 0x31, 0xaa, 0x02, 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, - 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x82, 0x01, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x52, 0x65, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x55, + 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x69, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x29, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x42, 0x7b, 0x0a, 0x20, 0x69, 0x6f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, + 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, + 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -511,13 +614,14 @@ func file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP() []byte { return file_opentelemetry_proto_common_v1_common_proto_rawDescData } -var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_opentelemetry_proto_common_v1_common_proto_goTypes = []interface{}{ (*AnyValue)(nil), // 0: opentelemetry.proto.common.v1.AnyValue (*ArrayValue)(nil), // 1: opentelemetry.proto.common.v1.ArrayValue (*KeyValueList)(nil), // 2: opentelemetry.proto.common.v1.KeyValueList (*KeyValue)(nil), // 3: opentelemetry.proto.common.v1.KeyValue (*InstrumentationScope)(nil), // 4: opentelemetry.proto.common.v1.InstrumentationScope + (*EntityRef)(nil), // 5: opentelemetry.proto.common.v1.EntityRef } var file_opentelemetry_proto_common_v1_common_proto_depIdxs = []int32{ 1, // 0: opentelemetry.proto.common.v1.AnyValue.array_value:type_name -> opentelemetry.proto.common.v1.ArrayValue @@ -599,6 +703,18 @@ func file_opentelemetry_proto_common_v1_common_proto_init() { return nil } } + file_opentelemetry_proto_common_v1_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntityRef); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_opentelemetry_proto_common_v1_common_proto_msgTypes[0].OneofWrappers = []interface{}{ (*AnyValue_StringValue)(nil), @@ -615,7 +731,7 @@ func file_opentelemetry_proto_common_v1_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_opentelemetry_proto_common_v1_common_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go b/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go index 8799d6ba251..ec187b13d0b 100644 --- a/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go +++ b/vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go @@ -526,7 +526,7 @@ type Metric struct { // description of the metric, which can be used in documentation. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // unit in which the metric value is reported. Follows the format - // described by http://unitsofmeasure.org/ucum.html. + // described by https://unitsofmeasure.org/ucum.html. Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"` // Data determines the aggregation type (if any) of the metric, what is the // reported value type for the data points, as well as the relatationship to @@ -929,7 +929,7 @@ func (x *ExponentialHistogram) GetAggregationTemporality() AggregationTemporalit // Summary metric data are used to convey quantile summaries, // a Prometheus (see: https://prometheus.io/docs/concepts/metric_types/#summary) -// and OpenMetrics (see: https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45) +// and OpenMetrics (see: https://github.com/prometheus/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45) // data type. These data points cannot always be merged in a meaningful way. // While they can be useful in some applications, histogram data points are // recommended for new applications. @@ -1175,7 +1175,9 @@ type HistogramDataPoint struct { // The sum of the bucket_counts must equal the value in the count field. // // The number of elements in bucket_counts array must be by one greater than - // the number of elements in explicit_bounds array. + // the number of elements in explicit_bounds array. The exception to this rule + // is when the length of bucket_counts is 0, then the length of explicit_bounds + // must also be 0. BucketCounts []uint64 `protobuf:"fixed64,6,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` // explicit_bounds specifies buckets with explicitly defined bounds for values. // @@ -1190,6 +1192,9 @@ type HistogramDataPoint struct { // Histogram buckets are inclusive of their upper boundary, except the last // bucket where the boundary is at infinity. This format is intentionally // compatible with the OpenMetrics histogram definition. + // + // If bucket_counts length is 0 then explicit_bounds length must also be 0, + // otherwise the data point is invalid. ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` // (Optional) List of exemplars collected from // measurements that were used to form the data point diff --git a/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go b/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go index b7545b03b9f..eb7745d66e0 100644 --- a/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go +++ b/vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go @@ -48,6 +48,12 @@ type Resource struct { // dropped_attributes_count is the number of dropped attributes. If the value is 0, then // no attributes were dropped. DroppedAttributesCount uint32 `protobuf:"varint,2,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` + // Set of entities that participate in this Resource. + // + // Note: keys in the references MUST exist in attributes of this message. + // + // Status: [Development] + EntityRefs []*v1.EntityRef `protobuf:"bytes,3,rep,name=entity_refs,json=entityRefs,proto3" json:"entity_refs,omitempty"` } func (x *Resource) Reset() { @@ -96,6 +102,13 @@ func (x *Resource) GetDroppedAttributesCount() uint32 { return 0 } +func (x *Resource) GetEntityRefs() []*v1.EntityRef { + if x != nil { + return x.EntityRefs + } + return nil +} + var File_opentelemetry_proto_resource_v1_resource_proto protoreflect.FileDescriptor var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{ @@ -106,7 +119,7 @@ var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd8, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, @@ -115,16 +128,21 @@ var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{ 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x83, 0x01, - 0x0a, 0x22, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, - 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, - 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, - 0x31, 0xaa, 0x02, 0x1f, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, - 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x49, 0x0a, + 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x66, 0x52, 0x0a, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x66, 0x73, 0x42, 0x83, 0x01, 0x0a, 0x22, 0x69, 0x6f, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, + 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1f, 0x4f, + 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -141,16 +159,18 @@ func file_opentelemetry_proto_resource_v1_resource_proto_rawDescGZIP() []byte { var file_opentelemetry_proto_resource_v1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_opentelemetry_proto_resource_v1_resource_proto_goTypes = []interface{}{ - (*Resource)(nil), // 0: opentelemetry.proto.resource.v1.Resource - (*v1.KeyValue)(nil), // 1: opentelemetry.proto.common.v1.KeyValue + (*Resource)(nil), // 0: opentelemetry.proto.resource.v1.Resource + (*v1.KeyValue)(nil), // 1: opentelemetry.proto.common.v1.KeyValue + (*v1.EntityRef)(nil), // 2: opentelemetry.proto.common.v1.EntityRef } var file_opentelemetry_proto_resource_v1_resource_proto_depIdxs = []int32{ 1, // 0: opentelemetry.proto.resource.v1.Resource.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 1: opentelemetry.proto.resource.v1.Resource.entity_refs:type_name -> opentelemetry.proto.common.v1.EntityRef + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_opentelemetry_proto_resource_v1_resource_proto_init() } diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go index bed9216d8d8..e017ef07142 100644 --- a/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go @@ -703,6 +703,65 @@ type QuotaFailure_Violation struct { // For example: "Service disabled" or "Daily Limit for read operations // exceeded". Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // The API Service from which the `QuotaFailure.Violation` orginates. In + // some cases, Quota issues originate from an API Service other than the one + // that was called. In other words, a dependency of the called API Service + // could be the cause of the `QuotaFailure`, and this field would have the + // dependency API service name. + // + // For example, if the called API is Kubernetes Engine API + // (container.googleapis.com), and a quota violation occurs in the + // Kubernetes Engine API itself, this field would be + // "container.googleapis.com". On the other hand, if the quota violation + // occurs when the Kubernetes Engine API creates VMs in the Compute Engine + // API (compute.googleapis.com), this field would be + // "compute.googleapis.com". + ApiService string `protobuf:"bytes,3,opt,name=api_service,json=apiService,proto3" json:"api_service,omitempty"` + // The metric of the violated quota. A quota metric is a named counter to + // measure usage, such as API requests or CPUs. When an activity occurs in a + // service, such as Virtual Machine allocation, one or more quota metrics + // may be affected. + // + // For example, "compute.googleapis.com/cpus_per_vm_family", + // "storage.googleapis.com/internet_egress_bandwidth". + QuotaMetric string `protobuf:"bytes,4,opt,name=quota_metric,json=quotaMetric,proto3" json:"quota_metric,omitempty"` + // The id of the violated quota. Also know as "limit name", this is the + // unique identifier of a quota in the context of an API service. + // + // For example, "CPUS-PER-VM-FAMILY-per-project-region". + QuotaId string `protobuf:"bytes,5,opt,name=quota_id,json=quotaId,proto3" json:"quota_id,omitempty"` + // The dimensions of the violated quota. Every non-global quota is enforced + // on a set of dimensions. While quota metric defines what to count, the + // dimensions specify for what aspects the counter should be increased. + // + // For example, the quota "CPUs per region per VM family" enforces a limit + // on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + // "region" and "vm_family". And if the violation occurred in region + // "us-central1" and for VM family "n1", the quota_dimensions would be, + // + // { + // "region": "us-central1", + // "vm_family": "n1", + // } + // + // When a quota is enforced globally, the quota_dimensions would always be + // empty. + QuotaDimensions map[string]string `protobuf:"bytes,6,rep,name=quota_dimensions,json=quotaDimensions,proto3" json:"quota_dimensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The enforced quota value at the time of the `QuotaFailure`. + // + // For example, if the enforced quota value at the time of the + // `QuotaFailure` on the number of CPUs is "10", then the value of this + // field would reflect this quantity. + QuotaValue int64 `protobuf:"varint,7,opt,name=quota_value,json=quotaValue,proto3" json:"quota_value,omitempty"` + // The new quota value being rolled out at the time of the violation. At the + // completion of the rollout, this value will be enforced in place of + // quota_value. If no rollout is in progress at the time of the violation, + // this field is not set. + // + // For example, if at the time of the violation a rollout is in progress + // changing the number of CPUs quota from 10 to 20, 20 would be the value of + // this field. + FutureQuotaValue *int64 `protobuf:"varint,8,opt,name=future_quota_value,json=futureQuotaValue,proto3,oneof" json:"future_quota_value,omitempty"` } func (x *QuotaFailure_Violation) Reset() { @@ -751,6 +810,48 @@ func (x *QuotaFailure_Violation) GetDescription() string { return "" } +func (x *QuotaFailure_Violation) GetApiService() string { + if x != nil { + return x.ApiService + } + return "" +} + +func (x *QuotaFailure_Violation) GetQuotaMetric() string { + if x != nil { + return x.QuotaMetric + } + return "" +} + +func (x *QuotaFailure_Violation) GetQuotaId() string { + if x != nil { + return x.QuotaId + } + return "" +} + +func (x *QuotaFailure_Violation) GetQuotaDimensions() map[string]string { + if x != nil { + return x.QuotaDimensions + } + return nil +} + +func (x *QuotaFailure_Violation) GetQuotaValue() int64 { + if x != nil { + return x.QuotaValue + } + return 0 +} + +func (x *QuotaFailure_Violation) GetFutureQuotaValue() int64 { + if x != nil && x.FutureQuotaValue != nil { + return *x.FutureQuotaValue + } + return 0 +} + // A message type used to describe a single precondition failure. type PreconditionFailure_Violation struct { state protoimpl.MessageState @@ -775,7 +876,7 @@ type PreconditionFailure_Violation struct { func (x *PreconditionFailure_Violation) Reset() { *x = PreconditionFailure_Violation{} if protoimpl.UnsafeEnabled { - mi := &file_google_rpc_error_details_proto_msgTypes[12] + mi := &file_google_rpc_error_details_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -788,7 +889,7 @@ func (x *PreconditionFailure_Violation) String() string { func (*PreconditionFailure_Violation) ProtoMessage() {} func (x *PreconditionFailure_Violation) ProtoReflect() protoreflect.Message { - mi := &file_google_rpc_error_details_proto_msgTypes[12] + mi := &file_google_rpc_error_details_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -886,7 +987,7 @@ type BadRequest_FieldViolation struct { func (x *BadRequest_FieldViolation) Reset() { *x = BadRequest_FieldViolation{} if protoimpl.UnsafeEnabled { - mi := &file_google_rpc_error_details_proto_msgTypes[13] + mi := &file_google_rpc_error_details_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -899,7 +1000,7 @@ func (x *BadRequest_FieldViolation) String() string { func (*BadRequest_FieldViolation) ProtoMessage() {} func (x *BadRequest_FieldViolation) ProtoReflect() protoreflect.Message { - mi := &file_google_rpc_error_details_proto_msgTypes[13] + mi := &file_google_rpc_error_details_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -958,7 +1059,7 @@ type Help_Link struct { func (x *Help_Link) Reset() { *x = Help_Link{} if protoimpl.UnsafeEnabled { - mi := &file_google_rpc_error_details_proto_msgTypes[14] + mi := &file_google_rpc_error_details_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -971,7 +1072,7 @@ func (x *Help_Link) String() string { func (*Help_Link) ProtoMessage() {} func (x *Help_Link) ProtoReflect() protoreflect.Message { - mi := &file_google_rpc_error_details_proto_msgTypes[14] + mi := &file_google_rpc_error_details_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1029,79 +1130,102 @@ var file_google_rpc_error_details_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x9b, 0x01, 0x0a, 0x0c, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x8e, 0x04, 0x0a, 0x0c, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x42, 0x0a, 0x0a, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x1a, 0x47, 0x0a, 0x09, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbd, 0x01, 0x0a, 0x13, 0x50, 0x72, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, - 0x70, 0x63, 0x2e, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, - 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0a, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x5b, 0x0a, 0x09, - 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8c, 0x02, 0x0a, 0x0a, 0x42, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x42, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xab, 0x01, 0x0a, 0x0e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, - 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x49, 0x0a, - 0x11, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4f, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, - 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6f, 0x0a, 0x04, - 0x48, 0x65, 0x6c, 0x70, 0x12, 0x2b, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, - 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, - 0x73, 0x1a, 0x3a, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x44, 0x0a, - 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x42, 0x6c, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x72, 0x70, 0x63, 0x42, 0x11, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, - 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x72, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x3b, 0x65, 0x72, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0xa2, 0x02, 0x03, 0x52, 0x50, - 0x43, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0xb9, 0x03, 0x0a, 0x09, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, + 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x61, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x19, + 0x0a, 0x08, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x49, 0x64, 0x12, 0x62, 0x0a, 0x10, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x56, 0x69, + 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x44, 0x69, 0x6d, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x31, + 0x0a, 0x12, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x10, 0x66, 0x75, + 0x74, 0x75, 0x72, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, + 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, + 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbd, 0x01, 0x0a, + 0x13, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, + 0x6c, 0x75, 0x72, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, + 0x5b, 0x0a, 0x09, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8c, 0x02, 0x0a, + 0x0a, 0x42, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x10, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, + 0x70, 0x63, 0x2e, 0x42, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xab, 0x01, + 0x0a, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x49, 0x0a, 0x11, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4f, 0x0a, 0x0b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x90, 0x01, 0x0a, + 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x6f, 0x0a, 0x04, 0x48, 0x65, 0x6c, 0x70, 0x12, 0x2b, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, + 0x69, 0x6e, 0x6b, 0x73, 0x1a, 0x3a, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x22, 0x44, 0x0a, 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x42, 0x11, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, + 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x72, 0x72, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x3b, 0x65, 0x72, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0xa2, 0x02, + 0x03, 0x52, 0x50, 0x43, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1116,7 +1240,7 @@ func file_google_rpc_error_details_proto_rawDescGZIP() []byte { return file_google_rpc_error_details_proto_rawDescData } -var file_google_rpc_error_details_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_google_rpc_error_details_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_google_rpc_error_details_proto_goTypes = []interface{}{ (*ErrorInfo)(nil), // 0: google.rpc.ErrorInfo (*RetryInfo)(nil), // 1: google.rpc.RetryInfo @@ -1130,24 +1254,26 @@ var file_google_rpc_error_details_proto_goTypes = []interface{}{ (*LocalizedMessage)(nil), // 9: google.rpc.LocalizedMessage nil, // 10: google.rpc.ErrorInfo.MetadataEntry (*QuotaFailure_Violation)(nil), // 11: google.rpc.QuotaFailure.Violation - (*PreconditionFailure_Violation)(nil), // 12: google.rpc.PreconditionFailure.Violation - (*BadRequest_FieldViolation)(nil), // 13: google.rpc.BadRequest.FieldViolation - (*Help_Link)(nil), // 14: google.rpc.Help.Link - (*durationpb.Duration)(nil), // 15: google.protobuf.Duration + nil, // 12: google.rpc.QuotaFailure.Violation.QuotaDimensionsEntry + (*PreconditionFailure_Violation)(nil), // 13: google.rpc.PreconditionFailure.Violation + (*BadRequest_FieldViolation)(nil), // 14: google.rpc.BadRequest.FieldViolation + (*Help_Link)(nil), // 15: google.rpc.Help.Link + (*durationpb.Duration)(nil), // 16: google.protobuf.Duration } var file_google_rpc_error_details_proto_depIdxs = []int32{ 10, // 0: google.rpc.ErrorInfo.metadata:type_name -> google.rpc.ErrorInfo.MetadataEntry - 15, // 1: google.rpc.RetryInfo.retry_delay:type_name -> google.protobuf.Duration + 16, // 1: google.rpc.RetryInfo.retry_delay:type_name -> google.protobuf.Duration 11, // 2: google.rpc.QuotaFailure.violations:type_name -> google.rpc.QuotaFailure.Violation - 12, // 3: google.rpc.PreconditionFailure.violations:type_name -> google.rpc.PreconditionFailure.Violation - 13, // 4: google.rpc.BadRequest.field_violations:type_name -> google.rpc.BadRequest.FieldViolation - 14, // 5: google.rpc.Help.links:type_name -> google.rpc.Help.Link - 9, // 6: google.rpc.BadRequest.FieldViolation.localized_message:type_name -> google.rpc.LocalizedMessage - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 13, // 3: google.rpc.PreconditionFailure.violations:type_name -> google.rpc.PreconditionFailure.Violation + 14, // 4: google.rpc.BadRequest.field_violations:type_name -> google.rpc.BadRequest.FieldViolation + 15, // 5: google.rpc.Help.links:type_name -> google.rpc.Help.Link + 12, // 6: google.rpc.QuotaFailure.Violation.quota_dimensions:type_name -> google.rpc.QuotaFailure.Violation.QuotaDimensionsEntry + 9, // 7: google.rpc.BadRequest.FieldViolation.localized_message:type_name -> google.rpc.LocalizedMessage + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_google_rpc_error_details_proto_init() } @@ -1288,7 +1414,7 @@ func file_google_rpc_error_details_proto_init() { return nil } } - file_google_rpc_error_details_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_google_rpc_error_details_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PreconditionFailure_Violation); i { case 0: return &v.state @@ -1300,7 +1426,7 @@ func file_google_rpc_error_details_proto_init() { return nil } } - file_google_rpc_error_details_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_google_rpc_error_details_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BadRequest_FieldViolation); i { case 0: return &v.state @@ -1312,7 +1438,7 @@ func file_google_rpc_error_details_proto_init() { return nil } } - file_google_rpc_error_details_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_google_rpc_error_details_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Help_Link); i { case 0: return &v.state @@ -1325,13 +1451,14 @@ func file_google_rpc_error_details_proto_init() { } } } + file_google_rpc_error_details_proto_msgTypes[11].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_rpc_error_details_proto_rawDesc, NumEnums: 0, - NumMessages: 15, + NumMessages: 16, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/modules.txt b/vendor/modules.txt index 765b42afdea..7a03e31cbdb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -44,6 +44,9 @@ github.com/bufbuild/protocompile/walk # github.com/cenkalti/backoff/v4 v4.3.0 ## explicit; go 1.18 github.com/cenkalti/backoff/v4 +# github.com/cenkalti/backoff/v5 v5.0.2 +## explicit; go 1.23 +github.com/cenkalti/backoff/v5 # github.com/cespare/xxhash/v2 v2.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 @@ -214,8 +217,8 @@ github.com/grafana/xk6-redis/redis github.com/grpc-ecosystem/go-grpc-middleware/retry github.com/grpc-ecosystem/go-grpc-middleware/util/backoffutils github.com/grpc-ecosystem/go-grpc-middleware/util/metautils -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 -## explicit; go 1.22 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 +## explicit; go 1.23.0 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities @@ -359,14 +362,13 @@ github.com/tidwall/pretty ## explicit; go 1.22.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry -# go.opentelemetry.io/otel v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute +go.opentelemetry.io/otel/attribute/internal go.opentelemetry.io/otel/baggage go.opentelemetry.io/otel/codes -go.opentelemetry.io/otel/internal -go.opentelemetry.io/otel/internal/attribute go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation @@ -389,31 +391,31 @@ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/envco go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/retry go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/transform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry -# go.opentelemetry.io/otel/metric v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/metric v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop -# go.opentelemetry.io/otel/sdk v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/sdk v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation go.opentelemetry.io/otel/sdk/internal/env @@ -428,14 +430,14 @@ go.opentelemetry.io/otel/sdk/metric/internal go.opentelemetry.io/otel/sdk/metric/internal/aggregate go.opentelemetry.io/otel/sdk/metric/internal/x go.opentelemetry.io/otel/sdk/metric/metricdata -# go.opentelemetry.io/otel/trace v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/trace v1.36.0 +## explicit; go 1.23.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop -# go.opentelemetry.io/proto/otlp v1.5.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/proto/otlp v1.6.0 +## explicit; go 1.23.0 go.opentelemetry.io/proto/otlp/collector/metrics/v1 go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 @@ -497,10 +499,10 @@ golang.org/x/text/unicode/rangetable # golang.org/x/time v0.11.0 ## explicit; go 1.23.0 golang.org/x/time/rate -# google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 +# google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 ## explicit; go 1.23.0 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 ## explicit; go 1.23.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status From c8ec2c0d54930b9c40a33b4478e166b0e8d53784 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 09:36:54 +0200 Subject: [PATCH 016/136] build(deps): bump github.com/evanw/esbuild from 0.25.4 to 0.25.5 (#4821) Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.25.4 to 0.25.5. - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md) - [Commits](https://github.com/evanw/esbuild/compare/v0.25.4...v0.25.5) --- updated-dependencies: - dependency-name: github.com/evanw/esbuild dependency-version: 0.25.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 +- .../esbuild/internal/compat/css_table.go | 43 +++++++++++++++++++ .../evanw/esbuild/internal/compat/js_table.go | 15 ++++--- .../esbuild/internal/css_parser/css_decls.go | 35 +++++++++++++-- .../internal/js_parser/js_parser_lower.go | 2 +- .../esbuild/internal/js_parser/ts_parser.go | 21 ++++++--- .../esbuild/internal/resolver/resolver.go | 29 +++++++------ vendor/modules.txt | 2 +- 9 files changed, 118 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index 0390f3fcb18..a25fb6ee0d3 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5 github.com/andybalholm/brotli v1.1.1 github.com/chromedp/cdproto v0.0.0-20250509201441-70372ae9ef75 - github.com/evanw/esbuild v0.25.4 + github.com/evanw/esbuild v0.25.5 github.com/fatih/color v1.18.0 github.com/go-json-experiment/json v0.0.0-20250211171154-1ae217ad3535 github.com/go-sourcemap/sourcemap v2.1.4+incompatible diff --git a/go.sum b/go.sum index e2ad5a0993d..0a33b7e6d43 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanw/esbuild v0.25.4 h1:k1bTSim+usBG27w7BfOCorhgx3tO+6bAfMj5pR+6SKg= -github.com/evanw/esbuild v0.25.4/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48= +github.com/evanw/esbuild v0.25.5 h1:E+JpeY5S/1LFmnX1vtuZqUKT7qDVcfXdhzMhM3uIKFs= +github.com/evanw/esbuild v0.25.5/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= diff --git a/vendor/github.com/evanw/esbuild/internal/compat/css_table.go b/vendor/github.com/evanw/esbuild/internal/compat/css_table.go index 951795d3d3b..0bc4cb9779b 100644 --- a/vendor/github.com/evanw/esbuild/internal/compat/css_table.go +++ b/vendor/github.com/evanw/esbuild/internal/compat/css_table.go @@ -220,6 +220,13 @@ var cssPrefixTable = map[css_ast.D][]prefixData{ {engine: Opera, prefix: WebkitPrefix, withoutPrefix: v{20, 0, 0}}, {engine: Safari, prefix: WebkitPrefix, withoutPrefix: v{9, 1, 0}}, }, + css_ast.DHeight: { + {engine: Chrome, prefix: WebkitPrefix}, + {engine: Edge, prefix: WebkitPrefix}, + {engine: IOS, prefix: WebkitPrefix}, + {engine: Opera, prefix: WebkitPrefix}, + {engine: Safari, prefix: WebkitPrefix}, + }, css_ast.DHyphens: { {engine: Edge, prefix: MsPrefix, withoutPrefix: v{79, 0, 0}}, {engine: Firefox, prefix: MozPrefix, withoutPrefix: v{43, 0, 0}}, @@ -273,6 +280,34 @@ var cssPrefixTable = map[css_ast.D][]prefixData{ {engine: Opera, prefix: WebkitPrefix, withoutPrefix: v{106, 0, 0}}, {engine: Safari, prefix: WebkitPrefix, withoutPrefix: v{15, 4, 0}}, }, + css_ast.DMaxHeight: { + {engine: Chrome, prefix: WebkitPrefix}, + {engine: Edge, prefix: WebkitPrefix}, + {engine: IOS, prefix: WebkitPrefix}, + {engine: Opera, prefix: WebkitPrefix}, + {engine: Safari, prefix: WebkitPrefix}, + }, + css_ast.DMaxWidth: { + {engine: Chrome, prefix: WebkitPrefix}, + {engine: Edge, prefix: WebkitPrefix}, + {engine: IOS, prefix: WebkitPrefix}, + {engine: Opera, prefix: WebkitPrefix}, + {engine: Safari, prefix: WebkitPrefix}, + }, + css_ast.DMinHeight: { + {engine: Chrome, prefix: WebkitPrefix}, + {engine: Edge, prefix: WebkitPrefix}, + {engine: IOS, prefix: WebkitPrefix}, + {engine: Opera, prefix: WebkitPrefix}, + {engine: Safari, prefix: WebkitPrefix}, + }, + css_ast.DMinWidth: { + {engine: Chrome, prefix: WebkitPrefix}, + {engine: Edge, prefix: WebkitPrefix}, + {engine: IOS, prefix: WebkitPrefix}, + {engine: Opera, prefix: WebkitPrefix}, + {engine: Safari, prefix: WebkitPrefix}, + }, css_ast.DPosition: { {engine: IOS, prefix: WebkitPrefix, withoutPrefix: v{13, 0, 0}}, {engine: Safari, prefix: WebkitPrefix, withoutPrefix: v{13, 0, 0}}, @@ -333,6 +368,14 @@ var cssPrefixTable = map[css_ast.D][]prefixData{ {engine: Safari, prefix: KhtmlPrefix, withoutPrefix: v{3, 0, 0}}, {engine: Safari, prefix: WebkitPrefix}, }, + css_ast.DWidth: { + {engine: Chrome, prefix: WebkitPrefix}, + {engine: Edge, prefix: WebkitPrefix}, + {engine: Firefox, prefix: MozPrefix}, + {engine: IOS, prefix: WebkitPrefix}, + {engine: Opera, prefix: WebkitPrefix}, + {engine: Safari, prefix: WebkitPrefix}, + }, } func CSSPrefixData(constraints map[Engine]Semver) (entries map[css_ast.D]CSSPrefix) { diff --git a/vendor/github.com/evanw/esbuild/internal/compat/js_table.go b/vendor/github.com/evanw/esbuild/internal/compat/js_table.go index 5cab807d2fb..d47101f7cf5 100644 --- a/vendor/github.com/evanw/esbuild/internal/compat/js_table.go +++ b/vendor/github.com/evanw/esbuild/internal/compat/js_table.go @@ -588,13 +588,14 @@ var jsTable = map[JSFeature]map[Engine][]versionRange{ Node: {{start: v{16, 14, 0}, end: v{22, 0, 0}}}, }, ImportAttributes: { - Chrome: {{start: v{123, 0, 0}}}, - Deno: {{start: v{1, 37, 0}}}, - Edge: {{start: v{123, 0, 0}}}, - IOS: {{start: v{17, 2, 0}}}, - Node: {{start: v{18, 20, 0}, end: v{19, 0, 0}}, {start: v{20, 10, 0}}}, - Opera: {{start: v{109, 0, 0}}}, - Safari: {{start: v{17, 2, 0}}}, + Chrome: {{start: v{123, 0, 0}}}, + Deno: {{start: v{1, 37, 0}}}, + Edge: {{start: v{123, 0, 0}}}, + Firefox: {{start: v{138, 0, 0}}}, + IOS: {{start: v{17, 2, 0}}}, + Node: {{start: v{18, 20, 0}, end: v{19, 0, 0}}, {start: v{20, 10, 0}}}, + Opera: {{start: v{109, 0, 0}}}, + Safari: {{start: v{17, 2, 0}}}, }, ImportMeta: { Chrome: {{start: v{64, 0, 0}}}, diff --git a/vendor/github.com/evanw/esbuild/internal/css_parser/css_decls.go b/vendor/github.com/evanw/esbuild/internal/css_parser/css_decls.go index eaca876e132..4a15a74a137 100644 --- a/vendor/github.com/evanw/esbuild/internal/css_parser/css_decls.go +++ b/vendor/github.com/evanw/esbuild/internal/css_parser/css_decls.go @@ -223,7 +223,7 @@ func (p *parser) processDeclarations(rules []css_ast.Rule, composesContext *comp case css_ast.DContainerName: p.processContainerName(decl.Value) - // Animation name + // Animation name case css_ast.DAnimation: p.processAnimationShorthand(decl.Value) case css_ast.DAnimationName: @@ -237,7 +237,7 @@ func (p *parser) processDeclarations(rules []css_ast.Rule, composesContext *comp p.processListStyleType(&decl.Value[0]) } - // Font + // Font case css_ast.DFont: if p.options.minifySyntax { decl.Value = p.mangleFont(decl.Value) @@ -253,7 +253,7 @@ func (p *parser) processDeclarations(rules []css_ast.Rule, composesContext *comp decl.Value[0] = p.mangleFontWeight(decl.Value[0]) } - // Margin + // Margin case css_ast.DMargin: if p.options.minifySyntax { margin.mangleSides(rewrittenRules, decl, p.options.minifyWhitespace) @@ -444,6 +444,13 @@ func (p *parser) insertPrefixedDeclaration(rules []css_ast.Rule, prefix string, if len(decl.Value) != 1 || decl.Value[0].Kind != css_lexer.TIdent || !strings.EqualFold(decl.Value[0].Text, "sticky") { return rules } + + case css_ast.DWidth, css_ast.DMinWidth, css_ast.DMaxWidth, + css_ast.DHeight, css_ast.DMinHeight, css_ast.DMaxHeight: + // The prefix is only needed for "width: stretch" + if len(decl.Value) != 1 || decl.Value[0].Kind != css_lexer.TIdent || !strings.EqualFold(decl.Value[0].Text, "stretch") { + return rules + } } value := css_ast.CloneTokensWithoutImportRecords(decl.Value) @@ -455,6 +462,19 @@ func (p *parser) insertPrefixedDeclaration(rules []css_ast.Rule, prefix string, keyText = decl.KeyText value[0].Text = "-webkit-sticky" + case css_ast.DWidth, css_ast.DMinWidth, css_ast.DMaxWidth, + css_ast.DHeight, css_ast.DMinHeight, css_ast.DMaxHeight: + // The prefix applies to the value, not the property + keyText = decl.KeyText + + // This currently only applies to "stretch" (already checked above) + switch prefix { + case "-webkit-": + value[0].Text = "-webkit-fill-available" + case "-moz-": + value[0].Text = "-moz-available" + } + case css_ast.DUserSelect: // The prefix applies to the value as well as the property if prefix == "-moz-" && len(value) == 1 && value[0].Kind == css_lexer.TIdent && strings.EqualFold(value[0].Text, "none") { @@ -481,6 +501,15 @@ func (p *parser) insertPrefixedDeclaration(rules []css_ast.Rule, prefix string, } } + // If we didn't change the key, manually search for a previous duplicate rule + if keyText == decl.KeyText { + for _, rule := range rules { + if prevDecl, ok := rule.Data.(*css_ast.RDeclaration); ok && prevDecl.KeyText == keyText && css_ast.TokensEqual(prevDecl.Value, value, nil) { + return rules + } + } + } + // Overwrite the latest declaration with the prefixed declaration rules[len(rules)-1] = css_ast.Rule{Loc: loc, Data: &css_ast.RDeclaration{ KeyText: keyText, diff --git a/vendor/github.com/evanw/esbuild/internal/js_parser/js_parser_lower.go b/vendor/github.com/evanw/esbuild/internal/js_parser/js_parser_lower.go index 89c772140e6..fbd74416061 100644 --- a/vendor/github.com/evanw/esbuild/internal/js_parser/js_parser_lower.go +++ b/vendor/github.com/evanw/esbuild/internal/js_parser/js_parser_lower.go @@ -1892,7 +1892,6 @@ func (p *parser) lowerUsingDeclarationContext() lowerUsingDeclarationContext { } } -// If this returns "nil", then no lowering needed to be done func (ctx *lowerUsingDeclarationContext) scanStmts(p *parser, stmts []js_ast.Stmt) { for _, stmt := range stmts { if local, ok := stmt.Data.(*js_ast.SLocal); ok && local.Kind.IsUsing() { @@ -2116,6 +2115,7 @@ func (p *parser) lowerUsingDeclarationInForOf(loc logger.Loc, init *js_ast.SLoca id.Ref = tempRef } +// If this returns "nil", then no lowering needed to be done func (p *parser) maybeLowerUsingDeclarationsInSwitch(loc logger.Loc, s *js_ast.SSwitch) []js_ast.Stmt { // Check for a "using" declaration in any case shouldLower := false diff --git a/vendor/github.com/evanw/esbuild/internal/js_parser/ts_parser.go b/vendor/github.com/evanw/esbuild/internal/js_parser/ts_parser.go index 6338fa09a9a..4b37be60189 100644 --- a/vendor/github.com/evanw/esbuild/internal/js_parser/ts_parser.go +++ b/vendor/github.com/evanw/esbuild/internal/js_parser/ts_parser.go @@ -262,7 +262,8 @@ loop: p.lexer.Next() // "[import: number]" - if flags.has(allowTupleLabelsFlag) && p.lexer.Token == js_lexer.TColon { + // "[import?: number]" + if flags.has(allowTupleLabelsFlag) && (p.lexer.Token == js_lexer.TColon || p.lexer.Token == js_lexer.TQuestion) { return } @@ -288,7 +289,8 @@ loop: p.lexer.Next() // "[new: number]" - if flags.has(allowTupleLabelsFlag) && p.lexer.Token == js_lexer.TColon { + // "[new?: number]" + if flags.has(allowTupleLabelsFlag) && (p.lexer.Token == js_lexer.TColon || p.lexer.Token == js_lexer.TQuestion) { return } @@ -314,13 +316,15 @@ loop: // Valid: // "[keyof: string]" + // "[keyof?: string]" // "{[keyof: string]: number}" // "{[keyof in string]: number}" // // Invalid: // "A extends B ? keyof : string" // - if (p.lexer.Token != js_lexer.TColon && p.lexer.Token != js_lexer.TIn) || (!flags.has(isIndexSignatureFlag) && !flags.has(allowTupleLabelsFlag)) { + if (p.lexer.Token != js_lexer.TColon && p.lexer.Token != js_lexer.TQuestion && p.lexer.Token != js_lexer.TIn) || + (!flags.has(isIndexSignatureFlag) && !flags.has(allowTupleLabelsFlag)) { p.skipTypeScriptType(js_ast.LPrefix) } break loop @@ -332,7 +336,10 @@ loop: // "type Foo = Bar extends [infer T extends string] ? T : null" // "type Foo = Bar extends [infer T extends string ? infer T : never] ? T : null" // "type Foo = { [infer in Bar]: number }" - if (p.lexer.Token != js_lexer.TColon && p.lexer.Token != js_lexer.TIn) || (!flags.has(isIndexSignatureFlag) && !flags.has(allowTupleLabelsFlag)) { + // "type Foo = [infer: number]" + // "type Foo = [infer?: number]" + if (p.lexer.Token != js_lexer.TColon && p.lexer.Token != js_lexer.TQuestion && p.lexer.Token != js_lexer.TIn) || + (!flags.has(isIndexSignatureFlag) && !flags.has(allowTupleLabelsFlag)) { p.lexer.Expect(js_lexer.TIdentifier) if p.lexer.Token == js_lexer.TExtends { p.trySkipTypeScriptConstraintOfInferTypeWithBacktracking(flags) @@ -390,7 +397,8 @@ loop: p.lexer.Next() // "[typeof: number]" - if flags.has(allowTupleLabelsFlag) && p.lexer.Token == js_lexer.TColon { + // "[typeof?: number]" + if flags.has(allowTupleLabelsFlag) && (p.lexer.Token == js_lexer.TColon || p.lexer.Token == js_lexer.TQuestion) { return } @@ -459,12 +467,13 @@ loop: default: // "[function: number]" + // "[function?: number]" if flags.has(allowTupleLabelsFlag) && p.lexer.IsIdentifierOrKeyword() { if p.lexer.Token != js_lexer.TFunction { p.log.AddError(&p.tracker, p.lexer.Range(), fmt.Sprintf("Unexpected %q", p.lexer.Raw())) } p.lexer.Next() - if p.lexer.Token != js_lexer.TColon { + if p.lexer.Token != js_lexer.TColon && p.lexer.Token != js_lexer.TQuestion { p.lexer.Expect(js_lexer.TColon) } return diff --git a/vendor/github.com/evanw/esbuild/internal/resolver/resolver.go b/vendor/github.com/evanw/esbuild/internal/resolver/resolver.go index 5625ea4989a..bd34c50c37e 100644 --- a/vendor/github.com/evanw/esbuild/internal/resolver/resolver.go +++ b/vendor/github.com/evanw/esbuild/internal/resolver/resolver.go @@ -1012,6 +1012,21 @@ func (r resolverQuery) resolveWithoutSymlinks(sourceDir string, sourceDirInfo *d strings.HasSuffix(importPath, "/.") || strings.HasSuffix(importPath, "/..") + // Check the "browser" map + if importDirInfo := r.dirInfoCached(r.fs.Dir(absPath)); importDirInfo != nil { + if remapped, ok := r.checkBrowserMap(importDirInfo, absPath, absolutePathKind); ok { + if remapped == nil { + return &ResolveResult{PathPair: PathPair{Primary: logger.Path{Text: absPath, Namespace: "file", Flags: logger.PathDisabled}}} + } + if remappedResult, ok, diffCase, sideEffects := r.resolveWithoutRemapping(importDirInfo.enclosingBrowserScope, *remapped); ok { + result = ResolveResult{PathPair: remappedResult, DifferentCase: diffCase, PrimarySideEffectsData: sideEffects} + hasTrailingSlash = false + checkRelative = false + checkPackage = false + } + } + } + if hasTrailingSlash { if absolute, ok, diffCase := r.loadAsDirectory(absPath); ok { checkPackage = false @@ -1020,20 +1035,6 @@ func (r resolverQuery) resolveWithoutSymlinks(sourceDir string, sourceDirInfo *d return nil } } else { - // Check the "browser" map - if importDirInfo := r.dirInfoCached(r.fs.Dir(absPath)); importDirInfo != nil { - if remapped, ok := r.checkBrowserMap(importDirInfo, absPath, absolutePathKind); ok { - if remapped == nil { - return &ResolveResult{PathPair: PathPair{Primary: logger.Path{Text: absPath, Namespace: "file", Flags: logger.PathDisabled}}} - } - if remappedResult, ok, diffCase, sideEffects := r.resolveWithoutRemapping(importDirInfo.enclosingBrowserScope, *remapped); ok { - result = ResolveResult{PathPair: remappedResult, DifferentCase: diffCase, PrimarySideEffectsData: sideEffects} - checkRelative = false - checkPackage = false - } - } - } - if checkRelative { if absolute, ok, diffCase := r.loadAsFileOrDirectory(absPath); ok { checkPackage = false diff --git a/vendor/modules.txt b/vendor/modules.txt index 7a03e31cbdb..84b666f148d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -118,7 +118,7 @@ github.com/dgryski/go-rendezvous ## explicit; go 1.13 github.com/dlclark/regexp2 github.com/dlclark/regexp2/syntax -# github.com/evanw/esbuild v0.25.4 +# github.com/evanw/esbuild v0.25.5 ## explicit; go 1.13 github.com/evanw/esbuild/internal/api_helpers github.com/evanw/esbuild/internal/ast From 1fb95fcc4fa7e0635ecc3a4037c1556b318e7b56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:07:16 +0000 Subject: [PATCH 017/136] build(deps): bump the golangx group with 5 updates Bumps the golangx group with 5 updates: | Package | From | To | | --- | --- | --- | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.38.0` | `0.39.0` | | [golang.org/x/net](https://github.com/golang/net) | `0.40.0` | `0.41.0` | | [golang.org/x/sync](https://github.com/golang/sync) | `0.14.0` | `0.15.0` | | [golang.org/x/time](https://github.com/golang/time) | `0.11.0` | `0.12.0` | | [golang.org/x/text](https://github.com/golang/text) | `0.25.0` | `0.26.0` | Updates `golang.org/x/crypto` from 0.38.0 to 0.39.0 - [Commits](https://github.com/golang/crypto/compare/v0.38.0...v0.39.0) Updates `golang.org/x/net` from 0.40.0 to 0.41.0 - [Commits](https://github.com/golang/net/compare/v0.40.0...v0.41.0) Updates `golang.org/x/sync` from 0.14.0 to 0.15.0 - [Commits](https://github.com/golang/sync/compare/v0.14.0...v0.15.0) Updates `golang.org/x/time` from 0.11.0 to 0.12.0 - [Commits](https://github.com/golang/time/compare/v0.11.0...v0.12.0) Updates `golang.org/x/text` from 0.25.0 to 0.26.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.39.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golangx - dependency-name: golang.org/x/net dependency-version: 0.41.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golangx - dependency-name: golang.org/x/sync dependency-version: 0.15.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golangx - dependency-name: golang.org/x/time dependency-version: 0.12.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golangx - dependency-name: golang.org/x/text dependency-version: 0.26.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golangx ... Signed-off-by: dependabot[bot] --- go.mod | 10 ++++---- go.sum | 24 +++++++++---------- vendor/golang.org/x/net/http2/frame.go | 16 ++++++------- vendor/golang.org/x/net/trace/events.go | 2 +- vendor/golang.org/x/sync/errgroup/errgroup.go | 9 ++++--- vendor/golang.org/x/time/rate/sometimes.go | 4 +++- vendor/modules.txt | 10 ++++---- 7 files changed, 38 insertions(+), 37 deletions(-) diff --git a/go.mod b/go.mod index a25fb6ee0d3..99096f4c5e3 100644 --- a/go.mod +++ b/go.mod @@ -55,12 +55,12 @@ require ( go.opentelemetry.io/otel/trace v1.36.0 go.opentelemetry.io/proto/otlp v1.6.0 go.uber.org/goleak v1.3.0 - golang.org/x/crypto v0.38.0 + golang.org/x/crypto v0.39.0 golang.org/x/crypto/x509roots/fallback v0.0.0-20250414110644-0091fc8e7c69 - golang.org/x/net v0.40.0 - golang.org/x/sync v0.14.0 + golang.org/x/net v0.41.0 + golang.org/x/sync v0.15.0 golang.org/x/term v0.32.0 - golang.org/x/time v0.11.0 + golang.org/x/time v0.12.0 google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 gopkg.in/guregu/null.v3 v3.3.0 @@ -101,7 +101,7 @@ require ( github.com/tidwall/pretty v1.2.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect golang.org/x/sys v0.33.0 // indirect - golang.org/x/text v0.25.0 // indirect + golang.org/x/text v0.26.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect diff --git a/go.sum b/go.sum index 0a33b7e6d43..0c0247dec71 100644 --- a/go.sum +++ b/go.sum @@ -234,8 +234,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/crypto/x509roots/fallback v0.0.0-20250414110644-0091fc8e7c69 h1:yMbJozT8oiQBENoJ9L7TCSZb6wJJAMDUnoIaHHvoEss= golang.org/x/crypto/x509roots/fallback v0.0.0-20250414110644-0091fc8e7c69/go.mod h1:lxN5T34bK4Z/i6cMaU7frUU57VkDXFD4Kamfl/cp9oU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -247,8 +247,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -262,8 +262,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -273,8 +273,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -304,10 +304,10 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= -golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= -golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index 97bd8b06f7a..db3264da8cc 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -39,7 +39,7 @@ const ( FrameContinuation FrameType = 0x9 ) -var frameName = map[FrameType]string{ +var frameNames = [...]string{ FrameData: "DATA", FrameHeaders: "HEADERS", FramePriority: "PRIORITY", @@ -53,10 +53,10 @@ var frameName = map[FrameType]string{ } func (t FrameType) String() string { - if s, ok := frameName[t]; ok { - return s + if int(t) < len(frameNames) { + return frameNames[t] } - return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", uint8(t)) + return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", t) } // Flags is a bitmask of HTTP/2 flags. @@ -124,7 +124,7 @@ var flagName = map[FrameType]map[Flags]string{ // might be 0). type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) -var frameParsers = map[FrameType]frameParser{ +var frameParsers = [...]frameParser{ FrameData: parseDataFrame, FrameHeaders: parseHeadersFrame, FramePriority: parsePriorityFrame, @@ -138,8 +138,8 @@ var frameParsers = map[FrameType]frameParser{ } func typeFrameParser(t FrameType) frameParser { - if f := frameParsers[t]; f != nil { - return f + if int(t) < len(frameParsers) { + return frameParsers[t] } return parseUnknownFrame } @@ -509,7 +509,7 @@ func (fr *Framer) ReadFrame() (Frame, error) { } if fh.Length > fr.maxReadSize { if fh == invalidHTTP1LookingFrameHeader() { - return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err) + return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge) } return nil, ErrFrameTooLarge } diff --git a/vendor/golang.org/x/net/trace/events.go b/vendor/golang.org/x/net/trace/events.go index c646a6952e5..3aaffdd1f7a 100644 --- a/vendor/golang.org/x/net/trace/events.go +++ b/vendor/golang.org/x/net/trace/events.go @@ -508,7 +508,7 @@ const eventsHTML = ` {{$el.When}} {{$el.ElapsedTime}} - {{$el.Title}} + {{$el.Title}} {{if $.Expanded}} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index cfafed5b54c..cb6bb9ad3ba 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -76,10 +76,8 @@ func (g *Group) Wait() error { } // Go calls the given function in a new goroutine. -// The first call to Go must happen before a Wait. -// It blocks until the new goroutine can be added without the number of -// active goroutines in the group exceeding the configured limit. // +// The first call to Go must happen before a Wait. // It blocks until the new goroutine can be added without the number of // goroutines in the group exceeding the configured limit. // @@ -185,8 +183,9 @@ type PanicError struct { } func (p PanicError) Error() string { - // A Go Error method conventionally does not include a stack dump, so omit it - // here. (Callers who care can extract it from the Stack field.) + if len(p.Stack) > 0 { + return fmt.Sprintf("recovered from errgroup.Group: %v\n%s", p.Recovered, p.Stack) + } return fmt.Sprintf("recovered from errgroup.Group: %v", p.Recovered) } diff --git a/vendor/golang.org/x/time/rate/sometimes.go b/vendor/golang.org/x/time/rate/sometimes.go index 6ba99ddb67b..9b83932692f 100644 --- a/vendor/golang.org/x/time/rate/sometimes.go +++ b/vendor/golang.org/x/time/rate/sometimes.go @@ -61,7 +61,9 @@ func (s *Sometimes) Do(f func()) { (s.Every > 0 && s.count%s.Every == 0) || (s.Interval > 0 && time.Since(s.last) >= s.Interval) { f() - s.last = time.Now() + if s.Interval > 0 { + s.last = time.Now() + } } s.count++ } diff --git a/vendor/modules.txt b/vendor/modules.txt index 84b666f148d..aec8f6c9d50 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -448,7 +448,7 @@ go.opentelemetry.io/proto/otlp/trace/v1 ## explicit; go 1.20 go.uber.org/goleak go.uber.org/goleak/internal/stack -# golang.org/x/crypto v0.38.0 +# golang.org/x/crypto v0.39.0 ## explicit; go 1.23.0 golang.org/x/crypto/md4 golang.org/x/crypto/ocsp @@ -456,7 +456,7 @@ golang.org/x/crypto/ripemd160 # golang.org/x/crypto/x509roots/fallback v0.0.0-20250414110644-0091fc8e7c69 ## explicit; go 1.23.0 golang.org/x/crypto/x509roots/fallback -# golang.org/x/net v0.40.0 +# golang.org/x/net v0.41.0 ## explicit; go 1.23.0 golang.org/x/net/context golang.org/x/net/html @@ -468,7 +468,7 @@ golang.org/x/net/idna golang.org/x/net/internal/httpcommon golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/sync v0.14.0 +# golang.org/x/sync v0.15.0 ## explicit; go 1.23.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore @@ -481,7 +481,7 @@ golang.org/x/sys/windows/registry # golang.org/x/term v0.32.0 ## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.25.0 +# golang.org/x/text v0.26.0 ## explicit; go 1.23.0 golang.org/x/text/cases golang.org/x/text/collate @@ -496,7 +496,7 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/unicode/rangetable -# golang.org/x/time v0.11.0 +# golang.org/x/time v0.12.0 ## explicit; go 1.23.0 golang.org/x/time/rate # google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 From 79b04f5934afdc5e371b18dcf54c025d90138034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 6 Jun 2025 11:55:30 -0400 Subject: [PATCH 018/136] Prevent testcov running for forks We can't retrieve secrets for public forks. Otherwise: Run grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets/v1.2.1 Run ${GITHUB_ACTION_PATH}/translate-secrets.bash Secrets that will be queried from Vault: ci/data/repo/grafana/k6/CODECOV_TOKEN CODECOV_TOKEN | CODECOV_TOKEN; Run actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea Error: Error message: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable at OidcClient. (/home/runner/work/_actions/actions/github-script/60a0d83039c74a4aee543508d2ffcb1c3799cdea/dist/index.js:585:23) at Generator.next () at /home/runner/work/_actions/actions/github-script/60a0d83039c74a4aee543508d2ffcb1c3799cdea/dist/index.js:522:71 at new Promise () at __webpack_modules__.8041.__awaiter (/home/runner/work/_actions/actions/github-script/60a0d83039c74a4aee543508d2ffcb1c3799cdea/dist/index.js:518:12) at OidcClient.getIDToken (/home/runner/work/_actions/actions/github-script/60a0d83039c74a4aee543508d2ffcb1c3799cdea/dist/index.js:571:16) at Object. (/home/runner/work/_actions/actions/github-script/60a0d83039c74a4aee543508d2ffcb1c3799cdea/dist/index.js:421:46) at Generator.next () at /home/runner/work/_actions/actions/github-script/60a0d83039c74a4aee543508d2ffcb1c3799cdea/dist/index.js:133:71 at new Promise () Error: Unhandled error: Error: Error message: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 404854667c9..297da30e3dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,6 +132,9 @@ jobs: rm -f *.coverage # Sets CODECOV_TOKEN as an environment variable for the next step - name: Get Codecov token + # Skip this step if the PR is from a fork, as we can't fetch secrets for forks. + # We'll be automatically passing a blank CODECOV_TOKEN in that case. + if: github.event.repository.fork == false && github.event.sender.login != 'dependabot[bot]' uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets/v1.2.1 with: repo_secrets: | From ee27d09da9f5ecda7ec87198af21b1971ae921ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 9 Jun 2025 09:44:56 -0400 Subject: [PATCH 019/136] Skip running codecov upload on public forks --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 297da30e3dd..f1a6f95d35d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -140,6 +140,7 @@ jobs: repo_secrets: | CODECOV_TOKEN=CODECOV_TOKEN:CODECOV_TOKEN - name: Upload coverage to Codecov + if: github.event.repository.fork == false && github.event.sender.login != 'dependabot[bot]' env: CODECOV_BASH_VERSION: 1.0.1 CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e From ab73b181c4d828589b08dd1be1d5b0cfe3b74ee1 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:33:19 +0100 Subject: [PATCH 020/136] Fix nth parse in injected script The body is a number, and we treat it as a number in the injected script. However it is set as a string due to how the selectors parsing is done in the browser codebase. --- internal/js/modules/k6/browser/common/js/injected_script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/js/modules/k6/browser/common/js/injected_script.js b/internal/js/modules/k6/browser/common/js/injected_script.js index 626608b4620..dfedd088b18 100644 --- a/internal/js/modules/k6/browser/common/js/injected_script.js +++ b/internal/js/modules/k6/browser/common/js/injected_script.js @@ -250,7 +250,7 @@ class InjectedScript { if (typeof selector.capture === "number") { return "error:nthnocapture"; } - const nth = part.body; + const nth = parseInt(part.body, 10); const set = new k6BrowserNative.Set(); for (const root of roots) { set.add(root.element); From 11dd1e249674429c58791293e1e0027307bd1856 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:35:41 +0100 Subject: [PATCH 021/136] Add detection of nth selector type This allows the interpretation of the nth selector in the injected script. --- internal/js/modules/k6/browser/common/selectors.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/js/modules/k6/browser/common/selectors.go b/internal/js/modules/k6/browser/common/selectors.go index 7eefa5ef806..950fb7e8b77 100644 --- a/internal/js/modules/k6/browser/common/selectors.go +++ b/internal/js/modules/k6/browser/common/selectors.go @@ -73,6 +73,9 @@ func (s *Selector) parse() error { var name, body string switch { + case strings.HasPrefix(part, "nth="): + name = "nth" + body = part[eqIndex+1:] case eqIndex != -1 && reQueryEngine.Match([]byte(strings.TrimSpace(part[0:eqIndex]))): name = strings.TrimSpace(part[0:eqIndex]) body = part[eqIndex+1:] From b55dcd6ce3d43886c2945acf2d35bcfa887cd449 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:38:02 +0100 Subject: [PATCH 022/136] Add Nth in locator --- internal/js/modules/k6/browser/common/locator.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go index a5fe5b0e0b0..31100936354 100644 --- a/internal/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -423,6 +423,12 @@ func (l *Locator) innerText(opts *FrameInnerTextOptions) (string, error) { return l.frame.innerText(l.selector, opts) } +// Nth will return the nth child of the element matching the locator's +// selector. +func (l *Locator) Nth(nth int) *Locator { + return NewLocator(l.ctx, fmt.Sprintf("%s >> nth=%d", l.selector, nth), l.frame, l.log) +} + // TextContent returns the element's text content that matches // the locator's selector with strict mode on. The second return // value is true if the returned text content is not null or empty, From e889229e8b634431ecffa6ab5b265901312af805 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:38:41 +0100 Subject: [PATCH 023/136] Add the mapping of the nth method for locator --- internal/js/modules/k6/browser/browser/locator_mapping.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/locator_mapping.go b/internal/js/modules/k6/browser/browser/locator_mapping.go index 3a71e3b23a1..1b62f45a085 100644 --- a/internal/js/modules/k6/browser/browser/locator_mapping.go +++ b/internal/js/modules/k6/browser/browser/locator_mapping.go @@ -11,6 +11,7 @@ import ( // mapLocator API to the JS module. func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen + rt := vu.Runtime() return mapping{ "clear": func(opts sobek.Value) (*sobek.Promise, error) { copts := common.NewFrameFillOptions(lo.Timeout()) @@ -118,6 +119,10 @@ func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen return lo.InnerText(opts) //nolint:wrapcheck }) }, + "nth": func(nth int) *sobek.Object { + ml := mapLocator(vu, lo.Nth(nth)) + return rt.ToValue(ml).ToObject(rt) + }, "textContent": func(opts sobek.Value) *sobek.Promise { return k6ext.Promise(vu.Context(), func() (any, error) { s, ok, err := lo.TextContent(opts) From 2ba4839e6f64029816d3979a5e7bbf6b40421213 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:44:05 +0100 Subject: [PATCH 024/136] Add test for locator.nth --- internal/js/modules/k6/browser/browser/mapping_test.go | 1 + internal/js/modules/k6/browser/tests/locator_test.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go index ea5fa951972..48612a01fef 100644 --- a/internal/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -536,6 +536,7 @@ type locatorAPI interface { //nolint:interfacebloat InnerText(opts sobek.Value) (string, error) TextContent(opts sobek.Value) (string, bool, error) InputValue(opts sobek.Value) (string, error) + Nth(nth int) *common.Locator SelectOption(values sobek.Value, opts sobek.Value) ([]string, error) Press(key string, opts sobek.Value) error Type(text string, opts sobek.Value) error diff --git a/internal/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go index 85628c93b50..cb9a5cf3ea7 100644 --- a/internal/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -227,6 +227,13 @@ func TestLocator(t *testing.T) { }) }, }, + { + "Nth", func(_ *testBrowser, p *common.Page) { + text, err := p.Locator("a", nil).Nth(0).InnerText(nil) + require.NoError(t, err) + require.Equal(t, `Click`, text) + }, + }, { "Press", func(_ *testBrowser, p *common.Page) { lo := p.Locator("#inputText", nil) From 2794351aeaef95001533065bc466c2291ec89307 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:48:23 +0100 Subject: [PATCH 025/136] Add locator.first This is a convenience method that is a wrapper around locator.nth(0). --- internal/js/modules/k6/browser/browser/locator_mapping.go | 4 ++++ internal/js/modules/k6/browser/browser/mapping_test.go | 1 + internal/js/modules/k6/browser/common/locator.go | 6 ++++++ internal/js/modules/k6/browser/tests/locator_test.go | 7 +++++++ 4 files changed, 18 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/locator_mapping.go b/internal/js/modules/k6/browser/browser/locator_mapping.go index 1b62f45a085..66fe5065dfa 100644 --- a/internal/js/modules/k6/browser/browser/locator_mapping.go +++ b/internal/js/modules/k6/browser/browser/locator_mapping.go @@ -92,6 +92,10 @@ func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen return nil, lo.Fill(value, opts) //nolint:wrapcheck }) }, + "first": func() *sobek.Object { + ml := mapLocator(vu, lo.First()) + return rt.ToValue(ml).ToObject(rt) + }, "focus": func(opts sobek.Value) *sobek.Promise { return k6ext.Promise(vu.Context(), func() (any, error) { return nil, lo.Focus(opts) //nolint:wrapcheck diff --git a/internal/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go index 48612a01fef..ca20b64d0e9 100644 --- a/internal/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -530,6 +530,7 @@ type locatorAPI interface { //nolint:interfacebloat IsVisible(opts sobek.Value) (bool, error) IsHidden(opts sobek.Value) (bool, error) Fill(value string, opts sobek.Value) error + First() *common.Locator Focus(opts sobek.Value) error GetAttribute(name string, opts sobek.Value) (string, bool, error) InnerHTML(opts sobek.Value) (string, error) diff --git a/internal/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go index 31100936354..30cb8e7ea4b 100644 --- a/internal/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -332,6 +332,12 @@ func (l *Locator) fill(value string, opts *FrameFillOptions) error { return l.frame.fill(l.selector, value, opts) } +// First will return the first child of the element matching the locator's +// selector. +func (l *Locator) First() *Locator { + return NewLocator(l.ctx, fmt.Sprintf("%s >> nth=0", l.selector), l.frame, l.log) +} + // Focus on the element using locator's selector with strict mode on. func (l *Locator) Focus(opts sobek.Value) error { l.log.Debugf("Locator:Focus", "fid:%s furl:%q sel:%q opts:%+v", l.frame.ID(), l.frame.URL(), l.selector, opts) diff --git a/internal/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go index cb9a5cf3ea7..b4088cdaeb0 100644 --- a/internal/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -156,6 +156,13 @@ func TestLocator(t *testing.T) { require.Error(t, lo.Fill(value, nil)) }, }, + { + "First", func(_ *testBrowser, p *common.Page) { + text, err := p.Locator("a", nil).First().InnerText(nil) + require.NoError(t, err) + require.Equal(t, `Click`, text) + }, + }, { "Focus", func(_ *testBrowser, p *common.Page) { focused := func() bool { From d522ae5732670431830e003a54a313816f4f9070 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:53:43 +0100 Subject: [PATCH 026/136] Add locator.last This is a convenience method wrapping around locator.nth(-1), which returns the last element that matches the selector. --- internal/js/modules/k6/browser/browser/locator_mapping.go | 4 ++++ internal/js/modules/k6/browser/browser/mapping_test.go | 1 + internal/js/modules/k6/browser/common/locator.go | 6 ++++++ internal/js/modules/k6/browser/tests/locator_test.go | 7 +++++++ 4 files changed, 18 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/locator_mapping.go b/internal/js/modules/k6/browser/browser/locator_mapping.go index 66fe5065dfa..9608647128d 100644 --- a/internal/js/modules/k6/browser/browser/locator_mapping.go +++ b/internal/js/modules/k6/browser/browser/locator_mapping.go @@ -123,6 +123,10 @@ func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen return lo.InnerText(opts) //nolint:wrapcheck }) }, + "last": func() *sobek.Object { + ml := mapLocator(vu, lo.Last()) + return rt.ToValue(ml).ToObject(rt) + }, "nth": func(nth int) *sobek.Object { ml := mapLocator(vu, lo.Nth(nth)) return rt.ToValue(ml).ToObject(rt) diff --git a/internal/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go index ca20b64d0e9..c49d94f1037 100644 --- a/internal/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -537,6 +537,7 @@ type locatorAPI interface { //nolint:interfacebloat InnerText(opts sobek.Value) (string, error) TextContent(opts sobek.Value) (string, bool, error) InputValue(opts sobek.Value) (string, error) + Last() *common.Locator Nth(nth int) *common.Locator SelectOption(values sobek.Value, opts sobek.Value) ([]string, error) Press(key string, opts sobek.Value) error diff --git a/internal/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go index 30cb8e7ea4b..3791d674949 100644 --- a/internal/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -429,6 +429,12 @@ func (l *Locator) innerText(opts *FrameInnerTextOptions) (string, error) { return l.frame.innerText(l.selector, opts) } +// Last will return the last child of the element matching the locator's +// selector. +func (l *Locator) Last() *Locator { + return NewLocator(l.ctx, fmt.Sprintf("%s >> nth=-1", l.selector), l.frame, l.log) +} + // Nth will return the nth child of the element matching the locator's // selector. func (l *Locator) Nth(nth int) *Locator { diff --git a/internal/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go index b4088cdaeb0..e7fd40ddcb3 100644 --- a/internal/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -234,6 +234,13 @@ func TestLocator(t *testing.T) { }) }, }, + { + "Last", func(_ *testBrowser, p *common.Page) { + text, err := p.Locator("div", nil).Last().InnerText(nil) + require.NoError(t, err) + require.Equal(t, `bye`, text) + }, + }, { "Nth", func(_ *testBrowser, p *common.Page) { text, err := p.Locator("a", nil).Nth(0).InnerText(nil) From 83425070f58fc2af51e06133a190f8e76ec5b4c8 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 12:15:12 +0100 Subject: [PATCH 027/136] Ignore lint issue This parse method will grow while we add more selectors. Refactoring should be done after. --- internal/js/modules/k6/browser/common/selectors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/js/modules/k6/browser/common/selectors.go b/internal/js/modules/k6/browser/common/selectors.go index 950fb7e8b77..392a72c4f0c 100644 --- a/internal/js/modules/k6/browser/common/selectors.go +++ b/internal/js/modules/k6/browser/common/selectors.go @@ -65,7 +65,7 @@ func (s *Selector) appendPart(p *SelectorPart, capture bool) error { return nil } -//nolint:cyclop +//nolint:cyclop,funlen func (s *Selector) parse() error { parsePart := func(selector string, start, index int) (*SelectorPart, bool) { part := strings.TrimSpace(selector[start:index]) From bf431a3c8e20226ac37318ef0f31ab2ec343afa3 Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 5 Jun 2025 09:14:53 +0100 Subject: [PATCH 028/136] Use string concat instead of sprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's more performant Co-authored-by: İnanç Gümüş --- internal/js/modules/k6/browser/common/locator.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go index 3791d674949..caa80b004eb 100644 --- a/internal/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -3,6 +3,7 @@ package common import ( "context" "fmt" + "strconv" "time" "github.com/grafana/sobek" @@ -335,7 +336,7 @@ func (l *Locator) fill(value string, opts *FrameFillOptions) error { // First will return the first child of the element matching the locator's // selector. func (l *Locator) First() *Locator { - return NewLocator(l.ctx, fmt.Sprintf("%s >> nth=0", l.selector), l.frame, l.log) + return NewLocator(l.ctx, l.selector+" >> nth=0", l.frame, l.log) } // Focus on the element using locator's selector with strict mode on. @@ -432,13 +433,13 @@ func (l *Locator) innerText(opts *FrameInnerTextOptions) (string, error) { // Last will return the last child of the element matching the locator's // selector. func (l *Locator) Last() *Locator { - return NewLocator(l.ctx, fmt.Sprintf("%s >> nth=-1", l.selector), l.frame, l.log) + return NewLocator(l.ctx, l.selector+" >> nth=-1", l.frame, l.log) } // Nth will return the nth child of the element matching the locator's // selector. func (l *Locator) Nth(nth int) *Locator { - return NewLocator(l.ctx, fmt.Sprintf("%s >> nth=%d", l.selector, nth), l.frame, l.log) + return NewLocator(l.ctx, l.selector+" >> nth="+strconv.Itoa(nth), l.frame, l.log) } // TextContent returns the element's text content that matches From c12984de876588d4a2140a1dfeb7d3e493ae8a2c Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 22 May 2025 23:50:18 +0100 Subject: [PATCH 029/136] Fix fill method in injection script This fill function was failing to fill the input text field. It would seem that it was returning to early, when it should have continued onto the end of the function and returned "needsinput". --- .../k6/browser/common/js/injected_script.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/js/modules/k6/browser/common/js/injected_script.js b/internal/js/modules/k6/browser/common/js/injected_script.js index dfedd088b18..c953c58bb12 100644 --- a/internal/js/modules/k6/browser/common/js/injected_script.js +++ b/internal/js/modules/k6/browser/common/js/injected_script.js @@ -578,14 +578,16 @@ class InjectedScript { if (type === "number" && isNaN(Number(value))) { return "error:notfillablenumberinput"; } - input.focus(); - input.value = value; - if (kDateTypes.has(type) && input.value !== value) { - return "error:notvaliddate"; + if (kDateTypes.has(type)) { + input.focus(); + input.value = value; + if (input.value !== value) { + return "error:notvaliddate"; + } + element.dispatchEvent(new Event("input", { bubbles: true })); + element.dispatchEvent(new Event("change", { bubbles: true })); + return "done"; // We have already changed the value, no need to input it. } - element.dispatchEvent(new Event("input", { bubbles: true })); - element.dispatchEvent(new Event("change", { bubbles: true })); - return "done"; // We have already changed the value, no need to input it. } else if (element.nodeName.toLowerCase() === "textarea") { // Nothing to check here. } else if (!element.isContentEditable) { From 418c9e28198d93fc59c01734be471dc3a2093eeb Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 23 May 2025 21:20:07 +0100 Subject: [PATCH 030/136] Add a test for the Fill fix It relies on a react based website. --- .../modules/k6/browser/tests/locator_test.go | 38 ++++++++++++++++++ .../k6/browser/tests/static/react_input.html | 40 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 internal/js/modules/k6/browser/tests/static/react_input.html diff --git a/internal/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go index e7fd40ddcb3..3d3fceff614 100644 --- a/internal/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -4,6 +4,7 @@ package tests import ( + "fmt" "testing" "time" @@ -791,3 +792,40 @@ func TestCount(t *testing.T) { }) } } + +func TestReactInput(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + do func(*testBrowser, *common.Page) + }{ + { + "Fill", func(_ *testBrowser, p *common.Page) { + const value = "test@example.com" + lo := p.Locator("input[placeholder='Username or email']", nil) + require.NoError(t, lo.Fill(value, nil)) + inputValue, err := p.InnerText("p[id='react-state']", common.NewFrameInnerTextOptions(p.MainFrame().Timeout())) + require.NoError(t, err) + require.Equal(t, fmt.Sprintf("React state: %q", value), inputValue) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + tb := newTestBrowser(t, withFileServer()) + p := tb.NewPage(nil) + opts := &common.FrameGotoOptions{ + Timeout: common.DefaultTimeout, + } + _, err := p.Goto( + tb.staticURL("react_input.html"), + opts, + ) + tt.do(tb, p) + require.NoError(t, err) + }) + } +} diff --git a/internal/js/modules/k6/browser/tests/static/react_input.html b/internal/js/modules/k6/browser/tests/static/react_input.html new file mode 100644 index 00000000000..05462ad0cf3 --- /dev/null +++ b/internal/js/modules/k6/browser/tests/static/react_input.html @@ -0,0 +1,40 @@ + + + + + Controlled Grafana-like Input Demo + + + + + + +
+ + From c5b88f457e55af926cd83cfb3d8af52d6d90f535 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 4 Jun 2025 11:15:44 +0100 Subject: [PATCH 031/136] Add react js files to avoid flaky tests due to... network issues. --- .../tests/static/react-dom.development.js | 29924 ++++++++++++++++ .../browser/tests/static/react.development.js | 3343 ++ .../k6/browser/tests/static/react_input.html | 4 +- 3 files changed, 33269 insertions(+), 2 deletions(-) create mode 100644 internal/js/modules/k6/browser/tests/static/react-dom.development.js create mode 100644 internal/js/modules/k6/browser/tests/static/react.development.js diff --git a/internal/js/modules/k6/browser/tests/static/react-dom.development.js b/internal/js/modules/k6/browser/tests/static/react-dom.development.js new file mode 100644 index 00000000000..90cd21d3cc9 --- /dev/null +++ b/internal/js/modules/k6/browser/tests/static/react-dom.development.js @@ -0,0 +1,29924 @@ +/** + * @license React + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : + typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : + (global = global || self, factory(global.ReactDOM = {}, global.React)); +}(this, (function (exports, React) { 'use strict'; + + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + + var suppressWarning = false; + function setSuppressWarning(newSuppressWarning) { + { + suppressWarning = newSuppressWarning; + } + } // In DEV, calls to console.warn and console.error get replaced + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + if (!suppressWarning) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } + } + } + function error(format) { + { + if (!suppressWarning) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } + } + } + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var ScopeComponent = 21; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; + + // ----------------------------------------------------------------------------- + + var enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing + // the react-reconciler package. + + var enableNewReconciler = false; // Support legacy Primer support on internal FB www + + var enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics. + + var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber + + var enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz + // React DOM Chopping Block + // + // Similar to main Chopping Block but only flags related to React DOM. These are + // grouped because we will likely batch all of them into a single major release. + // ----------------------------------------------------------------------------- + // Disable support for comment nodes as React DOM containers. Already disabled + // in open source, but www codebase still relies on it. Need to remove. + + var disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection. + // and client rendering, mostly to allow JSX attributes to apply to the custom + // element's object properties instead of only HTML attributes. + // https://github.com/facebook/react/issues/11347 + + var enableCustomElementPropertySupport = false; // Disables children for + + + + + + + + Progress + + Output + +
Summary
Details
+ + Dialog + +

Heading1

Heading2

Heading3

Heading4

Heading5
Heading6
+ +
+ + Img + +
  • Item1
+
  1. Item2
+ +
Term
Description
+ +
Legend
+ +
Caption
+ + + + + + + + + + + +
Head Gridcell
Head Cell
Head Column
Head Row
Cell
Row
Column Cell
Column Gridcell
Foot
+ +
Main
+ + + +
Article
+ + + +
+ +
Region content
+
Blockquote text
+ +
Table Caption
Cell
+ + Code sample + + Deleted text + + Definition term + + Emphasized text + + Inserted text + + Marked text + + x=1 + +
  • Menu item
  • + + 50% + +

    Paragraph text

    + + Strong text + + Subscript + + Superscript + + + + + + + + + + + + + + +
    Footer
    + + From a37fb85630d709d76609a31b1225ee2aacd4085e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 9 Jun 2025 22:29:29 +0100 Subject: [PATCH 074/136] Add getByRole in page mapping test --- internal/js/modules/k6/browser/browser/mapping_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go index c49d94f1037..439173edf77 100644 --- a/internal/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -318,6 +318,7 @@ type pageAPI interface { //nolint:interfacebloat Focus(selector string, opts sobek.Value) error Frames() []*common.Frame GetAttribute(selector string, name string, opts sobek.Value) (string, bool, error) + GetByRole(role string, opts *common.GetByRoleOptions) (*common.ElementHandle, error) GetKeyboard() *common.Keyboard GetMouse() *common.Mouse GetTouchscreen() *common.Touchscreen From bfc8d10b233f34081846ff5040d15d336fb4e25d Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 10 Jun 2025 11:01:52 +0100 Subject: [PATCH 075/136] Update tests so they work on windows --- internal/js/modules/k6/browser/tests/get_by_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index bb111d2d465..a572dc27d13 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -743,13 +743,13 @@ func TestGetByRoleFailure(t *testing.T) { "missing_quotes_on_string", "button", &common.GetByRoleOptions{Name: stringPtr(`Submit Form`)}, - "InvalidSelectorError: Error while parsing selector `button[name=Submit Form]`", + "Error while parsing selector `button[name=Submit Form]` - unexpected symbol", }, { "missing_role", "", nil, - "counting elements: InvalidSelectorError: Error while parsing selector `` - selector cannot be empty", + "Error while parsing selector `` - selector cannot be empty", }, } for _, tt := range tests { From 18ddef1cc9216aeefc99389d12a4b31b855fce16 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 10 Jun 2025 15:09:18 +0100 Subject: [PATCH 076/136] Update test file to ignore build on windows It seems to be an issue with locator based APIs in integration tests, they just don't work. Locator based tests work perfectly when written and ran from a js test script. --- internal/js/modules/k6/browser/tests/get_by_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index a572dc27d13..b3f5cc0d1b3 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -1,3 +1,6 @@ +// practically none of this work on windows +//go:build !windows + package tests import ( From 15b71ec1f5e008e6f56febe8845e38af18b0d26e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 10 Jun 2025 15:17:10 +0100 Subject: [PATCH 077/136] Update from " to ' The role based selector engine needs to work with ' and not " when it comes to the name option. This is automatically done for the user in the mapping layer, but in the integration test we need to ensure that we explicitly use ' and not ". --- .../modules/k6/browser/tests/get_by_test.go | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index b3f5cc0d1b3..e6be265d48f 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -55,31 +55,31 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "link", role: "link", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Link text"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Link text'`)}, expected: 1, expectedText: "Link text", }, { name: "area", role: "link", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Map area"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Map area'`)}, expected: 1, expectedText: "", }, { name: "button", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Click"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Click'`)}, expected: 1, expectedText: "Click", }, { name: "submit_type", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Submit"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Submit'`)}, expected: 1, expectedText: "", }, { name: "image_type", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Image Button"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Image Button'`)}, expected: 1, expectedText: "", }, { @@ -95,13 +95,13 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "text_type", role: "textbox", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Text type"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Text type'`)}, expected: 1, expectedText: "", }, { name: "textarea", role: "textbox", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Text area"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Text area'`)}, expected: 1, expectedText: "Textarea", }, { @@ -132,7 +132,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "details_summary", role: "group", - opts: &common.GetByRoleOptions{Name: stringPtr(`"details"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'details'`)}, expected: 1, expectedText: "SummaryDetails", }, { @@ -184,7 +184,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "img", role: "img", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Img"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Img'`)}, expected: 1, expectedText: "", }, { @@ -195,25 +195,25 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "ul_list", role: "list", - opts: &common.GetByRoleOptions{Name: stringPtr(`"ul"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'ul'`)}, expected: 1, expectedText: "", }, { name: "ol_list", role: "list", - opts: &common.GetByRoleOptions{Name: stringPtr(`"ol"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'ol'`)}, expected: 1, expectedText: "", }, { name: "ul_li_listitem", role: "listitem", - opts: &common.GetByRoleOptions{Name: stringPtr(`"ul-li"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'ul-li'`)}, expected: 1, expectedText: "Item1", }, { name: "ol_li_listitem", role: "listitem", - opts: &common.GetByRoleOptions{Name: stringPtr(`"ol-li"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'ol-li'`)}, expected: 1, expectedText: "Item2", }, { @@ -229,19 +229,19 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "fieldset_legend", role: "group", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Legend"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Legend'`)}, expected: 1, expectedText: "Legend", }, { name: "figure_figcaption", role: "figure", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Caption"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Caption'`)}, expected: 1, expectedText: "Caption", }, { name: "table", role: "table", - opts: &common.GetByRoleOptions{Name: stringPtr(`"table"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'table'`)}, expected: 1, expectedText: "", }, { @@ -257,43 +257,43 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "table_head_cell", role: "cell", - opts: &common.GetByRoleOptions{Name: stringPtr(`"th"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'th'`)}, expected: 1, expectedText: "Head Cell", }, { name: "table_head_gridcell", role: "gridcell", - opts: &common.GetByRoleOptions{Name: stringPtr(`"th gridcell"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'th gridcell'`)}, expected: 1, expectedText: "Head Gridcell", }, { name: "table_body", role: "rowgroup", - opts: &common.GetByRoleOptions{Name: stringPtr(`"tbody"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'tbody'`)}, expected: 1, expectedText: "Cell", }, { name: "table_foot", role: "rowgroup", - opts: &common.GetByRoleOptions{Name: stringPtr(`"tfoot"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'tfoot'`)}, expected: 1, expectedText: "Foot", }, { name: "table_tr", role: "row", - opts: &common.GetByRoleOptions{Name: stringPtr(`"tr"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'tr'`)}, expected: 1, expectedText: "Row", }, { name: "table_td_cell", role: "cell", - opts: &common.GetByRoleOptions{Name: stringPtr(`"td"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'td'`)}, expected: 1, expectedText: "Column Cell", }, { name: "table_td_gridcell", role: "gridcell", - opts: &common.GetByRoleOptions{Name: stringPtr(`"td gridcell"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'td gridcell'`)}, expected: 1, expectedText: "Column Gridcell", }, { @@ -332,14 +332,14 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "form", role: "form", - opts: &common.GetByRoleOptions{Name: stringPtr(`"form"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'form'`)}, expected: 1, expectedText: "", }, // Only works with aria labels. { name: "section", role: "region", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Region Section"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Region Section'`)}, expected: 1, expectedText: "Region content", }, { @@ -385,7 +385,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "menu", role: "list", - opts: &common.GetByRoleOptions{Name: stringPtr(`"menu"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'menu'`)}, expected: 1, expectedText: "Menu item", }, { @@ -416,7 +416,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "svg", role: "img", - opts: &common.GetByRoleOptions{Name: stringPtr(`"svg"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'svg'`)}, expected: 1, expectedText: "", }, { @@ -427,13 +427,13 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "select", role: "combobox", - opts: &common.GetByRoleOptions{Name: stringPtr(`"select"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'select'`)}, expected: 1, expectedText: "", }, { name: "select_multiple", role: "listbox", - opts: &common.GetByRoleOptions{Name: stringPtr(`"select multiple"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'select multiple'`)}, expected: 1, expectedText: "", }, { @@ -445,7 +445,7 @@ func TestGetByRoleSuccess(t *testing.T) { // { // name: "optgroup", // role: "group", - // opts: &common.GetByRoleOptions{Name: stringPtr(`"optgroup"`)}, + // opts: &common.GetByRoleOptions{Name: stringPtr(`'optgroup'`)}, // expected: 1, expectedText: "", // }, } @@ -620,31 +620,31 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "text_content_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Submit Form"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Submit Form'`)}, expected: 1, expectedText: "", }, { name: "aria_label_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Save Draft"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Save Draft'`)}, expected: 1, expectedText: "", }, { name: "aria_labelledby_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Upload"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Upload'`)}, expected: 1, expectedText: "labelledby-upload-button", }, { name: "hidden_text_nodes_should_be_ignored", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"FooBar"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'FooBar'`)}, expected: 0, expectedText: "", }, { name: "only_visible_node", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Bar"`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Bar'`)}, expected: 1, expectedText: "Bar", }, { @@ -698,19 +698,19 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "include_css_hidden", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Hidden X Button"`), IncludeHidden: boolPtr(true)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Hidden X Button'`), IncludeHidden: boolPtr(true)}, expected: 1, expectedText: "X", }, { name: "include_aria_hidden", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`"Hidden Hi Button"`), IncludeHidden: boolPtr(true)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'Hidden Hi Button'`), IncludeHidden: boolPtr(true)}, expected: 1, expectedText: "Hi", }, { name: "combo_options", role: "button", - opts: &common.GetByRoleOptions{Pressed: boolPtr(false), Name: stringPtr(`"Archive"`), IncludeHidden: boolPtr(true)}, + opts: &common.GetByRoleOptions{Pressed: boolPtr(false), Name: stringPtr(`'Archive'`), IncludeHidden: boolPtr(true)}, expected: 1, expectedText: "Combo Options Button", }, } From 95afd695945d7ea170e5844fec84496514bb4e03 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 10 Jun 2025 15:19:33 +0100 Subject: [PATCH 078/136] Fix test after change from " to ' --- internal/js/modules/k6/browser/tests/get_by_test.go | 2 +- .../modules/k6/browser/tests/static/get_by_role_implicit.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index e6be265d48f..2e804f7e788 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -241,7 +241,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "table", role: "table", - opts: &common.GetByRoleOptions{Name: stringPtr(`'table'`)}, + opts: &common.GetByRoleOptions{Name: stringPtr(`'table1'`)}, expected: 1, expectedText: "", }, { diff --git a/internal/js/modules/k6/browser/tests/static/get_by_role_implicit.html b/internal/js/modules/k6/browser/tests/static/get_by_role_implicit.html index f63bfe7adb1..d15a3b1415e 100644 --- a/internal/js/modules/k6/browser/tests/static/get_by_role_implicit.html +++ b/internal/js/modules/k6/browser/tests/static/get_by_role_implicit.html @@ -55,7 +55,7 @@

    Heading1

    Heading2

    Heading3

    Heading4

    Heading5
    Caption
    - +
    From 533be09ab35f1f0495b26d3d0187d8e7a1446f7f Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 16 Jun 2025 16:33:10 +0100 Subject: [PATCH 079/136] Update comment and log for GetByRole --- internal/js/modules/k6/browser/common/frame.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index a06e6f20aff..95ddb1b94e8 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -1002,9 +1002,10 @@ func (f *Frame) getAttribute(selector, name string, opts *FrameBaseOptions) (str return s, true, nil } -// Locator creates and returns a new locator for this frame. +// GetByRole creates and returns a new locator for this frame using the ARIA role +// and any additional options. func (f *Frame) GetByRole(role string, opts *GetByRoleOptions) *Locator { - f.log.Debugf("Frame:Locator", "fid:%s furl:%q role:%q opts:%+v", f.ID(), f.URL(), role, opts) + f.log.Debugf("Frame:GetByRole", "fid:%s furl:%q role:%q opts:%+v", f.ID(), f.URL(), role, opts) properties := make(map[string]string) From dcba8ec09e16965caacd837b856b6d29a952d7dc Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 16 Jun 2025 16:43:18 +0100 Subject: [PATCH 080/136] Refactor GetByRole Locator builder --- .../js/modules/k6/browser/common/frame.go | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index 95ddb1b94e8..fa788548e13 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "strconv" "strings" "sync" "time" @@ -1010,46 +1011,46 @@ func (f *Frame) GetByRole(role string, opts *GetByRoleOptions) *Locator { properties := make(map[string]string) if opts == nil { - return f.Locator(fmt.Sprintf("internal:role=%s", role), nil) + return f.Locator("internal:role="+role, nil) } if opts.Checked != nil { - properties["checked"] = fmt.Sprintf("%v", *opts.Checked) + properties["checked"] = strconv.FormatBool(*opts.Checked) } if opts.Disabled != nil { - properties["disabled"] = fmt.Sprintf("%v", *opts.Disabled) + properties["disabled"] = strconv.FormatBool(*opts.Disabled) } if opts.Selected != nil { - properties["selected"] = fmt.Sprintf("%v", *opts.Selected) + properties["selected"] = strconv.FormatBool(*opts.Selected) } if opts.Expanded != nil { - properties["expanded"] = fmt.Sprintf("%v", *opts.Expanded) + properties["expanded"] = strconv.FormatBool(*opts.Expanded) } if opts.IncludeHidden != nil { - properties["include-hidden"] = fmt.Sprintf("%v", *opts.IncludeHidden) + properties["include-hidden"] = strconv.FormatBool(*opts.IncludeHidden) } if opts.Level != nil { - properties["level"] = fmt.Sprintf("%v", *opts.Level) + properties["level"] = strconv.FormatInt(*opts.Level, 10) } if opts.Name != nil && *opts.Name != "" { // Exact option can only be applied to quoted strings. if (*opts.Name)[0] == '\'' && (*opts.Name)[len(*opts.Name)-1] == '\'' { if opts.Exact != nil && *opts.Exact { - *opts.Name = fmt.Sprintf("%vs", *opts.Name) + *opts.Name = *opts.Name + "s" } else { - *opts.Name = fmt.Sprintf("%vi", *opts.Name) + *opts.Name = *opts.Name + "i" } } properties["name"] = *opts.Name } if opts.Pressed != nil { - properties["pressed"] = fmt.Sprintf("%v", *opts.Pressed) + properties["pressed"] = strconv.FormatBool(*opts.Pressed) } var builder strings.Builder - builder.WriteString(fmt.Sprintf("internal:role=%s", role)) + builder.WriteString("internal:role=" + role) for key, value := range properties { - builder.WriteString(fmt.Sprintf("[%s=%s]", key, value)) + builder.WriteString("[" + key + "=" + value + "]") } return f.Locator(builder.String(), nil) From df0180972273eb01acd6182de0446c652a14ccdb Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 16 Jun 2025 16:46:31 +0100 Subject: [PATCH 081/136] Refactor to use generics in test --- .../modules/k6/browser/tests/get_by_test.go | 118 ++++++++---------- 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index 2e804f7e788..f942ed9896b 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -12,16 +12,8 @@ import ( "go.k6.io/k6/internal/js/modules/k6/browser/common" ) -func stringPtr(s string) *string { - return &s -} - -func boolPtr(b bool) *bool { - return &b -} - -func int64Ptr(i int64) *int64 { - return &i +func ptr[T any](v T) *T { + return &v } func TestGetByRoleSuccess(t *testing.T) { @@ -55,31 +47,31 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "link", role: "link", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Link text'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Link text'`)}, expected: 1, expectedText: "Link text", }, { name: "area", role: "link", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Map area'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Map area'`)}, expected: 1, expectedText: "", }, { name: "button", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Click'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Click'`)}, expected: 1, expectedText: "Click", }, { name: "submit_type", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Submit'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Submit'`)}, expected: 1, expectedText: "", }, { name: "image_type", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Image Button'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Image Button'`)}, expected: 1, expectedText: "", }, { @@ -95,13 +87,13 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "text_type", role: "textbox", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Text type'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Text type'`)}, expected: 1, expectedText: "", }, { name: "textarea", role: "textbox", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Text area'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Text area'`)}, expected: 1, expectedText: "Textarea", }, { @@ -132,7 +124,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "details_summary", role: "group", - opts: &common.GetByRoleOptions{Name: stringPtr(`'details'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'details'`)}, expected: 1, expectedText: "SummaryDetails", }, { @@ -143,37 +135,37 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "h1", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(1)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(1))}, expected: 1, expectedText: "Heading1", }, { name: "h2", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(2)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(2))}, expected: 1, expectedText: "Heading2", }, { name: "h3", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(3)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(3))}, expected: 1, expectedText: "Heading3", }, { name: "h4", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(4)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(4))}, expected: 1, expectedText: "Heading4", }, { name: "h5", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(5)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(5))}, expected: 1, expectedText: "Heading5", }, { name: "h6", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(6)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(6))}, expected: 1, expectedText: "Heading6", }, { @@ -184,7 +176,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "img", role: "img", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Img'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Img'`)}, expected: 1, expectedText: "", }, { @@ -195,25 +187,25 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "ul_list", role: "list", - opts: &common.GetByRoleOptions{Name: stringPtr(`'ul'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'ul'`)}, expected: 1, expectedText: "", }, { name: "ol_list", role: "list", - opts: &common.GetByRoleOptions{Name: stringPtr(`'ol'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'ol'`)}, expected: 1, expectedText: "", }, { name: "ul_li_listitem", role: "listitem", - opts: &common.GetByRoleOptions{Name: stringPtr(`'ul-li'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'ul-li'`)}, expected: 1, expectedText: "Item1", }, { name: "ol_li_listitem", role: "listitem", - opts: &common.GetByRoleOptions{Name: stringPtr(`'ol-li'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'ol-li'`)}, expected: 1, expectedText: "Item2", }, { @@ -229,19 +221,19 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "fieldset_legend", role: "group", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Legend'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Legend'`)}, expected: 1, expectedText: "Legend", }, { name: "figure_figcaption", role: "figure", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Caption'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Caption'`)}, expected: 1, expectedText: "Caption", }, { name: "table", role: "table", - opts: &common.GetByRoleOptions{Name: stringPtr(`'table1'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'table1'`)}, expected: 1, expectedText: "", }, { @@ -257,43 +249,43 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "table_head_cell", role: "cell", - opts: &common.GetByRoleOptions{Name: stringPtr(`'th'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'th'`)}, expected: 1, expectedText: "Head Cell", }, { name: "table_head_gridcell", role: "gridcell", - opts: &common.GetByRoleOptions{Name: stringPtr(`'th gridcell'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'th gridcell'`)}, expected: 1, expectedText: "Head Gridcell", }, { name: "table_body", role: "rowgroup", - opts: &common.GetByRoleOptions{Name: stringPtr(`'tbody'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'tbody'`)}, expected: 1, expectedText: "Cell", }, { name: "table_foot", role: "rowgroup", - opts: &common.GetByRoleOptions{Name: stringPtr(`'tfoot'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'tfoot'`)}, expected: 1, expectedText: "Foot", }, { name: "table_tr", role: "row", - opts: &common.GetByRoleOptions{Name: stringPtr(`'tr'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'tr'`)}, expected: 1, expectedText: "Row", }, { name: "table_td_cell", role: "cell", - opts: &common.GetByRoleOptions{Name: stringPtr(`'td'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'td'`)}, expected: 1, expectedText: "Column Cell", }, { name: "table_td_gridcell", role: "gridcell", - opts: &common.GetByRoleOptions{Name: stringPtr(`'td gridcell'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'td gridcell'`)}, expected: 1, expectedText: "Column Gridcell", }, { @@ -332,14 +324,14 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "form", role: "form", - opts: &common.GetByRoleOptions{Name: stringPtr(`'form'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'form'`)}, expected: 1, expectedText: "", }, // Only works with aria labels. { name: "section", role: "region", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Region Section'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Region Section'`)}, expected: 1, expectedText: "Region content", }, { @@ -385,7 +377,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "menu", role: "list", - opts: &common.GetByRoleOptions{Name: stringPtr(`'menu'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'menu'`)}, expected: 1, expectedText: "Menu item", }, { @@ -416,7 +408,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "svg", role: "img", - opts: &common.GetByRoleOptions{Name: stringPtr(`'svg'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'svg'`)}, expected: 1, expectedText: "", }, { @@ -427,13 +419,13 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "select", role: "combobox", - opts: &common.GetByRoleOptions{Name: stringPtr(`'select'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'select'`)}, expected: 1, expectedText: "", }, { name: "select_multiple", role: "listbox", - opts: &common.GetByRoleOptions{Name: stringPtr(`'select multiple'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'select multiple'`)}, expected: 1, expectedText: "", }, { @@ -445,7 +437,7 @@ func TestGetByRoleSuccess(t *testing.T) { // { // name: "optgroup", // role: "group", - // opts: &common.GetByRoleOptions{Name: stringPtr(`'optgroup'`)}, + // opts: &common.GetByRoleOptions{Name: ptr(`'optgroup'`)}, // expected: 1, expectedText: "", // }, } @@ -620,97 +612,97 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "text_content_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Submit Form'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Submit Form'`)}, expected: 1, expectedText: "", }, { name: "aria_label_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Save Draft'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Save Draft'`)}, expected: 1, expectedText: "", }, { name: "aria_labelledby_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Upload'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Upload'`)}, expected: 1, expectedText: "labelledby-upload-button", }, { name: "hidden_text_nodes_should_be_ignored", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'FooBar'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'FooBar'`)}, expected: 0, expectedText: "", }, { name: "only_visible_node", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Bar'`)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Bar'`)}, expected: 1, expectedText: "Bar", }, { name: "regex_matching", role: "heading", - opts: &common.GetByRoleOptions{Name: stringPtr(`/^[a-z0-9]+$/`)}, + opts: &common.GetByRoleOptions{Name: ptr(`/^[a-z0-9]+$/`)}, expected: 1, expectedText: "abc123", }, { name: "selected_option", role: "option", - opts: &common.GetByRoleOptions{Selected: boolPtr(true)}, + opts: &common.GetByRoleOptions{Selected: ptr(true)}, expected: 1, expectedText: "One", }, { name: "pressed_option", role: "button", - opts: &common.GetByRoleOptions{Pressed: boolPtr(true)}, + opts: &common.GetByRoleOptions{Pressed: ptr(true)}, expected: 1, expectedText: "Toggle", }, { name: "expanded_option", role: "button", - opts: &common.GetByRoleOptions{Expanded: boolPtr(true)}, + opts: &common.GetByRoleOptions{Expanded: ptr(true)}, expected: 1, expectedText: "Expanded", }, { name: "level_option", role: "heading", - opts: &common.GetByRoleOptions{Level: int64Ptr(6)}, + opts: &common.GetByRoleOptions{Level: ptr(int64(6))}, expected: 1, expectedText: "Section", }, { name: "checked_option", role: "checkbox", - opts: &common.GetByRoleOptions{Checked: boolPtr(true)}, + opts: &common.GetByRoleOptions{Checked: ptr(true)}, expected: 1, expectedText: "", }, { name: "radio_checked_option", role: "radio", - opts: &common.GetByRoleOptions{Checked: boolPtr(true)}, + opts: &common.GetByRoleOptions{Checked: ptr(true)}, expected: 1, expectedText: "", }, { name: "disabled_option", role: "button", - opts: &common.GetByRoleOptions{Disabled: boolPtr(true)}, + opts: &common.GetByRoleOptions{Disabled: ptr(true)}, expected: 1, expectedText: "Go", }, { name: "include_css_hidden", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Hidden X Button'`), IncludeHidden: boolPtr(true)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Hidden X Button'`), IncludeHidden: ptr(true)}, expected: 1, expectedText: "X", }, { name: "include_aria_hidden", role: "button", - opts: &common.GetByRoleOptions{Name: stringPtr(`'Hidden Hi Button'`), IncludeHidden: boolPtr(true)}, + opts: &common.GetByRoleOptions{Name: ptr(`'Hidden Hi Button'`), IncludeHidden: ptr(true)}, expected: 1, expectedText: "Hi", }, { name: "combo_options", role: "button", - opts: &common.GetByRoleOptions{Pressed: boolPtr(false), Name: stringPtr(`'Archive'`), IncludeHidden: boolPtr(true)}, + opts: &common.GetByRoleOptions{Pressed: ptr(false), Name: ptr(`'Archive'`), IncludeHidden: ptr(true)}, expected: 1, expectedText: "Combo Options Button", }, } @@ -745,7 +737,7 @@ func TestGetByRoleFailure(t *testing.T) { { "missing_quotes_on_string", "button", - &common.GetByRoleOptions{Name: stringPtr(`Submit Form`)}, + &common.GetByRoleOptions{Name: ptr(`Submit Form`)}, "Error while parsing selector `button[name=Submit Form]` - unexpected symbol", }, { From 94f2e4fda594132c027393916b0a6635719be17b Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 16 Jun 2025 16:50:37 +0100 Subject: [PATCH 082/136] Fix for linter --- internal/js/modules/k6/browser/common/frame.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index fa788548e13..70149c355d0 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -1036,9 +1036,9 @@ func (f *Frame) GetByRole(role string, opts *GetByRoleOptions) *Locator { // Exact option can only be applied to quoted strings. if (*opts.Name)[0] == '\'' && (*opts.Name)[len(*opts.Name)-1] == '\'' { if opts.Exact != nil && *opts.Exact { - *opts.Name = *opts.Name + "s" + *opts.Name = (*opts.Name) + "s" } else { - *opts.Name = *opts.Name + "i" + *opts.Name = (*opts.Name) + "i" } } properties["name"] = *opts.Name From cf7668767895ae24a6f4577460cb0d29d08a09e3 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 17 Jun 2025 17:39:50 +0100 Subject: [PATCH 083/136] Move parsing logic to mapping for getByRole --- .../k6/browser/browser/page_mapping.go | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go index 4a0291ef594..1841a2ad29b 100644 --- a/internal/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "reflect" "time" "github.com/grafana/sobek" @@ -689,3 +690,57 @@ func parseWaitForFunctionArgs( return js, popts, exportArgs(gargs), nil } + +// parseGetByRoleOptions parses the GetByRole options from the Sobek.Value. +func parseGetByRoleOptions(ctx context.Context, opts sobek.Value) (*common.GetByRoleOptions, error) { + if !sobekValueExists(opts) { + return nil, nil + } + + o := &common.GetByRoleOptions{} + + rt := k6ext.Runtime(ctx) + + obj := opts.ToObject(rt) + for _, k := range obj.Keys() { + switch k { + case "checked": + val := obj.Get(k).ToBoolean() + o.Checked = &val + case "disabled": + val := obj.Get(k).ToBoolean() + o.Disabled = &val + case "exact": + val := obj.Get(k).ToBoolean() + o.Exact = &val + case "expanded": + val := obj.Get(k).ToBoolean() + o.Expanded = &val + case "includeHidden": + val := obj.Get(k).ToBoolean() + o.IncludeHidden = &val + case "level": + val := obj.Get(k).ToInteger() + o.Level = &val + case "name": + var val string + switch obj.Get(k).ExportType() { + case reflect.TypeOf(string("")): + val = fmt.Sprintf("'%s'", obj.Get(k).String()) // Strings require quotes + case reflect.TypeOf(map[string]interface{}(nil)): // JS RegExp + val = obj.Get(k).String() // No quotes + default: // CSS, numbers or booleans + val = obj.Get(k).String() // No quotes + } + o.Name = &val + case "pressed": + val := obj.Get(k).ToBoolean() + o.Pressed = &val + case "selected": + val := obj.Get(k).ToBoolean() + o.Selected = &val + } + } + + return o, nil +} From fc123476b5877eb4e356d3185a681ceefbe8e079 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 17 Jun 2025 17:40:10 +0100 Subject: [PATCH 084/136] Use new parsing function for getByRole --- internal/js/modules/k6/browser/browser/page_mapping.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go index 1841a2ad29b..7885519603d 100644 --- a/internal/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -165,8 +165,8 @@ func mapPage(vu moduleVU, p *common.Page) mapping { //nolint:gocognit,cyclop }), nil }, "getByRole": func(role string, opts sobek.Value) (*sobek.Object, error) { - popts := common.NewGetByRoleOptions() - if err := popts.Parse(vu.Context(), opts); err != nil { + popts, err := parseGetByRoleOptions(vu.Context(), opts) + if err != nil { return nil, fmt.Errorf("parsing getByRole options: %w", err) } From 6af06186de6d5f3e627f642244a3cc159d85eaea Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 17 Jun 2025 17:40:28 +0100 Subject: [PATCH 085/136] Remove old getByRole parser --- .../k6/browser/common/locator_options.go | 66 ------------------- 1 file changed, 66 deletions(-) diff --git a/internal/js/modules/k6/browser/common/locator_options.go b/internal/js/modules/k6/browser/common/locator_options.go index 51f54a19cf1..ded03b5ab94 100644 --- a/internal/js/modules/k6/browser/common/locator_options.go +++ b/internal/js/modules/k6/browser/common/locator_options.go @@ -1,14 +1,5 @@ package common -import ( - "context" - "fmt" - "reflect" - - "github.com/grafana/sobek" - "go.k6.io/k6/internal/js/modules/k6/browser/k6ext" -) - // GetByRoleOptions are the optional options fow when working with the // GetByRole API. type GetByRoleOptions struct { @@ -22,60 +13,3 @@ type GetByRoleOptions struct { Pressed *bool `json:"pressed"` Selected *bool `json:"selected"` } - -// NewGetByRoleOptions will create a new empty GetByRoleOptions instance. -func NewGetByRoleOptions() *GetByRoleOptions { - return &GetByRoleOptions{} -} - -// Parse parses the GetByRole options from the Sobek.Value. -func (o *GetByRoleOptions) Parse(ctx context.Context, opts sobek.Value) error { - if !sobekValueExists(opts) { - return nil - } - - rt := k6ext.Runtime(ctx) - - obj := opts.ToObject(rt) - for _, k := range obj.Keys() { - switch k { - case "checked": - val := obj.Get(k).ToBoolean() - o.Checked = &val - case "disabled": - val := obj.Get(k).ToBoolean() - o.Disabled = &val - case "exact": - val := obj.Get(k).ToBoolean() - o.Exact = &val - case "expanded": - val := obj.Get(k).ToBoolean() - o.Expanded = &val - case "includeHidden": - val := obj.Get(k).ToBoolean() - o.IncludeHidden = &val - case "level": - val := obj.Get(k).ToInteger() - o.Level = &val - case "name": - var val string - switch obj.Get(k).ExportType() { - case reflect.TypeOf(string("")): - val = fmt.Sprintf("'%s'", obj.Get(k).String()) // Strings require quotes - case reflect.TypeOf(map[string]interface{}(nil)): // JS RegExp - val = obj.Get(k).String() // No quotes - default: // CSS, numbers or booleans - val = obj.Get(k).String() // No quotes - } - o.Name = &val - case "pressed": - val := obj.Get(k).ToBoolean() - o.Pressed = &val - case "selected": - val := obj.Get(k).ToBoolean() - o.Selected = &val - } - } - - return nil -} From 5872339646686afee461fd653d7dcd7317ca9aaa Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 17 Jun 2025 17:43:34 +0100 Subject: [PATCH 086/136] Move ptr and rename it to toPtr --- .../modules/k6/browser/tests/get_by_test.go | 110 +++++++++--------- .../modules/k6/browser/tests/test_browser.go | 5 + 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index f942ed9896b..f6833f1fbbe 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -12,10 +12,6 @@ import ( "go.k6.io/k6/internal/js/modules/k6/browser/common" ) -func ptr[T any](v T) *T { - return &v -} - func TestGetByRoleSuccess(t *testing.T) { t.Parallel() @@ -47,31 +43,31 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "link", role: "link", - opts: &common.GetByRoleOptions{Name: ptr(`'Link text'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Link text'`)}, expected: 1, expectedText: "Link text", }, { name: "area", role: "link", - opts: &common.GetByRoleOptions{Name: ptr(`'Map area'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Map area'`)}, expected: 1, expectedText: "", }, { name: "button", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Click'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Click'`)}, expected: 1, expectedText: "Click", }, { name: "submit_type", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Submit'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Submit'`)}, expected: 1, expectedText: "", }, { name: "image_type", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Image Button'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Image Button'`)}, expected: 1, expectedText: "", }, { @@ -87,13 +83,13 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "text_type", role: "textbox", - opts: &common.GetByRoleOptions{Name: ptr(`'Text type'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Text type'`)}, expected: 1, expectedText: "", }, { name: "textarea", role: "textbox", - opts: &common.GetByRoleOptions{Name: ptr(`'Text area'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Text area'`)}, expected: 1, expectedText: "Textarea", }, { @@ -124,7 +120,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "details_summary", role: "group", - opts: &common.GetByRoleOptions{Name: ptr(`'details'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'details'`)}, expected: 1, expectedText: "SummaryDetails", }, { @@ -135,37 +131,37 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "h1", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(1))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(1))}, expected: 1, expectedText: "Heading1", }, { name: "h2", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(2))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(2))}, expected: 1, expectedText: "Heading2", }, { name: "h3", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(3))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(3))}, expected: 1, expectedText: "Heading3", }, { name: "h4", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(4))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(4))}, expected: 1, expectedText: "Heading4", }, { name: "h5", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(5))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(5))}, expected: 1, expectedText: "Heading5", }, { name: "h6", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(6))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(6))}, expected: 1, expectedText: "Heading6", }, { @@ -176,7 +172,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "img", role: "img", - opts: &common.GetByRoleOptions{Name: ptr(`'Img'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Img'`)}, expected: 1, expectedText: "", }, { @@ -187,25 +183,25 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "ul_list", role: "list", - opts: &common.GetByRoleOptions{Name: ptr(`'ul'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'ul'`)}, expected: 1, expectedText: "", }, { name: "ol_list", role: "list", - opts: &common.GetByRoleOptions{Name: ptr(`'ol'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'ol'`)}, expected: 1, expectedText: "", }, { name: "ul_li_listitem", role: "listitem", - opts: &common.GetByRoleOptions{Name: ptr(`'ul-li'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'ul-li'`)}, expected: 1, expectedText: "Item1", }, { name: "ol_li_listitem", role: "listitem", - opts: &common.GetByRoleOptions{Name: ptr(`'ol-li'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'ol-li'`)}, expected: 1, expectedText: "Item2", }, { @@ -221,19 +217,19 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "fieldset_legend", role: "group", - opts: &common.GetByRoleOptions{Name: ptr(`'Legend'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Legend'`)}, expected: 1, expectedText: "Legend", }, { name: "figure_figcaption", role: "figure", - opts: &common.GetByRoleOptions{Name: ptr(`'Caption'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Caption'`)}, expected: 1, expectedText: "Caption", }, { name: "table", role: "table", - opts: &common.GetByRoleOptions{Name: ptr(`'table1'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'table1'`)}, expected: 1, expectedText: "", }, { @@ -249,43 +245,43 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "table_head_cell", role: "cell", - opts: &common.GetByRoleOptions{Name: ptr(`'th'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'th'`)}, expected: 1, expectedText: "Head Cell", }, { name: "table_head_gridcell", role: "gridcell", - opts: &common.GetByRoleOptions{Name: ptr(`'th gridcell'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'th gridcell'`)}, expected: 1, expectedText: "Head Gridcell", }, { name: "table_body", role: "rowgroup", - opts: &common.GetByRoleOptions{Name: ptr(`'tbody'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'tbody'`)}, expected: 1, expectedText: "Cell", }, { name: "table_foot", role: "rowgroup", - opts: &common.GetByRoleOptions{Name: ptr(`'tfoot'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'tfoot'`)}, expected: 1, expectedText: "Foot", }, { name: "table_tr", role: "row", - opts: &common.GetByRoleOptions{Name: ptr(`'tr'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'tr'`)}, expected: 1, expectedText: "Row", }, { name: "table_td_cell", role: "cell", - opts: &common.GetByRoleOptions{Name: ptr(`'td'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'td'`)}, expected: 1, expectedText: "Column Cell", }, { name: "table_td_gridcell", role: "gridcell", - opts: &common.GetByRoleOptions{Name: ptr(`'td gridcell'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'td gridcell'`)}, expected: 1, expectedText: "Column Gridcell", }, { @@ -324,14 +320,14 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "form", role: "form", - opts: &common.GetByRoleOptions{Name: ptr(`'form'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'form'`)}, expected: 1, expectedText: "", }, // Only works with aria labels. { name: "section", role: "region", - opts: &common.GetByRoleOptions{Name: ptr(`'Region Section'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Region Section'`)}, expected: 1, expectedText: "Region content", }, { @@ -377,7 +373,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "menu", role: "list", - opts: &common.GetByRoleOptions{Name: ptr(`'menu'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'menu'`)}, expected: 1, expectedText: "Menu item", }, { @@ -408,7 +404,7 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "svg", role: "img", - opts: &common.GetByRoleOptions{Name: ptr(`'svg'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'svg'`)}, expected: 1, expectedText: "", }, { @@ -419,13 +415,13 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "select", role: "combobox", - opts: &common.GetByRoleOptions{Name: ptr(`'select'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'select'`)}, expected: 1, expectedText: "", }, { name: "select_multiple", role: "listbox", - opts: &common.GetByRoleOptions{Name: ptr(`'select multiple'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'select multiple'`)}, expected: 1, expectedText: "", }, { @@ -437,7 +433,7 @@ func TestGetByRoleSuccess(t *testing.T) { // { // name: "optgroup", // role: "group", - // opts: &common.GetByRoleOptions{Name: ptr(`'optgroup'`)}, + // opts: &common.GetByRoleOptions{Name: toPtr(`'optgroup'`)}, // expected: 1, expectedText: "", // }, } @@ -612,97 +608,97 @@ func TestGetByRoleSuccess(t *testing.T) { { name: "text_content_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Submit Form'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Submit Form'`)}, expected: 1, expectedText: "", }, { name: "aria_label_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Save Draft'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Save Draft'`)}, expected: 1, expectedText: "", }, { name: "aria_labelledby_as_name", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Upload'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Upload'`)}, expected: 1, expectedText: "labelledby-upload-button", }, { name: "hidden_text_nodes_should_be_ignored", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'FooBar'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'FooBar'`)}, expected: 0, expectedText: "", }, { name: "only_visible_node", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Bar'`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Bar'`)}, expected: 1, expectedText: "Bar", }, { name: "regex_matching", role: "heading", - opts: &common.GetByRoleOptions{Name: ptr(`/^[a-z0-9]+$/`)}, + opts: &common.GetByRoleOptions{Name: toPtr(`/^[a-z0-9]+$/`)}, expected: 1, expectedText: "abc123", }, { name: "selected_option", role: "option", - opts: &common.GetByRoleOptions{Selected: ptr(true)}, + opts: &common.GetByRoleOptions{Selected: toPtr(true)}, expected: 1, expectedText: "One", }, { name: "pressed_option", role: "button", - opts: &common.GetByRoleOptions{Pressed: ptr(true)}, + opts: &common.GetByRoleOptions{Pressed: toPtr(true)}, expected: 1, expectedText: "Toggle", }, { name: "expanded_option", role: "button", - opts: &common.GetByRoleOptions{Expanded: ptr(true)}, + opts: &common.GetByRoleOptions{Expanded: toPtr(true)}, expected: 1, expectedText: "Expanded", }, { name: "level_option", role: "heading", - opts: &common.GetByRoleOptions{Level: ptr(int64(6))}, + opts: &common.GetByRoleOptions{Level: toPtr(int64(6))}, expected: 1, expectedText: "Section", }, { name: "checked_option", role: "checkbox", - opts: &common.GetByRoleOptions{Checked: ptr(true)}, + opts: &common.GetByRoleOptions{Checked: toPtr(true)}, expected: 1, expectedText: "", }, { name: "radio_checked_option", role: "radio", - opts: &common.GetByRoleOptions{Checked: ptr(true)}, + opts: &common.GetByRoleOptions{Checked: toPtr(true)}, expected: 1, expectedText: "", }, { name: "disabled_option", role: "button", - opts: &common.GetByRoleOptions{Disabled: ptr(true)}, + opts: &common.GetByRoleOptions{Disabled: toPtr(true)}, expected: 1, expectedText: "Go", }, { name: "include_css_hidden", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Hidden X Button'`), IncludeHidden: ptr(true)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Hidden X Button'`), IncludeHidden: toPtr(true)}, expected: 1, expectedText: "X", }, { name: "include_aria_hidden", role: "button", - opts: &common.GetByRoleOptions{Name: ptr(`'Hidden Hi Button'`), IncludeHidden: ptr(true)}, + opts: &common.GetByRoleOptions{Name: toPtr(`'Hidden Hi Button'`), IncludeHidden: toPtr(true)}, expected: 1, expectedText: "Hi", }, { name: "combo_options", role: "button", - opts: &common.GetByRoleOptions{Pressed: ptr(false), Name: ptr(`'Archive'`), IncludeHidden: ptr(true)}, + opts: &common.GetByRoleOptions{Pressed: toPtr(false), Name: toPtr(`'Archive'`), IncludeHidden: toPtr(true)}, expected: 1, expectedText: "Combo Options Button", }, } @@ -737,7 +733,7 @@ func TestGetByRoleFailure(t *testing.T) { { "missing_quotes_on_string", "button", - &common.GetByRoleOptions{Name: ptr(`Submit Form`)}, + &common.GetByRoleOptions{Name: toPtr(`Submit Form`)}, "Error while parsing selector `button[name=Submit Form]` - unexpected symbol", }, { diff --git a/internal/js/modules/k6/browser/tests/test_browser.go b/internal/js/modules/k6/browser/tests/test_browser.go index 6f87df8cabe..0bb5282a0ca 100644 --- a/internal/js/modules/k6/browser/tests/test_browser.go +++ b/internal/js/modules/k6/browser/tests/test_browser.go @@ -378,3 +378,8 @@ func asString(tb testing.TB, v any) string { require.True(tb, ok) return s } + +// toPtr is a helper function to convert a value to a pointer. +func toPtr[T any](v T) *T { + return &v +} From aa2f62b170901cf17f62da2efa4c40ea1b6a61e8 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 18 Jun 2025 11:14:39 +0100 Subject: [PATCH 087/136] Fix linter error due to nil error --- .../js/modules/k6/browser/browser/page_mapping.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go index 7885519603d..893e7f4edad 100644 --- a/internal/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -165,10 +165,7 @@ func mapPage(vu moduleVU, p *common.Page) mapping { //nolint:gocognit,cyclop }), nil }, "getByRole": func(role string, opts sobek.Value) (*sobek.Object, error) { - popts, err := parseGetByRoleOptions(vu.Context(), opts) - if err != nil { - return nil, fmt.Errorf("parsing getByRole options: %w", err) - } + popts := parseGetByRoleOptions(vu.Context(), opts) ml := mapLocator(vu, p.GetByRole(role, popts)) return rt.ToValue(ml).ToObject(rt), nil @@ -692,9 +689,9 @@ func parseWaitForFunctionArgs( } // parseGetByRoleOptions parses the GetByRole options from the Sobek.Value. -func parseGetByRoleOptions(ctx context.Context, opts sobek.Value) (*common.GetByRoleOptions, error) { +func parseGetByRoleOptions(ctx context.Context, opts sobek.Value) *common.GetByRoleOptions { if !sobekValueExists(opts) { - return nil, nil + return nil } o := &common.GetByRoleOptions{} @@ -742,5 +739,5 @@ func parseGetByRoleOptions(ctx context.Context, opts sobek.Value) (*common.GetBy } } - return o, nil + return o } From faff94a428696a00fb5736e643056fe27ba9cff0 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 7 Jul 2025 14:23:38 +0100 Subject: [PATCH 088/136] Add tests for exact option for getByRole --- .../js/modules/k6/browser/tests/get_by_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/internal/js/modules/k6/browser/tests/get_by_test.go b/internal/js/modules/k6/browser/tests/get_by_test.go index f6833f1fbbe..d3ef2a26196 100644 --- a/internal/js/modules/k6/browser/tests/get_by_test.go +++ b/internal/js/modules/k6/browser/tests/get_by_test.go @@ -611,6 +611,24 @@ func TestGetByRoleSuccess(t *testing.T) { opts: &common.GetByRoleOptions{Name: toPtr(`'Submit Form'`)}, expected: 1, expectedText: "", }, + { + name: "not_exact", + role: "button", + opts: &common.GetByRoleOptions{Name: toPtr(`'submit form'`), Exact: toPtr(false)}, + expected: 1, expectedText: "", + }, + { + name: "exact_no_match", + role: "button", + opts: &common.GetByRoleOptions{Name: toPtr(`'submit form'`), Exact: toPtr(true)}, + expected: 0, expectedText: "", + }, + { + name: "exact_match", + role: "button", + opts: &common.GetByRoleOptions{Name: toPtr(`'Submit Form'`), Exact: toPtr(true)}, + expected: 1, expectedText: "", + }, { name: "aria_label_as_name", role: "button", From a1a54e09acb2ae5103635981bf5010642e9a1c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Wed, 9 Jul 2025 20:53:56 +0200 Subject: [PATCH 089/136] xk6-dashboard upgraded to v0.7.9 --- go.mod | 2 +- go.sum | 4 +- .../assets/packages/report/dist/index.html | 10 ++-- .../{index-beb72b0a.js => index-edee3789.js} | 20 ++++---- .../assets/packages/ui/dist/index.html | 2 +- .../xk6-dashboard/dashboard/extension.go | 49 +++++++++++++------ vendor/modules.txt | 2 +- 7 files changed, 53 insertions(+), 36 deletions(-) rename vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/{index-beb72b0a.js => index-edee3789.js} (63%) diff --git a/go.mod b/go.mod index 8f2f19a6af6..4c26aa8c140 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/grafana/k6deps v0.2.6 github.com/grafana/k6provider v0.1.15 github.com/grafana/sobek v0.0.0-20250320150027-203dc85b6d98 - github.com/grafana/xk6-dashboard v0.7.6 + github.com/grafana/xk6-dashboard v0.7.9 github.com/grafana/xk6-redis v0.3.4 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc diff --git a/go.sum b/go.sum index dfccc0b67dd..200d8da3db9 100644 --- a/go.sum +++ b/go.sum @@ -95,8 +95,8 @@ github.com/grafana/k6provider v0.1.15 h1:aUStpqDMEnEL9aGCcSKmpcreHRZsr8IELna+ttK github.com/grafana/k6provider v0.1.15/go.mod h1:tnyPNxenfF0G5JWVXQixk7QUJIn2FbZneDfvgocttNs= github.com/grafana/sobek v0.0.0-20250320150027-203dc85b6d98 h1:DqWI8D/A8GABIIjukZVNr0Sj4sBeewK2TmbTyiqUAZk= github.com/grafana/sobek v0.0.0-20250320150027-203dc85b6d98/go.mod h1:FmcutBFPLiGgroH42I4/HBahv7GxVjODcVWFTw1ISes= -github.com/grafana/xk6-dashboard v0.7.6 h1:7MNk87R6ZUcBdyoIkaOkLsor4hrIT1F57X77Z83oE68= -github.com/grafana/xk6-dashboard v0.7.6/go.mod h1:ofJsxGG4TTuzSUvTU8BroyCBy6A44/ksi4x/hUNeiYA= +github.com/grafana/xk6-dashboard v0.7.9 h1:uLNnxNsCHH1oTcmCprMJpAMbellbhZqxfd+8S2WCM18= +github.com/grafana/xk6-dashboard v0.7.9/go.mod h1:ofJsxGG4TTuzSUvTU8BroyCBy6A44/ksi4x/hUNeiYA= github.com/grafana/xk6-redis v0.3.4 h1:IkB9N9YHU4u+BvBU+P0PJkCAZvYCyeXJNlb1XQjYXyU= github.com/grafana/xk6-redis v0.3.4/go.mod h1:2IyZC8uAFXuWmdu5TKPz5w9h2oPxQl5O2wSHv/HQ15I= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html index be4f0b4e9af..8e60747a142 100644 --- a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html +++ b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html @@ -15,17 +15,17 @@ k6 report diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-8105e2d0.css b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-109401fe.css similarity index 99% rename from vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-8105e2d0.css rename to vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-109401fe.css index 4709b7f97c4..8a27a959329 100644 --- a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-8105e2d0.css +++ b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-109401fe.css @@ -1 +1 @@ -*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}*{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif}html{font-size:62.5%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{letter-spacing:.075em;line-height:1.5;text-rendering:optimizeLegibility}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{font-size:1.25rem}#root{isolation:isolate}@keyframes ughkw70{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:root{--_1dwurlb0: 3px;--_1dwurlb1: 5px;--_1dwurlb2: 10px;--_1dwurlb3: 25px;--_1dwurlb4: .25rem;--_1dwurlb5: .5rem;--_1dwurlb6: .75rem;--_1dwurlb7: 1rem;--_1dwurlb8: 1.25rem;--_1dwurlb9: 1.5rem;--_1dwurlba: 1.75rem;--_1dwurlbb: 2rem;--_1dwurlbc: 3rem;--_1dwurlbd: 4rem;--_1dwurlbe: 5rem;--_1dwurlbf: 0px;--_1dwurlbg: 480px;--_1dwurlbh: 768px;--_1dwurlbi: 1024px;--_1dwurlbj: 1440px;--_1dwurlbk: 1920px;--_1dwurlbl: ughkw70;--_1dwurlbm: .5rem;--_1dwurlbn: .75rem;--_1dwurlbo: 1rem;--_1dwurlbp: 1.1rem;--_1dwurlbq: 1.25rem;--_1dwurlbr: 1.5rem;--_1dwurlbs: 2rem;--_1dwurlbt: 2.5rem;--_1dwurlbu: 3rem;--_1dwurlbv: 3.5rem;--_1dwurlbw: 100;--_1dwurlbx: 200;--_1dwurlby: 300;--_1dwurlbz: 400;--_1dwurlb10: 500;--_1dwurlb11: 600;--_1dwurlb12: 700;--_1dwurlb13: 800;--_1dwurlb14: 900;--_1dwurlb15: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--_1dwurlb16: ui-serif,serif;--_1dwurlb17: Dank Mono,Operator Mono,Inconsolata,Fira Mono,ui-monospace,SF Mono,Monaco,Droid Sans Mono,Source Code Pro,monospace;--_1dwurlb18: -.05em;--_1dwurlb19: .025em;--_1dwurlb1a: .05em;--_1dwurlb1b: .075em;--_1dwurlb1c: .15em;--_1dwurlb1d: .5em;--_1dwurlb1e: .75em;--_1dwurlb1f: 1em;--_1dwurlb1g: .95;--_1dwurlb1h: 1.1;--_1dwurlb1i: 1.25;--_1dwurlb1j: 1.375;--_1dwurlb1k: 1.5;--_1dwurlb1l: 1.75;--_1dwurlb1m: 2}._1dwurlb27{--_1dwurlb1n: #000000;--_1dwurlb1o: #ffffff;--_1dwurlb1p: #8e7de5;--_1dwurlb1q: #6e59de;--_1dwurlb1r: #604ec2;--_1dwurlb1s: #ffffff;--_1dwurlb1t: #fafafa;--_1dwurlb1u: #eeeeee;--_1dwurlb1v: #212121;--_1dwurlb1w: #616161;--_1dwurlb1x: #bdbdbd;--_1dwurlb1y: #9e9e9e;--_1dwurlb1z: #e0e0e0;--_1dwurlb20: #eeeeee;--_1dwurlb21: #e0e0e0;--_1dwurlb22: #e0e0e0;--_1dwurlb23: #6e59de;--_1dwurlb24: #6e59de;--_1dwurlb25: #edeafb;--_1dwurlb26: #eeeeee}._1dwurlb28{--_1dwurlb1n: #000000;--_1dwurlb1o: #ffffff;--_1dwurlb1p: #8e7de5;--_1dwurlb1q: #6e59de;--_1dwurlb1r: #604ec2;--_1dwurlb1s: #394160;--_1dwurlb1t: #2c324b;--_1dwurlb1u: #1F2537;--_1dwurlb1v: #ffffff;--_1dwurlb1w: #D6DCFF;--_1dwurlb1x: #3f486b;--_1dwurlb1y: #ffffff;--_1dwurlb1z: #3f486b;--_1dwurlb20: #394160;--_1dwurlb21: #1F2537;--_1dwurlb22: #394160;--_1dwurlb23: #8e7de5;--_1dwurlb24: #8e7de5;--_1dwurlb25: #372c6f;--_1dwurlb26: #3f486b}.wy7gkc0{flex-direction:row}.wy7gkc1{flex-direction:column}.wy7gkc2{flex-wrap:nowrap}.wy7gkc3{flex-wrap:wrap}.wy7gkc4{flex-wrap:wrap-reverse}.wy7gkc5{align-items:flex-start}.wy7gkc6{align-items:flex-end}.wy7gkc7{align-items:stretch}.wy7gkc8{align-items:center}.wy7gkc9{align-items:baseline}.wy7gkca{align-items:start}.wy7gkcb{align-items:end}.wy7gkcc{align-items:self-start}.wy7gkcd{align-items:self-end}.wy7gkce{justify-content:flex-start}.wy7gkcf{justify-content:flex-end}.wy7gkcg{justify-content:start}.wy7gkch{justify-content:end}.wy7gkci{justify-content:left}.wy7gkcj{justify-content:right}.wy7gkck{justify-content:center}.wy7gkcl{justify-content:space-between}.wy7gkcm{justify-content:space-around}.wy7gkcn{justify-content:space-evenly}.wy7gkco{gap:0}.wy7gkcp{gap:var(--_1dwurlb4)}.wy7gkcq{gap:var(--_1dwurlb5)}.wy7gkcr{gap:var(--_1dwurlb9)}.wy7gkcs{gap:var(--_1dwurlbc)}.wy7gkct{gap:var(--_1dwurlbe)}.wy7gkcu{padding:0}.wy7gkcv{padding:var(--_1dwurlb4)}.wy7gkcw{padding:var(--_1dwurlb5)}.wy7gkcx{padding:var(--_1dwurlb9)}.wy7gkcy{padding:var(--_1dwurlbc)}.wy7gkcz{padding:var(--_1dwurlbe)}.wy7gkc15{display:flex;flex-grow:var(--wy7gkc10);flex-shrink:var(--wy7gkc11);flex-basis:var(--wy7gkc12);height:var(--wy7gkc13);width:var(--wy7gkc14)}._17y8ldl0{background-color:transparent;border:none;color:var(--_1dwurlb1v);font-size:var(--_1dwurlbq);font-weight:var(--_1dwurlb10)}._17y8ldl0:is(:disabled){opacity:.5;cursor:not-allowed}._17y8ldl0:not(:disabled){cursor:pointer}._17y8ldl1{border-radius:var(--_1dwurlb0);font-weight:var(--_1dwurlb11);letter-spacing:var(--_1dwurlb1c);padding:var(--_1dwurlb6) var(--_1dwurlbb);text-transform:uppercase}._17y8ldl2{background-color:var(--_1dwurlb1q);color:var(--_1dwurlb1o)}._17y8ldl2:hover:not(:active){background-color:var(--_1dwurlb1p)}._17y8ldl2:active{background-color:var(--_1dwurlb1r)}._17y8ldl3{outline:2px solid var(--_1dwurlb23);outline-offset:-2px;color:var(--_1dwurlb24)}._17y8ldl3:hover{background-color:var(--_1dwurlb25)}._6j0qom0{position:sticky;bottom:0;left:0;padding:var(--_1dwurlb8) var(--_1dwurlb9);background-color:var(--_1dwurlb1u);text-align:right}._17unuvp0{background-color:var(--_1dwurlb22);height:3px}.iy2n4g0{padding:var(--_1dwurlb4) var(--_1dwurlb4);position:relative}.iy2n4g0:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:100%;transform:scale(0);transition:transform .2s ease-in-out;z-index:-1}.iy2n4g0:hover:before{background-color:var(--_1dwurlb20);transform:scale(1)}.iy2n4g0:active:before{background-color:var(--_1dwurlb1z)}.iy2n4g3{color:var(--_1dwurlb1v)}._1sxwks00{background-color:var(--_1dwurlb1t);border-radius:var(--_1dwurlb1);padding:var(--_1dwurlbb)}._1x45rmb0{background-color:var(--_1dwurlb1t);border:1px solid var(--_1dwurlb1q);padding:0;min-width:150px;overflow:hidden;z-index:10}._1x45rmb1{box-shadow:0 0 8px #00000026}._1x45rmb2{box-shadow:0 0 8px #000c}._1x45rmb3{cursor:pointer;font-size:var(--_1dwurlb8);padding:var(--_1dwurlb6)}._1x45rmb3:hover{background-color:var(--_1dwurlb20)}.tz5dd50{background:var(--_1dwurlb1t);overflow:auto;padding:var(--_1dwurlb5) var(--_1dwurlb9)}.tz5dd51{display:none}.tz5dd53{display:block}.tz5dd55{padding:var(--_1dwurlb6) var(--_1dwurlba);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10);position:relative;cursor:pointer;z-index:1}.tz5dd55:before{content:"";position:absolute;left:0;top:0;bottom:0;margin:auto;width:100%;height:80%;border-radius:var(--_1dwurlb1);z-index:-1}.tz5dd56{color:var(--_1dwurlb1v)}.tz5dd56:before{background:var(--_1dwurlb20)}.tz5dd57{color:var(--_1dwurlb1w)}.tz5dd57:hover:before{color:var(--_1dwurlb1v);background:var(--_1dwurlb20);opacity:.7}@media screen and (min-width: 1024px){.tz5dd50{padding:0 var(--_1dwurlba)}}@media (min-width: 1024px){.tz5dd52{display:none}.tz5dd54{display:block}}@keyframes _1e0qizf0{0%{background-position:200% 0}to{background-position:-200% 0}}._1e0qizf1{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;overflow:hidden;width:100%;height:100%;top:0;left:0;z-index:0}._1e0qizf1::-webkit-progress-bar{background-color:var(--_1dwurlb22)}._1e0qizf1::-webkit-progress-value{background-color:var(--_1dwurlb1q);transition:1s width}._1e0qizf1:indeterminate{animation:_1e0qizf0 1.5s linear infinite;background-color:var(--_1dwurlb22);background-image:linear-gradient(to right,var(--_1dwurlb1q) 30%,var(--_1dwurlb22) 30%);background-position:top left;background-repeat:no-repeat;background-size:150% 150%}._1e0qizf1:indeterminate._1e0qizf1::-webkit-progress-bar{background-color:transparent}._1e0qizf3:indeterminate{background-image:none}._1e0qizf4{position:relative;bottom:0;left:0;height:3px;width:100%}._1e0qizf5{color:#fff;position:relative;padding:calc(var(--_1dwurlb8) / 2);z-index:1;text-align:center;font-size:var(--_1dwurlbq)}._1lpb9zp0{border:1px solid var(--_1dwurlb1q);border-radius:0;font-size:var(--_1dwurlbq);max-width:600px;padding:var(--_1dwurlb7);z-index:10}._1lpb9zp1{background-color:var(--_1dwurlb1s)}._1lpb9zp2{background-color:var(--_1dwurlb1u)}._1lpb9zp3{position:absolute;width:8px;height:8px;background:inherit;visibility:hidden}._1lpb9zp3:before{content:"";position:absolute;border:1px solid transparent;width:8px;height:8px;background:inherit;visibility:visible;transform:rotate(45deg)}._1lpb9zp4{bottom:-4px}._1lpb9zp4:before{border-bottom-color:var(--_1dwurlb1q);border-right-color:var(--_1dwurlb1q)}._1lpb9zp5{top:-4px}._1lpb9zp5:before{border-top-color:var(--_1dwurlb1q);border-left-color:var(--_1dwurlb1q)}._1lpb9zp6{right:-4px}._1lpb9zp6:before{border-top-color:var(--_1dwurlb1q);border-right-color:var(--_1dwurlb1q)}._1lpb9zp7{left:-4px}._1lpb9zp7:before{border-bottom-color:var(--_1dwurlb1q);border-left-color:var(--_1dwurlb1q)}.kfrms70{background-color:var(--_1dwurlb1t);box-shadow:0 0 10px var(--_1dwurlb21);position:sticky;top:0;z-index:1}.kfrms71{padding:var(--_1dwurlb6) var(--_1dwurlb9)}.kfrms72{padding:0}.kfrms74{border:2px solid var(--_1dwurlb22);padding:var(--_1dwurlb6) var(--_1dwurlb8);border-radius:var(--_1dwurlb1)}@media (min-width: 1024px){.kfrms73{display:none}}._1isundr0{animation:var(--_1dwurlbl) 1s linear infinite;color:var(--_1dwurlb1w)}._1c9nzq10{border-radius:var(--_1dwurlb1) var(--_1dwurlb1) 0 0}._1c9nzq11{border-radius:var(--_1dwurlb1)}._1c9nzq12{color:var(--_1dwurlb1w);padding:var(--_1dwurlb9);background-color:var(--_1dwurlb1s);cursor:pointer;border:none}._1c9nzq13{font-size:var(--_1dwurlbs);font-weight:var(--_1dwurlb10)}._1c9nzq14{padding:var(--_1dwurlbb);background-color:var(--_1dwurlb1t)}.ag5hlo1{container-name:ag5hlo0;container-type:inline-size;display:grid;grid-template-rows:auto;grid-template-columns:repeat(12,1fr)}.ag5hlo2{gap:var(--_1dwurlb4)}.ag5hlo3{gap:clamp(var(--_1dwurlb4),4vw,var(--_1dwurlb5))}.ag5hlo4{gap:clamp(var(--_1dwurlb4),4vw,var(--_1dwurlb9))}.ag5hlo5{gap:clamp(var(--_1dwurlb4),4vw,var(--_1dwurlbe))}@container ag5hlo0 (min-width: 0px){.ag5hlo6{grid-column:span 1}.ag5hloc{grid-column:span 2}.ag5hloi{grid-column:span 3}.ag5hloo{grid-column:span 4}.ag5hlou{grid-column:span 5}.ag5hlo10{grid-column:span 6}.ag5hlo16{grid-column:span 7}.ag5hlo1c{grid-column:span 8}.ag5hlo1i{grid-column:span 9}.ag5hlo1o{grid-column:span 10}.ag5hlo1u{grid-column:span 11}.ag5hlo20{grid-column:span 12}}@container ag5hlo0 (min-width: 480px){.ag5hlo7{grid-column:span 1}.ag5hlod{grid-column:span 2}.ag5hloj{grid-column:span 3}.ag5hlop{grid-column:span 4}.ag5hlov{grid-column:span 5}.ag5hlo11{grid-column:span 6}.ag5hlo17{grid-column:span 7}.ag5hlo1d{grid-column:span 8}.ag5hlo1j{grid-column:span 9}.ag5hlo1p{grid-column:span 10}.ag5hlo1v{grid-column:span 11}.ag5hlo21{grid-column:span 12}}@container ag5hlo0 (min-width: 768px){.ag5hlo8{grid-column:span 1}.ag5hloe{grid-column:span 2}.ag5hlok{grid-column:span 3}.ag5hloq{grid-column:span 4}.ag5hlow{grid-column:span 5}.ag5hlo12{grid-column:span 6}.ag5hlo18{grid-column:span 7}.ag5hlo1e{grid-column:span 8}.ag5hlo1k{grid-column:span 9}.ag5hlo1q{grid-column:span 10}.ag5hlo1w{grid-column:span 11}.ag5hlo22{grid-column:span 12}}@container ag5hlo0 (min-width: 1024px){.ag5hlo9{grid-column:span 1}.ag5hlof{grid-column:span 2}.ag5hlol{grid-column:span 3}.ag5hlor{grid-column:span 4}.ag5hlox{grid-column:span 5}.ag5hlo13{grid-column:span 6}.ag5hlo19{grid-column:span 7}.ag5hlo1f{grid-column:span 8}.ag5hlo1l{grid-column:span 9}.ag5hlo1r{grid-column:span 10}.ag5hlo1x{grid-column:span 11}.ag5hlo23{grid-column:span 12}}@container ag5hlo0 (min-width: 1440px){.ag5hloa{grid-column:span 1}.ag5hlog{grid-column:span 2}.ag5hlom{grid-column:span 3}.ag5hlos{grid-column:span 4}.ag5hloy{grid-column:span 5}.ag5hlo14{grid-column:span 6}.ag5hlo1a{grid-column:span 7}.ag5hlo1g{grid-column:span 8}.ag5hlo1m{grid-column:span 9}.ag5hlo1s{grid-column:span 10}.ag5hlo1y{grid-column:span 11}.ag5hlo24{grid-column:span 12}}@container ag5hlo0 (min-width: 1920px){.ag5hlob{grid-column:span 1}.ag5hloh{grid-column:span 2}.ag5hlon{grid-column:span 3}.ag5hlot{grid-column:span 4}.ag5hloz{grid-column:span 5}.ag5hlo15{grid-column:span 6}.ag5hlo1b{grid-column:span 7}.ag5hlo1h{grid-column:span 8}.ag5hlo1n{grid-column:span 9}.ag5hlo1t{grid-column:span 10}.ag5hlo1z{grid-column:span 11}.ag5hlo25{grid-column:span 12}}.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:rgba(0,0,0,.07);position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}._14dhllh0{position:relative}._14dhllh1{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10);padding:var(--_1dwurlb5) var(--_1dwurlbb);border:1px dashed var(--_1dwurlb22)}._14dhllh2{break-inside:avoid}._14dhllh3{color:var(--_1dwurlb1w);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10)}._14dhllh2>.u-title{font-size:var(--_1dwurlbs);font-weight:var(--_1dwurlby)!important}._14dhllh2 .u-label{font-weight:var(--_1dwurlby)!important}.ova0r30{min-height:100%}.ova0r30>.u-title{color:var(--_1dwurlb1v);font-size:var(--_1dwurlbt);font-weight:var(--_1dwurlbz)!important;white-space:nowrap}.ova0r31{padding:var(--_1dwurlb8);height:100%}.ova0r32{font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10);color:var(--_1dwurlb1w);padding-top:var(--_1dwurlb8);text-align:center}._12owwid0{border-collapse:collapse;width:100%}._12owwid1{padding:var(--_1dwurlb6);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb11)}._12owwid3:hover{background-color:var(--_1dwurlb26)}._12owwid3:nth-child(odd):not(:hover){background-color:var(--_1dwurlb1s)}._12owwid3:nth-child(2n):not(:hover){background-color:var(--_1dwurlb1t)}._12owwid4{padding:var(--_1dwurlb6);font-size:var(--_1dwurlbq)}._57i9sh0{min-height:100%}._57i9sh1{overflow-x:auto}._1jb2mvv0{padding:0}._1jb2mvv1{background-color:var(--_1dwurlb1s);border-radius:var(--_1dwurlb1) var(--_1dwurlb1) 0 0;color:var(--_1dwurlb1w);padding:var(--_1dwurlb9) var(--_1dwurlbb);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10)}._1jb2mvv2{padding:var(--_1dwurlb8)}._1ls5syl0{margin-bottom:var(--_1dwurlb9)}._1t22owt0{background-color:var(--_1dwurlb1u);color:var(--_1dwurlb1v);min-height:100vh}._1t22owt1{padding:var(--_1dwurlb9)} +*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}*{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif}html{font-size:62.5%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{letter-spacing:.075em;line-height:1.5;text-rendering:optimizeLegibility}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{font-size:1.25rem}#root{isolation:isolate}@keyframes ughkw70{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:root{--_1dwurlb0: 3px;--_1dwurlb1: 5px;--_1dwurlb2: 10px;--_1dwurlb3: 25px;--_1dwurlb4: .25rem;--_1dwurlb5: .5rem;--_1dwurlb6: .75rem;--_1dwurlb7: 1rem;--_1dwurlb8: 1.25rem;--_1dwurlb9: 1.5rem;--_1dwurlba: 1.75rem;--_1dwurlbb: 2rem;--_1dwurlbc: 3rem;--_1dwurlbd: 4rem;--_1dwurlbe: 5rem;--_1dwurlbf: 0px;--_1dwurlbg: 480px;--_1dwurlbh: 768px;--_1dwurlbi: 1024px;--_1dwurlbj: 1440px;--_1dwurlbk: 1920px;--_1dwurlbl: ughkw70;--_1dwurlbm: .5rem;--_1dwurlbn: .75rem;--_1dwurlbo: 1rem;--_1dwurlbp: 1.1rem;--_1dwurlbq: 1.25rem;--_1dwurlbr: 1.5rem;--_1dwurlbs: 2rem;--_1dwurlbt: 2.5rem;--_1dwurlbu: 3rem;--_1dwurlbv: 3.5rem;--_1dwurlbw: 100;--_1dwurlbx: 200;--_1dwurlby: 300;--_1dwurlbz: 400;--_1dwurlb10: 500;--_1dwurlb11: 600;--_1dwurlb12: 700;--_1dwurlb13: 800;--_1dwurlb14: 900;--_1dwurlb15: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;--_1dwurlb16: ui-serif,serif;--_1dwurlb17: Dank Mono,Operator Mono,Inconsolata,Fira Mono,ui-monospace,SF Mono,Monaco,Droid Sans Mono,Source Code Pro,monospace;--_1dwurlb18: -.05em;--_1dwurlb19: .025em;--_1dwurlb1a: .05em;--_1dwurlb1b: .075em;--_1dwurlb1c: .15em;--_1dwurlb1d: .5em;--_1dwurlb1e: .75em;--_1dwurlb1f: 1em;--_1dwurlb1g: .95;--_1dwurlb1h: 1.1;--_1dwurlb1i: 1.25;--_1dwurlb1j: 1.375;--_1dwurlb1k: 1.5;--_1dwurlb1l: 1.75;--_1dwurlb1m: 2}._1dwurlb27{--_1dwurlb1n: #000000;--_1dwurlb1o: #ffffff;--_1dwurlb1p: #8e7de5;--_1dwurlb1q: #6e59de;--_1dwurlb1r: #604ec2;--_1dwurlb1s: #ffffff;--_1dwurlb1t: #fafafa;--_1dwurlb1u: #eeeeee;--_1dwurlb1v: #212121;--_1dwurlb1w: #616161;--_1dwurlb1x: #bdbdbd;--_1dwurlb1y: #9e9e9e;--_1dwurlb1z: #e0e0e0;--_1dwurlb20: #eeeeee;--_1dwurlb21: #e0e0e0;--_1dwurlb22: #e0e0e0;--_1dwurlb23: #6e59de;--_1dwurlb24: #6e59de;--_1dwurlb25: #edeafb;--_1dwurlb26: #eeeeee}._1dwurlb28{--_1dwurlb1n: #000000;--_1dwurlb1o: #ffffff;--_1dwurlb1p: #8e7de5;--_1dwurlb1q: #6e59de;--_1dwurlb1r: #604ec2;--_1dwurlb1s: #394160;--_1dwurlb1t: #2c324b;--_1dwurlb1u: #1F2537;--_1dwurlb1v: #ffffff;--_1dwurlb1w: #D6DCFF;--_1dwurlb1x: #3f486b;--_1dwurlb1y: #ffffff;--_1dwurlb1z: #3f486b;--_1dwurlb20: #394160;--_1dwurlb21: #1F2537;--_1dwurlb22: #394160;--_1dwurlb23: #8e7de5;--_1dwurlb24: #8e7de5;--_1dwurlb25: #372c6f;--_1dwurlb26: #3f486b}.wy7gkc0{flex-direction:row}.wy7gkc1{flex-direction:column}.wy7gkc2{flex-wrap:nowrap}.wy7gkc3{flex-wrap:wrap}.wy7gkc4{flex-wrap:wrap-reverse}.wy7gkc5{align-items:flex-start}.wy7gkc6{align-items:flex-end}.wy7gkc7{align-items:stretch}.wy7gkc8{align-items:center}.wy7gkc9{align-items:baseline}.wy7gkca{align-items:start}.wy7gkcb{align-items:end}.wy7gkcc{align-items:self-start}.wy7gkcd{align-items:self-end}.wy7gkce{justify-content:flex-start}.wy7gkcf{justify-content:flex-end}.wy7gkcg{justify-content:start}.wy7gkch{justify-content:end}.wy7gkci{justify-content:left}.wy7gkcj{justify-content:right}.wy7gkck{justify-content:center}.wy7gkcl{justify-content:space-between}.wy7gkcm{justify-content:space-around}.wy7gkcn{justify-content:space-evenly}.wy7gkco{gap:0}.wy7gkcp{gap:var(--_1dwurlb4)}.wy7gkcq{gap:var(--_1dwurlb5)}.wy7gkcr{gap:var(--_1dwurlb9)}.wy7gkcs{gap:var(--_1dwurlbc)}.wy7gkct{gap:var(--_1dwurlbe)}.wy7gkcu{padding:0}.wy7gkcv{padding:var(--_1dwurlb4)}.wy7gkcw{padding:var(--_1dwurlb5)}.wy7gkcx{padding:var(--_1dwurlb9)}.wy7gkcy{padding:var(--_1dwurlbc)}.wy7gkcz{padding:var(--_1dwurlbe)}.wy7gkc15{display:flex;flex-grow:var(--wy7gkc10);flex-shrink:var(--wy7gkc11);flex-basis:var(--wy7gkc12);height:var(--wy7gkc13);width:var(--wy7gkc14)}._17y8ldl0{background-color:transparent;border:none;color:var(--_1dwurlb1v);font-size:var(--_1dwurlbq);font-weight:var(--_1dwurlb10)}._17y8ldl0:is(:disabled){opacity:.5;cursor:not-allowed}._17y8ldl0:not(:disabled){cursor:pointer}._17y8ldl1{border-radius:var(--_1dwurlb0);font-weight:var(--_1dwurlb11);letter-spacing:var(--_1dwurlb1c);padding:var(--_1dwurlb6) var(--_1dwurlbb);text-transform:uppercase}._17y8ldl2{background-color:var(--_1dwurlb1q);color:var(--_1dwurlb1o)}._17y8ldl2:hover:not(:active){background-color:var(--_1dwurlb1p)}._17y8ldl2:active{background-color:var(--_1dwurlb1r)}._17y8ldl3{outline:2px solid var(--_1dwurlb23);outline-offset:-2px;color:var(--_1dwurlb24)}._17y8ldl3:hover{background-color:var(--_1dwurlb25)}._6j0qom0{position:sticky;bottom:0;left:0;padding:var(--_1dwurlb8) var(--_1dwurlb9);background-color:var(--_1dwurlb1u);text-align:right}._17unuvp0{background-color:var(--_1dwurlb22);height:3px}.iy2n4g0{padding:var(--_1dwurlb4) var(--_1dwurlb4);position:relative}.iy2n4g0:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:100%;transform:scale(0);transition:transform .2s ease-in-out;z-index:-1}.iy2n4g0:hover:before{background-color:var(--_1dwurlb20);transform:scale(1)}.iy2n4g0:active:before{background-color:var(--_1dwurlb1z)}.iy2n4g3{color:var(--_1dwurlb1v)}._1sxwks00{background-color:var(--_1dwurlb1t);border-radius:var(--_1dwurlb1);padding:var(--_1dwurlbb)}._1x45rmb0{background-color:var(--_1dwurlb1t);border:1px solid var(--_1dwurlb1q);padding:0;min-width:150px;overflow:hidden;z-index:10}._1x45rmb1{box-shadow:0 0 8px #00000026}._1x45rmb2{box-shadow:0 0 8px #000c}._1x45rmb3{cursor:pointer;font-size:var(--_1dwurlb8);padding:var(--_1dwurlb6)}._1x45rmb3:hover{background-color:var(--_1dwurlb20)}.tz5dd50{background:var(--_1dwurlb1t);overflow:auto;padding:var(--_1dwurlb5) var(--_1dwurlb9)}.tz5dd51{display:none}.tz5dd53{display:block}.tz5dd55{padding:var(--_1dwurlb6) var(--_1dwurlba);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10);position:relative;cursor:pointer;z-index:1}.tz5dd55:before{content:"";position:absolute;left:0;top:0;bottom:0;margin:auto;width:100%;height:80%;border-radius:var(--_1dwurlb1);z-index:-1}.tz5dd56{color:var(--_1dwurlb1v)}.tz5dd56:before{background:var(--_1dwurlb20)}.tz5dd57{color:var(--_1dwurlb1w)}.tz5dd57:hover:before{color:var(--_1dwurlb1v);background:var(--_1dwurlb20);opacity:.7}@media screen and (min-width: 1024px){.tz5dd50{padding:0 var(--_1dwurlba)}}@media (min-width: 1024px){.tz5dd52{display:none}.tz5dd54{display:block}}@keyframes _1e0qizf0{0%{background-position:200% 0}to{background-position:-200% 0}}._1e0qizf1{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;overflow:hidden;width:100%;height:100%;top:0;left:0;z-index:0}._1e0qizf1::-webkit-progress-bar{background-color:var(--_1dwurlb22)}._1e0qizf1::-webkit-progress-value{background-color:var(--_1dwurlb1q);transition:1s width}._1e0qizf1:indeterminate{animation:_1e0qizf0 1.5s linear infinite;background-color:var(--_1dwurlb22);background-image:linear-gradient(to right,var(--_1dwurlb1q) 30%,var(--_1dwurlb22) 30%);background-position:top left;background-repeat:no-repeat;background-size:150% 150%}._1e0qizf1:indeterminate._1e0qizf1::-webkit-progress-bar{background-color:transparent}._1e0qizf3:indeterminate{background-image:none}._1e0qizf4{position:relative;bottom:0;left:0;height:3px;width:100%}._1e0qizf5{color:#fff;position:relative;padding:calc(var(--_1dwurlb8) / 2);z-index:1;text-align:center;font-size:var(--_1dwurlbq)}._1lpb9zp0{border:1px solid var(--_1dwurlb1q);border-radius:0;font-size:var(--_1dwurlbq);max-width:600px;padding:var(--_1dwurlb7);z-index:10}._1lpb9zp1{background-color:var(--_1dwurlb1s)}._1lpb9zp2{background-color:var(--_1dwurlb1u)}._1lpb9zp3{position:absolute;width:8px;height:8px;background:inherit;visibility:hidden}._1lpb9zp3:before{content:"";position:absolute;border:1px solid transparent;width:8px;height:8px;background:inherit;visibility:visible;transform:rotate(45deg)}._1lpb9zp4{bottom:-4px}._1lpb9zp4:before{border-bottom-color:var(--_1dwurlb1q);border-right-color:var(--_1dwurlb1q)}._1lpb9zp5{top:-4px}._1lpb9zp5:before{border-top-color:var(--_1dwurlb1q);border-left-color:var(--_1dwurlb1q)}._1lpb9zp6{right:-4px}._1lpb9zp6:before{border-top-color:var(--_1dwurlb1q);border-right-color:var(--_1dwurlb1q)}._1lpb9zp7{left:-4px}._1lpb9zp7:before{border-bottom-color:var(--_1dwurlb1q);border-left-color:var(--_1dwurlb1q)}.kfrms70{background-color:var(--_1dwurlb1t);box-shadow:0 0 10px var(--_1dwurlb21);position:sticky;top:0;z-index:1}.kfrms71{padding:var(--_1dwurlb6) var(--_1dwurlb9)}.kfrms72{padding:0}.kfrms74{border:2px solid var(--_1dwurlb22);padding:var(--_1dwurlb6) var(--_1dwurlb8);border-radius:var(--_1dwurlb1)}@media (min-width: 1024px){.kfrms73{display:none}}._1isundr0{animation:var(--_1dwurlbl) 1s linear infinite;color:var(--_1dwurlb1w)}._1c9nzq10{border-radius:var(--_1dwurlb1) var(--_1dwurlb1) 0 0}._1c9nzq11{border-radius:var(--_1dwurlb1)}._1c9nzq12{color:var(--_1dwurlb1w);padding:var(--_1dwurlb9);background-color:var(--_1dwurlb1s);cursor:pointer;border:none}._1c9nzq13{font-size:var(--_1dwurlbs);font-weight:var(--_1dwurlb10)}._1c9nzq14{padding:var(--_1dwurlbb);background-color:var(--_1dwurlb1t)}.ag5hlo1{container-name:ag5hlo0;container-type:inline-size;display:grid;grid-template-rows:auto;grid-template-columns:repeat(12,1fr)}.ag5hlo2{gap:var(--_1dwurlb4)}.ag5hlo3{gap:clamp(var(--_1dwurlb4),4vw,var(--_1dwurlb5))}.ag5hlo4{gap:clamp(var(--_1dwurlb4),4vw,var(--_1dwurlb9))}.ag5hlo5{gap:clamp(var(--_1dwurlb4),4vw,var(--_1dwurlbe))}@container ag5hlo0 (min-width: 0px){.ag5hlo6{grid-column:span 1}.ag5hloc{grid-column:span 2}.ag5hloi{grid-column:span 3}.ag5hloo{grid-column:span 4}.ag5hlou{grid-column:span 5}.ag5hlo10{grid-column:span 6}.ag5hlo16{grid-column:span 7}.ag5hlo1c{grid-column:span 8}.ag5hlo1i{grid-column:span 9}.ag5hlo1o{grid-column:span 10}.ag5hlo1u{grid-column:span 11}.ag5hlo20{grid-column:span 12}}@container ag5hlo0 (min-width: 480px){.ag5hlo7{grid-column:span 1}.ag5hlod{grid-column:span 2}.ag5hloj{grid-column:span 3}.ag5hlop{grid-column:span 4}.ag5hlov{grid-column:span 5}.ag5hlo11{grid-column:span 6}.ag5hlo17{grid-column:span 7}.ag5hlo1d{grid-column:span 8}.ag5hlo1j{grid-column:span 9}.ag5hlo1p{grid-column:span 10}.ag5hlo1v{grid-column:span 11}.ag5hlo21{grid-column:span 12}}@container ag5hlo0 (min-width: 768px){.ag5hlo8{grid-column:span 1}.ag5hloe{grid-column:span 2}.ag5hlok{grid-column:span 3}.ag5hloq{grid-column:span 4}.ag5hlow{grid-column:span 5}.ag5hlo12{grid-column:span 6}.ag5hlo18{grid-column:span 7}.ag5hlo1e{grid-column:span 8}.ag5hlo1k{grid-column:span 9}.ag5hlo1q{grid-column:span 10}.ag5hlo1w{grid-column:span 11}.ag5hlo22{grid-column:span 12}}@container ag5hlo0 (min-width: 1024px){.ag5hlo9{grid-column:span 1}.ag5hlof{grid-column:span 2}.ag5hlol{grid-column:span 3}.ag5hlor{grid-column:span 4}.ag5hlox{grid-column:span 5}.ag5hlo13{grid-column:span 6}.ag5hlo19{grid-column:span 7}.ag5hlo1f{grid-column:span 8}.ag5hlo1l{grid-column:span 9}.ag5hlo1r{grid-column:span 10}.ag5hlo1x{grid-column:span 11}.ag5hlo23{grid-column:span 12}}@container ag5hlo0 (min-width: 1440px){.ag5hloa{grid-column:span 1}.ag5hlog{grid-column:span 2}.ag5hlom{grid-column:span 3}.ag5hlos{grid-column:span 4}.ag5hloy{grid-column:span 5}.ag5hlo14{grid-column:span 6}.ag5hlo1a{grid-column:span 7}.ag5hlo1g{grid-column:span 8}.ag5hlo1m{grid-column:span 9}.ag5hlo1s{grid-column:span 10}.ag5hlo1y{grid-column:span 11}.ag5hlo24{grid-column:span 12}}@container ag5hlo0 (min-width: 1920px){.ag5hlob{grid-column:span 1}.ag5hloh{grid-column:span 2}.ag5hlon{grid-column:span 3}.ag5hlot{grid-column:span 4}.ag5hloz{grid-column:span 5}.ag5hlo15{grid-column:span 6}.ag5hlo1b{grid-column:span 7}.ag5hlo1h{grid-column:span 8}.ag5hlo1n{grid-column:span 9}.ag5hlo1t{grid-column:span 10}.ag5hlo1z{grid-column:span 11}.ag5hlo25{grid-column:span 12}}.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:rgba(0,0,0,.07);position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}._14dhllh0{position:relative}._14dhllh1{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10);padding:var(--_1dwurlb5) var(--_1dwurlbb);border:1px dashed var(--_1dwurlb22)}._14dhllh2{break-inside:avoid}._14dhllh3{color:var(--_1dwurlb1w);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10)}._14dhllh2>.u-title{font-size:var(--_1dwurlbs);font-weight:var(--_1dwurlby)!important}._14dhllh2 .u-label{font-weight:var(--_1dwurlby)!important}.ova0r30{min-height:100%}.ova0r30>.u-title{color:var(--_1dwurlb1v);font-size:var(--_1dwurlbt);font-weight:var(--_1dwurlbz)!important;white-space:nowrap}.ova0r31{padding:var(--_1dwurlb8);height:100%}.ova0r32{font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10);color:var(--_1dwurlb1w);padding-top:var(--_1dwurlb8);text-align:center}._12owwid0{border-collapse:collapse;width:100%}._12owwid1{padding:var(--_1dwurlb6);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb11)}._12owwid3:hover{background-color:var(--_1dwurlb26)}._12owwid3:nth-child(odd):not(:hover){background-color:var(--_1dwurlb1s)}._12owwid3:nth-child(2n):not(:hover){background-color:var(--_1dwurlb1t)}._12owwid4{padding:var(--_1dwurlb6);font-size:var(--_1dwurlbq)}._57i9sh0{min-height:100%}._57i9sh1{overflow-x:auto}._1jb2mvv0{padding:0}._1jb2mvv1{background-color:var(--_1dwurlb1s);border-radius:var(--_1dwurlb1) var(--_1dwurlb1) 0 0;color:var(--_1dwurlb1w);padding:var(--_1dwurlb9) var(--_1dwurlbb);font-size:var(--_1dwurlbr);font-weight:var(--_1dwurlb10)}._1jb2mvv2{padding:var(--_1dwurlb8)}._1ls5syl0{margin-bottom:var(--_1dwurlb9)}._1t22owt0{background-color:var(--_1dwurlb1u);color:var(--_1dwurlb1v);min-height:100vh}._1t22owt1{padding:var(--_1dwurlb9)}.u-legend{height:55px} diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-7a8bc16f.js b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-7a8bc16f.js new file mode 100644 index 00000000000..5b2fd9f9b61 --- /dev/null +++ b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-7a8bc16f.js @@ -0,0 +1,11 @@ +var kf=Object.defineProperty;var Sf=(e,t,r)=>t in e?kf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var he=(e,t,r)=>(Sf(e,typeof t!="symbol"?t+"":t,r),r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var oi,de,tu,Vr,Sl,ru,nu,iu,no,zs,Bs,su,ti={},ou=[],Tf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,li=Array.isArray;function cr(e,t){for(var r in t)e[r]=t[r];return e}function io(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function le(e,t,r){var n,i,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?oi.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return Yn(e,o,n,i,null)}function Yn(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++tu,__i:-1,__u:0};return i==null&&de.vnode!=null&&de.vnode(s),s}function lu(){return{current:null}}function pt(e){return e.children}function Xt(e,t){this.props=e,this.context=t}function yn(e,t){if(t==null)return e.__?yn(e.__,e.__i+1):null;for(var r;tu&&Vr.sort(nu),e=Vr.shift(),u=Vr.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,s=[],o=[],t.__P&&((r=cr({},n)).__v=n.__v+1,de.vnode&&de.vnode(r),so(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,s,i??yn(n),!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,fu(s,r,o),r.__e!=i&&au(r)));Fi.__r=0}function uu(e,t,r,n,i,s,o,u,c,l,h){var f,m,_,b,k,S,E=n&&n.__k||ou,T=t.length;for(c=Cf(r,t,E,c,T),f=0;f0?Yn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,u=null,(l=o.__i=Ef(o,r,c,f))!=-1&&(f--,(u=r[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(i>h?m--:ic?m--:m++,o.__u|=4))):e.__k[s]=null;if(f)for(s=0;s(c!=null&&!(2&c.__u)?1:0))for(i=r-1,s=r+1;i>=0||s=0){if((c=t[i])&&!(2&c.__u)&&o==c.key&&u==c.type)return i;i--}if(s0?e:li(e)?e.map(hu):cr({},e)}function Of(e,t,r,n,i,s,o,u,c){var l,h,f,m,_,b,k,S=r.props,E=t.props,T=t.type;if(T=="svg"?i="http://www.w3.org/2000/svg":T=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l2&&(u.children=arguments.length>3?oi.call(arguments,2):r),Yn(e.type,u,n||e.key,i||e.ref,null)}function ai(e){function t(r){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&n.forEach(function(o){o.__e=!0,$s(o)})},this.sub=function(s){n.add(s);var o=s.componentWillUnmount;s.componentWillUnmount=function(){n&&n.delete(s),o&&o.call(s)}}),r.children}return t.__c="__cC"+su++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t}oi=ou.slice,de={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(u){e=u}throw e}},tu=0,Xt.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=cr({},this.state),typeof e=="function"&&(e=e(cr({},r),this.props)),e&&cr(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),$s(this))},Xt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$s(this))},Xt.prototype.render=pt,Vr=[],ru=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nu=function(e,t){return e.__v.__b-t.__v.__b},Fi.__r=0,iu=/(PointerCapture)$|Capture$/i,no=0,zs=Cl(!1),Bs=Cl(!0),su=0;var Mf=0;function P(e,t,r,n,i,s){t||(t={});var o,u,c=t;if("ref"in c)for(u in c={},t)u=="ref"?o=t[u]:c[u]=t[u];var l={type:e,props:c,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mf,__i:-1,__u:0,__source:i,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(u in o)c[u]===void 0&&(c[u]=o[u]);return de.vnode&&de.vnode(l),l}var kr,Ne,Ss,El,bn=0,mu=[],Ie=de,Ol=Ie.__b,Pl=Ie.__r,Al=Ie.diffed,Ml=Ie.__c,Rl=Ie.unmount,Nl=Ie.__;function Zr(e,t){Ie.__h&&Ie.__h(Ne,e,bn||t),bn=0;var r=Ne.__H||(Ne.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ke(e){return bn=1,Ii(_u,e)}function Ii(e,t,r){var n=Zr(kr++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):_u(void 0,t),function(u){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,u);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Ne,!Ne.__f)){var i=function(u,c,l){if(!n.__c.__H)return!0;var h=n.__c.__H.__.filter(function(m){return!!m.__c});if(h.every(function(m){return!m.__N}))return!s||s.call(this,u,c,l);var f=n.__c.props!==u;return h.forEach(function(m){if(m.__N){var _=m.__[0];m.__=m.__N,m.__N=void 0,_!==m.__[0]&&(f=!0)}}),s&&s.call(this,u,c,l)||f};Ne.__f=!0;var s=Ne.shouldComponentUpdate,o=Ne.componentWillUpdate;Ne.componentWillUpdate=function(u,c,l){if(this.__e){var h=s;s=void 0,i(u,c,l),s=h}o&&o.call(this,u,c,l)},Ne.shouldComponentUpdate=i}return n.__N||n.__}function tr(e,t){var r=Zr(kr++,3);!Ie.__s&&co(r.__H,t)&&(r.__=e,r.u=t,Ne.__H.__h.push(r))}function Lr(e,t){var r=Zr(kr++,4);!Ie.__s&&co(r.__H,t)&&(r.__=e,r.u=t,Ne.__h.push(r))}function Ct(e){return bn=5,Nr(function(){return{current:e}},[])}function lo(e,t,r){bn=6,Lr(function(){if(typeof e=="function"){var n=e(t());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=t(),function(){return e.current=null}},r==null?r:r.concat(e))}function Nr(e,t){var r=Zr(kr++,7);return co(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function yr(e,t){return bn=8,Nr(function(){return e},t)}function Pn(e){var t=Ne.context[e.__c],r=Zr(kr++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(Ne)),t.props.value):e.__}function ao(e,t){Ie.useDebugValue&&Ie.useDebugValue(t?t(e):e)}function Rf(e){var t=Zr(kr++,10),r=Ke();return t.__=e,Ne.componentDidCatch||(Ne.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function uo(){var e=Zr(kr++,11);if(!e.__){for(var t=Ne.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Nf(){for(var e;e=mu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mi),e.__H.__h.forEach(js),e.__H.__h=[]}catch(t){e.__H.__h=[],Ie.__e(t,e.__v)}}Ie.__b=function(e){Ne=null,Ol&&Ol(e)},Ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Nl&&Nl(e,t)},Ie.__r=function(e){Pl&&Pl(e),kr=0;var t=(Ne=e.__c).__H;t&&(Ss===Ne?(t.__h=[],Ne.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Mi),t.__h.forEach(js),t.__h=[],kr=0)),Ss=Ne},Ie.diffed=function(e){Al&&Al(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mu.push(t)!==1&&El===Ie.requestAnimationFrame||((El=Ie.requestAnimationFrame)||Df)(Nf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ss=Ne=null},Ie.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Mi),r.__h=r.__h.filter(function(n){return!n.__||js(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ie.__e(n,r.__v)}}),Ml&&Ml(e,t)},Ie.unmount=function(e){Rl&&Rl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Mi(n)}catch(i){t=i}}),r.__H=void 0,t&&Ie.__e(t,r.__v))};var Dl=typeof requestAnimationFrame=="function";function Df(e){var t,r=function(){clearTimeout(n),Dl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Dl&&(t=requestAnimationFrame(r))}function Mi(e){var t=Ne,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Ne=t}function js(e){var t=Ne;e.__c=e.__(),Ne=t}function co(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function _u(e,t){return typeof t=="function"?t(e):t}function vu(e,t){for(var r in t)e[r]=t[r];return e}function qs(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function fo(e,t){var r=t(),n=Ke({t:{__:r,u:t}}),i=n[0].t,s=n[1];return Lr(function(){i.__=r,i.u=t,Ts(i)&&s({t:i})},[e,r,t]),tr(function(){return Ts(i)&&s({t:i}),e(function(){Ts(i)&&s({t:i})})},[e]),r}function Ts(e){var t,r,n=e.u,i=e.__;try{var s=n();return!((t=i)===(r=s)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}function ho(e){e()}function po(e){return e}function mo(){return[!1,ho]}var _o=Lr;function zi(e,t){this.props=e,this.context=t}function gu(e,t){function r(i){var s=this.props.ref,o=s==i.ref;return!o&&s&&(s.call?s(null):s.current=null),t?!t(this.props,i)||!o:qs(this.props,i)}function n(i){return this.shouldComponentUpdate=r,le(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(zi.prototype=new Xt).isPureReactComponent=!0,zi.prototype.shouldComponentUpdate=function(e,t){return qs(this.props,e)||qs(this.state,t)};var Ll=de.__b;de.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ll&&Ll(e)};var Lf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function hr(e){function t(r){var n=vu({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=Lf,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Fl=function(e,t){return e==null?null:br(br(e).map(t))},yu={map:Fl,forEach:Fl,count:function(e){return e?br(e).length:0},only:function(e){var t=br(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:br},Ff=de.__e;de.__e=function(e,t,r,n){if(e.then){for(var i,s=t;s=s.__;)if((i=s.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Ff(e,t,r,n)};var zl=de.unmount;function bu(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=vu({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return bu(n,t,r)})),e}function wu(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return wu(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Zn(){this.__u=0,this.o=null,this.__b=null}function xu(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ku(e){var t,r,n;function i(s){if(t||(t=e()).then(function(o){r=o.default||o},function(o){n=o}),n)throw n;if(!r)throw t;return le(r,s)}return i.displayName="Lazy",i.__f=!0,i}function _n(){this.i=null,this.l=null}de.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),zl&&zl(e)},(Zn.prototype=new Xt).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=xu(n.__v),s=!1,o=function(){s||(s=!0,r.__R=null,i?i(u):u())};r.__R=o;var u=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=wu(c,c.__c.__P,c.__c.__O)}var l;for(n.setState({__a:n.__b=null});l=n.o.pop();)l.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},Zn.prototype.componentWillUnmount=function(){this.o=[]},Zn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=bu(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&le(pt,null,e.fallback);return i&&(i.__u&=-33),[le(pt,null,t.__a?null:e.children),i]};var Bl=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]>>1,1),t.h.removeChild(i)}}}ri(le(zf,{context:t.context},e.__v),t.v)}function Su(e,t){var r=le(Bf,{__v:e,h:t});return r.containerInfo=t,r}(_n.prototype=new Xt).__a=function(e){var t=this,r=xu(t.__v),n=t.l.get(e);return n[0]++,function(i){var s=function(){t.props.revealOrder?(n.push(i),Bl(t,e,n)):i()};r?r(s):s()}},_n.prototype.render=function(e){this.i=null,this.l=new Map;var t=br(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},_n.prototype.componentDidUpdate=_n.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Bl(e,r,t)})};var Tu=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,$f=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,jf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,qf=/[A-Z0-9]/g,Hf=typeof document<"u",If=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function vo(e,t,r){return t.__k==null&&(t.textContent=""),ri(e,t),typeof r=="function"&&r(),e?e.__c:null}function go(e,t,r){return du(e,t),typeof r=="function"&&r(),e?e.__c:null}Xt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Xt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var $l=de.event;function Vf(){}function Wf(){return this.cancelBubble}function Uf(){return this.defaultPrevented}de.event=function(e){return $l&&(e=$l(e)),e.persist=Vf,e.isPropagationStopped=Wf,e.isDefaultPrevented=Uf,e.nativeEvent=e};var yo,Gf={enumerable:!1,configurable:!0,get:function(){return this.class}},jl=de.vnode;de.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},s=n.indexOf("-")===-1;for(var o in r){var u=r[o];if(!(o==="value"&&"defaultValue"in r&&u==null||Hf&&o==="children"&&n==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&u===!0?u="":c==="translate"&&u==="no"?u=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?o="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||If(r.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":jf.test(o)&&(o=c):c=o="oninput":s&&$f.test(o)?o=o.replace(qf,"-$&").toLowerCase():u===null&&(u=void 0),c==="oninput"&&i[o=c]&&(o="oninputCapture"),i[o]=u}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=br(r.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=br(r.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Gf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Tu,jl&&jl(e)};var ql=de.__r;de.__r=function(e){ql&&ql(e),yo=e.__c};var Hl=de.diffed;de.diffed=function(e){Hl&&Hl(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),yo=null};var Cu={ReactCurrentDispatcher:{current:{readContext:function(e){return yo.__n[e.__c].props.value},useCallback:yr,useContext:Pn,useDebugValue:ao,useDeferredValue:po,useEffect:tr,useId:uo,useImperativeHandle:lo,useInsertionEffect:_o,useLayoutEffect:Lr,useMemo:Nr,useReducer:Ii,useRef:Ct,useState:Ke,useSyncExternalStore:fo,useTransition:mo}}},Kf="18.3.1";function Eu(e){return le.bind(null,e)}function ui(e){return!!e&&e.$$typeof===Tu}function Ou(e){return ui(e)&&e.type===pt}function Pu(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function bo(e){return ui(e)?Af.apply(null,arguments):e}function wo(e){return!!e.__k&&(ri(null,e),!0)}function Au(e){return e&&(e.base||e.nodeType===1&&e)||null}var Mu=function(e,t){return e(t)},xo=function(e,t){return e(t)},Ru=pt,Nu=ui,Yf={useState:Ke,useId:uo,useReducer:Ii,useEffect:tr,useLayoutEffect:Lr,useInsertionEffect:_o,useTransition:mo,useDeferredValue:po,useSyncExternalStore:fo,startTransition:ho,useRef:Ct,useImperativeHandle:lo,useMemo:Nr,useCallback:yr,useContext:Pn,useDebugValue:ao,version:"18.3.1",Children:yu,render:vo,hydrate:go,unmountComponentAtNode:wo,createPortal:Su,createElement:le,createContext:ai,createFactory:Eu,cloneElement:bo,createRef:lu,Fragment:pt,isValidElement:ui,isElement:Nu,isFragment:Ou,isMemo:Pu,findDOMNode:Au,Component:Xt,PureComponent:zi,memo:gu,forwardRef:hr,flushSync:xo,unstable_batchedUpdates:Mu,StrictMode:Ru,Suspense:Zn,SuspenseList:_n,lazy:ku,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Cu};function Du(e){return{render:function(t){vo(t,e)},unmount:function(){wo(e)}}}function Zf(e,t){return go(t,e),Du(e)}const Jf={createRoot:Du,hydrateRoot:Zf},Qf=Object.freeze(Object.defineProperty({__proto__:null,Children:yu,Component:Xt,Fragment:pt,PureComponent:zi,StrictMode:Ru,Suspense:Zn,SuspenseList:_n,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Cu,cloneElement:bo,createContext:ai,createElement:le,createFactory:Eu,createPortal:Su,createRef:lu,default:Yf,findDOMNode:Au,flushSync:xo,forwardRef:hr,hydrate:go,isElement:Nu,isFragment:Ou,isMemo:Pu,isValidElement:ui,lazy:ku,memo:gu,render:vo,startTransition:ho,unmountComponentAtNode:wo,unstable_batchedUpdates:Mu,useCallback:yr,useContext:Pn,useDebugValue:ao,useDeferredValue:po,useEffect:tr,useErrorBoundary:Rf,useId:uo,useImperativeHandle:lo,useInsertionEffect:_o,useLayoutEffect:Lr,useMemo:Nr,useReducer:Ii,useRef:Ct,useState:Ke,useSyncExternalStore:fo,useTransition:mo,version:Kf},Symbol.toStringTag,{value:"Module"})),Xf="k6 dashboard",eh=[{sections:[{panels:[{series:[{query:"iterations[?!tags && rate]"}],title:"Iteration Rate",kind:"stat",id:"tab-0.section-0.panel-0",summary:"The iteration rate represents the number of times a VU has executed a test script (the `default` function) over a period of time. The panel can help you ensure that your test iteration rate matches the configuration you have specified in your test script, and that the number of VUs you have allocated matches the test capacity."},{series:[{query:"http_reqs[?!tags && rate]"}],title:"HTTP Request Rate",kind:"stat",id:"tab-0.section-0.panel-1",summary:"The HTTP request rate represents the number of requests over a period of time."},{series:[{query:"http_req_duration[?!tags && avg]"}],title:"HTTP Request Duration",kind:"stat",id:"tab-0.section-0.panel-2",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test."},{series:[{query:"http_req_failed[?!tags && rate ]"}],title:"HTTP Request Failed",kind:"stat",id:"tab-0.section-0.panel-3",summary:"The rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details."},{series:[{query:"data_received[?!tags && rate]"}],title:"Received Rate",kind:"stat",id:"tab-0.section-0.panel-4",summary:"The amount of data received over a period of time."},{series:[{query:"data_sent[?!tags && rate]"}],title:"Sent Rate",kind:"stat",id:"tab-0.section-0.panel-5",summary:"The amount of data sent to the system under test. "}],id:"tab-0.section-0"},{panels:[{series:[{query:"http_reqs[?!tags && rate]",legend:"Request Rate"},{query:"http_req_duration[?!tags && p95]",legend:"Request Duration p(95)"},{query:"http_req_failed[?!tags && rate]",legend:"Request Failed"}],title:"HTTP Performance overview",id:"tab-0.section-1.panel-0",summary:"The HTTP request rate represents the number of requests over a period of time. The HTTP request duration 95 percentile represents the total time for 95% of the requests observed. The HTTP request failed rate represents the rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details.",fullWidth:!0,kind:"chart"}],id:"tab-0.section-1"},{panels:[{series:[{query:"vus[?!tags && value]"},{query:"http_reqs[?!tags && rate ]"}],title:"VUs",id:"tab-0.section-2.panel-0",summary:"The number of VUs and the number of requests throughout the test run. This is an indication of how the two metrics correlate, and can help you visualize if you need to increase or decrease the number of VUs for your test.",kind:"chart"},{series:[{query:"data_received[?!tags && rate]"},{query:"data_sent[?!tags && rate]"}],title:"Transfer Rate",id:"tab-0.section-2.panel-1",summary:"The rate at which data is sent to and received from the system under test.",kind:"chart"},{series:[{query:"http_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"HTTP Request Duration",id:"tab-0.section-2.panel-2",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test.",kind:"chart"},{series:[{query:"iteration_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Iteration Duration",id:"tab-0.section-2.panel-3",summary:"The time to complete one full iteration of the test, including time spent in setup and teardown.",kind:"chart"}],id:"tab-0.section-2"}],title:"Overview",summary:"This chapter provides an overview of the most important metrics of the test run. Graphs plot the value of metrics over time.",id:"tab-0"},{sections:[{panels:[{series:[{query:"http_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Duration",id:"tab-1.section-0.panel-0",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test.",kind:"chart"},{series:[{query:"http_req_failed[?!tags && rate ]"}],title:"Request Failed Rate",id:"tab-1.section-0.panel-1",summary:"The rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details.",kind:"chart"},{series:[{query:"http_reqs[?!tags && rate]"}],title:"Request Rate",id:"tab-1.section-0.panel-2",summary:"The HTTP request rate represents the number of requests over a period of time.",kind:"chart"},{series:[{query:"http_req_waiting[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Waiting",id:"tab-1.section-0.panel-3",summary:"The time between k6 sending a request and receiving the first byte of information from the remote host. Also known as 'time to first byte' or 'TTFB'.",kind:"chart"},{series:[{query:"http_req_tls_handshaking[?!tags && (avg || p90 || p95 || p99)]"}],title:"TLS handshaking",id:"tab-1.section-0.panel-4",summary:"The time it takes to complete the TLS handshake for the requests.",kind:"chart"},{series:[{query:"http_req_sending[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Sending",id:"tab-1.section-0.panel-5",summary:"The time k6 spends sending data to the remote host.",kind:"chart"},{series:[{query:"http_req_connecting[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Connecting",id:"tab-1.section-0.panel-6",summary:"The time k6 spends establishing a TCP connection to the remote host.",kind:"chart"},{series:[{query:"http_req_receiving[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Receiving",id:"tab-1.section-0.panel-7",summary:"The time k6 spends receiving data from the remote host.",kind:"chart"},{series:[{query:"http_req_blocked[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Blocked",id:"tab-1.section-0.panel-8",summary:"The time k6 spends waiting for a free TCP connection slot before initiating a request.",kind:"chart"}],title:"HTTP",summary:"These metrics are generated only when the test makes HTTP requests.",id:"tab-1.section-0"},{panels:[{series:[{query:"browser_http_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Duration",id:"tab-1.section-1.panel-0",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test.",kind:"chart"},{series:[{query:"browser_http_req_failed[?!tags && rate ]"}],title:"Request Failed Rate",id:"tab-1.section-1.panel-1",summary:"The rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details.",kind:"chart"},{series:[{query:"browser_web_vital_lcp[?!tags && (avg || p90 || p95 || p99)]"}],title:"Largest Contentful Paint",id:"tab-1.section-1.panel-2",summary:"Largest Contentful Paint (LCP) measures the time it takes for the largest content element on a page to become visible.",kind:"chart"},{series:[{query:"browser_web_vital_fid[?!tags && (avg || p90 || p95 || p99)]"}],title:"First Input Delay",id:"tab-1.section-1.panel-3",summary:"First Input Delay (FID) measures the responsiveness of a web page by quantifying the delay between a user's first interaction, such as clicking a button, and the browser's response.",kind:"chart"},{series:[{query:"browser_web_vital_cls[?!tags && (avg || p90 || p95 || p99)]"}],title:"Cumulative Layout Shift",id:"tab-1.section-1.panel-4",summary:"Cumulative Layout Shift (CLS) measures visual stability on a webpage by quantifying the amount of unexpected layout shift of visible page content.",kind:"chart"},{series:[{query:"browser_web_vital_ttfb[?!tags && (avg || p90 || p95 || p99)]"}],title:"Time to First Byte",id:"tab-1.section-1.panel-5",summary:"Time to First Byte (TTFB) measures the time between the request for a resource and when the first byte of a response begins to arrive.",kind:"chart"},{series:[{query:"browser_web_vital_fcp[?!tags && (avg || p90 || p95 || p99)]"}],title:"First Contentful Paint",id:"tab-1.section-1.panel-6",summary:"First Contentful Paint (FCP) measures the time it takes for the first content element to be painted on the screen.",kind:"chart"},{series:[{query:"browser_web_vital_inp[?!tags && (avg || p90 || p95 || p99)]"}],title:"Interaction to Next Paint",id:"tab-1.section-1.panel-7",summary:"Interaction to Next Paint (INP) measures a page's overall responsiveness to user interactions by observing the latency of all click, tap, and keyboard interactions that occur throughout the lifespan of a user's visit to a page.",kind:"chart"}],title:"Browser",summary:"The k6 browser module emits its own metrics based on the Core Web Vitals and Other Web Vitals.",id:"tab-1.section-1"},{panels:[{series:[{query:"ws_connecting[?!tags && (avg || p90 || p95 || p99)]"}],title:"Connect Duration",id:"tab-1.section-2.panel-0",summary:"The duration of the WebSocket connection request. This is an indication of the latency experienced when connecting to a WebSocket server.",kind:"chart"},{series:[{query:"ws_session_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Session Duration",id:"tab-1.section-2.panel-1",summary:"The time between the start of the connection and the end of the VU execution.",kind:"chart"},{series:[{query:"ws_ping[?!tags && (avg || p90 || p95 || p99)]"}],title:"Ping Duration",id:"tab-1.section-2.panel-2",summary:"The duration between a ping request and its pong reception. This is an indication of the latency experienced during the roundtrip of sending a ping message to a WebSocket server, and waiting for the pong response message to come back.",kind:"chart"},{series:[{query:"ws_msgs_sent[?!tags && rate]"},{query:"ws_msgs_received[?!tags && rate]"}],title:"Transfer Rate",id:"tab-1.section-2.panel-3",summary:"The total number of WebSocket messages sent, and the total number of WebSocket messages received.",kind:"chart"},{series:[{query:"ws_sessions[?!tags && rate]"}],title:"Sessions Rate",id:"tab-1.section-2.panel-4",summary:"The total number of WebSocket sessions started.",kind:"chart"}],title:"WebSocket",summary:"k6 emits the following metrics when interacting with a WebSocket service through the experimental or legacy websockets API.",id:"tab-1.section-2"},{panels:[{series:[{query:"grpc_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Duration",id:"tab-1.section-3.panel-0",summary:"The gRPC request duration represents the total time for a gRPC request. This is an indication of the latency experienced when making gRPC requests against the system under test.",kind:"chart"},{series:[{query:"grpc_streams_msgs_sent[?!tags && rate]"},{query:"grpc_streams_msgs_received[?!tags && rate]"}],title:"Transfer Rate",id:"tab-1.section-3.panel-1",summary:"The total number of messages sent to gRPC streams, and the total number of messages received from a gRPC stream.",kind:"chart"},{series:[{query:"grpc_streams[?!tags && rate]"}],title:"Streams Rate",id:"tab-1.section-3.panel-2",summary:"The total number of gRPC streams started.",kind:"chart"}],title:"gRPC",summary:"k6 emits the following metrics when it interacts with a service through the gRPC API.",id:"tab-1.section-3"}],title:"Timings",summary:"This chapter provides an overview of test run HTTP timing metrics. Graphs plot the value of metrics over time.",id:"tab-1"},{sections:[{panels:[{series:[{query:"[?!tags && trend]"}],title:"Trends",kind:"summary",id:"tab-2.section-0.panel-0"}],title:"",id:"tab-2.section-0"},{panels:[{series:[{query:"[?!tags && counter]"}],title:"Counters",kind:"summary",id:"tab-2.section-1.panel-0"},{series:[{query:"[?!tags && rate]"}],title:"Rates",kind:"summary",id:"tab-2.section-1.panel-1"},{series:[{query:"[?!tags && gauge]"}],title:"Gauges",kind:"summary",id:"tab-2.section-1.panel-2"}],title:"",id:"tab-2.section-1"}],title:"Summary",summary:"This chapter provides a summary of the test run metrics. The tables contains the aggregated values of the metrics for the entire test run.",id:"tab-2"}],Lu={title:Xf,tabs:eh};var vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Fu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var zu={};(function(e){(function(t){function r(d){return d!==null?Object.prototype.toString.call(d)==="[object Array]":!1}function n(d){return d!==null?Object.prototype.toString.call(d)==="[object Object]":!1}function i(d,y){if(d===y)return!0;var w=Object.prototype.toString.call(d);if(w!==Object.prototype.toString.call(y))return!1;if(r(d)===!0){if(d.length!==y.length)return!1;for(var A=0;A",9:"Array"},L="EOF",O="UnquotedIdentifier",F="QuotedIdentifier",M="Rbracket",z="Rparen",q="Comma",$="Colon",j="Rbrace",R="Number",W="Current",H="Expref",Q="Pipe",U="Or",ee="And",V="EQ",je="GT",me="LT",fe="GTE",_e="LTE",se="NE",Z="Flatten",be="Star",Ce="Filter",ge="Dot",pe="Not",De="Lbrace",Le="Lbracket",ke="Lparen",tt="Literal",bt={".":ge,"*":be,",":q,":":$,"{":De,"}":j,"]":M,"(":ke,")":z,"@":W},ut={"<":!0,">":!0,"=":!0,"!":!0},Lt={" ":!0," ":!0,"\n":!0};function rr(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d==="_"}function Ft(d){return d>="0"&&d<="9"||d==="-"}function nr(d){return d>="a"&&d<="z"||d>="A"&&d<="Z"||d>="0"&&d<="9"||d==="_"}function ir(){}ir.prototype={tokenize:function(d){var y=[];this._current=0;for(var w,A,N;this._current")return d[this._current]==="="?(this._current++,{type:fe,value:">=",start:y}):{type:je,value:">",start:y};if(w==="="&&d[this._current]==="=")return this._current++,{type:V,value:"==",start:y}},_consumeLiteral:function(d){this._current++;for(var y=this._current,w=d.length,A;d[this._current]!=="`"&&this._current=0)return!0;if(w.indexOf(d)>=0)return!0;if(A.indexOf(d[0])>=0)try{return JSON.parse(d),!0}catch{return!1}else return!1}};var ne={};ne[L]=0,ne[O]=0,ne[F]=0,ne[M]=0,ne[z]=0,ne[q]=0,ne[j]=0,ne[R]=0,ne[W]=0,ne[H]=0,ne[Q]=1,ne[U]=2,ne[ee]=3,ne[V]=5,ne[je]=5,ne[me]=5,ne[fe]=5,ne[_e]=5,ne[se]=5,ne[Z]=9,ne[be]=20,ne[Ce]=21,ne[ge]=40,ne[pe]=45,ne[De]=50,ne[Le]=55,ne[ke]=60;function Ae(){}Ae.prototype={parse:function(d){this._loadTokens(d),this.index=0;var y=this.expression(0);if(this._lookahead(0)!==L){var w=this._lookaheadToken(0),A=new Error("Unexpected token type: "+w.type+", value: "+w.value);throw A.name="ParserError",A}return y},_loadTokens:function(d){var y=new ir,w=y.tokenize(d);w.push({type:L,value:"",start:d.length}),this.tokens=w},expression:function(d){var y=this._lookaheadToken(0);this._advance();for(var w=this.nud(y),A=this._lookahead(0);d=0)return this.expression(d);if(y===Le)return this._match(Le),this._parseMultiselectList();if(y===De)return this._match(De),this._parseMultiselectHash()},_parseProjectionRHS:function(d){var y;if(ne[this._lookahead(0)]<10)y={type:"Identity"};else if(this._lookahead(0)===Le)y=this.expression(d);else if(this._lookahead(0)===Ce)y=this.expression(d);else if(this._lookahead(0)===ge)this._match(ge),y=this._parseDotRHS(d);else{var w=this._lookaheadToken(0),A=new Error("Sytanx error, unexpected token: "+w.value+"("+w.type+")");throw A.name="ParserError",A}return y},_parseMultiselectList:function(){for(var d=[];this._lookahead(0)!==M;){var y=this.expression(0);if(d.push(y),this._lookahead(0)===q&&(this._match(q),this._lookahead(0)===M))throw new Error("Unexpected token Rbracket")}return this._match(M),{type:"MultiSelectList",children:d}},_parseMultiselectHash:function(){for(var d=[],y=[O,F],w,A,N,K;;){if(w=this._lookaheadToken(0),y.indexOf(w.type)<0)throw new Error("Expecting an identifier token, got: "+w.type);if(A=w.value,this._advance(),this._match($),N=this.expression(0),K={type:"KeyValuePair",name:A,value:N},d.push(K),this._lookahead(0)===q)this._match(q);else if(this._lookahead(0)===j){this._match(j);break}}return{type:"MultiSelectHash",children:d}}};function wt(d){this.runtime=d}wt.prototype={search:function(d,y){return this.visit(d,y)},visit:function(d,y){var w,A,N,K,re,ue,Ee,Ue,He,ie;switch(d.type){case"Field":return y!==null&&n(y)?(ue=y[d.name],ue===void 0?null:ue):null;case"Subexpression":for(N=this.visit(d.children[0],y),ie=1;ie0)for(ie=mt;ieXr;ie+=en)N.push(y[ie]);return N;case"Projection":var Et=this.visit(d.children[0],y);if(!r(Et))return null;for(He=[],ie=0;iere;break;case fe:N=K>=re;break;case me:N=K=d&&(y=w<0?d-1:d),y}};function dt(d){this._interpreter=d,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[c]}]},avg:{_func:this._functionAvg,_signature:[{types:[S]}]},ceil:{_func:this._functionCeil,_signature:[{types:[c]}]},contains:{_func:this._functionContains,_signature:[{types:[h,f]},{types:[l]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[h]},{types:[h]}]},floor:{_func:this._functionFloor,_signature:[{types:[c]}]},length:{_func:this._functionLength,_signature:[{types:[h,f,m]}]},map:{_func:this._functionMap,_signature:[{types:[b]},{types:[f]}]},max:{_func:this._functionMax,_signature:[{types:[S,E]}]},merge:{_func:this._functionMerge,_signature:[{types:[m],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[f]},{types:[b]}]},sum:{_func:this._functionSum,_signature:[{types:[S]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[h]},{types:[h]}]},min:{_func:this._functionMin,_signature:[{types:[S,E]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[f]},{types:[b]}]},type:{_func:this._functionType,_signature:[{types:[l]}]},keys:{_func:this._functionKeys,_signature:[{types:[m]}]},values:{_func:this._functionValues,_signature:[{types:[m]}]},sort:{_func:this._functionSort,_signature:[{types:[E,S]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[f]},{types:[b]}]},join:{_func:this._functionJoin,_signature:[{types:[h]},{types:[E]}]},reverse:{_func:this._functionReverse,_signature:[{types:[h,f]}]},to_array:{_func:this._functionToArray,_signature:[{types:[l]}]},to_string:{_func:this._functionToString,_signature:[{types:[l]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[l]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[l],variadic:!0}]}}}dt.prototype={callFunction:function(d,y){var w=this.functionTable[d];if(w===void 0)throw new Error("Unknown function: "+d+"()");return this._validateArgs(d,y,w._signature),w._func.call(this,y)},_validateArgs:function(d,y,w){var A;if(w[w.length-1].variadic){if(y.length=0;N--)A+=w[N];return A}else{var K=d[0].slice(0);return K.reverse(),K}},_functionAbs:function(d){return Math.abs(d[0])},_functionCeil:function(d){return Math.ceil(d[0])},_functionAvg:function(d){for(var y=0,w=d[0],A=0;A=0},_functionFloor:function(d){return Math.floor(d[0])},_functionLength:function(d){return n(d[0])?Object.keys(d[0]).length:d[0].length},_functionMap:function(d){for(var y=[],w=this._interpreter,A=d[0],N=d[1],K=0;K0){var y=this._getTypeName(d[0][0]);if(y===c)return Math.max.apply(Math,d[0]);for(var w=d[0],A=w[0],N=1;N0){var y=this._getTypeName(d[0][0]);if(y===c)return Math.min.apply(Math,d[0]);for(var w=d[0],A=w[0],N=1;Nht?1:ieN&&(N=re,K=w[ue]);return K},_functionMinBy:function(d){for(var y=d[1],w=d[0],A=this.createKeyFunction(y,[c,h]),N=1/0,K,re,ue=0;ue(e.bytes="bytes",e.bps="bps",e.counter="counter",e.rps="rps",e.duration="duration",e.timestamp="timestamp",e.percent="percent",e.unknown="",e))(Mr||{}),Bu=class{constructor(e){he(this,"name");he(this,"aggregate");const[t,r]=e.split(".",2);this.aggregate=r,this.name=t}},Il="time",ko=class{constructor({values:e={},names:t=[]}={}){he(this,"values");he(this,"names");he(this,"_aggregates");this.values=e,this.names=t,this._aggregates={}}set aggregates(e){for(const t in e){const r=t;this._aggregates[r]=e[r].map(n=>n.replaceAll("(","").replaceAll(")",""))}}onEvent(e){for(const t in e)this.values[t]={...e[t],name:t};this.names=Object.keys(this.values),this.names.sort()}toAggregate(e){const t={};for(let r=0;r(e.config="config",e.param="param",e.start="start",e.stop="stop",e.metric="metric",e.snapshot="snapshot",e.cumulative="cumulative",e.threshold="threshold",e))($u||{}),Si="time",Ti=class{constructor({length:e=0,capacity:t=1e4,values:r=new Array,aggregate:n="value",metric:i=void 0,unit:s="",name:o="",tags:u={},group:c=void 0}={}){he(this,"capacity");he(this,"aggregate");he(this,"metric");he(this,"unit");he(this,"empty");he(this,"name");he(this,"tags");he(this,"group");he(this,"values");this.values=e==0?r:new Array(e),this.capacity=t,this.aggregate=n,this.metric=i,this.unit=s,this.empty=this.values.length==0,this.name=o,this.tags=u,this.group=c,Object.defineProperty(this,n,{value:!0,configurable:!0,enumerable:!0,writable:!0})}hasTags(){return this.tags!=null&&Object.keys(this.tags).length!=0}formatTags(){if(!this.hasTags())return"";let e="{";for(const t in this.tags)e+=`${t}:${this.tags[t]}`;return e+="}",e}get legend(){let e=this.aggregate;return this.metric&&this.metric.type!="trend"&&this.name.length!=0&&(e=this.name+this.formatTags()),e}grow(e){this.values[e-1]=void 0}push(...e){let t=!1;if(e.forEach(r=>{this.values.push(r),this.empty=!1,this.values.length==this.capacity&&(this.values.shift(),t=!0)}),t){this.empty=!0;for(let r=0;r{t.unit&&!e.includes(t.unit)&&e.push(t.unit)}),e}},rh=class{constructor({capacity:e=1e4,metrics:t=new ko}={}){he(this,"capacity");he(this,"metrics");he(this,"values");he(this,"vectors");he(this,"lookup");this.capacity=e,this.metrics=t,this.lookup={},this.vectors={},this.values={}}get length(){return this.values[Si]?this.values[Si].values.length:0}_push(e,t,r=void 0){const n=r?e+"."+r:e;let i=this.vectors[n];if(i)i.values.length0){n=e.substring(i),n=n.substring(1,n.length-1);const s=n.indexOf(":"),o=n.substring(0,s),u=n.substring(s+1);r.tags={[o]:u},o=="group"&&(r.group=u.substring(2)),e=e.substring(0,i)}return r.name=e,r.metric=this.metrics.find(e),r.unit=this.metrics.unit(e,t),new Ti(r)}onEvent(e){for(const t in e){if(t==Si){this._push(t,Math.floor(e[t].value/1e3));continue}for(const r in e[t]){const n=r;this._push(t,e[t][n],n)}}}annotate(e){this.metrics=e;for(const t in this.values){this.values[t].metric=e.find(t);const r=new Bu(t);this.values[t].unit=e.unit(r.name,r.aggregate)}}select(e){const t=new th(this.values[Si]);if(t.length==0)return t;for(const r of e){const n=this.queryAll(r);n.length>0&&t.push(...n)}return t}query(e){const t=Hs.search(this.lookup,e);if(Array.isArray(t)){const n=t.at(0);return n instanceof Ti?n:void 0}return t instanceof Ti?t:void 0}queryAll(e){const t=Hs.search(this.lookup,e);if(!Array.isArray(t)||t.length==0)return new Array;const r=t;return r.at(0)instanceof Ti?r:new Array}},Vl=class{constructor({values:e,metric:t,name:r}={}){he(this,"values");he(this,"metric");he(this,"name");he(this,"tags");he(this,"group");this.values=e,this.metric=t,this.name=r,t&&t.type&&Object.defineProperty(this,t.type,{value:!0,configurable:!0,enumerable:!0,writable:!0});let n="";const i=r.indexOf("{");if(i&&i>0){n=r.substring(i),n=n.substring(1,n.length-1);const s=n.indexOf(":"),o=n.substring(0,s),u=n.substring(s+1);this.tags={[o]:u},o=="group"&&(this.group=u.substring(2)),r=r.substring(0,i)}}},nh="time",ih=class extends Array{constructor(t){super();he(this,"aggregates");this.aggregates=new Array;for(let r=0;ri))}}get empty(){return this.length==0}},sh=class{constructor({values:t={},metrics:r=new ko,time:n=0}={}){he(this,"values");he(this,"lookup");he(this,"metrics");he(this,"time");this.values=t,this.lookup=new Array,this.metrics=r,this.time=n}onEvent(t){const r={};let n=0;for(const s in t){if(s==nh){n=Math.floor(t[s].value/1e3);continue}const o=this.newSummaryRow(s,t[s]);r[s]=o}this.values=r,this.time=n;const i=Array();for(const s in this.values)i.push(this.values[s]);this.lookup=i}newSummaryRow(t,r){const n={};return n.name=t,n.metric=this.metrics.find(t),n.values=r,new Vl(n)}annotate(t){this.metrics=t;for(const r in this.values)this.values[r].metric=t.find(r)}select(t){const r=new Array;for(const n of t){const i=this.queryAll(n);i.length>0&&r.push(...i)}return new ih(r)}queryAll(t){const r=Hs.search(this.lookup,t);if(!Array.isArray(r)||r.length==0)return new Array;const n=r;return n.at(0)instanceof Vl?n:new Array}},oh=class{constructor(e={}){Object.assign(this,e)}},lh=class{constructor(e={}){Object.assign(this,e)}},Is=class{constructor({config:e={},param:t={},start:r=void 0,stop:n=void 0,metrics:i=new ko,samples:s=new rh,summary:o=new sh,thresholds:u=new lh}={}){he(this,"config");he(this,"param");he(this,"start");he(this,"stop");he(this,"metrics");he(this,"samples");he(this,"summary");he(this,"thresholds");this.config=e,this.param=t,this.start=r,this.stop=n,this.metrics=i,this.samples=s,this.summary=o,this.thresholds=u}handleEvent(e){const t=e.type,r=JSON.parse(e.data);this.onEvent({type:t,data:r})}onEvent(e){switch(e.type){case"config":this.onConfig(e.data);break;case"param":this.onParam(e.data);break;case"start":this.onStart(this.metrics.toAggregate(e.data));break;case"stop":this.onStop(this.metrics.toAggregate(e.data));break;case"metric":this.onMetric(e.data);break;case"snapshot":this.onSnapshot(this.metrics.toAggregate(e.data));break;case"cumulative":this.onCumulative(this.metrics.toAggregate(e.data));break;case"threshold":this.onThreshold(e.data);break}}onConfig(e){Object.assign(this.config,e)}onParam(e){Object.assign(this.param,e),this.metrics.aggregates=e.aggregates}onStart(e){e.time&&e.time.value&&(this.start=new Date(e.time.value))}onStop(e){e.time&&e.time.value&&(this.stop=new Date(e.time.value))}onMetric(e){this.metrics.onEvent(e),this.samples.annotate(this.metrics),this.summary.annotate(this.metrics)}onSnapshot(e){this.samples.onEvent(e),this.samples.annotate(this.metrics)}onCumulative(e){this.summary.onEvent(e),this.summary.annotate(this.metrics)}onThreshold(e){Object.assign(this.thresholds,e)}};const So=ai(()=>new Is({config:Lu}));So.displayName="Digest";function ah({endpoint:e="/events",children:t}){const[r,n]=Ke(new Is({config:new oh(Lu)}));return tr(()=>{const i=new EventSource(e),s=o=>{r.handleEvent(o),n(new Is(r))};for(const o in $u)i.addEventListener(o,s)},[]),P(So.Provider,{value:()=>r,children:t})}function Jr(){const e=Pn(So);if(e===void 0)throw new Error("useDigest must be used within a DigestProvider");return e()}var uh="_1dwurlb28",ch="_1dwurlb27",ju={borderRadius:{sm:"var(--_1dwurlb0)",md:"var(--_1dwurlb1)",lg:"var(--_1dwurlb2)",xl:"var(--_1dwurlb3)"},sizes:{size1:"var(--_1dwurlb4)",size2:"var(--_1dwurlb5)",size3:"var(--_1dwurlb6)",size4:"var(--_1dwurlb7)",size5:"var(--_1dwurlb8)",size6:"var(--_1dwurlb9)",size7:"var(--_1dwurlba)",size8:"var(--_1dwurlbb)",size9:"var(--_1dwurlbc)",size10:"var(--_1dwurlbd)",size11:"var(--_1dwurlbe)",xs:"var(--_1dwurlbf)",sm:"var(--_1dwurlbg)",md:"var(--_1dwurlbh)",lg:"var(--_1dwurlbi)",xl:"var(--_1dwurlbj)",xxl:"var(--_1dwurlbk)"},animation:{spin:"var(--_1dwurlbl)"},fontSizes:{size0:"var(--_1dwurlbm)",size1:"var(--_1dwurlbn)",size2:"var(--_1dwurlbo)",size3:"var(--_1dwurlbp)",size4:"var(--_1dwurlbq)",size5:"var(--_1dwurlbr)",size6:"var(--_1dwurlbs)",size7:"var(--_1dwurlbt)",size8:"var(--_1dwurlbu)",size9:"var(--_1dwurlbv)"},fontWeights:{weight100:"var(--_1dwurlbw)",weight200:"var(--_1dwurlbx)",weight300:"var(--_1dwurlby)",weight400:"var(--_1dwurlbz)",weight500:"var(--_1dwurlb10)",weight600:"var(--_1dwurlb11)",weight700:"var(--_1dwurlb12)",weight800:"var(--_1dwurlb13)",weight900:"var(--_1dwurlb14)"},fonts:{sans:"var(--_1dwurlb15)",serif:"var(--_1dwurlb16)",mono:"var(--_1dwurlb17)"},letterSpacings:{size0:"var(--_1dwurlb18)",size1:"var(--_1dwurlb19)",size2:"var(--_1dwurlb1a)",size3:"var(--_1dwurlb1b)",size4:"var(--_1dwurlb1c)",size5:"var(--_1dwurlb1d)",size6:"var(--_1dwurlb1e)",size7:"var(--_1dwurlb1f)"},lineHeights:{size0:"var(--_1dwurlb1g)",size1:"var(--_1dwurlb1h)",size2:"var(--_1dwurlb1i)",size3:"var(--_1dwurlb1j)",size4:"var(--_1dwurlb1k)",size5:"var(--_1dwurlb1l)",size6:"var(--_1dwurlb1m)"},breakpoints:{header:"1024px"},colors:{common:{black:"var(--_1dwurlb1n)",white:"var(--_1dwurlb1o)"},primary:{light:"var(--_1dwurlb1p)",main:"var(--_1dwurlb1q)",dark:"var(--_1dwurlb1r)"},secondary:{light:"var(--_1dwurlb1s)",main:"var(--_1dwurlb1t)",dark:"var(--_1dwurlb1u)"},text:{primary:"var(--_1dwurlb1v)",secondary:"var(--_1dwurlb1w)",disabled:"var(--_1dwurlb1x)",hover:"var(--_1dwurlb1y)"},action:{active:"var(--_1dwurlb1z)",hover:"var(--_1dwurlb20)"},shadow:"var(--_1dwurlb21)",border:"var(--_1dwurlb22)",components:{button:{outline:{border:"var(--_1dwurlb23)",text:"var(--_1dwurlb24)",background:"var(--_1dwurlb25)"}},table:{row:{hover:"var(--_1dwurlb26)"}}}}},fh=typeof vn=="object"&&vn&&vn.Object===Object&&vn,hh=typeof self=="object"&&self&&self.Object===Object&&self;fh||hh||Function("return this")();var To=typeof window<"u"?Lr:tr;function Bi(e,t,r,n){const i=Ct(t);To(()=>{i.current=t},[t]),tr(()=>{const s=(r==null?void 0:r.current)??window;if(!(s&&s.addEventListener))return;const o=u=>{i.current(u)};return s.addEventListener(e,o,n),()=>{s.removeEventListener(e,o,n)}},[e,r,n])}function qu(e){const t=Ct(()=>{throw new Error("Cannot call an event handler while rendering.")});return To(()=>{t.current=e},[e]),yr((...r)=>t.current(...r),[t])}var ph=typeof window>"u";function Co(e,t){const r=typeof t=="boolean"?t:(t==null?void 0:t.defaultValue)??!1,n=typeof t=="boolean"?void 0:(t==null?void 0:t.initializeWithValue)??void 0,i=c=>ph?r:window.matchMedia(c).matches,[s,o]=Ke(()=>n?i(e):r);function u(){o(i(e))}return To(()=>{const c=window.matchMedia(e);return u(),c.addListener?c.addListener(u):c.addEventListener("change",u),()=>{c.removeListener?c.removeListener(u):c.removeEventListener("change",u)}},[e]),s}function dh(){const e=Ct(!1);return tr(()=>(e.current=!0,()=>{e.current=!1}),[]),yr(()=>e.current,[])}var Wl={width:void 0,height:void 0};function Hu(e){const{ref:t,box:r="content-box"}=e,[{width:n,height:i},s]=Ke(Wl),o=dh(),u=Ct({...Wl}),c=Ct(void 0);return c.current=e==null?void 0:e.onResize,tr(()=>{if(!(t!=null&&t.current)||typeof window>"u"||!("ResizeObserver"in window))return;const l=new ResizeObserver(([h])=>{const f=r==="border-box"?"borderBoxSize":r==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",m=Ul(h,f,"inlineSize"),_=Ul(h,f,"blockSize");if(u.current.width!==m||u.current.height!==_){const k={width:m,height:_};u.current.width=m,u.current.height=_,c!=null&&c.current?c.current(k):o()&&s(k)}});return l.observe(t.current,{box:r}),()=>{l.disconnect()}},[r,t,o]),{width:n,height:i}}function Ul(e,t,r){return e[t]?Array.isArray(e[t])?e[t][0][r]:e[t][r]:t==="contentBoxSize"?e.contentRect[r==="inlineSize"?"width":"height"]:void 0}var Gl=typeof window>"u";function mh(e,t,r={}){const{initializeWithValue:n=!0}=r,i=yr(f=>r.serializer?r.serializer(f):JSON.stringify(f),[r]),s=yr(f=>{if(r.deserializer)return r.deserializer(f);if(f==="undefined")return;const m=t instanceof Function?t():t;let _;try{_=JSON.parse(f)}catch(b){return console.error("Error parsing JSON:",b),m}return _},[r,t]),o=yr(()=>{const f=t instanceof Function?t():t;if(Gl)return f;try{const m=window.sessionStorage.getItem(e);return m?s(m):f}catch(m){return console.warn(`Error reading sessionStorage key “${e}”:`,m),f}},[t,e,s]),[u,c]=Ke(()=>n?o():t instanceof Function?t():t),l=qu(f=>{Gl&&console.warn(`Tried setting sessionStorage key “${e}” even though environment is not a client`);try{const m=f instanceof Function?f(o()):f;window.sessionStorage.setItem(e,i(m)),c(m),window.dispatchEvent(new StorageEvent("session-storage",{key:e}))}catch(m){console.warn(`Error setting sessionStorage key “${e}”:`,m)}});tr(()=>{c(o())},[e]);const h=yr(f=>{f!=null&&f.key&&f.key!==e||c(o())},[e,o]);return Bi("storage",h),Bi("session-storage",h),[u,l]}const Iu=ai({});function _h({children:e}){const t=Co("(prefers-color-scheme: dark)"),[r,n]=mh("theme",void 0),i={theme:s(),themeClassName:s()==="light"?ch:uh,setTheme:n};function s(){return r||(t?"dark":"light")}return P(Iu.Provider,{value:i,children:e})}function An(){const e=Pn(Iu);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}const Vu=ai(void 0);function vh({children:e}){const[t,r]=Ke(),n={timeRange:t,setTimeRange:r};return P(Vu.Provider,{value:n,children:e})}function Eo(){const e=Pn(Vu);if(e===void 0)throw new Error("useTimeRange must be used within a TimeRangeProvider");return e}var gh={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},yh={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},bh={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},wh={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},Cs={black:"#000000",white:"#ffffff"},xh={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},kh={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},Sh={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},Th={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Wu={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Ch={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},Eh={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Oh={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},Ph={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},Kl={50:"#ffffff",100:"#D6DCFF",200:"#CED4EF",300:"#C2CAEF",400:"#B6C0EF",500:"#AAB6EF",600:"#3f486b",700:"#394160",800:"#2c324b",900:"#1F2537"},Ah={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Mh={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},Rh={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Nh={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Dh={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},Lh={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};const Ci={red:Nh,pink:Mh,purple:Rh,deepPurple:Sh,indigo:Ch,blue:yh,lightBlue:Eh,cyan:xh,teal:Dh,green:Th,lightGreen:Oh,lime:Ph,yellow:Lh,amber:gh,orange:Ah,deepOrange:kh,brown:wh,grey:Wu,blueGrey:bh},Fh=["grey","teal","blue","purple","indigo","orange","pink","green","cyan","amber","lime","brown","lightGreen","red","deepPurple","lightBlue","yellow","deepOrange","blueGrey"],Uu=e=>Fh.map(t=>({stroke:e=="dark"?Ci[t][500]:Ci[t][800],fill:(e=="dark"?Ci[t][300]:Ci[t][600])+"20"})),zh=e=>Object.entries(e).reduce((t,[r,n])=>n===void 0?t:{...t,[r]:n},{}),Bh=(e,t)=>Object.entries(t).reduce((r,[n,i])=>(e.includes(n)&&(r[n]=i),r),{}),$h=(e,t)=>({...e,...t}),jh=e=>(t,r)=>$h(t,Bh(e,r));function Yl(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function qh(e,t){var r=e;for(var n of t){if(!(n in r))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));r=r[n]}return r}function Gu(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n={};for(var i in e){var s=e[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=t(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=Gu(s,t,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function Hh(e,t){var r={};if(typeof t=="object"){var n=e;Gu(t,(u,c)=>{if(u!=null){var l=qh(n,c);r[Yl(l)]=String(u)}})}else{var i=e;for(var s in i){var o=i[s];o!=null&&(r[Yl(s)]=o)}}return Object.defineProperty(r,"toString",{value:function(){return Object.keys(this).map(c=>"".concat(c,":").concat(this[c])).join(";")},writable:!1}),r}const dr=(...e)=>e.filter(Boolean).join(" "),Ih=(e,t)=>Hh(e,zh(t));function Vh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wh(e){var t=Vh(e,"string");return typeof t=="symbol"?t:String(t)}function Uh(e,t,r){return t=Wh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Es(e){for(var t=1;tfunction(){for(var t=arguments.length,r=new Array(t),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),u=c=>{var l=[],h={},f=Es({},c),m=!1;for(var _ of o){var b=c[_];if(b!=null){var k=i[_];m=!0;for(var S of k.mappings)h[S]=b,f[S]==null&&delete f[S]}}var E=m?Es(Es({},h),f):c,T=function(){var F=E[L],M=i[L];try{if(M.mappings)return 1;if(typeof F=="string"||typeof F=="number")l.push(M.values[F].defaultClass);else if(Array.isArray(F))for(var z=0;ze,ci=function(){return Gh(Kh)(...arguments)},Yh="wy7gkc15",Zh={flexGrow:"var(--wy7gkc10)",flexShrink:"var(--wy7gkc11)",flexBasis:"var(--wy7gkc12)",height:"var(--wy7gkc13)",width:"var(--wy7gkc14)"},Jh=ci({conditions:void 0,styles:{flexDirection:{values:{row:{defaultClass:"wy7gkc0"},column:{defaultClass:"wy7gkc1"}}},flexWrap:{values:{nowrap:{defaultClass:"wy7gkc2"},wrap:{defaultClass:"wy7gkc3"},"wrap-reverse":{defaultClass:"wy7gkc4"}}},alignItems:{values:{"flex-start":{defaultClass:"wy7gkc5"},"flex-end":{defaultClass:"wy7gkc6"},stretch:{defaultClass:"wy7gkc7"},center:{defaultClass:"wy7gkc8"},baseline:{defaultClass:"wy7gkc9"},start:{defaultClass:"wy7gkca"},end:{defaultClass:"wy7gkcb"},"self-start":{defaultClass:"wy7gkcc"},"self-end":{defaultClass:"wy7gkcd"}}},justifyContent:{values:{"flex-start":{defaultClass:"wy7gkce"},"flex-end":{defaultClass:"wy7gkcf"},start:{defaultClass:"wy7gkcg"},end:{defaultClass:"wy7gkch"},left:{defaultClass:"wy7gkci"},right:{defaultClass:"wy7gkcj"},center:{defaultClass:"wy7gkck"},"space-between":{defaultClass:"wy7gkcl"},"space-around":{defaultClass:"wy7gkcm"},"space-evenly":{defaultClass:"wy7gkcn"}}},gap:{values:{0:{defaultClass:"wy7gkco"},1:{defaultClass:"wy7gkcp"},2:{defaultClass:"wy7gkcq"},3:{defaultClass:"wy7gkcr"},4:{defaultClass:"wy7gkcs"},5:{defaultClass:"wy7gkct"}}},padding:{values:{0:{defaultClass:"wy7gkcu"},1:{defaultClass:"wy7gkcv"},2:{defaultClass:"wy7gkcw"},3:{defaultClass:"wy7gkcx"},4:{defaultClass:"wy7gkcy"},5:{defaultClass:"wy7gkcz"}}}}});function Qh({as:e="div",align:t,basis:r,children:n,className:i,direction:s,gap:o=3,grow:u,height:c,justify:l,padding:h,shrink:f,width:m,wrap:_,...b},k){const S=Jh({alignItems:t,flexDirection:s,flexWrap:_,gap:o,justifyContent:l,padding:h}),E=dr(Yh,S,i),T=Ih(Zh,{flexBasis:r,flexGrow:u,flexShrink:f,height:c,width:m});return P(e,{ref:k,className:E,style:T,...b,children:n})}const Je=hr(Qh);var Xh={fill:"_17y8ldl2 _17y8ldl1 _17y8ldl0",outline:"_17y8ldl3 _17y8ldl1 _17y8ldl0",text:"_17y8ldl0"};const e0=({as:e="button",children:t,className:r,variant:n="fill",...i},s)=>P(e,{ref:s,className:dr(Xh[n],r),...i,children:t}),fi=hr(e0),t0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},le("rect",{fill:"none",height:24,width:24}),le("path",{d:"M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36c-0.98,1.37-2.58,2.26-4.4,2.26 c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})),r0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},le("path",{d:"M0 0h24v24H0z",fill:"none"}),le("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"})),n0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},le("path",{d:"M0 0h24v24H0z",fill:"none"}),le("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),i0=e=>le("svg",{fill:"currentColor",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24px",height:"24px",viewBox:"796 796 200 200",enableBackground:"new 796 796 200 200",xmlSpace:"preserve",...e},le("g",null,le("path",{d:"M939.741,830.286c0.203-1.198-0.133-2.426-0.918-3.354s-1.938-1.461-3.153-1.461h-79.338c-1.214,0-2.365,0.536-3.149,1.463 c-0.784,0.928-1.124,2.155-0.92,3.352c2.866,16.875,12.069,32.797,25.945,42.713c7.737,5.529,13.827,8.003,17.793,8.003 c3.965,0,10.055-2.474,17.793-8.003C927.67,863.083,936.874,847.162,939.741,830.286z"}),le("path",{d:"M966.478,980.009h-5.074v-11.396c0-23.987-13.375-48.914-35.775-66.679l-7.485-5.936l7.485-5.934 c22.4-17.762,35.775-42.688,35.775-66.678v-11.396h5.074c4.416,0,7.996-3.58,7.996-7.995c0-4.416-3.58-7.996-7.996-7.996H825.521 c-4.415,0-7.995,3.58-7.995,7.996c0,4.415,3.58,7.995,7.995,7.995h5.077v9.202c0,27.228,13.175,53.007,35.243,68.962l8.085,5.843 l-8.085,5.847c-22.068,15.952-35.243,41.732-35.243,68.962v9.202h-5.077c-4.415,0-7.995,3.58-7.995,7.996 c0,4.415,3.58,7.995,7.995,7.995h140.956c4.416,0,7.996-3.58,7.996-7.995C974.474,983.589,970.894,980.009,966.478,980.009z M842.592,970.807c0-23.392,11.318-45.538,30.277-59.242l8.429-6.097c3.03-2.19,4.839-5.729,4.839-9.47 c0-3.739-1.809-7.279-4.84-9.471l-8.429-6.091c-18.958-13.707-30.276-35.853-30.276-59.243v-3.349c0-3.232,2.62-5.853,5.853-5.853 h95.112c3.232,0,5.854,2.621,5.854,5.853v5.543c0,20.36-11.676,41.774-31.232,57.279l-7.792,6.177 c-2.811,2.232-4.422,5.568-4.422,9.155c0,3.588,1.611,6.926,4.425,9.157l7.788,6.177c19.558,15.508,31.233,36.921,31.233,57.28 v5.544c0,3.232-2.621,5.854-5.854,5.854h-95.112c-3.232,0-5.853-2.621-5.853-5.854V970.807z"}))),s0=e=>le("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le("path",{d:"M12 11V16M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),le("circle",{cx:12,cy:7.5,r:1,fill:"currentColor"})),o0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},le("rect",{fill:"none",height:24,width:24}),le("path",{d:"M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})),l0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",width:37,height:34,viewBox:"0 0 37 34",fill:"currentColor",...e},le("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9129 12.4547L29.0217 0L36.6667 33.1967H0L12.2687 6.86803L19.9129 12.4547ZM15.1741 24.4166L17.3529 27.4205L19.6915 27.4198L17.1351 23.8957L19.3864 20.7907L17.8567 19.6768L15.1741 23.3764V17.7248L13.1575 16.2575V27.4205H15.1741V24.4166ZM20.0105 24.1067C20.0105 26.0056 21.5468 27.5452 23.4425 27.5452C25.3396 27.5452 26.8759 26.0056 26.8759 24.1075C26.8746 23.2903 26.5844 22.5003 26.0573 21.8786C25.5301 21.2569 24.8003 20.8441 23.9983 20.714L25.6403 18.45L24.1105 17.3361L20.6675 22.0832C20.2395 22.6699 20.0093 23.379 20.0105 24.1067ZM24.9179 24.1067C24.9179 24.9226 24.2579 25.5843 23.4432 25.5843C23.2499 25.5848 23.0583 25.547 22.8795 25.473C22.7007 25.399 22.5382 25.2903 22.4011 25.153C22.2641 25.0158 22.1553 24.8528 22.081 24.6733C22.0066 24.4937 21.9681 24.3012 21.9677 24.1067C21.9677 23.2908 22.6277 22.6291 23.4432 22.6291C24.2572 22.6291 24.9179 23.2908 24.9179 24.1067Z",fill:"#7D64FF"})),a0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"currentColor",...e},le("path",{d:"M12 2C12 0.89544 11.1046 0 10 0C8.8954 0 8 0.89544 8 2C8 3.10456 8.8954 4 10 4C11.1046 4 12 3.10456 12 2Z",fill:"currentColor"}),le("path",{d:"M12 9.33337C12 8.22881 11.1046 7.33337 10 7.33337C8.8954 7.33337 8 8.22881 8 9.33337C8 10.4379 8.8954 11.3334 10 11.3334C11.1046 11.3334 12 10.4379 12 9.33337Z",fill:"currentColor"}),le("path",{d:"M12 16.6666C12 15.5621 11.1046 14.6666 10 14.6666C8.8954 14.6666 8 15.5621 8 16.6666C8 17.7712 8.8954 18.6666 10 18.6666C11.1046 18.6666 12 17.7712 12 16.6666Z",fill:"currentColor"})),u0=e=>le("svg",{width:"24px",height:"24px",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},le("g",{id:"Page-1",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},le("g",{id:"add",fill:"currentColor",transform:"translate(42.666667, 42.666667)"},le("path",{d:"M291.76704,163.504 C291.76704,177.01952 288.33216,188.82176 281.479253,198.90112 C275.828267,207.371093 266.358187,216.549547 253.042987,226.434987 C245.378987,231.682347 240.331947,236.618667 237.916587,241.257813 C234.87744,246.90624 233.376213,255.371093 233.376213,266.666667 L190.710827,266.666667 C190.710827,249.530027 192.53504,237.027413 196.165333,229.162667 C200.394453,219.679573 209.571627,210.098773 223.686187,200.42048 C230.350293,195.374933 235.188693,190.2368 238.214827,184.994773 C241.839787,179.143253 243.664,172.49216 243.664,165.028693 C243.664,153.13024 240.125013,144.26304 233.070293,138.404907 C227.4336,134.177067 220.56768,132.059947 212.501333,132.059947 C199.39328,132.059947 189.911467,136.398507 184.065067,145.069013 C179.829333,151.518293 177.7056,159.787733 177.7056,169.868587 L177.7056,170.173227 L132.34368,170.173227 C132.34368,143.751253 140.703147,123.790507 157.43488,110.274773 C171.554773,98.9922133 189.007787,93.3346133 209.77344,93.3346133 C227.933653,93.3346133 243.865813,96.86848 257.571627,103.9232 C280.37504,115.62624 291.76704,135.494827 291.76704,163.504 Z M426.666667,213.333333 C426.666667,331.153707 331.153707,426.666667 213.333333,426.666667 C95.51296,426.666667 3.55271368e-14,331.153707 3.55271368e-14,213.333333 C3.55271368e-14,95.51168 95.51296,3.55271368e-14 213.333333,3.55271368e-14 C331.153707,3.55271368e-14 426.666667,95.51168 426.666667,213.333333 Z M384,213.333333 C384,119.226667 307.43872,42.6666667 213.333333,42.6666667 C119.227947,42.6666667 42.6666667,119.226667 42.6666667,213.333333 C42.6666667,307.43872 119.227947,384 213.333333,384 C307.43872,384 384,307.43872 384,213.333333 Z M213.332053,282.666667 C198.60416,282.666667 186.665387,294.60544 186.665387,309.333333 C186.665387,324.061227 198.60416,336 213.332053,336 C228.059947,336 239.99872,324.061227 239.99872,309.333333 C239.99872,294.60544 228.059947,282.666667 213.332053,282.666667 Z",id:"Shape"})))),c0=e=>le("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:16,height:16,fill:"currentColor",...e},le("path",{d:"M12,2A10,10,0,0,0,5.12,4.77V3a1,1,0,0,0-2,0V7.5a1,1,0,0,0,1,1H8.62a1,1,0,0,0,0-2H6.22A8,8,0,1,1,4,12a1,1,0,0,0-2,0A10,10,0,1,0,12,2Zm0,6a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h2a1,1,0,0,0,0-2H13V9A1,1,0,0,0,12,8Z"})),f0=e=>le("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"}),le("path",{d:"M12 22C17.5228 22 22 17.5228 22 12H19C19 15.866 15.866 19 12 19V22Z",fill:"currentColor"}),le("path",{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"})),h0=e=>le("svg",{width:"24px",height:"24px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"bi bi-stopwatch",...e},le("path",{d:"M8.5 5.6a.5.5 0 1 0-1 0v2.9h-3a.5.5 0 0 0 0 1H8a.5.5 0 0 0 .5-.5V5.6z"}),le("path",{d:"M6.5 1A.5.5 0 0 1 7 .5h2a.5.5 0 0 1 0 1v.57c1.36.196 2.594.78 3.584 1.64a.715.715 0 0 1 .012-.013l.354-.354-.354-.353a.5.5 0 0 1 .707-.708l1.414 1.415a.5.5 0 1 1-.707.707l-.353-.354-.354.354a.512.512 0 0 1-.013.012A7 7 0 1 1 7 2.071V1.5a.5.5 0 0 1-.5-.5zM8 3a6 6 0 1 0 .001 12A6 6 0 0 0 8 3z"}));function p0({className:e,name:t,title:r,...n},i){const s=d0[t];return P("span",{ref:i,children:P(s,{"aria-hidden":"true",className:e,title:r,...n})})}const d0={"chevron-down":n0,"chevron-up":r0,"hour-glass":i0,info:s0,options:a0,logo:l0,moon:t0,question:u0,"rewind-time":c0,spinner:f0,"stop-watch":h0,sun:o0},er=hr(p0),Ku=()=>{const{timeRange:e,setTimeRange:t}=Eo();return e?P(fi,{variant:"outline",onClick:()=>t(void 0),children:P(Je,{align:"center",gap:2,children:[P(er,{name:"rewind-time"}),P("span",{children:"Reset"})]})}):null};var m0="_6j0qom0";const _0=()=>{const e=Co(`(max-width: ${ju.breakpoints.header})`),{timeRange:t}=Eo();return!t||!e?null:P("footer",{className:m0,children:P(Ku,{})})};var v0="_17unuvp0";const g0=({className:e,...t})=>P("div",{className:dr(v0,e),...t});var Jl=function(t){return t.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},Ql=typeof window<"u"&&window.document&&window.document.createElement?Lr:tr,St="top",Vt="bottom",Wt="right",Tt="left",Oo="auto",hi=[St,Vt,Wt,Tt],wn="start",ni="end",y0="clippingParents",Yu="viewport",In="popper",b0="reference",Xl=hi.reduce(function(e,t){return e.concat([t+"-"+wn,t+"-"+ni])},[]),Zu=[].concat(hi,[Oo]).reduce(function(e,t){return e.concat([t,t+"-"+wn,t+"-"+ni])},[]),w0="beforeRead",x0="read",k0="afterRead",S0="beforeMain",T0="main",C0="afterMain",E0="beforeWrite",O0="write",P0="afterWrite",A0=[w0,x0,k0,S0,T0,C0,E0,O0,P0];function pr(e){return e?(e.nodeName||"").toLowerCase():null}function Nt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Kr(e){var t=Nt(e).Element;return e instanceof t||e instanceof Element}function It(e){var t=Nt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Po(e){if(typeof ShadowRoot>"u")return!1;var t=Nt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function M0(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},s=t.elements[r];!It(s)||!pr(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(o){var u=i[o];u===!1?s.removeAttribute(o):s.setAttribute(o,u===!0?"":u)}))})}function R0(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],s=t.attributes[n]||{},o=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),u=o.reduce(function(c,l){return c[l]="",c},{});!It(i)||!pr(i)||(Object.assign(i.style,u),Object.keys(s).forEach(function(c){i.removeAttribute(c)}))})}}const N0={name:"applyStyles",enabled:!0,phase:"write",fn:M0,effect:R0,requires:["computeStyles"]};function fr(e){return e.split("-")[0]}var Ur=Math.max,$i=Math.min,xn=Math.round;function Vs(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ju(){return!/^((?!chrome|android).)*safari/i.test(Vs())}function kn(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,s=1;t&&It(e)&&(i=e.offsetWidth>0&&xn(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&xn(n.height)/e.offsetHeight||1);var o=Kr(e)?Nt(e):window,u=o.visualViewport,c=!Ju()&&r,l=(n.left+(c&&u?u.offsetLeft:0))/i,h=(n.top+(c&&u?u.offsetTop:0))/s,f=n.width/i,m=n.height/s;return{width:f,height:m,top:h,right:l+f,bottom:h+m,left:l,x:l,y:h}}function Ao(e){var t=kn(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Qu(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Po(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Sr(e){return Nt(e).getComputedStyle(e)}function D0(e){return["table","td","th"].indexOf(pr(e))>=0}function Fr(e){return((Kr(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wi(e){return pr(e)==="html"?e:e.assignedSlot||e.parentNode||(Po(e)?e.host:null)||Fr(e)}function ea(e){return!It(e)||Sr(e).position==="fixed"?null:e.offsetParent}function L0(e){var t=/firefox/i.test(Vs()),r=/Trident/i.test(Vs());if(r&&It(e)){var n=Sr(e);if(n.position==="fixed")return null}var i=Wi(e);for(Po(i)&&(i=i.host);It(i)&&["html","body"].indexOf(pr(i))<0;){var s=Sr(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function pi(e){for(var t=Nt(e),r=ea(e);r&&D0(r)&&Sr(r).position==="static";)r=ea(r);return r&&(pr(r)==="html"||pr(r)==="body"&&Sr(r).position==="static")?t:r||L0(e)||t}function Mo(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jn(e,t,r){return Ur(e,$i(t,r))}function F0(e,t,r){var n=Jn(e,t,r);return n>r?r:n}function Xu(){return{top:0,right:0,bottom:0,left:0}}function ec(e){return Object.assign({},Xu(),e)}function tc(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var z0=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,ec(typeof t!="number"?t:tc(t,hi))};function B0(e){var t,r=e.state,n=e.name,i=e.options,s=r.elements.arrow,o=r.modifiersData.popperOffsets,u=fr(r.placement),c=Mo(u),l=[Tt,Wt].indexOf(u)>=0,h=l?"height":"width";if(!(!s||!o)){var f=z0(i.padding,r),m=Ao(s),_=c==="y"?St:Tt,b=c==="y"?Vt:Wt,k=r.rects.reference[h]+r.rects.reference[c]-o[c]-r.rects.popper[h],S=o[c]-r.rects.reference[c],E=pi(s),T=E?c==="y"?E.clientHeight||0:E.clientWidth||0:0,L=k/2-S/2,O=f[_],F=T-m[h]-f[b],M=T/2-m[h]/2+L,z=Jn(O,M,F),q=c;r.modifiersData[n]=(t={},t[q]=z,t.centerOffset=z-M,t)}}function $0(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Qu(t.elements.popper,i)&&(t.elements.arrow=i))}const j0={name:"arrow",enabled:!0,phase:"main",fn:B0,effect:$0,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sn(e){return e.split("-")[1]}var q0={top:"auto",right:"auto",bottom:"auto",left:"auto"};function H0(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:xn(r*i)/i||0,y:xn(n*i)/i||0}}function ta(e){var t,r=e.popper,n=e.popperRect,i=e.placement,s=e.variation,o=e.offsets,u=e.position,c=e.gpuAcceleration,l=e.adaptive,h=e.roundOffsets,f=e.isFixed,m=o.x,_=m===void 0?0:m,b=o.y,k=b===void 0?0:b,S=typeof h=="function"?h({x:_,y:k}):{x:_,y:k};_=S.x,k=S.y;var E=o.hasOwnProperty("x"),T=o.hasOwnProperty("y"),L=Tt,O=St,F=window;if(l){var M=pi(r),z="clientHeight",q="clientWidth";if(M===Nt(r)&&(M=Fr(r),Sr(M).position!=="static"&&u==="absolute"&&(z="scrollHeight",q="scrollWidth")),M=M,i===St||(i===Tt||i===Wt)&&s===ni){O=Vt;var $=f&&M===F&&F.visualViewport?F.visualViewport.height:M[z];k-=$-n.height,k*=c?1:-1}if(i===Tt||(i===St||i===Vt)&&s===ni){L=Wt;var j=f&&M===F&&F.visualViewport?F.visualViewport.width:M[q];_-=j-n.width,_*=c?1:-1}}var R=Object.assign({position:u},l&&q0),W=h===!0?H0({x:_,y:k},Nt(r)):{x:_,y:k};if(_=W.x,k=W.y,c){var H;return Object.assign({},R,(H={},H[O]=T?"0":"",H[L]=E?"0":"",H.transform=(F.devicePixelRatio||1)<=1?"translate("+_+"px, "+k+"px)":"translate3d("+_+"px, "+k+"px, 0)",H))}return Object.assign({},R,(t={},t[O]=T?k+"px":"",t[L]=E?_+"px":"",t.transform="",t))}function I0(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,s=r.adaptive,o=s===void 0?!0:s,u=r.roundOffsets,c=u===void 0?!0:u,l={placement:fr(t.placement),variation:Sn(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ta(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ta(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const V0={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:I0,data:{}};var Ei={passive:!0};function W0(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,s=i===void 0?!0:i,o=n.resize,u=o===void 0?!0:o,c=Nt(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&l.forEach(function(h){h.addEventListener("scroll",r.update,Ei)}),u&&c.addEventListener("resize",r.update,Ei),function(){s&&l.forEach(function(h){h.removeEventListener("scroll",r.update,Ei)}),u&&c.removeEventListener("resize",r.update,Ei)}}const U0={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:W0,data:{}};var G0={left:"right",right:"left",bottom:"top",top:"bottom"};function Ri(e){return e.replace(/left|right|bottom|top/g,function(t){return G0[t]})}var K0={start:"end",end:"start"};function ra(e){return e.replace(/start|end/g,function(t){return K0[t]})}function Ro(e){var t=Nt(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function No(e){return kn(Fr(e)).left+Ro(e).scrollLeft}function Y0(e,t){var r=Nt(e),n=Fr(e),i=r.visualViewport,s=n.clientWidth,o=n.clientHeight,u=0,c=0;if(i){s=i.width,o=i.height;var l=Ju();(l||!l&&t==="fixed")&&(u=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:u+No(e),y:c}}function Z0(e){var t,r=Fr(e),n=Ro(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=Ur(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Ur(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-n.scrollLeft+No(e),c=-n.scrollTop;return Sr(i||r).direction==="rtl"&&(u+=Ur(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:u,y:c}}function Do(e){var t=Sr(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function rc(e){return["html","body","#document"].indexOf(pr(e))>=0?e.ownerDocument.body:It(e)&&Do(e)?e:rc(Wi(e))}function Qn(e,t){var r;t===void 0&&(t=[]);var n=rc(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=Nt(n),o=i?[s].concat(s.visualViewport||[],Do(n)?n:[]):n,u=t.concat(o);return i?u:u.concat(Qn(Wi(o)))}function Ws(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J0(e,t){var r=kn(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function na(e,t,r){return t===Yu?Ws(Y0(e,r)):Kr(t)?J0(t,r):Ws(Z0(Fr(e)))}function Q0(e){var t=Qn(Wi(e)),r=["absolute","fixed"].indexOf(Sr(e).position)>=0,n=r&&It(e)?pi(e):e;return Kr(n)?t.filter(function(i){return Kr(i)&&Qu(i,n)&&pr(i)!=="body"}):[]}function X0(e,t,r,n){var i=t==="clippingParents"?Q0(e):[].concat(t),s=[].concat(i,[r]),o=s[0],u=s.reduce(function(c,l){var h=na(e,l,n);return c.top=Ur(h.top,c.top),c.right=$i(h.right,c.right),c.bottom=$i(h.bottom,c.bottom),c.left=Ur(h.left,c.left),c},na(e,o,n));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function nc(e){var t=e.reference,r=e.element,n=e.placement,i=n?fr(n):null,s=n?Sn(n):null,o=t.x+t.width/2-r.width/2,u=t.y+t.height/2-r.height/2,c;switch(i){case St:c={x:o,y:t.y-r.height};break;case Vt:c={x:o,y:t.y+t.height};break;case Wt:c={x:t.x+t.width,y:u};break;case Tt:c={x:t.x-r.width,y:u};break;default:c={x:t.x,y:t.y}}var l=i?Mo(i):null;if(l!=null){var h=l==="y"?"height":"width";switch(s){case wn:c[l]=c[l]-(t[h]/2-r[h]/2);break;case ni:c[l]=c[l]+(t[h]/2-r[h]/2);break}}return c}function ii(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,s=r.strategy,o=s===void 0?e.strategy:s,u=r.boundary,c=u===void 0?y0:u,l=r.rootBoundary,h=l===void 0?Yu:l,f=r.elementContext,m=f===void 0?In:f,_=r.altBoundary,b=_===void 0?!1:_,k=r.padding,S=k===void 0?0:k,E=ec(typeof S!="number"?S:tc(S,hi)),T=m===In?b0:In,L=e.rects.popper,O=e.elements[b?T:m],F=X0(Kr(O)?O:O.contextElement||Fr(e.elements.popper),c,h,o),M=kn(e.elements.reference),z=nc({reference:M,element:L,strategy:"absolute",placement:i}),q=Ws(Object.assign({},L,z)),$=m===In?q:M,j={top:F.top-$.top+E.top,bottom:$.bottom-F.bottom+E.bottom,left:F.left-$.left+E.left,right:$.right-F.right+E.right},R=e.modifiersData.offset;if(m===In&&R){var W=R[i];Object.keys(j).forEach(function(H){var Q=[Wt,Vt].indexOf(H)>=0?1:-1,U=[St,Vt].indexOf(H)>=0?"y":"x";j[H]+=W[U]*Q})}return j}function ep(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,s=r.rootBoundary,o=r.padding,u=r.flipVariations,c=r.allowedAutoPlacements,l=c===void 0?Zu:c,h=Sn(n),f=h?u?Xl:Xl.filter(function(b){return Sn(b)===h}):hi,m=f.filter(function(b){return l.indexOf(b)>=0});m.length===0&&(m=f);var _=m.reduce(function(b,k){return b[k]=ii(e,{placement:k,boundary:i,rootBoundary:s,padding:o})[fr(k)],b},{});return Object.keys(_).sort(function(b,k){return _[b]-_[k]})}function tp(e){if(fr(e)===Oo)return[];var t=Ri(e);return[ra(e),t,ra(t)]}function rp(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,s=i===void 0?!0:i,o=r.altAxis,u=o===void 0?!0:o,c=r.fallbackPlacements,l=r.padding,h=r.boundary,f=r.rootBoundary,m=r.altBoundary,_=r.flipVariations,b=_===void 0?!0:_,k=r.allowedAutoPlacements,S=t.options.placement,E=fr(S),T=E===S,L=c||(T||!b?[Ri(S)]:tp(S)),O=[S].concat(L).reduce(function(be,Ce){return be.concat(fr(Ce)===Oo?ep(t,{placement:Ce,boundary:h,rootBoundary:f,padding:l,flipVariations:b,allowedAutoPlacements:k}):Ce)},[]),F=t.rects.reference,M=t.rects.popper,z=new Map,q=!0,$=O[0],j=0;j=0,U=Q?"width":"height",ee=ii(t,{placement:R,boundary:h,rootBoundary:f,altBoundary:m,padding:l}),V=Q?H?Wt:Tt:H?Vt:St;F[U]>M[U]&&(V=Ri(V));var je=Ri(V),me=[];if(s&&me.push(ee[W]<=0),u&&me.push(ee[V]<=0,ee[je]<=0),me.every(function(be){return be})){$=R,q=!1;break}z.set(R,me)}if(q)for(var fe=b?3:1,_e=function(Ce){var ge=O.find(function(pe){var De=z.get(pe);if(De)return De.slice(0,Ce).every(function(Le){return Le})});if(ge)return $=ge,"break"},se=fe;se>0;se--){var Z=_e(se);if(Z==="break")break}t.placement!==$&&(t.modifiersData[n]._skip=!0,t.placement=$,t.reset=!0)}}const np={name:"flip",enabled:!0,phase:"main",fn:rp,requiresIfExists:["offset"],data:{_skip:!1}};function ia(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function sa(e){return[St,Wt,Vt,Tt].some(function(t){return e[t]>=0})}function ip(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,o=ii(t,{elementContext:"reference"}),u=ii(t,{altBoundary:!0}),c=ia(o,n),l=ia(u,i,s),h=sa(c),f=sa(l);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:h,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":f})}const sp={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ip};function op(e,t,r){var n=fr(e),i=[Tt,St].indexOf(n)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,o=s[0],u=s[1];return o=o||0,u=(u||0)*i,[Tt,Wt].indexOf(n)>=0?{x:u,y:o}:{x:o,y:u}}function lp(e){var t=e.state,r=e.options,n=e.name,i=r.offset,s=i===void 0?[0,0]:i,o=Zu.reduce(function(h,f){return h[f]=op(f,t.rects,s),h},{}),u=o[t.placement],c=u.x,l=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=o}const ap={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lp};function up(e){var t=e.state,r=e.name;t.modifiersData[r]=nc({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const cp={name:"popperOffsets",enabled:!0,phase:"read",fn:up,data:{}};function fp(e){return e==="x"?"y":"x"}function hp(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,s=i===void 0?!0:i,o=r.altAxis,u=o===void 0?!1:o,c=r.boundary,l=r.rootBoundary,h=r.altBoundary,f=r.padding,m=r.tether,_=m===void 0?!0:m,b=r.tetherOffset,k=b===void 0?0:b,S=ii(t,{boundary:c,rootBoundary:l,padding:f,altBoundary:h}),E=fr(t.placement),T=Sn(t.placement),L=!T,O=Mo(E),F=fp(O),M=t.modifiersData.popperOffsets,z=t.rects.reference,q=t.rects.popper,$=typeof k=="function"?k(Object.assign({},t.rects,{placement:t.placement})):k,j=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(M){if(s){var H,Q=O==="y"?St:Tt,U=O==="y"?Vt:Wt,ee=O==="y"?"height":"width",V=M[O],je=V+S[Q],me=V-S[U],fe=_?-q[ee]/2:0,_e=T===wn?z[ee]:q[ee],se=T===wn?-q[ee]:-z[ee],Z=t.elements.arrow,be=_&&Z?Ao(Z):{width:0,height:0},Ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Xu(),ge=Ce[Q],pe=Ce[U],De=Jn(0,z[ee],be[ee]),Le=L?z[ee]/2-fe-De-ge-j.mainAxis:_e-De-ge-j.mainAxis,ke=L?-z[ee]/2+fe+De+pe+j.mainAxis:se+De+pe+j.mainAxis,tt=t.elements.arrow&&pi(t.elements.arrow),bt=tt?O==="y"?tt.clientTop||0:tt.clientLeft||0:0,ut=(H=R==null?void 0:R[O])!=null?H:0,Lt=V+Le-ut-bt,rr=V+ke-ut,Ft=Jn(_?$i(je,Lt):je,V,_?Ur(me,rr):me);M[O]=Ft,W[O]=Ft-V}if(u){var nr,ir=O==="x"?St:Tt,ne=O==="x"?Vt:Wt,Ae=M[F],wt=F==="y"?"height":"width",dt=Ae+S[ir],zt=Ae-S[ne],ae=[St,Tt].indexOf(E)!==-1,G=(nr=R==null?void 0:R[F])!=null?nr:0,d=ae?dt:Ae-z[wt]-q[wt]-G+j.altAxis,y=ae?Ae+z[wt]+q[wt]-G-j.altAxis:zt,w=_&&ae?F0(d,Ae,y):Jn(_?d:dt,Ae,_?y:zt);M[F]=w,W[F]=w-Ae}t.modifiersData[n]=W}}const pp={name:"preventOverflow",enabled:!0,phase:"main",fn:hp,requiresIfExists:["offset"]};function dp(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function mp(e){return e===Nt(e)||!It(e)?Ro(e):dp(e)}function _p(e){var t=e.getBoundingClientRect(),r=xn(t.width)/e.offsetWidth||1,n=xn(t.height)/e.offsetHeight||1;return r!==1||n!==1}function vp(e,t,r){r===void 0&&(r=!1);var n=It(t),i=It(t)&&_p(t),s=Fr(t),o=kn(e,i,r),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((pr(t)!=="body"||Do(s))&&(u=mp(t)),It(t)?(c=kn(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=No(s))),{x:o.left+u.scrollLeft-c.x,y:o.top+u.scrollTop-c.y,width:o.width,height:o.height}}function gp(e){var t=new Map,r=new Set,n=[];e.forEach(function(s){t.set(s.name,s)});function i(s){r.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(u){if(!r.has(u)){var c=t.get(u);c&&i(c)}}),n.push(s)}return e.forEach(function(s){r.has(s.name)||i(s)}),n}function yp(e){var t=gp(e);return A0.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function bp(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function wp(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var oa={placement:"bottom",modifiers:[],strategy:"absolute"};function la(){for(var e=arguments.length,t=new Array(e),r=0;re===null&&t===null?null:r=>{aa(e,r),aa(t,r)},[e,t])}const Np=({children:e,onClickAway:t})=>{const r=Ct(document),n=Ct(null),i=Rp(n,e.ref),s=qu(o=>{if(!n.current)throw new Error("ClickAwayListener: missing ref");const u=!r.current.contains(o.target)||n.current.contains(o.target);o.type==="keyup"&&"key"in o&&(!["Escape","Tab"].includes(o.key)||o.key==="Tab"&&u)||o.type==="mouseup"&&u||t(o)});return Bi("mouseup",s,r),Bi("keyup",s,r),P(pt,{children:bo(e,{ref:i})})};var Dp="iy2n4g0",Lp={fill:"iy2n4g1",outline:"iy2n4g2",text:"iy2n4g3"};function Fp({className:e,name:t,title:r,variant:n="fill",...i},s){return P(fi,{ref:s,className:dr(Dp,e),variant:n,...i,children:P(er,{className:Lp[n],name:t,title:r})})}const zp=hr(Fp);var Bp="_1sxwks00";function $p({children:e,className:t,...r},n){return P("div",{ref:n,className:dr(Bp,t),...r,children:e})}const Ui=hr($p);var jp="_1x45rmb3",qp={light:"_1x45rmb1 _1x45rmb0",dark:"_1x45rmb2 _1x45rmb0"};function Hp({children:e}){const{theme:t}=An(),[r,n]=Ke(!1),[i,s]=Ke(null),[o,u]=Ke(null),{styles:c,attributes:l}=ic(i,o,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,10]}}]});return P(pt,{children:[P(zp,{ref:s,"aria-expanded":r?"true":"false","aria-label":"Menu",name:"options",variant:"text",onClick:()=>n(!r)}),r&&P(Np,{onClickAway:()=>n(!1),children:P(Ui,{...l.popper,ref:u,className:qp[t],style:c.popper,onMouseLeave:()=>n(!1),children:P(Je,{direction:"column",gap:0,children:e})})})]})}function Ip({children:e,onClick:t}){return P(fi,{variant:"text",onClick:t,children:P(Je,{className:jp,align:"center",gap:2,children:e})})}const Os=Object.assign(Hp,{Item:Ip});var Vp={active:"tz5dd56 tz5dd55",inactive:"tz5dd57 tz5dd55"};ci({conditions:{defaultCondition:"mobile",conditionNames:["mobile","desktop"],responsiveArray:void 0},styles:{display:{values:{none:{conditions:{mobile:"tz5dd51",desktop:"tz5dd52"},defaultClass:"tz5dd51"},block:{conditions:{mobile:"tz5dd53",desktop:"tz5dd54"},defaultClass:"tz5dd53"}}}}});var Wp="tz5dd50";function Up({options:e,value:t,onChange:r}){return P("nav",{className:dr(Wp),children:P(Je,{gap:2,children:e.map((n,i)=>P(Gp,{label:n.title,index:i,value:t,onChange:r},n.id))})})}function Gp({index:e,label:t,value:r,onChange:n,...i}){const s=e===r;return P(fi,{"aria-current":s,className:Vp[s?"active":"inactive"],variant:"text",onClick:()=>n(e),...i,children:t})}var Kp={loading:"_1e0qizf1",default:"_1e0qizf3 _1e0qizf1"},Yp="_1e0qizf4",Zp="_1e0qizf5";const Jp=({children:e,isLoading:t=!1,max:r="100",value:n,...i})=>P("div",{className:Yp,children:[P("progress",{className:Kp[t?"loading":"default"],max:r,value:n,...i}),e?P("div",{className:Zp,children:e}):null]}),Qp=e=>{var t;return(t=e==null?void 0:e.popper)==null?void 0:t["data-popper-placement"]},Xp=e=>e?e.startsWith("top")?"top":e.startsWith("bottom")?"bottom":e.startsWith("right")?"right":"left":"left";var ed={top:"_1lpb9zp4 _1lpb9zp3",bottom:"_1lpb9zp5 _1lpb9zp3",left:"_1lpb9zp6 _1lpb9zp3",right:"_1lpb9zp7 _1lpb9zp3"},td={light:"_1lpb9zp1 _1lpb9zp0",dark:"_1lpb9zp2 _1lpb9zp0"};function Us({children:e,placement:t="bottom-start",title:r}){const[n,i]=Ke(!1),{theme:s}=An(),[o,u]=Ke(null),[c,l]=Ke(null),[h,f]=Ke(null),{styles:m,attributes:_}=ic(c,h,{placement:t,modifiers:[{name:"arrow",options:{element:o}},{name:"offset",options:{offset:[0,5]}}]}),b=Xp(Qp(_));return r?P(pt,{children:[P("div",{ref:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:e}),n&&P("div",{ref:f,className:td[s],style:m.popper,..._.popper,children:[r,P("div",{ref:u,className:ed[b],style:m.arrow})]})]}):e}const ua=e=>e&&new Date(e).getTime(),sc=(e,t)=>e&&new Date(e.getTime()+t),rd=(e,t,r)=>{const n=ua(e)||0,i=ua(t)||0,s=r.getTime()-n,o=i-n;return s/o*100},nd=(e,t)=>{if(e.stop)return 100;const r=e.param.endOffset,n=sc(e.start,r),i=rd(e.start,n,t);return Math.round(i)},oc=(e=0)=>{const t=Math.round(e),r=Math.round(t%60);return t<0?"-":t<60?`${t}s`:r>0?`${Math.round((e-r)/60)}min ${r}s`:`${Math.round(t/60)}min`},id=e=>{const t=e.param.period||0;return oc(t/1e3)},sd=e=>{const t=e.start,r=e.param.endOffset||0,n=e.stop||sc(e.start,r);if(!(!t||!n))return oc((n.getTime()-t.getTime())/1e3)};var od="kfrms71",ld="kfrms73",ad="kfrms70",ud="kfrms74";function cd({config:e,tab:t,onTabChange:r}){const n=Jr(),i=Co(`(max-width: ${ju.breakpoints.header})`),s=!n.stop&&nd(n,new Date);return P(pt,{children:P("header",{className:ad,children:[P(Je,{className:od,align:"center",justify:"space-between",children:[P(Je,{align:"center",gap:4,children:[P(er,{name:"logo"}),P(Up,{options:e.tabs,value:t,onChange:r})]}),P(Je,{align:"center",children:[!i&&P(ca,{tab:t}),P(hd,{})]})]}),s?P(Jp,{value:s}):P(g0,{className:ld}),i&&P(Je,{align:"center",gap:3,justify:"end",padding:3,children:P(ca,{tab:t})})]})})}const fd=()=>{const e=Jr();return P("div",{className:ud,children:P(Je,{align:"center",gap:3,children:[P(Us,{placement:"bottom",title:"Refresh rate",children:P(Je,{align:"center",gap:2,children:[P(er,{name:"stop-watch",width:"12px",height:"12px"}),P("span",{children:id(e)})]})}),P(Us,{placement:"bottom",title:"Duration",children:P(Je,{align:"center",gap:2,children:[P(er,{name:"hour-glass",width:"12px",height:"12px"}),P("span",{children:sd(e)})]})})]})})},ca=({tab:e})=>P(pt,{children:[!(e===2)&&P(Ku,{}),P(fi,{onClick:()=>window.open("../report","k6-report"),children:"Report"}),P(fd,{})]}),hd=()=>{const{theme:e,setTheme:t}=An();function r(){window.open("https://github.com/grafana/k6/blob/master/SUPPORT.md","_blank")}function n(){t(e==="light"?"dark":"light")}return P(Os,{children:[P(Os.Item,{onClick:r,children:[P(er,{name:"question"}),P("span",{children:"Help"})]}),P(Os.Item,{onClick:n,children:[P(er,{name:e==="dark"?"sun":"moon"}),P("span",{children:[e==="dark"?"Light":"Dark"," mode"]})]})]})};var pd="_1isundr0";function dd({children:e,message:t,isLoading:r}){return r?P(Je,{align:"center",justify:"center",children:[P(er,{className:pd,name:"spinner"}),P("h2",{children:t})]}):e}var lc={exports:{}};/*! @preserve + * numeral.js + * version : 2.0.6 + * author : Adam Draper + * license : MIT + * http://adamwdraper.github.com/Numeral-js/ + */(function(e){(function(t,r){e.exports?e.exports=r():t.numeral=r()})(vn,function(){var t,r,n="2.0.6",i={},s={},o={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},u={currentLocale:o.currentLocale,zeroFormat:o.zeroFormat,nullFormat:o.nullFormat,defaultFormat:o.defaultFormat,scalePercentBy100:o.scalePercentBy100};function c(l,h){this._input=l,this._value=h}return t=function(l){var h,f,m,_;if(t.isNumeral(l))h=l.value();else if(l===0||typeof l>"u")h=0;else if(l===null||r.isNaN(l))h=null;else if(typeof l=="string")if(u.zeroFormat&&l===u.zeroFormat)h=0;else if(u.nullFormat&&l===u.nullFormat||!l.replace(/[^0-9]+/g,"").length)h=null;else{for(f in i)if(_=typeof i[f].regexps.unformat=="function"?i[f].regexps.unformat():i[f].regexps.unformat,_&&l.match(_)){m=i[f].unformat;break}m=m||t._.stringToNumber,h=m(l)}else h=Number(l)||null;return new c(l,h)},t.version=n,t.isNumeral=function(l){return l instanceof c},t._=r={numberToFormat:function(l,h,f){var m=s[t.options.currentLocale],_=!1,b=!1,k=0,S="",E=1e12,T=1e9,L=1e6,O=1e3,F="",M=!1,z,q,$,j,R,W,H;if(l=l||0,q=Math.abs(l),t._.includes(h,"(")?(_=!0,h=h.replace(/[\(|\)]/g,"")):(t._.includes(h,"+")||t._.includes(h,"-"))&&(R=t._.includes(h,"+")?h.indexOf("+"):l<0?h.indexOf("-"):-1,h=h.replace(/[\+|\-]/g,"")),t._.includes(h,"a")&&(z=h.match(/a(k|m|b|t)?/),z=z?z[1]:!1,t._.includes(h," a")&&(S=" "),h=h.replace(new RegExp(S+"a[kmbt]?"),""),q>=E&&!z||z==="t"?(S+=m.abbreviations.trillion,l=l/E):q=T&&!z||z==="b"?(S+=m.abbreviations.billion,l=l/T):q=L&&!z||z==="m"?(S+=m.abbreviations.million,l=l/L):(q=O&&!z||z==="k")&&(S+=m.abbreviations.thousand,l=l/O)),t._.includes(h,"[.]")&&(b=!0,h=h.replace("[.]",".")),$=l.toString().split(".")[0],j=h.split(".")[1],W=h.indexOf(","),k=(h.split(".")[0].split(",")[0].match(/0/g)||[]).length,j?(t._.includes(j,"[")?(j=j.replace("]",""),j=j.split("["),F=t._.toFixed(l,j[0].length+j[1].length,f,j[1].length)):F=t._.toFixed(l,j.length,f),$=F.split(".")[0],t._.includes(F,".")?F=m.delimiters.decimal+F.split(".")[1]:F="",b&&Number(F.slice(1))===0&&(F="")):$=t._.toFixed(l,0,f),S&&!z&&Number($)>=1e3&&S!==m.abbreviations.trillion)switch($=String(Number($)/1e3),S){case m.abbreviations.thousand:S=m.abbreviations.million;break;case m.abbreviations.million:S=m.abbreviations.billion;break;case m.abbreviations.billion:S=m.abbreviations.trillion;break}if(t._.includes($,"-")&&($=$.slice(1),M=!0),$.length0;Q--)$="0"+$;return W>-1&&($=$.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),h.indexOf(".")===0&&($=""),H=$+F+(S||""),_?H=(_&&M?"(":"")+H+(_&&M?")":""):R>=0?H=R===0?(M?"-":"+")+H:H+(M?"-":"+"):M&&(H="-"+H),H},stringToNumber:function(l){var h=s[u.currentLocale],f=l,m={thousand:3,million:6,billion:9,trillion:12},_,b,k;if(u.zeroFormat&&l===u.zeroFormat)b=0;else if(u.nullFormat&&l===u.nullFormat||!l.replace(/[^0-9]+/g,"").length)b=null;else{b=1,h.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(h.delimiters.decimal,"."));for(_ in m)if(k=new RegExp("[^a-zA-Z]"+h.abbreviations[_]+"(?:\\)|(\\"+h.currency.symbol+")?(?:\\))?)?$"),f.match(k)){b*=Math.pow(10,m[_]);break}b*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),b*=Number(l)}return b},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,h){return l.indexOf(h)!==-1},insert:function(l,h,f){return l.slice(0,f)+h+l.slice(f)},reduce:function(l,h){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof h!="function")throw new TypeError(h+" is not a function");var f=Object(l),m=f.length>>>0,_=0,b;if(arguments.length===3)b=arguments[2];else{for(;_=m)throw new TypeError("Reduce of empty array with no initial value");b=f[_++]}for(;_m?h:m},1)},toFixed:function(l,h,f,m){var _=l.toString().split("."),b=h-(m||0),k,S,E,T;return _.length===2?k=Math.min(Math.max(_[1].length,b),h):k=b,E=Math.pow(10,k),T=(f(l+"e+"+k)/E).toFixed(k),m>h-k&&(S=new RegExp("\\.?0{1,"+(m-(h-k))+"}$"),T=T.replace(S,"")),T}},t.options=u,t.formats=i,t.locales=s,t.locale=function(l){return l&&(u.currentLocale=l.toLowerCase()),u.currentLocale},t.localeData=function(l){if(!l)return s[u.currentLocale];if(l=l.toLowerCase(),!s[l])throw new Error("Unknown locale : "+l);return s[l]},t.reset=function(){for(var l in o)u[l]=o[l]},t.zeroFormat=function(l){u.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){u.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){u.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,h,f){if(h=h.toLowerCase(),this[l+"s"][h])throw new TypeError(h+" "+l+" already registered.");return this[l+"s"][h]=f,f},t.validate=function(l,h){var f,m,_,b,k,S,E,T;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{E=t.localeData(h)}catch{E=t.localeData(t.locale())}return _=E.currency.symbol,k=E.abbreviations,f=E.delimiters.decimal,E.delimiters.thousands==="."?m="\\.":m=E.delimiters.thousands,T=l.match(/^[^\d]+/),T!==null&&(l=l.substr(1),T[0]!==_)||(T=l.match(/[^\d]+$/),T!==null&&(l=l.slice(0,-1),T[0]!==k.thousand&&T[0]!==k.million&&T[0]!==k.billion&&T[0]!==k.trillion))?!1:(S=new RegExp(m+"{2}"),l.match(/[^\d.,]/g)?!1:(b=l.split(f),b.length>2?!1:b.length<2?!!b[0].match(/^\d+.*\d$/)&&!b[0].match(S):b[0].length===1?!!b[0].match(/^\d+$/)&&!b[0].match(S)&&!!b[1].match(/^\d+$/):!!b[0].match(/^\d+.*\d$/)&&!b[0].match(S)&&!!b[1].match(/^\d+$/)))},t.fn=c.prototype={clone:function(){return t(this)},format:function(l,h){var f=this._value,m=l||u.defaultFormat,_,b,k;if(h=h||Math.round,f===0&&u.zeroFormat!==null)b=u.zeroFormat;else if(f===null&&u.nullFormat!==null)b=u.nullFormat;else{for(_ in i)if(m.match(i[_].regexps.format)){k=i[_].format;break}k=k||t._.numberToFormat,b=k(f,m,h)}return b},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var h=r.correctionFactor.call(null,this._value,l);function f(m,_,b,k){return m+Math.round(h*_)}return this._value=r.reduce([this._value,l],f,0)/h,this},subtract:function(l){var h=r.correctionFactor.call(null,this._value,l);function f(m,_,b,k){return m-Math.round(h*_)}return this._value=r.reduce([l],f,Math.round(this._value*h))/h,this},multiply:function(l){function h(f,m,_,b){var k=r.correctionFactor(f,m);return Math.round(f*k)*Math.round(m*k)/Math.round(k*k)}return this._value=r.reduce([this._value,l],h,1),this},divide:function(l){function h(f,m,_,b){var k=r.correctionFactor(f,m);return Math.round(f*k)/Math.round(m*k)}return this._value=r.reduce([this._value,l],h),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var h=l%10;return~~(l%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,h,f){var m=t._.includes(h," BPS")?" ":"",_;return l=l*1e4,h=h.replace(/\s?BPS/,""),_=t._.numberToFormat(l,h,f),t._.includes(_,")")?(_=_.split(""),_.splice(-1,0,m+"BPS"),_=_.join("")):_=_+m+"BPS",_},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},h={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},f=l.suffixes.concat(h.suffixes.filter(function(_){return l.suffixes.indexOf(_)<0})),m=f.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(_,b,k){var S,E=t._.includes(b,"ib")?h:l,T=t._.includes(b," b")||t._.includes(b," ib")?" ":"",L,O,F;for(b=b.replace(/\s?i?b/,""),L=0;L<=E.suffixes.length;L++)if(O=Math.pow(E.base,L),F=Math.pow(E.base,L+1),_===null||_===0||_>=O&&_0&&(_=_/O);break}return S=t._.numberToFormat(_,b,k),S+T},unformat:function(_){var b=t._.stringToNumber(_),k,S;if(b){for(k=l.suffixes.length-1;k>=0;k--){if(t._.includes(_,l.suffixes[k])){S=Math.pow(l.base,k);break}if(t._.includes(_,h.suffixes[k])){S=Math.pow(h.base,k);break}}b*=S||1}return b}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,h,f){var m=t.locales[t.options.currentLocale],_={before:h.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:h.match(/([\+|\-|\)|\s|\$]*)$/)[0]},b,k,S;for(h=h.replace(/\s?\$\s?/,""),b=t._.numberToFormat(l,h,f),l>=0?(_.before=_.before.replace(/[\-\(]/,""),_.after=_.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(_.before,"-")&&!t._.includes(_.before,"(")&&(_.before="-"+_.before),S=0;S<_.before.length;S++)switch(k=_.before[S],k){case"$":b=t._.insert(b,m.currency.symbol,S);break;case" ":b=t._.insert(b," ",S+m.currency.symbol.length-1);break}for(S=_.after.length-1;S>=0;S--)switch(k=_.after[S],k){case"$":b=S===_.after.length-1?b+m.currency.symbol:t._.insert(b,m.currency.symbol,-(_.after.length-(1+S)));break;case" ":b=S===_.after.length-1?b+" ":t._.insert(b," ",-(_.after.length-(1+S)+m.currency.symbol.length-1));break}return b}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,h,f){var m,_=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",b=_.split("e");return h=h.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(b[0]),h,f),m+"e"+b[1]},unformat:function(l){var h=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),f=Number(h[0]),m=Number(h[1]);m=t._.includes(l,"e-")?m*=-1:m;function _(b,k,S,E){var T=t._.correctionFactor(b,k),L=b*T*(k*T)/(T*T);return L}return t._.reduce([f,Math.pow(10,m)],_,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,h,f){var m=t.locales[t.options.currentLocale],_,b=t._.includes(h," o")?" ":"";return h=h.replace(/\s?o/,""),b+=m.ordinal(l),_=t._.numberToFormat(l,h,f),_+b}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,h,f){var m=t._.includes(h," %")?" ":"",_;return t.options.scalePercentBy100&&(l=l*100),h=h.replace(/\s?\%/,""),_=t._.numberToFormat(l,h,f),t._.includes(_,")")?(_=_.split(""),_.splice(-1,0,m+"%"),_=_.join("")):_=_+m+"%",_},unformat:function(l){var h=t._.stringToNumber(l);return t.options.scalePercentBy100?h*.01:h}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,h,f){var m=Math.floor(l/60/60),_=Math.floor((l-m*60*60)/60),b=Math.round(l-m*60*60-_*60);return m+":"+(_<10?"0"+_:_)+":"+(b<10?"0"+b:b)},unformat:function(l){var h=l.split(":"),f=0;return h.length===3?(f=f+Number(h[0])*60*60,f=f+Number(h[1])*60,f=f+Number(h[2])):h.length===2&&(f=f+Number(h[0])*60,f=f+Number(h[1])),Number(f)}})}(),t})})(lc);var md=lc.exports;const Ps=Vi(md),_d=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],vd=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],gd=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],yd=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],fa=(e,t,r)=>{let n=e;return typeof t=="string"||Array.isArray(t)?n=e.toLocaleString(t,r):(t===!0||r!==void 0)&&(n=e.toLocaleString(void 0,r)),n};function bd(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const r=t.bits?t.binary?yd:gd:t.binary?vd:_d,n=t.space?" ":"";if(t.signed&&e===0)return` 0${n}${r[0]}`;const i=e<0,s=i?"-":t.signed?"+":"";i&&(e=-e);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1){const h=fa(e,t.locale,o);return s+h+n+r[0]}const u=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),r.length-1);e/=(t.binary?1024:1e3)**u,o||(e=e.toPrecision(3));const c=fa(Number(e),t.locale,o),l=r[u];return s+c+n+l}function wd(e){if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}}const xd=(e,t)=>t===1?e:`${e}s`,kd=1e-7;function Sd(e,t={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const r=[],n=(o,u)=>{const c=Math.floor(o*10**u+kd);return(Math.round(c)/10**u).toFixed(u)},i=(o,u,c,l)=>{if((r.length===0||!t.colonNotation)&&o===0&&!(t.colonNotation&&c==="m"))return;l=(l||o||"0").toString();let h,f;if(t.colonNotation){h=r.length>0?":":"",f="";const m=l.includes(".")?l.split(".")[0].length:l.length,_=r.length>0?2:1;l="0".repeat(Math.max(0,_-m))+l}else h="",f=t.verbose?" "+xd(u,o):c;r.push(h+l+f)},s=wd(e);if(i(Math.trunc(s.days/365),"year","y"),i(s.days%365,"day","d"),i(s.hours,"hour","h"),i(s.minutes,"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(i(s.seconds,"second","s"),t.formatSubMilliseconds)i(s.milliseconds,"millisecond","ms"),i(s.microseconds,"microsecond","µs"),i(s.nanoseconds,"nanosecond","ns");else{const o=s.milliseconds+s.microseconds/1e3+s.nanoseconds/1e6,u=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,c=o>=1?Math.round(o):Math.ceil(o),l=u?o.toFixed(u):c;i(Number.parseFloat(l),"millisecond","ms",l)}else{const o=e/1e3%60,u=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,c=n(o,u),l=t.keepDecimalsOnWholeSeconds?c:c.replace(/\.0+$/,"");i(Number.parseFloat(l),"second","s",l)}if(r.length===0)return"0"+(t.verbose?" milliseconds":"ms");if(t.compact)return r[0];if(typeof t.unitCount=="number"){const o=t.colonNotation?"":" ";return r.slice(0,Math.max(t.unitCount,1)).join(o)}return t.colonNotation?r.join(""):r.join(" ")}const Td=!0,et="u-",Cd="uplot",Ed=et+"hz",Od=et+"vt",Pd=et+"title",Ad=et+"wrap",Md=et+"under",Rd=et+"over",Nd=et+"axis",Wr=et+"off",Dd=et+"select",Ld=et+"cursor-x",Fd=et+"cursor-y",zd=et+"cursor-pt",Bd=et+"legend",$d=et+"live",jd=et+"inline",qd=et+"series",Hd=et+"marker",ha=et+"label",Id=et+"value",Un="width",Gn="height",Vn="top",pa="bottom",dn="left",As="right",Lo="#000",da=Lo+"0",Ms="mousemove",ma="mousedown",Rs="mouseup",_a="mouseenter",va="mouseleave",ga="dblclick",Vd="resize",Wd="scroll",ya="change",ji="dppxchange",Fo="--",Mn=typeof window<"u",Gs=Mn?document:null,gn=Mn?window:null,Ud=Mn?navigator:null;let Te,Oi;function Ks(){let e=devicePixelRatio;Te!=e&&(Te=e,Oi&&Zs(ya,Oi,Ks),Oi=matchMedia(`(min-resolution: ${Te-.001}dppx) and (max-resolution: ${Te+.001}dppx)`),Gr(ya,Oi,Ks),gn.dispatchEvent(new CustomEvent(ji)))}function Mt(e,t){if(t!=null){let r=e.classList;!r.contains(t)&&r.add(t)}}function Ys(e,t){let r=e.classList;r.contains(t)&&r.remove(t)}function $e(e,t,r){e.style[t]=r+"px"}function Zt(e,t,r,n){let i=Gs.createElement(e);return t!=null&&Mt(i,t),r!=null&&r.insertBefore(i,n),i}function qt(e,t){return Zt("div",e,t)}const ba=new WeakMap;function ur(e,t,r,n,i){let s="translate("+t+"px,"+r+"px)",o=ba.get(e);s!=o&&(e.style.transform=s,ba.set(e,s),t<0||r<0||t>n||r>i?Mt(e,Wr):Ys(e,Wr))}const wa=new WeakMap;function xa(e,t,r){let n=t+r,i=wa.get(e);n!=i&&(wa.set(e,n),e.style.background=t,e.style.borderColor=r)}const ka=new WeakMap;function Sa(e,t,r,n){let i=t+""+r,s=ka.get(e);i!=s&&(ka.set(e,i),e.style.height=r+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-r/2+"px":0)}const zo={passive:!0},Gd={...zo,capture:!0};function Gr(e,t,r,n){t.addEventListener(e,r,n?Gd:zo)}function Zs(e,t,r,n){t.removeEventListener(e,r,zo)}Mn&&Ks();function Jt(e,t,r,n){let i;r=r||0,n=n||t.length-1;let s=n<=2147483647;for(;n-r>1;)i=s?r+n>>1:Rt((r+n)/2),t[i]{let s=-1,o=-1;for(let u=n;u<=i;u++)if(e(r[u])){s=u;break}for(let u=i;u>=n;u--)if(e(r[u])){o=u;break}return[s,o]}}const uc=e=>e!=null,cc=e=>e!=null&&e>0,Gi=ac(uc),Kd=ac(cc);function Yd(e,t,r,n=0,i=!1){let s=i?Kd:Gi,o=i?cc:uc;[t,r]=s(e,t,r);let u=e[t],c=e[t];if(t>-1)if(n==1)u=e[t],c=e[r];else if(n==-1)u=e[r],c=e[t];else for(let l=t;l<=r;l++){let h=e[l];o(h)&&(hc&&(c=h))}return[u??Me,c??-Me]}function Ki(e,t,r,n){let i=Ea(e),s=Ea(t);e==t&&(i==-1?(e*=r,t/=r):(e/=r,t*=r));let o=r==10?wr:fc,u=i==1?Rt:Ht,c=s==1?Ht:Rt,l=u(o(Xe(e))),h=c(o(Xe(t))),f=Tn(r,l),m=Tn(r,h);return r==10&&(l<0&&(f=Re(f,-l)),h<0&&(m=Re(m,-h))),n||r==2?(e=f*i,t=m*s):(e=mc(e,f),t=Yi(t,m)),[e,t]}function Bo(e,t,r,n){let i=Ki(e,t,r,n);return e==0&&(i[0]=0),t==0&&(i[1]=0),i}const $o=.1,Ta={mode:3,pad:$o},Xn={pad:0,soft:null,mode:0},Zd={min:Xn,max:Xn};function qi(e,t,r,n){return Zi(r)?Ca(e,t,r):(Xn.pad=r,Xn.soft=n?0:null,Xn.mode=n?3:0,Ca(e,t,Zd))}function xe(e,t){return e??t}function Jd(e,t,r){for(t=xe(t,0),r=xe(r,e.length-1);t<=r;){if(e[t]!=null)return!0;t++}return!1}function Ca(e,t,r){let n=r.min,i=r.max,s=xe(n.pad,0),o=xe(i.pad,0),u=xe(n.hard,-Me),c=xe(i.hard,Me),l=xe(n.soft,Me),h=xe(i.soft,-Me),f=xe(n.mode,0),m=xe(i.mode,0),_=t-e,b=wr(_),k=yt(Xe(e),Xe(t)),S=wr(k),E=Xe(S-b);(_<1e-24||E>10)&&(_=0,(e==0||t==0)&&(_=1e-24,f==2&&l!=Me&&(s=0),m==2&&h!=-Me&&(o=0)));let T=_||k||1e3,L=wr(T),O=Tn(10,Rt(L)),F=T*(_==0?e==0?.1:1:s),M=Re(mc(e-F,O/10),24),z=e>=l&&(f==1||f==3&&M<=l||f==2&&M>=l)?l:Me,q=yt(u,M=z?z:Qt(z,M)),$=T*(_==0?t==0?.1:1:o),j=Re(Yi(t+$,O/10),24),R=t<=h&&(m==1||m==3&&j>=h||m==2&&j<=h)?h:-Me,W=Qt(c,j>R&&t<=R?R:yt(R,j));return q==W&&q==0&&(W=100),[q,W]}const Qd=new Intl.NumberFormat(Mn?Ud.language:"en-US"),jo=e=>Qd.format(e),Dt=Math,Di=Dt.PI,Xe=Dt.abs,Rt=Dt.floor,Qe=Dt.round,Ht=Dt.ceil,Qt=Dt.min,yt=Dt.max,Tn=Dt.pow,Ea=Dt.sign,wr=Dt.log10,fc=Dt.log2,Xd=(e,t=1)=>Dt.sinh(e)*t,Ns=(e,t=1)=>Dt.asinh(e/t),Me=1/0;function Oa(e){return(wr((e^e>>31)-(e>>31))|0)+1}function Js(e,t,r){return Qt(yt(e,t),r)}function hc(e){return typeof e=="function"}function ye(e){return hc(e)?e:()=>e}const em=()=>{},pc=e=>e,dc=(e,t)=>t,tm=e=>null,Pa=e=>!0,Aa=(e,t)=>e==t,rm=/\.\d*?(?=9{6,}|0{6,})/gm,Yr=e=>{if(vc(e)||Dr.has(e))return e;const t=`${e}`,r=t.match(rm);if(r==null)return e;let n=r[0].length-1;if(t.indexOf("e-")!=-1){let[i,s]=t.split("e");return+`${Yr(i)}e${s}`}return Re(e,n)};function Hr(e,t){return Yr(Re(Yr(e/t))*t)}function Yi(e,t){return Yr(Ht(Yr(e/t))*t)}function mc(e,t){return Yr(Rt(Yr(e/t))*t)}function Re(e,t=0){if(vc(e))return e;let r=10**t,n=e*r*(1+Number.EPSILON);return Qe(n)/r}const Dr=new Map;function _c(e){return((""+e).split(".")[1]||"").length}function si(e,t,r,n){let i=[],s=n.map(_c);for(let o=t;o=0?0:u)+(o>=s[l]?0:s[l]),m=e==10?h:Re(h,f);i.push(m),Dr.set(m,f)}}return i}const ei={},qo=[],Cn=[null,null],Rr=Array.isArray,vc=Number.isInteger,nm=e=>e===void 0;function Ma(e){return typeof e=="string"}function Zi(e){let t=!1;if(e!=null){let r=e.constructor;t=r==null||r==Object}return t}function im(e){return e!=null&&typeof e=="object"}const sm=Object.getPrototypeOf(Uint8Array),gc="__proto__";function En(e,t=Zi){let r;if(Rr(e)){let n=e.find(i=>i!=null);if(Rr(n)||t(n)){r=Array(e.length);for(let i=0;is){for(i=o-1;i>=0&&e[i]==null;)e[i--]=null;for(i=o+1;io-u)],i=n[0].length,s=new Map;for(let o=0;o"u"?e=>Promise.resolve().then(e):queueMicrotask;function hm(e){let t=e[0],r=t.length,n=Array(r);for(let s=0;st[s]-t[o]);let i=[];for(let s=0;s=n&&e[i]==null;)i--;if(i<=n)return!0;const s=yt(1,Rt((i-n+1)/t));for(let o=e[n],u=n+s;u<=i;u+=s){const c=e[u];if(c!=null){if(c<=o)return!1;o=c}}return!0}const yc=["January","February","March","April","May","June","July","August","September","October","November","December"],bc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function wc(e){return e.slice(0,3)}const mm=bc.map(wc),_m=yc.map(wc),vm={MMMM:yc,MMM:_m,WWWW:bc,WWW:mm};function Wn(e){return(e<10?"0":"")+e}function gm(e){return(e<10?"00":e<100?"0":"")+e}const ym={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Wn(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Wn(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Wn(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Wn(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Wn(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>gm(e.getMilliseconds())};function Ho(e,t){t=t||vm;let r=[],n=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=n.exec(e);)r.push(i[0][0]=="{"?ym[i[1]]:i[0]);return s=>{let o="";for(let u=0;ue%1==0,Hi=[1,2,2.5,5],xm=si(10,-32,0,Hi),kc=si(10,0,32,Hi),km=kc.filter(xc),Ir=xm.concat(kc),Io=` +`,Sc="{YYYY}",Ra=Io+Sc,Tc="{M}/{D}",Kn=Io+Tc,Pi=Kn+"/{YY}",Cc="{aa}",Sm="{h}:{mm}",mn=Sm+Cc,Na=Io+mn,Da=":{ss}",Oe=null;function Ec(e){let t=e*1e3,r=t*60,n=r*60,i=n*24,s=i*30,o=i*365,c=(e==1?si(10,0,3,Hi).filter(xc):si(10,-3,0,Hi)).concat([t,t*5,t*10,t*15,t*30,r,r*5,r*10,r*15,r*30,n,n*2,n*3,n*4,n*6,n*8,n*12,i,i*2,i*3,i*4,i*5,i*6,i*7,i*8,i*9,i*10,i*15,s,s*2,s*3,s*4,s*6,o,o*2,o*5,o*10,o*25,o*50,o*100]);const l=[[o,Sc,Oe,Oe,Oe,Oe,Oe,Oe,1],[i*28,"{MMM}",Ra,Oe,Oe,Oe,Oe,Oe,1],[i,Tc,Ra,Oe,Oe,Oe,Oe,Oe,1],[n,"{h}"+Cc,Pi,Oe,Kn,Oe,Oe,Oe,1],[r,mn,Pi,Oe,Kn,Oe,Oe,Oe,1],[t,Da,Pi+" "+mn,Oe,Kn+" "+mn,Oe,Na,Oe,1],[e,Da+".{fff}",Pi+" "+mn,Oe,Kn+" "+mn,Oe,Na,Oe,1]];function h(f){return(m,_,b,k,S,E)=>{let T=[],L=S>=o,O=S>=s&&S=i?i:S,j=Rt(b)-Rt(M),R=q+j+Yi(M-q,$);T.push(R);let W=f(R),H=W.getHours()+W.getMinutes()/r+W.getSeconds()/n,Q=S/n,U=m.axes[_]._space,ee=E/U;for(;R=Re(R+S,e==1?0:3),!(R>k);)if(Q>1){let V=Rt(Re(H+Q,6))%24,fe=f(R).getHours()-V;fe>1&&(fe=-1),R-=fe*n,H=(H+Q)%24;let _e=T[T.length-1];Re((R-_e)/S,3)*ee>=.7&&T.push(R)}else T.push(R)}return T}}return[c,l,h]}const[Tm,Cm,Em]=Ec(1),[Om,Pm,Am]=Ec(.001);si(2,-53,53,[1]);function La(e,t){return e.map(r=>r.map((n,i)=>i==0||i==8||n==null?n:t(i==1||r[8]==0?n:r[1]+n)))}function Fa(e,t){return(r,n,i,s,o)=>{let u=t.find(b=>o>=b[0])||t[t.length-1],c,l,h,f,m,_;return n.map(b=>{let k=e(b),S=k.getFullYear(),E=k.getMonth(),T=k.getDate(),L=k.getHours(),O=k.getMinutes(),F=k.getSeconds(),M=S!=c&&u[2]||E!=l&&u[3]||T!=h&&u[4]||L!=f&&u[5]||O!=m&&u[6]||F!=_&&u[7]||u[1];return c=S,l=E,h=T,f=L,m=O,_=F,M(k)})}}function Mm(e,t){let r=Ho(t);return(n,i,s,o,u)=>i.map(c=>r(e(c)))}function Ds(e,t,r){return new Date(e,t,r)}function za(e,t){return t(e)}const Rm="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function Ba(e,t){return(r,n,i,s)=>s==null?Fo:t(e(n))}function Nm(e,t){let r=e.series[t];return r.width?r.stroke(e,t):r.points.width?r.points.stroke(e,t):null}function Dm(e,t){return e.series[t].fill(e,t)}const Lm={show:!0,live:!0,isolate:!1,mount:em,markers:{show:!0,width:2,stroke:Nm,fill:Dm,dash:"solid"},idx:null,idxs:null,values:[]};function Fm(e,t){let r=e.cursor.points,n=qt(),i=r.size(e,t);$e(n,Un,i),$e(n,Gn,i);let s=i/-2;$e(n,"marginLeft",s),$e(n,"marginTop",s);let o=r.width(e,t,i);return o&&$e(n,"borderWidth",o),n}function zm(e,t){let r=e.series[t].points;return r._fill||r._stroke}function Bm(e,t){let r=e.series[t].points;return r._stroke||r._fill}function $m(e,t){return e.series[t].points.size}const Ls=[0,0];function jm(e,t,r){return Ls[0]=t,Ls[1]=r,Ls}function Ai(e,t,r,n=!0){return i=>{i.button==0&&(!n||i.target==t)&&r(i)}}function Fs(e,t,r,n=!0){return i=>{(!n||i.target==t)&&r(i)}}const qm={show:!0,x:!0,y:!0,lock:!1,move:jm,points:{one:!1,show:Fm,size:$m,width:0,stroke:Bm,fill:zm},bind:{mousedown:Ai,mouseup:Ai,click:Ai,dblclick:Ai,mousemove:Fs,mouseleave:Fs,mouseenter:Fs},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,r,n,i)=>n-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},Oc={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Vo=Ze({},Oc,{filter:dc}),Pc=Ze({},Vo,{size:10}),Ac=Ze({},Oc,{show:!1}),Wo='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Mc="bold "+Wo,Rc=1.5,$a={show:!0,scale:"x",stroke:Lo,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Mc,side:2,grid:Vo,ticks:Pc,border:Ac,font:Wo,lineGap:Rc,rotate:0},Hm="Value",Im="Time",ja={show:!0,scale:"x",auto:!1,sorted:1,min:Me,max:-Me,idxs:[]};function Vm(e,t,r,n,i){return t.map(s=>s==null?"":jo(s))}function Wm(e,t,r,n,i,s,o){let u=[],c=Dr.get(i)||0;r=o?r:Re(Yi(r,i),c);for(let l=r;l<=n;l=Re(l+i,c))u.push(Object.is(l,-0)?0:l);return u}function Qs(e,t,r,n,i,s,o){const u=[],c=e.scales[e.axes[t].scale].log,l=c==10?wr:fc,h=Rt(l(r));i=Tn(c,h),c==10&&(i=Ir[Jt(i,Ir)]);let f=r,m=i*c;c==10&&(m=Ir[Jt(m,Ir)]);do u.push(f),f=f+i,c==10&&!Dr.has(f)&&(f=Re(f,Dr.get(i))),f>=m&&(i=f,m=i*c,c==10&&(m=Ir[Jt(m,Ir)]));while(f<=n);return u}function Um(e,t,r,n,i,s,o){let c=e.scales[e.axes[t].scale].asinh,l=n>c?Qs(e,t,yt(c,r),n,i):[c],h=n>=0&&r<=0?[0]:[];return(r<-c?Qs(e,t,yt(c,-n),-r,i):[c]).reverse().map(m=>-m).concat(h,l)}const Nc=/./,Gm=/[12357]/,Km=/[125]/,qa=/1/,Xs=(e,t,r,n)=>e.map((i,s)=>t==4&&i==0||s%n==0&&r.test(i.toExponential()[i<0?1:0])?i:null);function Ym(e,t,r,n,i){let s=e.axes[r],o=s.scale,u=e.scales[o],c=e.valToPos,l=s._space,h=c(10,o),f=c(9,o)-h>=l?Nc:c(7,o)-h>=l?Gm:c(5,o)-h>=l?Km:qa;if(f==qa){let m=Xe(c(1,o)-h);if(mi,Va={show:!0,auto:!0,sorted:0,gaps:Dc,alpha:1,facets:[Ze({},Ia,{scale:"x"}),Ze({},Ia,{scale:"y"})]},Wa={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Dc,alpha:1,points:{show:Xm,filter:null},values:null,min:Me,max:-Me,idxs:[],path:null,clip:null};function e_(e,t,r,n,i){return r/10}const Lc={time:Td,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},t_=Ze({},Lc,{time:!1,ori:1}),Ua={};function Fc(e,t){let r=Ua[e];return r||(r={key:e,plots:[],sub(n){r.plots.push(n)},unsub(n){r.plots=r.plots.filter(i=>i!=n)},pub(n,i,s,o,u,c,l){for(let h=0;h{let E=o.pxRound;const T=l.dir*(l.ori==0?1:-1),L=l.ori==0?Rn:Nn;let O,F;T==1?(O=r,F=n):(O=n,F=r);let M=E(f(u[O],l,k,_)),z=E(m(c[O],h,S,b)),q=E(f(u[F],l,k,_)),$=E(m(s==1?h.max:h.min,h,S,b)),j=new Path2D(i);return L(j,q,$),L(j,M,$),L(j,M,z),j})}function Ji(e,t,r,n,i,s){let o=null;if(e.length>0){o=new Path2D;const u=t==0?es:Ko;let c=r;for(let f=0;fm[0]){let _=m[0]-c;_>0&&u(o,c,n,_,n+s),c=m[1]}}let l=r+i-c,h=10;l>0&&u(o,c,n-h/2,l,n+s+h)}return o}function n_(e,t,r){let n=e[e.length-1];n&&n[0]==t?n[1]=r:e.push([t,r])}function Go(e,t,r,n,i,s,o){let u=[],c=e.length;for(let l=i==1?r:n;l>=r&&l<=n;l+=i)if(t[l]===null){let f=l,m=l;if(i==1)for(;++l<=n&&t[l]===null;)m=l;else for(;--l>=r&&t[l]===null;)m=l;let _=s(e[f]),b=m==f?_:s(e[m]),k=f-i;_=o<=0&&k>=0&&k=0&&E>=0&&E=_&&u.push([_,b])}return u}function Ga(e){return e==0?pc:e==1?Qe:t=>Hr(t,e)}function zc(e){let t=e==0?Qi:Xi,r=e==0?(i,s,o,u,c,l)=>{i.arcTo(s,o,u,c,l)}:(i,s,o,u,c,l)=>{i.arcTo(o,s,c,u,l)},n=e==0?(i,s,o,u,c)=>{i.rect(s,o,u,c)}:(i,s,o,u,c)=>{i.rect(o,s,c,u)};return(i,s,o,u,c,l=0,h=0)=>{l==0&&h==0?n(i,s,o,u,c):(l=Qt(l,u/2,c/2),h=Qt(h,u/2,c/2),t(i,s+l,o),r(i,s+u,o,s+u,o+c,l),r(i,s+u,o+c,s,o+c,h),r(i,s,o+c,s,o,h),r(i,s,o,s+u,o,l),i.closePath())}}const Qi=(e,t,r)=>{e.moveTo(t,r)},Xi=(e,t,r)=>{e.moveTo(r,t)},Rn=(e,t,r)=>{e.lineTo(t,r)},Nn=(e,t,r)=>{e.lineTo(r,t)},es=zc(0),Ko=zc(1),Bc=(e,t,r,n,i,s)=>{e.arc(t,r,n,i,s)},$c=(e,t,r,n,i,s)=>{e.arc(r,t,n,i,s)},jc=(e,t,r,n,i,s,o)=>{e.bezierCurveTo(t,r,n,i,s,o)},qc=(e,t,r,n,i,s,o)=>{e.bezierCurveTo(r,t,i,n,o,s)};function Hc(e){return(t,r,n,i,s)=>Qr(t,r,(o,u,c,l,h,f,m,_,b,k,S)=>{let{pxRound:E,points:T}=o,L,O;l.ori==0?(L=Qi,O=Bc):(L=Xi,O=$c);const F=Re(T.width*Te,3);let M=(T.size-T.width)/2*Te,z=Re(M*2,3),q=new Path2D,$=new Path2D,{left:j,top:R,width:W,height:H}=t.bbox;es($,j-z,R-z,W+z*2,H+z*2);const Q=U=>{if(c[U]!=null){let ee=E(f(u[U],l,k,_)),V=E(m(c[U],h,S,b));L(q,ee+M,V),O(q,ee,V,M,0,Di*2)}};if(s)s.forEach(Q);else for(let U=n;U<=i;U++)Q(U);return{stroke:F>0?q:null,fill:q,clip:$,flags:On|eo}})}function Ic(e){return(t,r,n,i,s,o)=>{n!=i&&(s!=n&&o!=n&&e(t,r,n),s!=i&&o!=i&&e(t,r,i),e(t,r,o))}}const i_=Ic(Rn),s_=Ic(Nn);function Vc(e){const t=xe(e==null?void 0:e.alignGaps,0);return(r,n,i,s)=>Qr(r,n,(o,u,c,l,h,f,m,_,b,k,S)=>{[i,s]=Gi(c,i,s);let E=o.pxRound,T=H=>E(f(H,l,k,_)),L=H=>E(m(H,h,S,b)),O,F;l.ori==0?(O=Rn,F=i_):(O=Nn,F=s_);const M=l.dir*(l.ori==0?1:-1),z={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:On},q=z.stroke;let $=!1;if(s-i>=k*4){let H=Z=>r.posToVal(Z,l.key,!0),Q=null,U=null,ee,V,je,me=T(u[M==1?i:s]),fe=T(u[i]),_e=T(u[s]),se=H(M==1?fe+1:_e-1);for(let Z=M==1?i:s;Z>=i&&Z<=s;Z+=M){let be=u[Z],ge=(M==1?bese)?me:T(be),pe=c[Z];ge==me?pe!=null?(V=pe,Q==null?(O(q,ge,L(V)),ee=Q=U=V):VU&&(U=V)):pe===null&&($=!0):(Q!=null&&F(q,me,L(Q),L(U),L(ee),L(V)),pe!=null?(V=pe,O(q,ge,L(V)),Q=U=ee=V):(Q=U=null,pe===null&&($=!0)),me=ge,se=H(me+M))}Q!=null&&Q!=U&&je!=me&&F(q,me,L(Q),L(U),L(ee),L(V))}else for(let H=M==1?i:s;H>=i&&H<=s;H+=M){let Q=c[H];Q===null?$=!0:Q!=null&&O(q,T(u[H]),L(Q))}let[R,W]=Uo(r,n);if(o.fill!=null||R!=0){let H=z.fill=new Path2D(q),Q=o.fillTo(r,n,o.min,o.max,R),U=L(Q),ee=T(u[i]),V=T(u[s]);M==-1&&([V,ee]=[ee,V]),O(H,V,U),O(H,ee,U)}if(!o.spanGaps){let H=[];$&&H.push(...Go(u,c,i,s,M,T,t)),z.gaps=H=o.gaps(r,n,i,s,H),z.clip=Ji(H,l.ori,_,b,k,S)}return W!=0&&(z.band=W==2?[xr(r,n,i,s,q,-1),xr(r,n,i,s,q,1)]:xr(r,n,i,s,q,W)),z})}function o_(e){const t=xe(e.align,1),r=xe(e.ascDesc,!1),n=xe(e.alignGaps,0),i=xe(e.extend,!1);return(s,o,u,c)=>Qr(s,o,(l,h,f,m,_,b,k,S,E,T,L)=>{[u,c]=Gi(f,u,c);let O=l.pxRound,{left:F,width:M}=s.bbox,z=fe=>O(b(fe,m,T,S)),q=fe=>O(k(fe,_,L,E)),$=m.ori==0?Rn:Nn;const j={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:On},R=j.stroke,W=m.dir*(m.ori==0?1:-1);let H=q(f[W==1?u:c]),Q=z(h[W==1?u:c]),U=Q,ee=Q;i&&t==-1&&(ee=F,$(R,ee,H)),$(R,Q,H);for(let fe=W==1?u:c;fe>=u&&fe<=c;fe+=W){let _e=f[fe];if(_e==null)continue;let se=z(h[fe]),Z=q(_e);t==1?$(R,se,H):$(R,U,Z),$(R,se,Z),H=Z,U=se}let V=U;i&&t==1&&(V=F+M,$(R,V,H));let[je,me]=Uo(s,o);if(l.fill!=null||je!=0){let fe=j.fill=new Path2D(R),_e=l.fillTo(s,o,l.min,l.max,je),se=q(_e);$(fe,V,se),$(fe,ee,se)}if(!l.spanGaps){let fe=[];fe.push(...Go(h,f,u,c,W,z,n));let _e=l.width*Te/2,se=r||t==1?_e:-_e,Z=r||t==-1?-_e:_e;fe.forEach(be=>{be[0]+=se,be[1]+=Z}),j.gaps=fe=l.gaps(s,o,u,c,fe),j.clip=Ji(fe,m.ori,S,E,T,L)}return me!=0&&(j.band=me==2?[xr(s,o,u,c,R,-1),xr(s,o,u,c,R,1)]:xr(s,o,u,c,R,me)),j})}function Ka(e,t,r,n,i,s,o=Me){if(e.length>1){let u=null;for(let c=0,l=1/0;c{}),{fill:f,stroke:m}=l;return(_,b,k,S)=>Qr(_,b,(E,T,L,O,F,M,z,q,$,j,R)=>{let W=E.pxRound,H=r,Q=n*Te,U=u*Te,ee=c*Te,V,je;O.ori==0?[V,je]=s(_,b):[je,V]=s(_,b);const me=O.dir*(O.ori==0?1:-1);let fe=O.ori==0?es:Ko,_e=O.ori==0?h:(G,d,y,w,A,N,K)=>{h(G,d,y,A,w,K,N)},se=xe(_.bands,qo).find(G=>G.series[0]==b),Z=se!=null?se.dir:0,be=E.fillTo(_,b,E.min,E.max,Z),Ce=W(z(be,F,R,$)),ge,pe,De,Le=j,ke=W(E.width*Te),tt=!1,bt=null,ut=null,Lt=null,rr=null;f!=null&&(ke==0||m!=null)&&(tt=!0,bt=f.values(_,b,k,S),ut=new Map,new Set(bt).forEach(G=>{G!=null&&ut.set(G,new Path2D)}),ke>0&&(Lt=m.values(_,b,k,S),rr=new Map,new Set(Lt).forEach(G=>{G!=null&&rr.set(G,new Path2D)})));let{x0:Ft,size:nr}=l;if(Ft!=null&&nr!=null){H=1,T=Ft.values(_,b,k,S),Ft.unit==2&&(T=T.map(y=>_.posToVal(q+y*j,O.key,!0)));let G=nr.values(_,b,k,S);nr.unit==2?pe=G[0]*j:pe=M(G[0],O,j,q)-M(0,O,j,q),Le=Ka(T,L,M,O,j,q,Le),De=Le-pe+Q}else Le=Ka(T,L,M,O,j,q,Le),De=Le*o+Q,pe=Le-De;De<1&&(De=0),ke>=pe/2&&(ke=0),De<5&&(W=pc);let ir=De>0,ne=Le-De-(ir?ke:0);pe=W(Js(ne,ee,U)),ge=(H==0?pe/2:H==me?0:pe)-H*me*((H==0?Q/2:0)+(ir?ke/2:0));const Ae={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},wt=tt?null:new Path2D;let dt=null;if(se!=null)dt=_.data[se.series[1]];else{let{y0:G,y1:d}=l;G!=null&&d!=null&&(L=d.values(_,b,k,S),dt=G.values(_,b,k,S))}let zt=V*pe,ae=je*pe;for(let G=me==1?k:S;G>=k&&G<=S;G+=me){let d=L[G];if(d==null)continue;if(dt!=null){let Ee=dt[G]??0;if(d-Ee==0)continue;Ce=z(Ee,F,R,$)}let y=O.distr!=2||l!=null?T[G]:G,w=M(y,O,j,q),A=z(xe(d,be),F,R,$),N=W(w-ge),K=W(yt(A,Ce)),re=W(Qt(A,Ce)),ue=K-re;if(d!=null){let Ee=d<0?ae:zt,Ue=d<0?zt:ae;tt?(ke>0&&Lt[G]!=null&&fe(rr.get(Lt[G]),N,re+Rt(ke/2),pe,yt(0,ue-ke),Ee,Ue),bt[G]!=null&&fe(ut.get(bt[G]),N,re+Rt(ke/2),pe,yt(0,ue-ke),Ee,Ue)):fe(wt,N,re+Rt(ke/2),pe,yt(0,ue-ke),Ee,Ue),_e(_,b,G,N-ke/2,re,pe+ke,ue)}}return ke>0?Ae.stroke=tt?rr:wt:tt||(Ae._fill=E.width==0?E._fill:E._stroke??E._fill,Ae.width=0),Ae.fill=tt?ut:wt,Ae})}function a_(e,t){const r=xe(t==null?void 0:t.alignGaps,0);return(n,i,s,o)=>Qr(n,i,(u,c,l,h,f,m,_,b,k,S,E)=>{[s,o]=Gi(l,s,o);let T=u.pxRound,L=V=>T(m(V,h,S,b)),O=V=>T(_(V,f,E,k)),F,M,z;h.ori==0?(F=Qi,z=Rn,M=jc):(F=Xi,z=Nn,M=qc);const q=h.dir*(h.ori==0?1:-1);let $=L(c[q==1?s:o]),j=$,R=[],W=[];for(let V=q==1?s:o;V>=s&&V<=o;V+=q)if(l[V]!=null){let me=c[V],fe=L(me);R.push(j=fe),W.push(O(l[V]))}const H={stroke:e(R,W,F,z,M,T),fill:null,clip:null,band:null,gaps:null,flags:On},Q=H.stroke;let[U,ee]=Uo(n,i);if(u.fill!=null||U!=0){let V=H.fill=new Path2D(Q),je=u.fillTo(n,i,u.min,u.max,U),me=O(je);z(V,j,me),z(V,$,me)}if(!u.spanGaps){let V=[];V.push(...Go(c,l,s,o,q,L,r)),H.gaps=V=u.gaps(n,i,s,o,V),H.clip=Ji(V,h.ori,b,k,S,E)}return ee!=0&&(H.band=ee==2?[xr(n,i,s,o,Q,-1),xr(n,i,s,o,Q,1)]:xr(n,i,s,o,Q,ee)),H})}function u_(e){return a_(c_,e)}function c_(e,t,r,n,i,s){const o=e.length;if(o<2)return null;const u=new Path2D;if(r(u,e[0],t[0]),o==2)n(u,e[1],t[1]);else{let c=Array(o),l=Array(o-1),h=Array(o-1),f=Array(o-1);for(let m=0;m0!=l[m]>0?c[m]=0:(c[m]=3*(f[m-1]+f[m])/((2*f[m]+f[m-1])/l[m-1]+(f[m]+2*f[m-1])/l[m]),isFinite(c[m])||(c[m]=0));c[o-1]=l[o-2];for(let m=0;m{at.pxRatio=Te}));const f_=Vc(),h_=Hc();function Za(e,t,r,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((s,o)=>ro(s,o,t,r))}function p_(e,t){return e.map((r,n)=>n==0?{}:Ze({},t,r))}function ro(e,t,r,n){return Ze({},t==0?r:n,e)}function Wc(e,t,r){return t==null?Cn:[t,r]}const d_=Wc;function m_(e,t,r){return t==null?Cn:qi(t,r,$o,!0)}function Uc(e,t,r,n){return t==null?Cn:Ki(t,r,e.scales[n].log,!1)}const __=Uc;function Gc(e,t,r,n){return t==null?Cn:Bo(t,r,e.scales[n].log,!1)}const v_=Gc;function g_(e,t,r,n,i){let s=yt(Oa(e),Oa(t)),o=t-e,u=Jt(i/n*o,r);do{let c=r[u],l=n*c/o;if(l>=i&&s+(c<5?Dr.get(c):0)<=17)return[c,l]}while(++u(t=Qe((r=+i)*Te))+"px"),[e,t,r]}function y_(e){e.show&&[e.font,e.labelFont].forEach(t=>{let r=Re(t[2]*Te,1);t[0]=t[0].replace(/[0-9.]+px/,r+"px"),t[1]=r})}function at(e,t,r){const n={mode:xe(e.mode,1)},i=n.mode;function s(a,p,v,g){let x=p.valToPct(a);return g+v*(p.dir==-1?1-x:x)}function o(a,p,v,g){let x=p.valToPct(a);return g+v*(p.dir==-1?x:1-x)}function u(a,p,v,g){return p.ori==0?s(a,p,v,g):o(a,p,v,g)}n.valToPosH=s,n.valToPosV=o;let c=!1;n.status=0;const l=n.root=qt(Cd);if(e.id!=null&&(l.id=e.id),Mt(l,e.class),e.title){let a=qt(Pd,l);a.textContent=e.title}const h=Zt("canvas"),f=n.ctx=h.getContext("2d"),m=qt(Ad,l);Gr("click",m,a=>{a.target===b&&(Fe!=un||qe!=cn)&&ft.click(n,a)},!0);const _=n.under=qt(Md,m);m.appendChild(h);const b=n.over=qt(Rd,m);e=En(e);const k=+xe(e.pxAlign,1),S=Ga(k);(e.plugins||[]).forEach(a=>{a.opts&&(e=a.opts(n,e)||e)});const E=e.ms||.001,T=n.series=i==1?Za(e.series||[],ja,Wa,!1):p_(e.series||[null],Va),L=n.axes=Za(e.axes||[],$a,Ha,!0),O=n.scales={},F=n.bands=e.bands||[];F.forEach(a=>{a.fill=ye(a.fill||null),a.dir=xe(a.dir,-1)});const M=i==2?T[1].facets[0].scale:T[0].scale,z={axes:af,series:rf},q=(e.drawOrder||["axes","series"]).map(a=>z[a]);function $(a){const p=a.distr==3?v=>wr(v>0?v:a.clamp(n,v,a.min,a.max,a.key)):a.distr==4?v=>Ns(v,a.asinh):a.distr==100?v=>a.fwd(v):v=>v;return v=>{let g=p(v),{_min:x,_max:C}=a,D=C-x;return(g-x)/D}}function j(a){let p=O[a];if(p==null){let v=(e.scales||ei)[a]||ei;if(v.from!=null){j(v.from);let g=Ze({},O[v.from],v,{key:a});g.valToPct=$(g),O[a]=g}else{p=O[a]=Ze({},a==M?Lc:t_,v),p.key=a;let g=p.time,x=p.range,C=Rr(x);if((a!=M||i==2&&!g)&&(C&&(x[0]==null||x[1]==null)&&(x={min:x[0]==null?Ta:{mode:1,hard:x[0],soft:x[0]},max:x[1]==null?Ta:{mode:1,hard:x[1],soft:x[1]}},C=!1),!C&&Zi(x))){let D=x;x=(B,I,Y)=>I==null?Cn:qi(I,Y,D)}p.range=ye(x||(g?d_:a==M?p.distr==3?__:p.distr==4?v_:Wc:p.distr==3?Uc:p.distr==4?Gc:m_)),p.auto=ye(C?!1:p.auto),p.clamp=ye(p.clamp||e_),p._min=p._max=null,p.valToPct=$(p)}}}j("x"),j("y"),i==1&&T.forEach(a=>{j(a.scale)}),L.forEach(a=>{j(a.scale)});for(let a in e.scales)j(a);const R=O[M],W=R.distr;let H,Q;R.ori==0?(Mt(l,Ed),H=s,Q=o):(Mt(l,Od),H=o,Q=s);const U={};for(let a in O){let p=O[a];(p.min!=null||p.max!=null)&&(U[a]={min:p.min,max:p.max},p.min=p.max=null)}const ee=e.tzDate||(a=>new Date(Qe(a/E))),V=e.fmtDate||Ho,je=E==1?Em(ee):Am(ee),me=Fa(ee,La(E==1?Cm:Pm,V)),fe=Ba(ee,za(Rm,V)),_e=[],se=n.legend=Ze({},Lm,e.legend),Z=n.cursor=Ze({},qm,{drag:{y:i==2}},e.cursor),be=se.show,Ce=Z.show,ge=se.markers;se.idxs=_e,ge.width=ye(ge.width),ge.dash=ye(ge.dash),ge.stroke=ye(ge.stroke),ge.fill=ye(ge.fill);let pe,De,Le,ke=[],tt=[],bt,ut=!1,Lt={};if(se.live){const a=T[1]?T[1].values:null;ut=a!=null,bt=ut?a(n,1,0):{_:0};for(let p in bt)Lt[p]=Fo}if(be)if(pe=Zt("table",Bd,l),Le=Zt("tbody",null,pe),se.mount(n,pe),ut){De=Zt("thead",null,pe,Le);let a=Zt("tr",null,De);Zt("th",null,a);for(var rr in bt)Zt("th",ha,a).textContent=rr}else Mt(pe,jd),se.live&&Mt(pe,$d);const Ft={show:!0},nr={show:!1};function ir(a,p){if(p==0&&(ut||!se.live||i==2))return Cn;let v=[],g=Zt("tr",qd,Le,Le.childNodes[p]);Mt(g,a.class),a.show||Mt(g,Wr);let x=Zt("th",null,g);if(ge.show){let B=qt(Hd,x);if(p>0){let I=ge.width(n,p);I&&(B.style.border=I+"px "+ge.dash(n,p)+" "+ge.stroke(n,p)),B.style.background=ge.fill(n,p)}}let C=qt(ha,x);a.label instanceof HTMLElement?C.appendChild(a.label):C.textContent=a.label,p>0&&(ge.show||(C.style.color=a.width>0?ge.stroke(n,p):ge.fill(n,p)),Ae("click",x,B=>{if(Z._lock)return;Ut(B);let I=T.indexOf(a);if((B.ctrlKey||B.metaKey)!=se.isolate){let Y=T.some((J,X)=>X>0&&X!=I&&J.show);T.forEach((J,X)=>{X>0&&sr(X,Y?X==I?Ft:nr:Ft,!0,Ye.setSeries)})}else sr(I,{show:!a.show},!0,Ye.setSeries)},!1),_r&&Ae(_a,x,B=>{Z._lock||(Ut(B),sr(T.indexOf(a),hn,!0,Ye.setSeries))},!1));for(var D in bt){let B=Zt("td",Id,g);B.textContent="--",v.push(B)}return[g,v]}const ne=new Map;function Ae(a,p,v,g=!0){const x=ne.get(p)||{},C=Z.bind[a](n,p,v,g);C&&(Gr(a,p,x[a]=C),ne.set(p,x))}function wt(a,p,v){const g=ne.get(p)||{};for(let x in g)(a==null||x==a)&&(Zs(x,p,g[x]),delete g[x]);a==null&&ne.delete(p)}let dt=0,zt=0,ae=0,G=0,d=0,y=0,w=d,A=y,N=ae,K=G,re=0,ue=0,Ee=0,Ue=0;n.bbox={};let He=!1,ie=!1,ht=!1,mr=!1,Tr=!1,mt=!1;function Xr(a,p,v){(v||a!=n.width||p!=n.height)&&en(a,p),sn(!1),ht=!0,ie=!0,on()}function en(a,p){n.width=dt=ae=a,n.height=zt=G=p,d=y=0,mi(),Ln();let v=n.bbox;re=v.left=Hr(d*Te,.5),ue=v.top=Hr(y*Te,.5),Ee=v.width=Hr(ae*Te,.5),Ue=v.height=Hr(G*Te,.5)}const Et=3;function di(){let a=!1,p=0;for(;!a;){p++;let v=of(p),g=lf(p);a=p==Et||v&&g,a||(en(n.width,n.height),ie=!0)}}function Dn({width:a,height:p}){Xr(a,p)}n.setSize=Dn;function mi(){let a=!1,p=!1,v=!1,g=!1;L.forEach((x,C)=>{if(x.show&&x._show){let{side:D,_size:B}=x,I=D%2,Y=x.label!=null?x.labelSize:0,J=B+Y;J>0&&(I?(ae-=J,D==3?(d+=J,g=!0):v=!0):(G-=J,D==0?(y+=J,a=!0):p=!0))}}),zr[0]=a,zr[1]=v,zr[2]=p,zr[3]=g,ae-=Cr[1]+Cr[3],d+=Cr[3],G-=Cr[2]+Cr[0],y+=Cr[0]}function Ln(){let a=d+ae,p=y+G,v=d,g=y;function x(C,D){switch(C){case 1:return a+=D,a-D;case 2:return p+=D,p-D;case 3:return v-=D,v+D;case 0:return g-=D,g+D}}L.forEach((C,D)=>{if(C.show&&C._show){let B=C.side;C._pos=x(B,C._size),C.label!=null&&(C._lpos=x(B,C.labelSize))}})}if(Z.dataIdx==null){let a=Z.hover,p=a.skip=new Set(a.skip??[]);p.add(void 0);let v=a.prox=ye(a.prox),g=a.bias??(a.bias=0);Z.dataIdx=(x,C,D,B)=>{if(C==0)return D;let I=D,Y=v(x,C,D,B)??Me,J=Y>=0&&Y0;)p.has(we[te])||(ve=te);if(g==0||g==1)for(te=D;oe==null&&te++Y&&(I=null);return I}}const Ut=a=>{Z.event=a};Z.idxs=_e,Z._lock=!1;let Ge=Z.points;Ge.show=ye(Ge.show),Ge.size=ye(Ge.size),Ge.stroke=ye(Ge.stroke),Ge.width=ye(Ge.width),Ge.fill=ye(Ge.fill);const xt=n.focus=Ze({},e.focus||{alpha:.3},Z.focus),_r=xt.prox>=0,vr=_r&&Ge.one;let Bt=[],tn=[],rn=[];function Yo(a,p){let v=Ge.show(n,p);if(v instanceof HTMLElement)return Mt(v,zd),Mt(v,a.class),ur(v,-10,-10,ae,G),b.insertBefore(v,Bt[p]),v}function Zo(a,p){if(i==1||p>0){let v=i==1&&O[a.scale].time,g=a.value;a.value=v?Ma(g)?Ba(ee,za(g,V)):g||fe:g||Jm,a.label=a.label||(v?Im:Hm)}if(vr||p>0){a.width=a.width==null?1:a.width,a.paths=a.paths||f_||tm,a.fillTo=ye(a.fillTo||r_),a.pxAlign=+xe(a.pxAlign,k),a.pxRound=Ga(a.pxAlign),a.stroke=ye(a.stroke||null),a.fill=ye(a.fill||null),a._stroke=a._fill=a._paths=a._focus=null;let v=Qm(yt(1,a.width),1),g=a.points=Ze({},{size:v,width:yt(1,v*.2),stroke:a.stroke,space:v*2,paths:h_,_stroke:null,_fill:null},a.points);g.show=ye(g.show),g.filter=ye(g.filter),g.fill=ye(g.fill),g.stroke=ye(g.stroke),g.paths=ye(g.paths),g.pxAlign=a.pxAlign}if(be){let v=ir(a,p);ke.splice(p,0,v[0]),tt.splice(p,0,v[1]),se.values.push(null)}if(Ce){_e.splice(p,0,null);let v=null;vr?p==0&&(v=Yo(a,p)):p>0&&(v=Yo(a,p)),Bt.splice(p,0,v),tn.splice(p,0,0),rn.splice(p,0,0)}ot("addSeries",p)}function Jc(a,p){p=p??T.length,a=i==1?ro(a,p,ja,Wa):ro(a,p,{},Va),T.splice(p,0,a),Zo(T[p],p)}n.addSeries=Jc;function Qc(a){if(T.splice(a,1),be){se.values.splice(a,1),tt.splice(a,1);let p=ke.splice(a,1)[0];wt(null,p.firstChild),p.remove()}Ce&&(_e.splice(a,1),Bt.splice(a,1)[0].remove(),tn.splice(a,1),rn.splice(a,1)),ot("delSeries",a)}n.delSeries=Qc;const zr=[!1,!1,!1,!1];function Xc(a,p){if(a._show=a.show,a.show){let v=a.side%2,g=O[a.scale];g==null&&(a.scale=v?T[1].scale:M,g=O[a.scale]);let x=g.time;a.size=ye(a.size),a.space=ye(a.space),a.rotate=ye(a.rotate),Rr(a.incrs)&&a.incrs.forEach(D=>{!Dr.has(D)&&Dr.set(D,_c(D))}),a.incrs=ye(a.incrs||(g.distr==2?km:x?E==1?Tm:Om:Ir)),a.splits=ye(a.splits||(x&&g.distr==1?je:g.distr==3?Qs:g.distr==4?Um:Wm)),a.stroke=ye(a.stroke),a.grid.stroke=ye(a.grid.stroke),a.ticks.stroke=ye(a.ticks.stroke),a.border.stroke=ye(a.border.stroke);let C=a.values;a.values=Rr(C)&&!Rr(C[0])?ye(C):x?Rr(C)?Fa(ee,La(C,V)):Ma(C)?Mm(ee,C):C||me:C||Vm,a.filter=ye(a.filter||(g.distr>=3&&g.log==10?Ym:g.distr==3&&g.log==2?Zm:dc)),a.font=Ja(a.font),a.labelFont=Ja(a.labelFont),a._size=a.size(n,null,p,0),a._space=a._rotate=a._incrs=a._found=a._splits=a._values=null,a._size>0&&(zr[p]=!0,a._el=qt(Nd,m))}}function Fn(a,p,v,g){let[x,C,D,B]=v,I=p%2,Y=0;return I==0&&(B||C)&&(Y=p==0&&!x||p==2&&!D?Qe($a.size/3):0),I==1&&(x||D)&&(Y=p==1&&!C||p==3&&!B?Qe(Ha.size/2):0),Y}const Jo=n.padding=(e.padding||[Fn,Fn,Fn,Fn]).map(a=>ye(xe(a,Fn))),Cr=n._padding=Jo.map((a,p)=>a(n,p,zr,0));let ct,rt=null,nt=null;const _i=i==1?T[0].idxs:null;let Gt=null,zn=!1;function Qo(a,p){if(t=a??[],n.data=n._data=t,i==2){ct=0;for(let v=1;v=0,mt=!0,on()}}n.setData=Qo;function ns(){zn=!0;let a,p;i==1&&(ct>0?(rt=_i[0]=0,nt=_i[1]=ct-1,a=t[0][rt],p=t[0][nt],W==2?(a=rt,p=nt):a==p&&(W==3?[a,p]=Ki(a,a,R.log,!1):W==4?[a,p]=Bo(a,a,R.log,!1):R.time?p=a+Qe(86400/E):[a,p]=qi(a,p,$o,!0))):(rt=_i[0]=a=null,nt=_i[1]=p=null)),Or(M,a,p)}let vi,nn,is,ss,os,ls,as,us,cs,kt;function Xo(a,p,v,g,x,C){a??(a=da),v??(v=qo),g??(g="butt"),x??(x=da),C??(C="round"),a!=vi&&(f.strokeStyle=vi=a),x!=nn&&(f.fillStyle=nn=x),p!=is&&(f.lineWidth=is=p),C!=os&&(f.lineJoin=os=C),g!=ls&&(f.lineCap=ls=g),v!=ss&&f.setLineDash(ss=v)}function el(a,p,v,g){p!=nn&&(f.fillStyle=nn=p),a!=as&&(f.font=as=a),v!=us&&(f.textAlign=us=v),g!=cs&&(f.textBaseline=cs=g)}function fs(a,p,v,g,x=0){if(g.length>0&&a.auto(n,zn)&&(p==null||p.min==null)){let C=xe(rt,0),D=xe(nt,g.length-1),B=v.min==null?Yd(g,C,D,x,a.distr==3):[v.min,v.max];a.min=Qt(a.min,v.min=B[0]),a.max=yt(a.max,v.max=B[1])}}const tl={min:null,max:null};function ef(){for(let g in O){let x=O[g];U[g]==null&&(x.min==null||U[M]!=null&&x.auto(n,zn))&&(U[g]=tl)}for(let g in O){let x=O[g];U[g]==null&&x.from!=null&&U[x.from]!=null&&(U[g]=tl)}U[M]!=null&&sn(!0);let a={};for(let g in U){let x=U[g];if(x!=null){let C=a[g]=En(O[g],im);if(x.min!=null)Ze(C,x);else if(g!=M||i==2)if(ct==0&&C.from==null){let D=C.range(n,null,null,g);C.min=D[0],C.max=D[1]}else C.min=Me,C.max=-Me}}if(ct>0){T.forEach((g,x)=>{if(i==1){let C=g.scale,D=U[C];if(D==null)return;let B=a[C];if(x==0){let I=B.range(n,B.min,B.max,C);B.min=I[0],B.max=I[1],rt=Jt(B.min,t[0]),nt=Jt(B.max,t[0]),nt-rt>1&&(t[0][rt]B.max&&nt--),g.min=Gt[rt],g.max=Gt[nt]}else g.show&&g.auto&&fs(B,D,g,t[x],g.sorted);g.idxs[0]=rt,g.idxs[1]=nt}else if(x>0&&g.show&&g.auto){let[C,D]=g.facets,B=C.scale,I=D.scale,[Y,J]=t[x],X=a[B],ce=a[I];X!=null&&fs(X,U[B],C,Y,C.sorted),ce!=null&&fs(ce,U[I],D,J,D.sorted),g.min=D.min,g.max=D.max}});for(let g in a){let x=a[g],C=U[g];if(x.from==null&&(C==null||C.min==null)){let D=x.range(n,x.min==Me?null:x.min,x.max==-Me?null:x.max,g);x.min=D[0],x.max=D[1]}}}for(let g in a){let x=a[g];if(x.from!=null){let C=a[x.from];if(C.min==null)x.min=x.max=null;else{let D=x.range(n,C.min,C.max,g);x.min=D[0],x.max=D[1]}}}let p={},v=!1;for(let g in a){let x=a[g],C=O[g];if(C.min!=x.min||C.max!=x.max){C.min=x.min,C.max=x.max;let D=C.distr;C._min=D==3?wr(C.min):D==4?Ns(C.min,C.asinh):D==100?C.fwd(C.min):C.min,C._max=D==3?wr(C.max):D==4?Ns(C.max,C.asinh):D==100?C.fwd(C.max):C.max,p[g]=v=!0}}if(v){T.forEach((g,x)=>{i==2?x>0&&p.y&&(g._paths=null):p[g.scale]&&(g._paths=null)});for(let g in p)ht=!0,ot("setScale",g);Ce&&Z.left>=0&&(mr=mt=!0)}for(let g in U)U[g]=null}function tf(a){let p=Js(rt-1,0,ct-1),v=Js(nt+1,0,ct-1);for(;a[p]==null&&p>0;)p--;for(;a[v]==null&&v0){let a=T.some(p=>p._focus)&&kt!=xt.alpha;a&&(f.globalAlpha=kt=xt.alpha),T.forEach((p,v)=>{if(v>0&&p.show&&(rl(v,!1),rl(v,!0),p._paths==null)){let g=kt;kt!=p.alpha&&(f.globalAlpha=kt=p.alpha);let x=i==2?[0,t[v][0].length-1]:tf(t[v]);p._paths=p.paths(n,v,x[0],x[1]),kt!=g&&(f.globalAlpha=kt=g)}}),T.forEach((p,v)=>{if(v>0&&p.show){let g=kt;kt!=p.alpha&&(f.globalAlpha=kt=p.alpha),p._paths!=null&&nl(v,!1);{let x=p._paths!=null?p._paths.gaps:null,C=p.points.show(n,v,rt,nt,x),D=p.points.filter(n,v,C,x);(C||D)&&(p.points._paths=p.points.paths(n,v,rt,nt,D),nl(v,!0))}kt!=g&&(f.globalAlpha=kt=g),ot("drawSeries",v)}}),a&&(f.globalAlpha=kt=1)}}function rl(a,p){let v=p?T[a].points:T[a];v._stroke=v.stroke(n,a),v._fill=v.fill(n,a)}function nl(a,p){let v=p?T[a].points:T[a],{stroke:g,fill:x,clip:C,flags:D,_stroke:B=v._stroke,_fill:I=v._fill,_width:Y=v.width}=v._paths;Y=Re(Y*Te,3);let J=null,X=Y%2/2;p&&I==null&&(I=Y>0?"#fff":B);let ce=v.pxAlign==1&&X>0;if(ce&&f.translate(X,X),!p){let Se=re-Y/2,we=ue-Y/2,ve=Ee+Y,oe=Ue+Y;J=new Path2D,J.rect(Se,we,ve,oe)}p?hs(B,Y,v.dash,v.cap,I,g,x,D,C):nf(a,B,Y,v.dash,v.cap,I,g,x,D,J,C),ce&&f.translate(-X,-X)}function nf(a,p,v,g,x,C,D,B,I,Y,J){let X=!1;I!=0&&F.forEach((ce,Se)=>{if(ce.series[0]==a){let we=T[ce.series[1]],ve=t[ce.series[1]],oe=(we._paths||ei).band;Rr(oe)&&(oe=ce.dir==1?oe[0]:oe[1]);let te,Be=null;we.show&&oe&&Jd(ve,rt,nt)?(Be=ce.fill(n,Se)||C,te=we._paths.clip):oe=null,hs(p,v,g,x,Be,D,B,I,Y,J,te,oe),X=!0}}),X||hs(p,v,g,x,C,D,B,I,Y,J)}const il=On|eo;function hs(a,p,v,g,x,C,D,B,I,Y,J,X){Xo(a,p,v,g,x),(I||Y||X)&&(f.save(),I&&f.clip(I),Y&&f.clip(Y)),X?(B&il)==il?(f.clip(X),J&&f.clip(J),yi(x,D),gi(a,C,p)):B&eo?(yi(x,D),f.clip(X),gi(a,C,p)):B&On&&(f.save(),f.clip(X),J&&f.clip(J),yi(x,D),f.restore(),gi(a,C,p)):(yi(x,D),gi(a,C,p)),(I||Y||X)&&f.restore()}function gi(a,p,v){v>0&&(p instanceof Map?p.forEach((g,x)=>{f.strokeStyle=vi=x,f.stroke(g)}):p!=null&&a&&f.stroke(p))}function yi(a,p){p instanceof Map?p.forEach((v,g)=>{f.fillStyle=nn=g,f.fill(v)}):p!=null&&a&&f.fill(p)}function sf(a,p,v,g){let x=L[a],C;if(g<=0)C=[0,0];else{let D=x._space=x.space(n,a,p,v,g),B=x._incrs=x.incrs(n,a,p,v,g,D);C=g_(p,v,B,g,D)}return x._found=C}function ps(a,p,v,g,x,C,D,B,I,Y){let J=D%2/2;k==1&&f.translate(J,J),Xo(B,D,I,Y,B),f.beginPath();let X,ce,Se,we,ve=x+(g==0||g==3?-C:C);v==0?(ce=x,we=ve):(X=x,Se=ve);for(let oe=0;oe{if(!v.show)return;let x=O[v.scale];if(x.min==null){v._show&&(p=!1,v._show=!1,sn(!1));return}else v._show||(p=!1,v._show=!0,sn(!1));let C=v.side,D=C%2,{min:B,max:I}=x,[Y,J]=sf(g,B,I,D==0?ae:G);if(J==0)return;let X=x.distr==2,ce=v._splits=v.splits(n,g,B,I,Y,J,X),Se=x.distr==2?ce.map(te=>Gt[te]):ce,we=x.distr==2?Gt[ce[1]]-Gt[ce[0]]:Y,ve=v._values=v.values(n,v.filter(n,Se,g,J,we),g,J,we);v._rotate=C==2?v.rotate(n,ve,g,J):0;let oe=v._size;v._size=Ht(v.size(n,ve,g,a)),oe!=null&&v._size!=oe&&(p=!1)}),p}function lf(a){let p=!0;return Jo.forEach((v,g)=>{let x=v(n,g,zr,a);x!=Cr[g]&&(p=!1),Cr[g]=x}),p}function af(){for(let a=0;aGt[vt]):Se,ve=J.distr==2?Gt[Se[1]]-Gt[Se[0]]:I,oe=p.ticks,te=p.border,Be=oe.show?oe.size:0,Ve=Qe(Be*Te),lt=Qe((p.alignTo==2?p._size-Be-p.gap:p.gap)*Te),Pe=p._rotate*-Di/180,We=S(p._pos*Te),Ot=(Ve+lt)*B,_t=We+Ot;C=g==0?_t:0,x=g==1?_t:0;let $t=p.font[0],Kt=p.align==1?dn:p.align==2?As:Pe>0?dn:Pe<0?As:g==0?"center":v==3?As:dn,lr=Pe||g==1?"middle":v==2?Vn:pa;el($t,D,Kt,lr);let Pt=p.font[1]*p.lineGap,jt=Se.map(vt=>S(u(vt,J,X,ce))),Yt=p._values;for(let vt=0;vt{v>0&&(p._paths=null,a&&(i==1?(p.min=null,p.max=null):p.facets.forEach(g=>{g.min=null,g.max=null})))})}let bi=!1,ds=!1,Bn=[];function uf(){ds=!1;for(let a=0;a0&&queueMicrotask(uf)}n.batch=cf;function sl(){if(He&&(ef(),He=!1),ht&&(di(),ht=!1),ie){if($e(_,dn,d),$e(_,Vn,y),$e(_,Un,ae),$e(_,Gn,G),$e(b,dn,d),$e(b,Vn,y),$e(b,Un,ae),$e(b,Gn,G),$e(m,Un,dt),$e(m,Gn,zt),h.width=Qe(dt*Te),h.height=Qe(zt*Te),L.forEach(({_el:a,_show:p,_size:v,_pos:g,side:x})=>{if(a!=null)if(p){let C=x===3||x===0?v:0,D=x%2==1;$e(a,D?"left":"top",g-C),$e(a,D?"width":"height",v),$e(a,D?"top":"left",D?y:d),$e(a,D?"height":"width",D?G:ae),Ys(a,Wr)}else Mt(a,Wr)}),vi=nn=is=os=ls=as=us=cs=ss=null,kt=1,qn(!0),d!=w||y!=A||ae!=N||G!=K){sn(!1);let a=ae/N,p=G/K;if(Ce&&!mr&&Z.left>=0){Z.left*=a,Z.top*=p,ln&&ur(ln,Qe(Z.left),0,ae,G),an&&ur(an,0,Qe(Z.top),ae,G);for(let v=0;v=0&&ze.width>0){ze.left*=a,ze.width*=a,ze.top*=p,ze.height*=p;for(let v in bs)$e(fn,v,ze[v])}w=d,A=y,N=ae,K=G}ot("setSize"),ie=!1}dt>0&&zt>0&&(f.clearRect(0,0,h.width,h.height),ot("drawClear"),q.forEach(a=>a()),ot("draw")),ze.show&&Tr&&(wi(ze),Tr=!1),Ce&&mr&&($r(null,!0,!1),mr=!1),se.show&&se.live&&mt&&(gs(),mt=!1),c||(c=!0,n.status=1,ot("ready")),zn=!1,bi=!1}n.redraw=(a,p)=>{ht=p||!1,a!==!1?Or(M,R.min,R.max):on()};function ms(a,p){let v=O[a];if(v.from==null){if(ct==0){let g=v.range(n,p.min,p.max,a);p.min=g[0],p.max=g[1]}if(p.min>p.max){let g=p.min;p.min=p.max,p.max=g}if(ct>1&&p.min!=null&&p.max!=null&&p.max-p.min<1e-16)return;a==M&&v.distr==2&&ct>0&&(p.min=Jt(p.min,t[0]),p.max=Jt(p.max,t[0]),p.min==p.max&&p.max++),U[a]=p,He=!0,on()}}n.setScale=ms;let _s,vs,ln,an,ol,ll,un,cn,al,ul,Fe,qe,Er=!1;const ft=Z.drag;let it=ft.x,st=ft.y;Ce&&(Z.x&&(_s=qt(Ld,b)),Z.y&&(vs=qt(Fd,b)),R.ori==0?(ln=_s,an=vs):(ln=vs,an=_s),Fe=Z.left,qe=Z.top);const ze=n.select=Ze({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),fn=ze.show?qt(Dd,ze.over?b:_):null;function wi(a,p){if(ze.show){for(let v in a)ze[v]=a[v],v in bs&&$e(fn,v,a[v]);p!==!1&&ot("setSelect")}}n.setSelect=wi;function ff(a){if(T[a].show)be&&Ys(ke[a],Wr);else if(be&&Mt(ke[a],Wr),Ce){let v=vr?Bt[0]:Bt[a];v!=null&&ur(v,-10,-10,ae,G)}}function Or(a,p,v){ms(a,{min:p,max:v})}function sr(a,p,v,g){p.focus!=null&&_f(a),p.show!=null&&T.forEach((x,C)=>{C>0&&(a==C||a==null)&&(x.show=p.show,ff(C),i==2?(Or(x.facets[0].scale,null,null),Or(x.facets[1].scale,null,null)):Or(x.scale,null,null),on())}),v!==!1&&ot("setSeries",a,p),g&&Hn("setSeries",n,a,p)}n.setSeries=sr;function hf(a,p){Ze(F[a],p)}function pf(a,p){a.fill=ye(a.fill||null),a.dir=xe(a.dir,-1),p=p??F.length,F.splice(p,0,a)}function df(a){a==null?F.length=0:F.splice(a,1)}n.addBand=pf,n.setBand=hf,n.delBand=df;function mf(a,p){T[a].alpha=p,Ce&&Bt[a]!=null&&(Bt[a].style.opacity=p),be&&ke[a]&&(ke[a].style.opacity=p)}let gr,Pr,Br;const hn={focus:!0};function _f(a){if(a!=Br){let p=a==null,v=xt.alpha!=1;T.forEach((g,x)=>{if(i==1||x>0){let C=p||x==0||x==a;g._focus=p?null:C,v&&mf(x,C?1:xt.alpha)}}),Br=a,v&&on()}}be&&_r&&Ae(va,pe,a=>{Z._lock||(Ut(a),Br!=null&&sr(null,hn,!0,Ye.setSeries))});function or(a,p,v){let g=O[p];v&&(a=a/Te-(g.ori==1?y:d));let x=ae;g.ori==1&&(x=G,a=x-a),g.dir==-1&&(a=x-a);let C=g._min,D=g._max,B=a/x,I=C+(D-C)*B,Y=g.distr;return Y==3?Tn(10,I):Y==4?Xd(I,g.asinh):Y==100?g.bwd(I):I}function vf(a,p){let v=or(a,M,p);return Jt(v,t[0],rt,nt)}n.valToIdx=a=>Jt(a,t[0]),n.posToIdx=vf,n.posToVal=or,n.valToPos=(a,p,v)=>O[p].ori==0?s(a,O[p],v?Ee:ae,v?re:0):o(a,O[p],v?Ue:G,v?ue:0),n.setCursor=(a,p,v)=>{Fe=a.left,qe=a.top,$r(null,p,v)};function cl(a,p){$e(fn,dn,ze.left=a),$e(fn,Un,ze.width=p)}function fl(a,p){$e(fn,Vn,ze.top=a),$e(fn,Gn,ze.height=p)}let $n=R.ori==0?cl:fl,jn=R.ori==1?cl:fl;function gf(){if(be&&se.live)for(let a=i==2?1:0;a{_e[g]=v}):nm(a.idx)||_e.fill(a.idx),se.idx=_e[0]),be&&se.live){for(let v=0;v0||i==1&&!ut)&&yf(v,_e[v]);gf()}mt=!1,p!==!1&&ot("setLegend")}n.setLegend=gs;function yf(a,p){let v=T[a],g=a==0&&W==2?Gt:t[a],x;ut?x=v.values(n,a,p)??Lt:(x=v.value(n,p==null?null:g[p],a,p),x=x==null?Lt:{_:x}),se.values[a]=x}function $r(a,p,v){al=Fe,ul=qe,[Fe,qe]=Z.move(n,Fe,qe),Z.left=Fe,Z.top=qe,Ce&&(ln&&ur(ln,Qe(Fe),0,ae,G),an&&ur(an,0,Qe(qe),ae,G));let g,x=rt>nt;gr=Me,Pr=null;let C=R.ori==0?ae:G,D=R.ori==1?ae:G;if(Fe<0||ct==0||x){g=Z.idx=null;for(let B=0;B0&&Be.show){let Ot=Pe==null?-10:Pe==g?Y:H(i==1?t[0][Pe]:t[te][0][Pe],R,C,0),_t=We==null?-10:Q(We,i==1?O[Be.scale]:O[Be.facets[1].scale],D,0);if(_r&&We!=null){let $t=R.ori==1?Fe:qe,Kt=Xe(xt.dist(n,te,Pe,_t,$t));if(Kt=0?1:-1,Yt=Pt>=0?1:-1;Yt==jt&&(Yt==1?lr==1?We>=Pt:We<=Pt:lr==1?We<=Pt:We>=Pt)&&(gr=Kt,Pr=te)}else gr=Kt,Pr=te}}if(mt||vr){let $t,Kt;R.ori==0?($t=Ot,Kt=_t):($t=_t,Kt=Ot);let lr,Pt,jt,Yt,ar,vt,At=!0,jr=Ge.bbox;if(jr!=null){At=!1;let gt=jr(n,te);jt=gt.left,Yt=gt.top,lr=gt.width,Pt=gt.height}else jt=$t,Yt=Kt,lr=Pt=Ge.size(n,te);if(vt=Ge.fill(n,te),ar=Ge.stroke(n,te),vr)te==Pr&&gr<=xt.prox&&(J=jt,X=Yt,ce=lr,Se=Pt,we=At,ve=vt,oe=ar);else{let gt=Bt[te];gt!=null&&(tn[te]=jt,rn[te]=Yt,Sa(gt,lr,Pt,At),xa(gt,vt,ar),ur(gt,Ht(jt),Ht(Yt),ae,G))}}}}if(vr){let te=xt.prox,Be=Br==null?gr<=te:gr>te||Pr!=Br;if(mt||Be){let Ve=Bt[0];Ve!=null&&(tn[0]=J,rn[0]=X,Sa(Ve,ce,Se,we),xa(Ve,ve,oe),ur(Ve,Ht(J),Ht(X),ae,G))}}}if(ze.show&&Er)if(a!=null){let[B,I]=Ye.scales,[Y,J]=Ye.match,[X,ce]=a.cursor.sync.scales,Se=a.cursor.drag;if(it=Se._x,st=Se._y,it||st){let{left:we,top:ve,width:oe,height:te}=a.select,Be=a.scales[X].ori,Ve=a.posToVal,lt,Pe,We,Ot,_t,$t=B!=null&&Y(B,X),Kt=I!=null&&J(I,ce);$t&&it?(Be==0?(lt=we,Pe=oe):(lt=ve,Pe=te),We=O[B],Ot=H(Ve(lt,X),We,C,0),_t=H(Ve(lt+Pe,X),We,C,0),$n(Qt(Ot,_t),Xe(_t-Ot))):$n(0,C),Kt&&st?(Be==1?(lt=we,Pe=oe):(lt=ve,Pe=te),We=O[I],Ot=Q(Ve(lt,ce),We,D,0),_t=Q(Ve(lt+Pe,ce),We,D,0),jn(Qt(Ot,_t),Xe(_t-Ot))):jn(0,D)}else ws()}else{let B=Xe(al-ol),I=Xe(ul-ll);if(R.ori==1){let ce=B;B=I,I=ce}it=ft.x&&B>=ft.dist,st=ft.y&&I>=ft.dist;let Y=ft.uni;Y!=null?it&&st&&(it=B>=Y,st=I>=Y,!it&&!st&&(I>B?st=!0:it=!0)):ft.x&&ft.y&&(it||st)&&(it=st=!0);let J,X;it&&(R.ori==0?(J=un,X=Fe):(J=cn,X=qe),$n(Qt(J,X),Xe(X-J)),st||jn(0,D)),st&&(R.ori==1?(J=un,X=Fe):(J=cn,X=qe),jn(Qt(J,X),Xe(X-J)),it||$n(0,C)),!it&&!st&&($n(0,0),jn(0,0))}if(ft._x=it,ft._y=st,a==null){if(v){if(xl!=null){let[B,I]=Ye.scales;Ye.values[0]=B!=null?or(R.ori==0?Fe:qe,B):null,Ye.values[1]=I!=null?or(R.ori==1?Fe:qe,I):null}Hn(Ms,n,Fe,qe,ae,G,g)}if(_r){let B=v&&Ye.setSeries,I=xt.prox;Br==null?gr<=I&&sr(Pr,hn,!0,B):gr>I?sr(null,hn,!0,B):Pr!=Br&&sr(Pr,hn,!0,B)}}mt&&(se.idx=g,gs()),p!==!1&&ot("setCursor")}let Ar=null;Object.defineProperty(n,"rect",{get(){return Ar==null&&qn(!1),Ar}});function qn(a=!1){a?Ar=null:(Ar=b.getBoundingClientRect(),ot("syncRect",Ar))}function hl(a,p,v,g,x,C,D){Z._lock||Er&&a!=null&&a.movementX==0&&a.movementY==0||(ys(a,p,v,g,x,C,D,!1,a!=null),a!=null?$r(null,!0,!0):$r(p,!0,!1))}function ys(a,p,v,g,x,C,D,B,I){if(Ar==null&&qn(!1),Ut(a),a!=null)v=a.clientX-Ar.left,g=a.clientY-Ar.top;else{if(v<0||g<0){Fe=-10,qe=-10;return}let[Y,J]=Ye.scales,X=p.cursor.sync,[ce,Se]=X.values,[we,ve]=X.scales,[oe,te]=Ye.match,Be=p.axes[0].side%2==1,Ve=R.ori==0?ae:G,lt=R.ori==1?ae:G,Pe=Be?C:x,We=Be?x:C,Ot=Be?g:v,_t=Be?v:g;if(we!=null?v=oe(Y,we)?u(ce,O[Y],Ve,0):-10:v=Ve*(Ot/Pe),ve!=null?g=te(J,ve)?u(Se,O[J],lt,0):-10:g=lt*(_t/We),R.ori==1){let $t=v;v=g,g=$t}}I&&(p==null||p.cursor.event.type==Ms)&&((v<=1||v>=ae-1)&&(v=Hr(v,ae)),(g<=1||g>=G-1)&&(g=Hr(g,G))),B?(ol=v,ll=g,[un,cn]=Z.move(n,v,g)):(Fe=v,qe=g)}const bs={width:0,height:0,left:0,top:0};function ws(){wi(bs,!1)}let pl,dl,ml,_l;function vl(a,p,v,g,x,C,D){Er=!0,it=st=ft._x=ft._y=!1,ys(a,p,v,g,x,C,D,!0,!1),a!=null&&(Ae(Rs,Gs,gl,!1),Hn(ma,n,un,cn,ae,G,null));let{left:B,top:I,width:Y,height:J}=ze;pl=B,dl=I,ml=Y,_l=J}function gl(a,p,v,g,x,C,D){Er=ft._x=ft._y=!1,ys(a,p,v,g,x,C,D,!1,!0);let{left:B,top:I,width:Y,height:J}=ze,X=Y>0||J>0,ce=pl!=B||dl!=I||ml!=Y||_l!=J;if(X&&ce&&wi(ze),ft.setScale&&X&&ce){let Se=B,we=Y,ve=I,oe=J;if(R.ori==1&&(Se=I,we=J,ve=B,oe=Y),it&&Or(M,or(Se,M),or(Se+we,M)),st)for(let te in O){let Be=O[te];te!=M&&Be.from==null&&Be.min!=Me&&Or(te,or(ve+oe,te),or(ve,te))}ws()}else Z.lock&&(Z._lock=!Z._lock,$r(p,!0,a!=null));a!=null&&(wt(Rs,Gs),Hn(Rs,n,Fe,qe,ae,G,null))}function bf(a,p,v,g,x,C,D){if(Z._lock)return;Ut(a);let B=Er;if(Er){let I=!0,Y=!0,J=10,X,ce;R.ori==0?(X=it,ce=st):(X=st,ce=it),X&&ce&&(I=Fe<=J||Fe>=ae-J,Y=qe<=J||qe>=G-J),X&&I&&(Fe=Fe{let x=Ye.match[2];v=x(n,p,v),v!=-1&&sr(v,g,!0,!1)},Ce&&(Ae(ma,b,vl),Ae(Ms,b,hl),Ae(_a,b,a=>{Ut(a),qn(!1)}),Ae(va,b,bf),Ae(ga,b,yl),to.add(n),n.syncRect=qn);const xi=n.hooks=e.hooks||{};function ot(a,p,v){ds?Bn.push([a,p,v]):a in xi&&xi[a].forEach(g=>{g.call(null,n,p,v)})}(e.plugins||[]).forEach(a=>{for(let p in a.hooks)xi[p]=(xi[p]||[]).concat(a.hooks[p])});const wl=(a,p,v)=>v,Ye=Ze({key:null,setSeries:!1,filters:{pub:Pa,sub:Pa},scales:[M,T[1]?T[1].scale:null],match:[Aa,Aa,wl],values:[null,null]},Z.sync);Ye.match.length==2&&Ye.match.push(wl),Z.sync=Ye;const xl=Ye.key,xs=Fc(xl);function Hn(a,p,v,g,x,C,D){Ye.filters.pub(a,p,v,g,x,C,D)&&xs.pub(a,p,v,g,x,C,D)}xs.sub(n);function wf(a,p,v,g,x,C,D){Ye.filters.sub(a,p,v,g,x,C,D)&&pn[a](null,p,v,g,x,C,D)}n.pub=wf;function xf(){xs.unsub(n),to.delete(n),ne.clear(),Zs(ji,gn,bl),l.remove(),pe==null||pe.remove(),ot("destroy")}n.destroy=xf;function ks(){ot("init",e,t),Qo(t||e.data,!1),U[M]?ms(M,U[M]):ns(),Tr=ze.show&&(ze.width>0||ze.height>0),mr=mt=!0,Xr(e.width,e.height)}return T.forEach(Zo),L.forEach(Xc),r?r instanceof HTMLElement?(r.appendChild(l),ks()):r(n,ks):ks(),n}at.assign=Ze;at.fmtNum=jo;at.rangeNum=qi;at.rangeLog=Ki;at.rangeAsinh=Bo;at.orient=Qr;at.pxRatio=Te;at.join=cm;at.fmtDate=Ho,at.tzDate=wm;at.sync=Fc;{at.addGap=n_,at.clipGaps=Ji;let e=at.paths={points:Hc};e.linear=Vc,e.stepped=o_,e.bars=l_,e.spline=u_}const b_=Object.freeze(Object.defineProperty({__proto__:null,default:at},Symbol.toStringTag,{value:"Module"}));function w_(e,t){let[r,n]=Sd(e,{formatSubMilliseconds:!0,compact:t}).split(" ").slice(0,2);return r.match(/[0-9]+s/)&&!t?(r=r.replace("s","."),n?n=n.substring(0,1):n="0",r+n+"s"):(n&&(r+=" "+n),r)}function Qa(e){return bd(e)}var x_=at.fmtDate("{YYYY}-{MM}-{DD} {HH}:{mm}:{ss}");function ts(e,t,r=!1){switch(e){case Mr.duration:return w_(t,r);case Mr.bytes:return Qa(t);case Mr.bps:return Qa(t)+"/s";case Mr.counter:return Ps(t).format("0.[0]a");case Mr.rps:return Ps(t).format("0.[00]a")+"/s";case Mr.timestamp:return x_(new Date(t*1e3));case Mr.percent:return Ps(t).format("0.0%");default:return isNaN(t)||t==null?"0":t.toFixed(2)}}function k_(e){return function(t,r,n,i){return i==null?"--":r==null?"":ts(e,r)}}var Kc=class{constructor(e,t,r){he(this,"samples");he(this,"series");const n=t.series.map(i=>i.query);this.samples=e.samples.select(n),this.samples.empty||(this.series=this.buildSeries(t.series,r))}get empty(){return this.samples.empty}get data(){const e=new Array;for(let t=0;t0&&(s=e[n].legend),r.push({stroke:t[i].stroke,fill:t[i].fill,value:k_(this.samples[n].unit),points:{show:!1},label:s,scale:this.samples[n].unit})}return r}};function S_(e){let t;function r(s){t=document.createElement("div");const o={display:"none",position:"absolute",padding:"1rem",border:"1px solid #7b65fa",zIndex:"10",pointerEvents:"none",fontSize:"1.25rem"};Object.assign(t.style,o),s.over.appendChild(t),s.over.onmouseleave=()=>{t.style.display="none"},s.over.onmouseenter=()=>{t.style.display="block"}}function n(s){i(s)}function i(s){const o=s.over.getBoundingClientRect();t.style.background=e;const u=T_(s);if(!u){t.style.display="none";return}t.innerHTML=u;const{left:c,top:l}=s.cursor,h=c??0,f=l??0;t.innerHTML=u,hs.over.focus()}}}function T_(e){const{idx:t}=e.cursor;if(t==null)return"";let r;e.legend.values?r=e.legend.values[0]._:r="";let n=`
    Head Gridcell
    Head Cell
    Head Column
    `;for(let i=1;i`}return n+="
    ${r}
    ${C_(s,o)}${u}${c}
    ",n}function C_(e,t){return``}var Li=(e=>(e.chart="chart",e.stat="stat",e.summary="summary",e))(Li||{}),E_=class{constructor(e,t){he(this,"view");he(this,"metrics");this.metrics=t.metrics;const r=e.series.map(n=>n.query);this.view=t.summary.select(r)}get empty(){return this.view.empty}get cols(){return this.view.aggregates.length}get header(){return new Array("metric",...this.view.aggregates.map(e=>e))}get body(){const e=new Array;for(let t=0;tthis.format(this.view[t],n))),e.push(r)}return e}format(e,t){var r;const n=this.metrics.unit(((r=e.metric)==null?void 0:r.name)??"",t);return ts(n,e.values[t],!0)}};function O_(e,t){for(let r=0;rn.query)).empty}function M_(e,t){return t.summary.select(e.series.map(n=>n.query)).empty}var R_=ci({conditions:void 0,styles:{borderRadius:{values:{true:{defaultClass:"_1c9nzq10"},false:{defaultClass:"_1c9nzq11"}}}}}),N_="_1c9nzq14",D_="_1c9nzq12",L_="_1c9nzq13";const F_=({children:e,title:t,isOpen:r,onClick:n})=>P("div",{children:[P(Je,{as:"button",align:"center","aria-expanded":r,className:dr(D_,R_({borderRadius:String(r)})),width:"100%",onClick:n,children:[r?P(er,{name:"chevron-up"}):P(er,{name:"chevron-down"}),P("h2",{className:L_,children:t})]}),r&&P("div",{className:N_,children:e})]});var z_=ci({conditions:{defaultCondition:"xs",conditionNames:["xs","sm","md","lg","xl","xxl"],responsiveArray:void 0},styles:{gridColumn:{values:{1:{conditions:{xs:"ag5hlo6",sm:"ag5hlo7",md:"ag5hlo8",lg:"ag5hlo9",xl:"ag5hloa",xxl:"ag5hlob"},defaultClass:"ag5hlo6"},2:{conditions:{xs:"ag5hloc",sm:"ag5hlod",md:"ag5hloe",lg:"ag5hlof",xl:"ag5hlog",xxl:"ag5hloh"},defaultClass:"ag5hloc"},3:{conditions:{xs:"ag5hloi",sm:"ag5hloj",md:"ag5hlok",lg:"ag5hlol",xl:"ag5hlom",xxl:"ag5hlon"},defaultClass:"ag5hloi"},4:{conditions:{xs:"ag5hloo",sm:"ag5hlop",md:"ag5hloq",lg:"ag5hlor",xl:"ag5hlos",xxl:"ag5hlot"},defaultClass:"ag5hloo"},5:{conditions:{xs:"ag5hlou",sm:"ag5hlov",md:"ag5hlow",lg:"ag5hlox",xl:"ag5hloy",xxl:"ag5hloz"},defaultClass:"ag5hlou"},6:{conditions:{xs:"ag5hlo10",sm:"ag5hlo11",md:"ag5hlo12",lg:"ag5hlo13",xl:"ag5hlo14",xxl:"ag5hlo15"},defaultClass:"ag5hlo10"},7:{conditions:{xs:"ag5hlo16",sm:"ag5hlo17",md:"ag5hlo18",lg:"ag5hlo19",xl:"ag5hlo1a",xxl:"ag5hlo1b"},defaultClass:"ag5hlo16"},8:{conditions:{xs:"ag5hlo1c",sm:"ag5hlo1d",md:"ag5hlo1e",lg:"ag5hlo1f",xl:"ag5hlo1g",xxl:"ag5hlo1h"},defaultClass:"ag5hlo1c"},9:{conditions:{xs:"ag5hlo1i",sm:"ag5hlo1j",md:"ag5hlo1k",lg:"ag5hlo1l",xl:"ag5hlo1m",xxl:"ag5hlo1n"},defaultClass:"ag5hlo1i"},10:{conditions:{xs:"ag5hlo1o",sm:"ag5hlo1p",md:"ag5hlo1q",lg:"ag5hlo1r",xl:"ag5hlo1s",xxl:"ag5hlo1t"},defaultClass:"ag5hlo1o"},11:{conditions:{xs:"ag5hlo1u",sm:"ag5hlo1v",md:"ag5hlo1w",lg:"ag5hlo1x",xl:"ag5hlo1y",xxl:"ag5hlo1z"},defaultClass:"ag5hlo1u"},12:{conditions:{xs:"ag5hlo20",sm:"ag5hlo21",md:"ag5hlo22",lg:"ag5hlo23",xl:"ag5hlo24",xxl:"ag5hlo25"},defaultClass:"ag5hlo20"}}}}}),Xa={root:"ag5hlo1",variants:ci({conditions:void 0,styles:{gap:{values:{1:{defaultClass:"ag5hlo2"},2:{defaultClass:"ag5hlo3"},3:{defaultClass:"ag5hlo4"},4:{defaultClass:"ag5hlo5"}}}}})};function B_({as:e="div",gap:t=3,children:r,className:n,...i},s){return P(e,{ref:s,className:dr(n,Xa.root,Xa.variants({gap:t})),...i,children:r})}function $_({children:e,as:t="div",className:r,xs:n=12,sm:i,md:s,lg:o,xl:u,xxl:c,...l},h){return P(t,{ref:h,className:dr(r,z_({gridColumn:{xs:n,sm:i,md:s,lg:o,xl:u,xxl:c}})),...l,children:e})}const rs=Object.assign(hr(B_),{Column:hr($_)});var Yc={exports:{}};const j_=Fu(Qf),q_=Fu(b_);(function(e,t){(function(n,i){e.exports=i(j_,q_)})(vn,(r,n)=>(()=>{var i={"./common/index.ts":(c,l,h)=>{h.r(l),h.d(l,{dataMatch:()=>_,optionsUpdateState:()=>m});var f=function(b,k){var S={};for(var E in b)Object.prototype.hasOwnProperty.call(b,E)&&k.indexOf(E)<0&&(S[E]=b[E]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var T=0,E=Object.getOwnPropertySymbols(b);T{c.exports=r},uplot:c=>{c.exports=n}},s={};function o(c){var l=s[c];if(l!==void 0)return l.exports;var h=s[c]={exports:{}};return i[c](h,h.exports,o),h.exports}o.n=c=>{var l=c&&c.__esModule?()=>c.default:()=>c;return o.d(l,{a:l}),l},o.d=(c,l)=>{for(var h in l)o.o(l,h)&&!o.o(c,h)&&Object.defineProperty(c,h,{enumerable:!0,get:l[h]})},o.o=(c,l)=>Object.prototype.hasOwnProperty.call(c,l),o.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var u={};return(()=>{/*!*******************************!*\ + !*** ./react/uplot-react.tsx ***! + \*******************************/o.r(u),o.d(u,{default:()=>_});var c=o("react"),l=o.n(c),h=o("uplot"),f=o.n(h),m=o("./common/index.ts");function _(b){var k=b.options,S=b.data,E=b.target,T=b.onDelete,L=b.onCreate,O=b.resetScales,F=O===void 0?!0:O,M=b.className,z=(0,c.useRef)(null),q=(0,c.useRef)(null),$=(0,c.useRef)(k),j=(0,c.useRef)(E),R=(0,c.useRef)(S),W=(0,c.useRef)(L),H=(0,c.useRef)(T);(0,c.useEffect)(function(){W.current=L,H.current=T});var Q=(0,c.useCallback)(function(ee){var V;ee&&((V=H.current)===null||V===void 0||V.call(H,ee),ee.destroy(),z.current=null)},[]),U=(0,c.useCallback)(function(){var ee,V=new(f())($.current,R.current,j.current||q.current);z.current=V,(ee=W.current)===null||ee===void 0||ee.call(W,V)},[]);return(0,c.useEffect)(function(){return U(),function(){Q(z.current)}},[U,Q]),(0,c.useEffect)(function(){if($.current!==k){var ee=(0,m.optionsUpdateState)($.current,k);$.current=k,!z.current||ee==="create"?(Q(z.current),U()):ee==="update"&&z.current.setSize({width:k.width,height:k.height})}},[k,U,Q]),(0,c.useEffect)(function(){R.current!==S&&(z.current?(0,m.dataMatch)(R.current,S)||(F?z.current.setData(S,!0):(z.current.setData(S,!1),z.current.redraw())):(R.current=S,U()),R.current=S)},[S,F,U]),(0,c.useEffect)(function(){return j.current!==E&&(j.current=E,U()),function(){return Q(z.current)}},[E,U,Q]),E?null:l().createElement("div",{ref:q,className:M})}})(),u=u.default,u})())})(Yc);var H_=Yc.exports;const Zc=Vi(H_);var I_="_14dhllh0",V_="_14dhllh1",W_="_14dhllh3",U_="_14dhllh2";const G_=1,K_=70,Y_=250,Z_=at.sync("chart"),J_=[[3600*24*365,"0",null,null,null,null,null,null,1],[3600*24*28,"0",null,null,null,null,null,null,1],[3600*24,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[3600,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[60,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[1,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[.001,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1]],Q_=e=>({tooltip:e==="dark"?Kl[900]:Cs.white,grid:e==="dark"?Kl[700]:Wu[300],axes:e==="dark"?Cs.white:Cs.black}),X_=(e,t)=>t===0?J_:(r,n)=>n.map(i=>ts(e,i)),e1=(e,t)=>(r,n)=>{const i={stroke:e.axes,grid:{stroke:e.grid,width:1},ticks:{stroke:e.grid},values:X_(r,n),scale:r,space:r==="timestamp"?60:40};return n===2&&t>2&&(i.side=G_),n!==0&&(i.size=K_),i},t1=({height:e=Y_,hooks:t,plot:r,scales:n,theme:i,width:s})=>{const o=Q_(i),u=r.samples.units,c=u.map(e1(o,u.length));return{class:U_,width:s,height:e,hooks:t,cursor:{sync:{key:Z_.key}},legend:{live:!0},scales:n,series:r.series,axes:c,plugins:[S_(o.tooltip)]}},r1=jh(["show"]),n1=(e=[],t=[])=>e.map((r,n)=>r1(r,t[n])),i1=e=>(e==null?void 0:e.type)==="dblclick",s1=e=>e!=null&&!e.ctrlKey&&!e.metaKey,o1=e=>{const[t,r]=Ke(e);return[n1(e,t),s=>{r(s.series)}]},l1=({plot:e,theme:t,width:r})=>{const{timeRange:n,setTimeRange:i}=Eo(),[s,o]=o1(e.series),u={...e,series:s},c={timestamp:{min:n==null?void 0:n.from,max:n==null?void 0:n.to}};return t1({hooks:{setCursor:[_=>{i1(_.cursor.event)&&i(void 0)}],ready:[_=>{const b=_.root.querySelector(".u-legend");if(b){const k=b.querySelector("tr");k&&(k.style.display="none")}}],setSelect:[_=>{if(!s1(_.cursor.event))return;const b=_.posToVal(_.select.left,"timestamp"),k=_.posToVal(_.select.left+_.select.width,"timestamp");i({from:b,to:k})}],setSeries:[o]},plot:u,scales:c,theme:t,width:r})};function a1({panel:e,container:t}){const r=Jr(),{theme:n}=An(),i=Ct(null),{width:s}=Hu({ref:i}),o=new Kc(r,e,Uu(n)),u=!o.empty&&o.data[0].length>1,c=u?o.data:[],l=l1({plot:o,theme:n,width:s}),h=t?pt:Ui;function f(m){const _=n=="dark"?"#60606080":"#d0d0d080",b=m.root.querySelector(".u-select");b&&(b.style.background=_)}return P(rs.Column,{xs:12,lg:e.fullWidth?12:6,children:P(h,{children:P("div",{ref:i,children:[P(Je,{align:"center",gap:1,children:[P("h3",{className:W_,children:e.title}),P(Us,{title:e.summary,children:P(er,{name:"info",width:"20px",height:"20px"})})]}),P("div",{className:I_,children:[!u&&P("p",{className:V_,children:"no data"}),P(Zc,{options:l,data:c,onCreate:f})]})]})})})}var u1="ova0r31",c1="ova0r32",f1="ova0r30";const h1=32,p1=({digest:e,panel:t,plot:r,width:n})=>{const i=t.series[0].query,s=e.samples.query(i);let o;return s&&Array.isArray(s.values)&&s.values.length!==0&&(o=ts(s.unit,Number(s.values.slice(-1)),!0)),{class:f1,width:n,height:h1,title:o,series:r.series,axes:[{show:!1},{show:!1}],legend:{show:!1},cursor:{show:!1}}};function d1({panel:e}){const t=Jr(),{theme:r}=An(),n=Ct(null),{width:i}=Hu({ref:n}),s=new Kc(t,e,Uu(r));if(s.empty)return null;const o=p1({digest:t,panel:e,plot:s,width:i});return P(rs.Column,{xs:6,md:4,lg:2,children:P(Ui,{className:u1,children:P(Je,{direction:"column",justify:"end",gap:0,height:"100%",children:[P("p",{className:c1,children:e.title}),P("div",{ref:n,children:P(Zc,{options:o,data:s.data})})]})})})}var m1="_12owwid0",_1="_12owwid4",v1="_12owwid1",g1={thead:"_12owwid2",tbody:"_12owwid3"};function y1({children:e,...t}){return P("table",{className:m1,...t,children:e})}function b1({children:e,...t}){return P("thead",{...t,children:e})}function w1({children:e,...t}){return P("tbody",{...t,children:e})}function x1({children:e,...t}){return P("th",{className:v1,...t,children:e})}function k1({children:e,isHead:t=!1,...r}){return P("tr",{className:g1[t?"thead":"tbody"],...r,children:e})}function S1({children:e,...t}){return P("td",{className:_1,...t,children:e})}function T1({children:e,...t}){return P("tfoot",{...t,children:e})}const qr=Object.assign(y1,{Body:w1,Cell:S1,Footer:T1,Head:b1,Header:x1,Row:k1});var C1="_57i9sh1",E1="_57i9sh0";var O1="_1jb2mvv0",P1="_1jb2mvv2",A1="_1jb2mvv1";function M1({children:e,className:t,title:r,...n},i){return P(Ui,{ref:i,className:dr(O1,t),...n,children:[r&&P("h3",{className:A1,children:r}),P("div",{className:P1,children:e})]})}const R1=hr(M1);function N1({panel:e}){const t=Jr(),r=new E_(e,t);if(r.empty)return P("div",{});const n=r.view.aggregates.length,i=n>6?12:n>1?6:3,s=n>6||n>1?12:6;return P(rs.Column,{xs:12,md:s,lg:i,children:P(R1,{className:E1,title:e.title,children:P("div",{className:C1,children:P(qr,{children:[P(qr.Head,{children:P(qr.Row,{isHead:!0,children:r.header.map((o,u)=>P(qr.Header,{align:u==0?"left":"right",children:o},e.id+"header"+o))})}),P(qr.Body,{children:r.body.map((o,u)=>P(qr.Row,{children:o.map((c,l)=>P(qr.Cell,{align:l==0?"left":"right",children:c},e.id+"_value_"+u+"_"+l))},e.id+"row"+u))})]})})},e.id)})}function D1({container:e,panel:t}){switch(t.kind){case Li.chart:return P(a1,{panel:t,container:e});case Li.stat:return P(d1,{panel:t});case Li.summary:return P(N1,{panel:t});default:return null}}var L1="_1ls5syl0";function eu({container:e,section:t}){return P(rs,{gap:e?4:3,children:t.panels.map(r=>P(D1,{panel:r,container:e},r.id))})}function F1({section:e}){const[t,r]=Ke(!0),n=Jr();return O_(e,n)?null:e.title?P(Je,{direction:"column",children:P(F_,{title:e.title,isOpen:t,onClick:()=>r(!t),children:P(eu,{container:!0,section:e})})}):P(Je,{direction:"column",children:[e.summary&&P("p",{className:L1,children:e.summary}),P(eu,{section:e})]})}var z1="_1t22owt0",B1="_1t22owt1";function $1(){const e=Jr(),{themeClassName:t}=An(),[r,n]=Ke(0),i=!!e.samples.length;return P(Je,{className:`${t} ${z1}`,direction:"column",gap:0,children:[P(cd,{config:e.config,tab:r,onTabChange:n}),P(Je,{as:"main",className:B1,direction:"column",grow:i?0:1,children:P(dd,{isLoading:!i,message:"Loading...",children:e.config.tabs.map((s,o)=>P(j1,{active:r,idx:o,children:s.sections.map(u=>P(F1,{section:u},u.id))},s.id))})}),P(_0,{})]})}function j1({children:e,active:t,idx:r}){return t!==r?null:P(Je,{direction:"column",gap:3,children:e})}const q1=new URLSearchParams(window.location.search).get("endpoint")||"http://localhost:5665/",H1=document.getElementById("root");Jf.createRoot(H1).render(P(ah,{endpoint:q1+"events",children:P(_h,{children:P(vh,{children:P($1,{})})})})); diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-edee3789.js b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-edee3789.js deleted file mode 100644 index 7803126413b..00000000000 --- a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/assets/index-edee3789.js +++ /dev/null @@ -1,50 +0,0 @@ -var tg=Object.defineProperty;var ng=(e,t,n)=>t in e?tg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>(ng(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();var rg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ha(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}),n}var ah={exports:{}},ma={},uh={exports:{}},we={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var No=Symbol.for("react.element"),ig=Symbol.for("react.portal"),og=Symbol.for("react.fragment"),sg=Symbol.for("react.strict_mode"),ag=Symbol.for("react.profiler"),ug=Symbol.for("react.provider"),cg=Symbol.for("react.context"),fg=Symbol.for("react.forward_ref"),dg=Symbol.for("react.suspense"),pg=Symbol.for("react.memo"),hg=Symbol.for("react.lazy"),Ud=Symbol.iterator;function mg(e){return e===null||typeof e!="object"?null:(e=Ud&&e[Ud]||e["@@iterator"],typeof e=="function"?e:null)}var ch={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fh=Object.assign,dh={};function ci(e,t,n){this.props=e,this.context=t,this.refs=dh,this.updater=n||ch}ci.prototype.isReactComponent={};ci.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ci.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ph(){}ph.prototype=ci.prototype;function Qc(e,t,n){this.props=e,this.context=t,this.refs=dh,this.updater=n||ch}var Zc=Qc.prototype=new ph;Zc.constructor=Qc;fh(Zc,ci.prototype);Zc.isPureReactComponent=!0;var Wd=Array.isArray,hh=Object.prototype.hasOwnProperty,Jc={current:null},mh={key:!0,ref:!0,__self:!0,__source:!0};function vh(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)hh.call(t,r)&&!mh.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,Y=q[re];if(0>>1;rel(pe,G))Rel(Ue,pe)?(q[re]=Ue,q[Re]=G,re=Re):(q[re]=pe,q[X]=G,re=X);else if(Rel(Ue,G))q[re]=Ue,q[Re]=G,re=Re;else break e}}return J}function l(q,J){var G=q.sortIndex-J.sortIndex;return G!==0?G:q.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],a=[],c=1,p=null,d=3,g=!1,_=!1,x=!1,P=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(q){for(var J=n(a);J!==null;){if(J.callback===null)r(a);else if(J.startTime<=q)r(a),J.sortIndex=J.expirationTime,t(u,J);else break;J=n(a)}}function T(q){if(x=!1,w(q),!_)if(n(u)!==null)_=!0,fe(O);else{var J=n(a);J!==null&&ne(T,J.startTime-q)}}function O(q,J){_=!1,x&&(x=!1,y(R),R=-1),g=!0;var G=d;try{for(w(J),p=n(u);p!==null&&(!(p.expirationTime>J)||q&&!D());){var re=p.callback;if(typeof re=="function"){p.callback=null,d=p.priorityLevel;var Y=re(p.expirationTime<=J);J=e.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(u)&&r(u),w(J)}else r(u);p=n(u)}if(p!==null)var me=!0;else{var X=n(a);X!==null&&ne(T,X.startTime-J),me=!1}return me}finally{p=null,d=G,g=!1}}var M=!1,N=null,R=-1,I=5,A=-1;function D(){return!(e.unstable_now()-Aq||125re?(q.sortIndex=G,t(a,q),n(u)===null&&q===n(a)&&(x?(y(R),R=-1):x=!0,ne(T,G-re))):(q.sortIndex=Y,t(u,q),_||g||(_=!0,fe(O))),q},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(q){var J=d;return function(){var G=d;d=J;try{return q.apply(this,arguments)}finally{d=G}}}})(_h);wh.exports=_h;var Tg=wh.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var xh=$,sn=Tg;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wu=Object.prototype.hasOwnProperty,Pg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Kd={},Gd={};function Og(e){return Wu.call(Gd,e)?!0:Wu.call(Kd,e)?!1:Pg.test(e)?Gd[e]=!0:(Kd[e]=!0,!1)}function bg(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ng(e,t,n,r){if(t===null||typeof t>"u"||bg(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ut(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rt[e]=new Ut(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rt[t]=new Ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rt[e]=new Ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rt[e]=new Ut(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Rt[e]=new Ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rt[e]=new Ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rt[e]=new Ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rt[e]=new Ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rt[e]=new Ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var ef=/[\-:]([a-z])/g;function tf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ef,tf);Rt[t]=new Ut(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ef,tf);Rt[t]=new Ut(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ef,tf);Rt[t]=new Ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rt[e]=new Ut(e,1,!1,e.toLowerCase(),null,!1,!1)});Rt.xlinkHref=new Ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rt[e]=new Ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function nf(e,t,n,r){var l=Rt.hasOwnProperty(t)?Rt[t]:null;(l!==null?l.type!==0:r||!(2s||l[o]!==i[s]){var u=` -`+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{cu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hi(e):""}function Mg(e){switch(e.tag){case 5:return Hi(e.type);case 16:return Hi("Lazy");case 13:return Hi("Suspense");case 19:return Hi("SuspenseList");case 0:case 2:case 15:return e=fu(e.type,!1),e;case 11:return e=fu(e.type.render,!1),e;case 1:return e=fu(e.type,!0),e;default:return""}}function Yu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ol:return"Fragment";case Pl:return"Portal";case qu:return"Profiler";case rf:return"StrictMode";case Ku:return"Suspense";case Gu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Eh:return(e.displayName||"Context")+".Consumer";case Sh:return(e._context.displayName||"Context")+".Provider";case lf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case of:return t=e.displayName||null,t!==null?t:Yu(e.type)||"Memo";case xr:t=e._payload,e=e._init;try{return Yu(e(t))}catch{}}return null}function Rg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yu(t);case 8:return t===rf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ar(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Th(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lg(e){var t=Th(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ts(e){e._valueTracker||(e._valueTracker=Lg(e))}function Ph(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Th(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Is(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qu(e,t){var n=t.checked;return Ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Qd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ar(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oh(e,t){t=t.checked,t!=null&&nf(e,"checked",t,!1)}function Zu(e,t){Oh(e,t);var n=Ar(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ju(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ju(e,t.type,Ar(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ju(e,t,n){(t!=="number"||Is(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vi=Array.isArray;function Il(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ns.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function uo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jg=["Webkit","ms","Moz","O"];Object.keys(Yi).forEach(function(e){jg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yi[t]=Yi[e]})});function Rh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yi.hasOwnProperty(e)&&Yi[e]?(""+t).trim():t+"px"}function Lh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Rh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var zg=Ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tc(e,t){if(t){if(zg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function nc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rc=null;function sf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var lc=null,Bl=null,$l=null;function ep(e){if(e=Lo(e)){if(typeof lc!="function")throw Error(H(280));var t=e.stateNode;t&&(t=_a(t),lc(e.stateNode,e.type,t))}}function jh(e){Bl?$l?$l.push(e):$l=[e]:Bl=e}function zh(){if(Bl){var e=Bl,t=$l;if($l=Bl=null,ep(e),t)for(e=0;e>>=0,e===0?32:31-(qg(e)/Kg|0)|0}var rs=64,ls=4194304;function Ui(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Vs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~l;s!==0?r=Ui(s):(i&=o,i!==0&&(r=Ui(i)))}else o=n&~l,o!==0?r=Ui(o):i!==0&&(r=Ui(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Mo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zn(t),e[t]=n}function Zg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zi),up=String.fromCharCode(32),cp=!1;function tm(e,t){switch(e){case"keyup":return Cy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bl=!1;function Py(e,t){switch(e){case"compositionend":return nm(t);case"keypress":return t.which!==32?null:(cp=!0,up);case"textInput":return e=t.data,e===up&&cp?null:e;default:return null}}function Oy(e,t){if(bl)return e==="compositionend"||!mf&&tm(e,t)?(e=Xh(),Ts=df=Tr=null,bl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hp(n)}}function om(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?om(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sm(){for(var e=window,t=Is();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Is(e.document)}return t}function vf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Dy(e){var t=sm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&om(n.ownerDocument.documentElement,n)){if(r!==null&&vf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=mp(n,i);var o=mp(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Nl=null,cc=null,Xi=null,fc=!1;function vp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fc||Nl==null||Nl!==Is(r)||(r=Nl,"selectionStart"in r&&vf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xi&&vo(Xi,r)||(Xi=r,r=qs(cc,"onSelect"),0Ll||(e.current=gc[Ll],gc[Ll]=null,Ll--)}function je(e,t){Ll++,gc[Ll]=e.current,e.current=t}var Dr={},Dt=Ir(Dr),Gt=Ir(!1),ll=Dr;function Kl(e,t){var n=e.type.contextTypes;if(!n)return Dr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Yt(e){return e=e.childContextTypes,e!=null}function Gs(){Ie(Gt),Ie(Dt)}function Sp(e,t,n){if(Dt.current!==Dr)throw Error(H(168));je(Dt,t),je(Gt,n)}function vm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(H(108,Rg(e)||"Unknown",l));return Ye({},n,r)}function Ys(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dr,ll=Dt.current,je(Dt,e),je(Gt,Gt.current),!0}function Ep(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=vm(e,t,ll),r.__reactInternalMemoizedMergedChildContext=e,Ie(Gt),Ie(Dt),je(Dt,e)):Ie(Gt),je(Gt,n)}var tr=null,xa=!1,Cu=!1;function gm(e){tr===null?tr=[e]:tr.push(e)}function Yy(e){xa=!0,gm(e)}function Br(){if(!Cu&&tr!==null){Cu=!0;var e=0,t=Me;try{var n=tr;for(Me=1;e>=o,l-=o,nr=1<<32-zn(t)+l|n<R?(I=N,N=null):I=N.sibling;var A=d(y,N,w[R],T);if(A===null){N===null&&(N=I);break}e&&N&&A.alternate===null&&t(y,N),v=i(A,v,R),M===null?O=A:M.sibling=A,M=A,N=I}if(R===w.length)return n(y,N),Ve&&qr(y,R),O;if(N===null){for(;RR?(I=N,N=null):I=N.sibling;var D=d(y,N,A.value,T);if(D===null){N===null&&(N=I);break}e&&N&&D.alternate===null&&t(y,N),v=i(D,v,R),M===null?O=D:M.sibling=D,M=D,N=I}if(A.done)return n(y,N),Ve&&qr(y,R),O;if(N===null){for(;!A.done;R++,A=w.next())A=p(y,A.value,T),A!==null&&(v=i(A,v,R),M===null?O=A:M.sibling=A,M=A);return Ve&&qr(y,R),O}for(N=r(y,N);!A.done;R++,A=w.next())A=g(N,y,R,A.value,T),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?R:A.key),v=i(A,v,R),M===null?O=A:M.sibling=A,M=A);return e&&N.forEach(function(V){return t(y,V)}),Ve&&qr(y,R),O}function P(y,v,w,T){if(typeof w=="object"&&w!==null&&w.type===Ol&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case es:e:{for(var O=w.key,M=v;M!==null;){if(M.key===O){if(O=w.type,O===Ol){if(M.tag===7){n(y,M.sibling),v=l(M,w.props.children),v.return=y,y=v;break e}}else if(M.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===xr&&Mp(O)===M.type){n(y,M.sibling),v=l(M,w.props),v.ref=Ai(y,M,w),v.return=y,y=v;break e}n(y,M);break}else t(y,M);M=M.sibling}w.type===Ol?(v=el(w.props.children,y.mode,T,w.key),v.return=y,y=v):(T=js(w.type,w.key,w.props,null,y.mode,T),T.ref=Ai(y,v,w),T.return=y,y=T)}return o(y);case Pl:e:{for(M=w.key;v!==null;){if(v.key===M)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(y,v.sibling),v=l(v,w.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=Lu(w,y.mode,T),v.return=y,y=v}return o(y);case xr:return M=w._init,P(y,v,M(w._payload),T)}if(Vi(w))return _(y,v,w,T);if(Mi(w))return x(y,v,w,T);fs(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(y,v.sibling),v=l(v,w),v.return=y,y=v):(n(y,v),v=Ru(w,y.mode,T),v.return=y,y=v),o(y)):n(y,v)}return P}var Yl=Cm(!0),Tm=Cm(!1),jo={},qn=Ir(jo),_o=Ir(jo),xo=Ir(jo);function Jr(e){if(e===jo)throw Error(H(174));return e}function Cf(e,t){switch(je(xo,t),je(_o,e),je(qn,jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ec(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ec(t,e)}Ie(qn),je(qn,t)}function Ql(){Ie(qn),Ie(_o),Ie(xo)}function Pm(e){Jr(xo.current);var t=Jr(qn.current),n=ec(t,e.type);t!==n&&(je(_o,e),je(qn,n))}function Tf(e){_o.current===e&&(Ie(qn),Ie(_o))}var Ke=Ir(0);function ta(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Tu=[];function Pf(){for(var e=0;en?n:4,e(!0);var r=Pu.transition;Pu.transition={};try{e(!1),t()}finally{Me=n,Pu.transition=r}}function Vm(){return kn().memoizedState}function Xy(e,t,n){var r=jr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Um(e))Wm(t,n);else if(n=xm(e,t,n,r),n!==null){var l=Ht();An(n,e,r,l),qm(n,t,r)}}function ew(e,t,n){var r=jr(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Um(e))Wm(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,n);if(l.hasEagerState=!0,l.eagerState=s,Dn(s,o)){var u=t.interleaved;u===null?(l.next=l,Sf(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=xm(e,t,l,r),n!==null&&(l=Ht(),An(n,e,r,l),qm(n,t,r))}}function Um(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function Wm(e,t){eo=na=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,uf(e,n)}}var ra={readContext:xn,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},tw={readContext:xn,useCallback:function(e,t){return Vn().memoizedState=[e,t===void 0?null:t],e},useContext:xn,useEffect:Lp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ns(4194308,4,Fm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ns(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ns(4,2,e,t)},useMemo:function(e,t){var n=Vn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Xy.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Vn();return e={current:e},t.memoizedState=e},useState:Rp,useDebugValue:Rf,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Rp(!1),t=e[0];return e=Jy.bind(null,e[1]),Vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,l=Vn();if(Ve){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),St===null)throw Error(H(349));ol&30||Nm(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Lp(Rm.bind(null,r,i,e),[e]),r.flags|=2048,Eo(9,Mm.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vn(),t=St.identifierPrefix;if(Ve){var n=rr,r=nr;n=(r&~(1<<32-zn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ko++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Un]=t,e[wo]=r,t1(e,t,!1,!1),t.stateNode=e;e:{switch(o=nc(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),l=r;break;case"iframe":case"object":case"embed":Fe("load",e),l=r;break;case"video":case"audio":for(l=0;lJl&&(t.flags|=128,r=!0,Di(i,!1),t.lanes=4194304)}else{if(!r)if(e=ta(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Di(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ve)return zt(t),null}else 2*et()-i.renderingStartTime>Jl&&n!==1073741824&&(t.flags|=128,r=!0,Di(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=et(),t.sibling=null,n=Ke.current,je(Ke,r?n&1|2:n&1),t):(zt(t),null);case 22:case 23:return Ff(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tn&1073741824&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function uw(e,t){switch(yf(t),t.tag){case 1:return Yt(t.type)&&Gs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ql(),Ie(Gt),Ie(Dt),Pf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Tf(t),null;case 13:if(Ie(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Gl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Ke),null;case 4:return Ql(),null;case 10:return kf(t.type._context),null;case 22:case 23:return Ff(),null;case 24:return null;default:return null}}var ps=!1,At=!1,cw=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Dl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function bc(e,t,n){try{n()}catch(r){Je(e,t,r)}}var Hp=!1;function fw(e,t){if(dc=Us,e=sm(),vf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,a=0,c=0,p=e,d=null;t:for(;;){for(var g;p!==n||l!==0&&p.nodeType!==3||(s=o+l),p!==i||r!==0&&p.nodeType!==3||(u=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(g=p.firstChild)!==null;)d=p,p=g;for(;;){if(p===e)break t;if(d===n&&++a===l&&(s=o),d===i&&++c===r&&(u=o),(g=p.nextSibling)!==null)break;p=d,d=p.parentNode}p=g}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(pc={focusedElem:e,selectionRange:n},Us=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var x=_.memoizedProps,P=_.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Rn(t.type,x),P);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(T){Je(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return _=Hp,Hp=!1,_}function to(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&bc(t,n,i)}l=l.next}while(l!==r)}}function Ea(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Nc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function l1(e){var t=e.alternate;t!==null&&(e.alternate=null,l1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Un],delete t[wo],delete t[vc],delete t[Ky],delete t[Gy])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function i1(e){return e.tag===5||e.tag===3||e.tag===4}function Vp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||i1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ks));else if(r!==4&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}function Rc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Rc(e,t,n),e=e.sibling;e!==null;)Rc(e,t,n),e=e.sibling}var Nt=null,Ln=!1;function yr(e,t,n){for(n=n.child;n!==null;)o1(e,t,n),n=n.sibling}function o1(e,t,n){if(Wn&&typeof Wn.onCommitFiberUnmount=="function")try{Wn.onCommitFiberUnmount(va,n)}catch{}switch(n.tag){case 5:At||Dl(n,t);case 6:var r=Nt,l=Ln;Nt=null,yr(e,t,n),Nt=r,Ln=l,Nt!==null&&(Ln?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(Ln?(e=Nt,n=n.stateNode,e.nodeType===8?Eu(e.parentNode,n):e.nodeType===1&&Eu(e,n),ho(e)):Eu(Nt,n.stateNode));break;case 4:r=Nt,l=Ln,Nt=n.stateNode.containerInfo,Ln=!0,yr(e,t,n),Nt=r,Ln=l;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&bc(n,t,o),l=l.next}while(l!==r)}yr(e,t,n);break;case 1:if(!At&&(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Je(n,t,s)}yr(e,t,n);break;case 21:yr(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,yr(e,t,n),At=r):yr(e,t,n);break;default:yr(e,t,n)}}function Up(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cw),t.forEach(function(r){var l=_w.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Nn(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=et()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pw(r/1960))-r,10e?16:e,Pr===null)var r=!1;else{if(e=Pr,Pr=null,oa=0,Se&6)throw Error(H(331));var l=Se;for(Se|=4,ee=e.current;ee!==null;){var i=ee,o=i.child;if(ee.flags&16){var s=i.deletions;if(s!==null){for(var u=0;uet()-Af?Xr(e,0):zf|=n),Qt(e,t)}function h1(e,t){t===0&&(e.mode&1?(t=ls,ls<<=1,!(ls&130023424)&&(ls=4194304)):t=1);var n=Ht();e=ur(e,t),e!==null&&(Mo(e,t,n),Qt(e,n))}function ww(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),h1(e,n)}function _w(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),h1(e,n)}var m1;m1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)Kt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Kt=!1,sw(e,t,n);Kt=!!(e.flags&131072)}else Kt=!1,Ve&&t.flags&1048576&&ym(t,Zs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ms(e,t),e=t.pendingProps;var l=Kl(t,Dt.current);Vl(t,n),l=bf(null,t,r,e,l,n);var i=Nf();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(r)?(i=!0,Ys(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ef(t),l.updater=ka,t.stateNode=l,l._reactInternals=t,kc(t,r,e,n),t=Cc(null,t,r,!0,i,n)):(t.tag=0,Ve&&i&&gf(t),$t(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ms(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=kw(r),e=Rn(r,e),l){case 0:t=Ec(null,t,r,e,n);break e;case 1:t=Ip(null,t,r,e,n);break e;case 11:t=Dp(null,t,r,e,n);break e;case 14:t=Fp(null,t,r,Rn(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Rn(r,l),Ec(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Rn(r,l),Ip(e,t,r,l,n);case 3:e:{if(Jm(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,l=i.element,km(e,t),ea(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Zl(Error(H(423)),t),t=Bp(e,t,r,n,l);break e}else if(r!==l){l=Zl(Error(H(424)),t),t=Bp(e,t,r,n,l);break e}else for(rn=Mr(t.stateNode.containerInfo.firstChild),ln=t,Ve=!0,jn=null,n=Tm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gl(),r===l){t=cr(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return Pm(t),e===null&&wc(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,hc(r,l)?o=null:i!==null&&hc(r,i)&&(t.flags|=32),Zm(e,t),$t(e,t,o,n),t.child;case 6:return e===null&&wc(t),null;case 13:return Xm(e,t,n);case 4:return Cf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Yl(t,null,r,n):$t(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Rn(r,l),Dp(e,t,r,l,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,je(Js,r._currentValue),r._currentValue=o,i!==null)if(Dn(i.value,o)){if(i.children===l.children&&!Gt.current){t=cr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=lr(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var c=a.pending;c===null?u.next=u:(u.next=c.next,c.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),_c(i.return,n,t),s.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(H(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),_c(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}$t(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Vl(t,n),l=xn(l),r=r(l),t.flags|=1,$t(e,t,r,n),t.child;case 14:return r=t.type,l=Rn(r,t.pendingProps),l=Rn(r.type,l),Fp(e,t,r,l,n);case 15:return Ym(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Rn(r,l),Ms(e,t),t.tag=1,Yt(r)?(e=!0,Ys(t)):e=!1,Vl(t,n),Em(t,r,l),kc(t,r,l,n),Cc(null,t,r,!0,e,n);case 19:return e1(e,t,n);case 22:return Qm(e,t,n)}throw Error(H(156,t.tag))};function v1(e,t){return Hh(e,t)}function xw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(e,t,n,r){return new xw(e,t,n,r)}function Bf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kw(e){if(typeof e=="function")return Bf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lf)return 11;if(e===of)return 14}return 2}function zr(e,t){var n=e.alternate;return n===null?(n=yn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function js(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Bf(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ol:return el(n.children,l,i,t);case rf:o=8,l|=8;break;case qu:return e=yn(12,n,t,l|2),e.elementType=qu,e.lanes=i,e;case Ku:return e=yn(13,n,t,l),e.elementType=Ku,e.lanes=i,e;case Gu:return e=yn(19,n,t,l),e.elementType=Gu,e.lanes=i,e;case Ch:return Ta(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sh:o=10;break e;case Eh:o=9;break e;case lf:o=11;break e;case of:o=14;break e;case xr:o=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=yn(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function el(e,t,n,r){return e=yn(7,e,r,t),e.lanes=n,e}function Ta(e,t,n,r){return e=yn(22,e,r,t),e.elementType=Ch,e.lanes=n,e.stateNode={isHidden:!1},e}function Ru(e,t,n){return e=yn(6,e,null,t),e.lanes=n,e}function Lu(e,t,n){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sw(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pu(0),this.expirationTimes=pu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pu(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function $f(e,t,n,r,l,i,o,s,u){return e=new Sw(e,t,n,s,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=yn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ef(i),e}function Ew(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_1)}catch(e){console.error(e)}}_1(),yh.exports=un;var x1=yh.exports,Jp=x1;Uu.createRoot=Jp.createRoot,Uu.hydrateRoot=Jp.hydrateRoot;const bw="k6 dashboard",Nw=[{sections:[{panels:[{series:[{query:"iterations[?!tags && rate]"}],title:"Iteration Rate",kind:"stat",id:"tab-0.section-0.panel-0",summary:"The iteration rate represents the number of times a VU has executed a test script (the `default` function) over a period of time. The panel can help you ensure that your test iteration rate matches the configuration you have specified in your test script, and that the number of VUs you have allocated matches the test capacity."},{series:[{query:"http_reqs[?!tags && rate]"}],title:"HTTP Request Rate",kind:"stat",id:"tab-0.section-0.panel-1",summary:"The HTTP request rate represents the number of requests over a period of time."},{series:[{query:"http_req_duration[?!tags && avg]"}],title:"HTTP Request Duration",kind:"stat",id:"tab-0.section-0.panel-2",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test."},{series:[{query:"http_req_failed[?!tags && rate ]"}],title:"HTTP Request Failed",kind:"stat",id:"tab-0.section-0.panel-3",summary:"The rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details."},{series:[{query:"data_received[?!tags && rate]"}],title:"Received Rate",kind:"stat",id:"tab-0.section-0.panel-4",summary:"The amount of data received over a period of time."},{series:[{query:"data_sent[?!tags && rate]"}],title:"Sent Rate",kind:"stat",id:"tab-0.section-0.panel-5",summary:"The amount of data sent to the system under test. "}],id:"tab-0.section-0"},{panels:[{series:[{query:"http_reqs[?!tags && rate]",legend:"Request Rate"},{query:"http_req_duration[?!tags && p95]",legend:"Request Duration p(95)"},{query:"http_req_failed[?!tags && rate]",legend:"Request Failed"}],title:"HTTP Performance overview",id:"tab-0.section-1.panel-0",summary:"The HTTP request rate represents the number of requests over a period of time. The HTTP request duration 95 percentile represents the total time for 95% of the requests observed. The HTTP request failed rate represents the rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details.",fullWidth:!0,kind:"chart"}],id:"tab-0.section-1"},{panels:[{series:[{query:"vus[?!tags && value]"},{query:"http_reqs[?!tags && rate ]"}],title:"VUs",id:"tab-0.section-2.panel-0",summary:"The number of VUs and the number of requests throughout the test run. This is an indication of how the two metrics correlate, and can help you visualize if you need to increase or decrease the number of VUs for your test.",kind:"chart"},{series:[{query:"data_received[?!tags && rate]"},{query:"data_sent[?!tags && rate]"}],title:"Transfer Rate",id:"tab-0.section-2.panel-1",summary:"The rate at which data is sent to and received from the system under test.",kind:"chart"},{series:[{query:"http_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"HTTP Request Duration",id:"tab-0.section-2.panel-2",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test.",kind:"chart"},{series:[{query:"iteration_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Iteration Duration",id:"tab-0.section-2.panel-3",summary:"The time to complete one full iteration of the test, including time spent in setup and teardown.",kind:"chart"}],id:"tab-0.section-2"}],title:"Overview",summary:"This chapter provides an overview of the most important metrics of the test run. Graphs plot the value of metrics over time.",id:"tab-0"},{sections:[{panels:[{series:[{query:"http_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Duration",id:"tab-1.section-0.panel-0",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test.",kind:"chart"},{series:[{query:"http_req_failed[?!tags && rate ]"}],title:"Request Failed Rate",id:"tab-1.section-0.panel-1",summary:"The rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details.",kind:"chart"},{series:[{query:"http_reqs[?!tags && rate]"}],title:"Request Rate",id:"tab-1.section-0.panel-2",summary:"The HTTP request rate represents the number of requests over a period of time.",kind:"chart"},{series:[{query:"http_req_waiting[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Waiting",id:"tab-1.section-0.panel-3",summary:"The time between k6 sending a request and receiving the first byte of information from the remote host. Also known as 'time to first byte' or 'TTFB'.",kind:"chart"},{series:[{query:"http_req_tls_handshaking[?!tags && (avg || p90 || p95 || p99)]"}],title:"TLS handshaking",id:"tab-1.section-0.panel-4",summary:"The time it takes to complete the TLS handshake for the requests.",kind:"chart"},{series:[{query:"http_req_sending[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Sending",id:"tab-1.section-0.panel-5",summary:"The time k6 spends sending data to the remote host.",kind:"chart"},{series:[{query:"http_req_connecting[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Connecting",id:"tab-1.section-0.panel-6",summary:"The time k6 spends establishing a TCP connection to the remote host.",kind:"chart"},{series:[{query:"http_req_receiving[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Receiving",id:"tab-1.section-0.panel-7",summary:"The time k6 spends receiving data from the remote host.",kind:"chart"},{series:[{query:"http_req_blocked[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Blocked",id:"tab-1.section-0.panel-8",summary:"The time k6 spends waiting for a free TCP connection slot before initiating a request.",kind:"chart"}],title:"HTTP",summary:"These metrics are generated only when the test makes HTTP requests.",id:"tab-1.section-0"},{panels:[{series:[{query:"browser_http_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Duration",id:"tab-1.section-1.panel-0",summary:"The HTTP request duration represents the total time for a request. This is an indication of the latency experienced when making HTTP requests against the system under test.",kind:"chart"},{series:[{query:"browser_http_req_failed[?!tags && rate ]"}],title:"Request Failed Rate",id:"tab-1.section-1.panel-1",summary:"The rate of failed requests according to the test configuration. Failed requests can include any number of status codes depending on your test. Refer to setResponseCallback for more details.",kind:"chart"},{series:[{query:"browser_web_vital_lcp[?!tags && (avg || p90 || p95 || p99)]"}],title:"Largest Contentful Paint",id:"tab-1.section-1.panel-2",summary:"Largest Contentful Paint (LCP) measures the time it takes for the largest content element on a page to become visible.",kind:"chart"},{series:[{query:"browser_web_vital_fid[?!tags && (avg || p90 || p95 || p99)]"}],title:"First Input Delay",id:"tab-1.section-1.panel-3",summary:"First Input Delay (FID) measures the responsiveness of a web page by quantifying the delay between a user's first interaction, such as clicking a button, and the browser's response.",kind:"chart"},{series:[{query:"browser_web_vital_cls[?!tags && (avg || p90 || p95 || p99)]"}],title:"Cumulative Layout Shift",id:"tab-1.section-1.panel-4",summary:"Cumulative Layout Shift (CLS) measures visual stability on a webpage by quantifying the amount of unexpected layout shift of visible page content.",kind:"chart"},{series:[{query:"browser_web_vital_ttfb[?!tags && (avg || p90 || p95 || p99)]"}],title:"Time to First Byte",id:"tab-1.section-1.panel-5",summary:"Time to First Byte (TTFB) measures the time between the request for a resource and when the first byte of a response begins to arrive.",kind:"chart"},{series:[{query:"browser_web_vital_fcp[?!tags && (avg || p90 || p95 || p99)]"}],title:"First Contentful Paint",id:"tab-1.section-1.panel-6",summary:"First Contentful Paint (FCP) measures the time it takes for the first content element to be painted on the screen.",kind:"chart"},{series:[{query:"browser_web_vital_inp[?!tags && (avg || p90 || p95 || p99)]"}],title:"Interaction to Next Paint",id:"tab-1.section-1.panel-7",summary:"Interaction to Next Paint (INP) measures a page's overall responsiveness to user interactions by observing the latency of all click, tap, and keyboard interactions that occur throughout the lifespan of a user's visit to a page.",kind:"chart"}],title:"Browser",summary:"The k6 browser module emits its own metrics based on the Core Web Vitals and Other Web Vitals.",id:"tab-1.section-1"},{panels:[{series:[{query:"ws_connecting[?!tags && (avg || p90 || p95 || p99)]"}],title:"Connect Duration",id:"tab-1.section-2.panel-0",summary:"The duration of the WebSocket connection request. This is an indication of the latency experienced when connecting to a WebSocket server.",kind:"chart"},{series:[{query:"ws_session_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Session Duration",id:"tab-1.section-2.panel-1",summary:"The time between the start of the connection and the end of the VU execution.",kind:"chart"},{series:[{query:"ws_ping[?!tags && (avg || p90 || p95 || p99)]"}],title:"Ping Duration",id:"tab-1.section-2.panel-2",summary:"The duration between a ping request and its pong reception. This is an indication of the latency experienced during the roundtrip of sending a ping message to a WebSocket server, and waiting for the pong response message to come back.",kind:"chart"},{series:[{query:"ws_msgs_sent[?!tags && rate]"},{query:"ws_msgs_received[?!tags && rate]"}],title:"Transfer Rate",id:"tab-1.section-2.panel-3",summary:"The total number of WebSocket messages sent, and the total number of WebSocket messages received.",kind:"chart"},{series:[{query:"ws_sessions[?!tags && rate]"}],title:"Sessions Rate",id:"tab-1.section-2.panel-4",summary:"The total number of WebSocket sessions started.",kind:"chart"}],title:"WebSocket",summary:"k6 emits the following metrics when interacting with a WebSocket service through the experimental or legacy websockets API.",id:"tab-1.section-2"},{panels:[{series:[{query:"grpc_req_duration[?!tags && (avg || p90 || p95 || p99)]"}],title:"Request Duration",id:"tab-1.section-3.panel-0",summary:"The gRPC request duration represents the total time for a gRPC request. This is an indication of the latency experienced when making gRPC requests against the system under test.",kind:"chart"},{series:[{query:"grpc_streams_msgs_sent[?!tags && rate]"},{query:"grpc_streams_msgs_received[?!tags && rate]"}],title:"Transfer Rate",id:"tab-1.section-3.panel-1",summary:"The total number of messages sent to gRPC streams, and the total number of messages received from a gRPC stream.",kind:"chart"},{series:[{query:"grpc_streams[?!tags && rate]"}],title:"Streams Rate",id:"tab-1.section-3.panel-2",summary:"The total number of gRPC streams started.",kind:"chart"}],title:"gRPC",summary:"k6 emits the following metrics when it interacts with a service through the gRPC API.",id:"tab-1.section-3"}],title:"Timings",summary:"This chapter provides an overview of test run HTTP timing metrics. Graphs plot the value of metrics over time.",id:"tab-1"},{sections:[{panels:[{series:[{query:"[?!tags && trend]"}],title:"Trends",kind:"summary",id:"tab-2.section-0.panel-0"}],title:"",id:"tab-2.section-0"},{panels:[{series:[{query:"[?!tags && counter]"}],title:"Counters",kind:"summary",id:"tab-2.section-1.panel-0"},{series:[{query:"[?!tags && rate]"}],title:"Rates",kind:"summary",id:"tab-2.section-1.panel-1"},{series:[{query:"[?!tags && gauge]"}],title:"Gauges",kind:"summary",id:"tab-2.section-1.panel-2"}],title:"",id:"tab-2.section-1"}],title:"Summary",summary:"This chapter provides a summary of the test run metrics. The tables contains the aggregated values of the metrics for the entire test run.",id:"tab-2"}],k1={title:bw,tabs:Nw};var S1={};(function(e){(function(t){function n(h){return h!==null?Object.prototype.toString.call(h)==="[object Array]":!1}function r(h){return h!==null?Object.prototype.toString.call(h)==="[object Object]":!1}function l(h,S){if(h===S)return!0;var C=Object.prototype.toString.call(h);if(C!==Object.prototype.toString.call(S))return!1;if(n(h)===!0){if(h.length!==S.length)return!1;for(var L=0;L",9:"Array"},w="EOF",T="UnquotedIdentifier",O="QuotedIdentifier",M="Rbracket",N="Rparen",R="Comma",I="Colon",A="Rbrace",D="Number",V="Current",K="Expref",oe="Pipe",se="Or",fe="And",ne="EQ",q="GT",J="LT",G="GTE",re="LTE",Y="NE",me="Flatten",X="Star",pe="Filter",Re="Dot",Ue="Not",Be="Lbrace",tt="Lbracket",Ct="Lparen",at="Literal",dn={".":Re,"*":X,",":R,":":I,"{":Be,"}":A,"]":M,"(":Ct,")":N,"@":V},Qn={"<":!0,">":!0,"=":!0,"!":!0},pn={" ":!0," ":!0,"\n":!0};function Zn(h){return h>="a"&&h<="z"||h>="A"&&h<="Z"||h==="_"}function Cn(h){return h>="0"&&h<="9"||h==="-"}function hn(h){return h>="a"&&h<="z"||h>="A"&&h<="Z"||h>="0"&&h<="9"||h==="_"}function ht(){}ht.prototype={tokenize:function(h){var S=[];this._current=0;for(var C,L,F;this._current")return h[this._current]==="="?(this._current++,{type:G,value:">=",start:S}):{type:q,value:">",start:S};if(C==="="&&h[this._current]==="=")return this._current++,{type:ne,value:"==",start:S}},_consumeLiteral:function(h){this._current++;for(var S=this._current,C=h.length,L;h[this._current]!=="`"&&this._current=0)return!0;if(C.indexOf(h)>=0)return!0;if(L.indexOf(h[0])>=0)try{return JSON.parse(h),!0}catch{return!1}else return!1}};var ue={};ue[w]=0,ue[T]=0,ue[O]=0,ue[M]=0,ue[N]=0,ue[R]=0,ue[A]=0,ue[D]=0,ue[V]=0,ue[K]=0,ue[oe]=1,ue[se]=2,ue[fe]=3,ue[ne]=5,ue[q]=5,ue[J]=5,ue[G]=5,ue[re]=5,ue[Y]=5,ue[me]=9,ue[X]=20,ue[pe]=21,ue[Re]=40,ue[Ue]=45,ue[Be]=50,ue[tt]=55,ue[Ct]=60;function nt(){}nt.prototype={parse:function(h){this._loadTokens(h),this.index=0;var S=this.expression(0);if(this._lookahead(0)!==w){var C=this._lookaheadToken(0),L=new Error("Unexpected token type: "+C.type+", value: "+C.value);throw L.name="ParserError",L}return S},_loadTokens:function(h){var S=new ht,C=S.tokenize(h);C.push({type:w,value:"",start:h.length}),this.tokens=C},expression:function(h){var S=this._lookaheadToken(0);this._advance();for(var C=this.nud(S),L=this._lookahead(0);h=0)return this.expression(h);if(S===tt)return this._match(tt),this._parseMultiselectList();if(S===Be)return this._match(Be),this._parseMultiselectHash()},_parseProjectionRHS:function(h){var S;if(ue[this._lookahead(0)]<10)S={type:"Identity"};else if(this._lookahead(0)===tt)S=this.expression(h);else if(this._lookahead(0)===pe)S=this.expression(h);else if(this._lookahead(0)===Re)this._match(Re),S=this._parseDotRHS(h);else{var C=this._lookaheadToken(0),L=new Error("Sytanx error, unexpected token: "+C.value+"("+C.type+")");throw L.name="ParserError",L}return S},_parseMultiselectList:function(){for(var h=[];this._lookahead(0)!==M;){var S=this.expression(0);if(h.push(S),this._lookahead(0)===R&&(this._match(R),this._lookahead(0)===M))throw new Error("Unexpected token Rbracket")}return this._match(M),{type:"MultiSelectList",children:h}},_parseMultiselectHash:function(){for(var h=[],S=[T,O],C,L,F,Q;;){if(C=this._lookaheadToken(0),S.indexOf(C.type)<0)throw new Error("Expecting an identifier token, got: "+C.type);if(L=C.value,this._advance(),this._match(I),F=this.expression(0),Q={type:"KeyValuePair",name:L,value:F},h.push(Q),this._lookahead(0)===R)this._match(R);else if(this._lookahead(0)===A){this._match(A);break}}return{type:"MultiSelectHash",children:h}}};function Ft(h){this.runtime=h}Ft.prototype={search:function(h,S){return this.visit(h,S)},visit:function(h,S){var C,L,F,Q,ae,he,ut,Qe,We,ce;switch(h.type){case"Field":return S!==null&&r(S)?(he=S[h.name],he===void 0?null:he):null;case"Subexpression":for(F=this.visit(h.children[0],S),ce=1;ce0)for(ce=Io;ceBo;ce+=de)F.push(S[ce]);return F;case"Projection":var ct=this.visit(h.children[0],S);if(!n(ct))return null;for(We=[],ce=0;ceae;break;case G:F=Q>=ae;break;case J:F=Q=h&&(S=C<0?h-1:h),S}};function ye(h){this._interpreter=h,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[u]}]},avg:{_func:this._functionAvg,_signature:[{types:[P]}]},ceil:{_func:this._functionCeil,_signature:[{types:[u]}]},contains:{_func:this._functionContains,_signature:[{types:[c,p]},{types:[a]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[c]},{types:[c]}]},floor:{_func:this._functionFloor,_signature:[{types:[u]}]},length:{_func:this._functionLength,_signature:[{types:[c,p,d]}]},map:{_func:this._functionMap,_signature:[{types:[_]},{types:[p]}]},max:{_func:this._functionMax,_signature:[{types:[P,y]}]},merge:{_func:this._functionMerge,_signature:[{types:[d],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[p]},{types:[_]}]},sum:{_func:this._functionSum,_signature:[{types:[P]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[c]},{types:[c]}]},min:{_func:this._functionMin,_signature:[{types:[P,y]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[p]},{types:[_]}]},type:{_func:this._functionType,_signature:[{types:[a]}]},keys:{_func:this._functionKeys,_signature:[{types:[d]}]},values:{_func:this._functionValues,_signature:[{types:[d]}]},sort:{_func:this._functionSort,_signature:[{types:[y,P]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[p]},{types:[_]}]},join:{_func:this._functionJoin,_signature:[{types:[c]},{types:[y]}]},reverse:{_func:this._functionReverse,_signature:[{types:[c,p]}]},to_array:{_func:this._functionToArray,_signature:[{types:[a]}]},to_string:{_func:this._functionToString,_signature:[{types:[a]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[a]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[a],variadic:!0}]}}}ye.prototype={callFunction:function(h,S){var C=this.functionTable[h];if(C===void 0)throw new Error("Unknown function: "+h+"()");return this._validateArgs(h,S,C._signature),C._func.call(this,S)},_validateArgs:function(h,S,C){var L;if(C[C.length-1].variadic){if(S.length=0;F--)L+=C[F];return L}else{var Q=h[0].slice(0);return Q.reverse(),Q}},_functionAbs:function(h){return Math.abs(h[0])},_functionCeil:function(h){return Math.ceil(h[0])},_functionAvg:function(h){for(var S=0,C=h[0],L=0;L=0},_functionFloor:function(h){return Math.floor(h[0])},_functionLength:function(h){return r(h[0])?Object.keys(h[0]).length:h[0].length},_functionMap:function(h){for(var S=[],C=this._interpreter,L=h[0],F=h[1],Q=0;Q0){var S=this._getTypeName(h[0][0]);if(S===u)return Math.max.apply(Math,h[0]);for(var C=h[0],L=C[0],F=1;F0){var S=this._getTypeName(h[0][0]);if(S===u)return Math.min.apply(Math,h[0]);for(var C=h[0],L=C[0],F=1;FTn?1:ceF&&(F=ae,Q=C[he]);return Q},_functionMinBy:function(h){for(var S=h[1],C=h[0],L=this.createKeyFunction(S,[u,c]),F=1/0,Q,ae,he=0;he(e.bytes="bytes",e.bps="bps",e.counter="counter",e.rps="rps",e.duration="duration",e.timestamp="timestamp",e.percent="percent",e.unknown="",e))(wr||{}),E1=class{constructor(e){ve(this,"name");ve(this,"aggregate");const[t,n]=e.split(".",2);this.aggregate=n,this.name=t}},Xp="time",Wf=class{constructor({values:e={},names:t=[]}={}){ve(this,"values");ve(this,"names");ve(this,"_aggregates");this.values=e,this.names=t,this._aggregates={}}set aggregates(e){for(const t in e){const n=t;this._aggregates[n]=e[n].map(r=>r.replaceAll("(","").replaceAll(")",""))}}onEvent(e){for(const t in e)this.values[t]={...e[t],name:t};this.names=Object.keys(this.values),this.names.sort()}toAggregate(e){const t={};for(let n=0;n(e.config="config",e.param="param",e.start="start",e.stop="stop",e.metric="metric",e.snapshot="snapshot",e.cumulative="cumulative",e.threshold="threshold",e))(C1||{}),vs="time",gs=class{constructor({length:e=0,capacity:t=1e4,values:n=new Array,aggregate:r="value",metric:l=void 0,unit:i="",name:o="",tags:s={},group:u=void 0}={}){ve(this,"capacity");ve(this,"aggregate");ve(this,"metric");ve(this,"unit");ve(this,"empty");ve(this,"name");ve(this,"tags");ve(this,"group");ve(this,"values");this.values=e==0?n:new Array(e),this.capacity=t,this.aggregate=r,this.metric=l,this.unit=i,this.empty=this.values.length==0,this.name=o,this.tags=s,this.group=u,Object.defineProperty(this,r,{value:!0,configurable:!0,enumerable:!0,writable:!0})}hasTags(){return this.tags!=null&&Object.keys(this.tags).length!=0}formatTags(){if(!this.hasTags())return"";let e="{";for(const t in this.tags)e+=`${t}:${this.tags[t]}`;return e+="}",e}get legend(){let e=this.aggregate;return this.metric&&this.metric.type!="trend"&&this.name.length!=0&&(e=this.name+this.formatTags()),e}grow(e){this.values[e-1]=void 0}push(...e){let t=!1;if(e.forEach(n=>{this.values.push(n),this.empty=!1,this.values.length==this.capacity&&(this.values.shift(),t=!0)}),t){this.empty=!0;for(let n=0;n{t.unit&&!e.includes(t.unit)&&e.push(t.unit)}),e}},Rw=class{constructor({capacity:e=1e4,metrics:t=new Wf}={}){ve(this,"capacity");ve(this,"metrics");ve(this,"values");ve(this,"vectors");ve(this,"lookup");this.capacity=e,this.metrics=t,this.lookup={},this.vectors={},this.values={}}get length(){return this.values[vs]?this.values[vs].values.length:0}_push(e,t,n=void 0){const r=n?e+"."+n:e;let l=this.vectors[r];if(l)l.values.length0){r=e.substring(l),r=r.substring(1,r.length-1);const i=r.indexOf(":"),o=r.substring(0,i),s=r.substring(i+1);n.tags={[o]:s},o=="group"&&(n.group=s.substring(2)),e=e.substring(0,l)}return n.name=e,n.metric=this.metrics.find(e),n.unit=this.metrics.unit(e,t),new gs(n)}onEvent(e){for(const t in e){if(t==vs){this._push(t,Math.floor(e[t].value/1e3));continue}for(const n in e[t]){const r=n;this._push(t,e[t][r],r)}}}annotate(e){this.metrics=e;for(const t in this.values){this.values[t].metric=e.find(t);const n=new E1(t);this.values[t].unit=e.unit(n.name,n.aggregate)}}select(e){const t=new Mw(this.values[vs]);if(t.length==0)return t;for(const n of e){const r=this.queryAll(n);r.length>0&&t.push(...r)}return t}query(e){const t=Dc.search(this.lookup,e);if(Array.isArray(t)){const r=t.at(0);return r instanceof gs?r:void 0}return t instanceof gs?t:void 0}queryAll(e){const t=Dc.search(this.lookup,e);if(!Array.isArray(t)||t.length==0)return new Array;const n=t;return n.at(0)instanceof gs?n:new Array}},e0=class{constructor({values:e,metric:t,name:n}={}){ve(this,"values");ve(this,"metric");ve(this,"name");ve(this,"tags");ve(this,"group");this.values=e,this.metric=t,this.name=n,t&&t.type&&Object.defineProperty(this,t.type,{value:!0,configurable:!0,enumerable:!0,writable:!0});let r="";const l=n.indexOf("{");if(l&&l>0){r=n.substring(l),r=r.substring(1,r.length-1);const i=r.indexOf(":"),o=r.substring(0,i),s=r.substring(i+1);this.tags={[o]:s},o=="group"&&(this.group=s.substring(2)),n=n.substring(0,l)}}},Lw="time",jw=class extends Array{constructor(t){super();ve(this,"aggregates");this.aggregates=new Array;for(let n=0;nl))}}get empty(){return this.length==0}},zw=class{constructor({values:t={},metrics:n=new Wf,time:r=0}={}){ve(this,"values");ve(this,"lookup");ve(this,"metrics");ve(this,"time");this.values=t,this.lookup=new Array,this.metrics=n,this.time=r}onEvent(t){const n={};let r=0;for(const i in t){if(i==Lw){r=Math.floor(t[i].value/1e3);continue}const o=this.newSummaryRow(i,t[i]);n[i]=o}this.values=n,this.time=r;const l=Array();for(const i in this.values)l.push(this.values[i]);this.lookup=l}newSummaryRow(t,n){const r={};return r.name=t,r.metric=this.metrics.find(t),r.values=n,new e0(r)}annotate(t){this.metrics=t;for(const n in this.values)this.values[n].metric=t.find(n)}select(t){const n=new Array;for(const r of t){const l=this.queryAll(r);l.length>0&&n.push(...l)}return new jw(n)}queryAll(t){const n=Dc.search(this.lookup,t);if(!Array.isArray(n)||n.length==0)return new Array;const r=n;return r.at(0)instanceof e0?r:new Array}},Aw=class{constructor(e={}){Object.assign(this,e)}},Dw=class{constructor(e={}){Object.assign(this,e)}},Fc=class{constructor({config:e={},param:t={},start:n=void 0,stop:r=void 0,metrics:l=new Wf,samples:i=new Rw,summary:o=new zw,thresholds:s=new Dw}={}){ve(this,"config");ve(this,"param");ve(this,"start");ve(this,"stop");ve(this,"metrics");ve(this,"samples");ve(this,"summary");ve(this,"thresholds");this.config=e,this.param=t,this.start=n,this.stop=r,this.metrics=l,this.samples=i,this.summary=o,this.thresholds=s}handleEvent(e){const t=e.type,n=JSON.parse(e.data);this.onEvent({type:t,data:n})}onEvent(e){switch(e.type){case"config":this.onConfig(e.data);break;case"param":this.onParam(e.data);break;case"start":this.onStart(this.metrics.toAggregate(e.data));break;case"stop":this.onStop(this.metrics.toAggregate(e.data));break;case"metric":this.onMetric(e.data);break;case"snapshot":this.onSnapshot(this.metrics.toAggregate(e.data));break;case"cumulative":this.onCumulative(this.metrics.toAggregate(e.data));break;case"threshold":this.onThreshold(e.data);break}}onConfig(e){Object.assign(this.config,e)}onParam(e){Object.assign(this.param,e),this.metrics.aggregates=e.aggregates}onStart(e){e.time&&e.time.value&&(this.start=new Date(e.time.value))}onStop(e){e.time&&e.time.value&&(this.stop=new Date(e.time.value))}onMetric(e){this.metrics.onEvent(e),this.samples.annotate(this.metrics),this.summary.annotate(this.metrics)}onSnapshot(e){this.samples.onEvent(e),this.samples.annotate(this.metrics)}onCumulative(e){this.summary.onEvent(e),this.summary.annotate(this.metrics)}onThreshold(e){Object.assign(this.thresholds,e)}};const qf=$.createContext(()=>new Fc({config:k1}));qf.displayName="Digest";function Fw({endpoint:e="/events",children:t}){const[n,r]=$.useState(new Fc({config:new Aw(k1)}));return $.useEffect(()=>{const l=new EventSource(e),i=o=>{n.handleEvent(o),r(new Fc(n))};for(const o in C1)l.addEventListener(o,i)},[]),j.jsx(qf.Provider,{value:()=>n,children:t})}function pl(){const e=$.useContext(qf);if(e===void 0)throw new Error("useDigest must be used within a DigestProvider");return e()}var Iw="_1dwurlb28",Bw="_1dwurlb27",T1={borderRadius:{sm:"var(--_1dwurlb0)",md:"var(--_1dwurlb1)",lg:"var(--_1dwurlb2)",xl:"var(--_1dwurlb3)"},sizes:{size1:"var(--_1dwurlb4)",size2:"var(--_1dwurlb5)",size3:"var(--_1dwurlb6)",size4:"var(--_1dwurlb7)",size5:"var(--_1dwurlb8)",size6:"var(--_1dwurlb9)",size7:"var(--_1dwurlba)",size8:"var(--_1dwurlbb)",size9:"var(--_1dwurlbc)",size10:"var(--_1dwurlbd)",size11:"var(--_1dwurlbe)",xs:"var(--_1dwurlbf)",sm:"var(--_1dwurlbg)",md:"var(--_1dwurlbh)",lg:"var(--_1dwurlbi)",xl:"var(--_1dwurlbj)",xxl:"var(--_1dwurlbk)"},animation:{spin:"var(--_1dwurlbl)"},fontSizes:{size0:"var(--_1dwurlbm)",size1:"var(--_1dwurlbn)",size2:"var(--_1dwurlbo)",size3:"var(--_1dwurlbp)",size4:"var(--_1dwurlbq)",size5:"var(--_1dwurlbr)",size6:"var(--_1dwurlbs)",size7:"var(--_1dwurlbt)",size8:"var(--_1dwurlbu)",size9:"var(--_1dwurlbv)"},fontWeights:{weight100:"var(--_1dwurlbw)",weight200:"var(--_1dwurlbx)",weight300:"var(--_1dwurlby)",weight400:"var(--_1dwurlbz)",weight500:"var(--_1dwurlb10)",weight600:"var(--_1dwurlb11)",weight700:"var(--_1dwurlb12)",weight800:"var(--_1dwurlb13)",weight900:"var(--_1dwurlb14)"},fonts:{sans:"var(--_1dwurlb15)",serif:"var(--_1dwurlb16)",mono:"var(--_1dwurlb17)"},letterSpacings:{size0:"var(--_1dwurlb18)",size1:"var(--_1dwurlb19)",size2:"var(--_1dwurlb1a)",size3:"var(--_1dwurlb1b)",size4:"var(--_1dwurlb1c)",size5:"var(--_1dwurlb1d)",size6:"var(--_1dwurlb1e)",size7:"var(--_1dwurlb1f)"},lineHeights:{size0:"var(--_1dwurlb1g)",size1:"var(--_1dwurlb1h)",size2:"var(--_1dwurlb1i)",size3:"var(--_1dwurlb1j)",size4:"var(--_1dwurlb1k)",size5:"var(--_1dwurlb1l)",size6:"var(--_1dwurlb1m)"},breakpoints:{header:"1024px"},colors:{common:{black:"var(--_1dwurlb1n)",white:"var(--_1dwurlb1o)"},primary:{light:"var(--_1dwurlb1p)",main:"var(--_1dwurlb1q)",dark:"var(--_1dwurlb1r)"},secondary:{light:"var(--_1dwurlb1s)",main:"var(--_1dwurlb1t)",dark:"var(--_1dwurlb1u)"},text:{primary:"var(--_1dwurlb1v)",secondary:"var(--_1dwurlb1w)",disabled:"var(--_1dwurlb1x)",hover:"var(--_1dwurlb1y)"},action:{active:"var(--_1dwurlb1z)",hover:"var(--_1dwurlb20)"},shadow:"var(--_1dwurlb21)",border:"var(--_1dwurlb22)",components:{button:{outline:{border:"var(--_1dwurlb23)",text:"var(--_1dwurlb24)",background:"var(--_1dwurlb25)"}},table:{row:{hover:"var(--_1dwurlb26)"}}}}};globalThis&&globalThis.__awaiter;function P1(){const[e,t]=$.useState(null),[n,r]=$.useState({width:0,height:0}),l=$.useCallback(()=>{r({width:(e==null?void 0:e.offsetWidth)||0,height:(e==null?void 0:e.offsetHeight)||0})},[e==null?void 0:e.offsetHeight,e==null?void 0:e.offsetWidth]);return To("resize",l),Kf(()=>{l()},[e==null?void 0:e.offsetHeight,e==null?void 0:e.offsetWidth]),[t,n]}function O1(e){const t=$.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return Kf(()=>{t.current=e},[e]),$.useCallback((...n)=>t.current(...n),[t])}function To(e,t,n,r){const l=$.useRef(t);Kf(()=>{l.current=t},[t]),$.useEffect(()=>{var i;const o=(i=n==null?void 0:n.current)!==null&&i!==void 0?i:window;if(!(o&&o.addEventListener))return;const s=u=>l.current(u);return o.addEventListener(e,s,r),()=>{o.removeEventListener(e,s,r)}},[e,n,r])}globalThis&&globalThis.__awaiter;const Kf=typeof window<"u"?$.useLayoutEffect:$.useEffect;function Gf(e){const t=i=>typeof window<"u"?window.matchMedia(i).matches:!1,[n,r]=$.useState(t(e));function l(){r(t(e))}return $.useEffect(()=>{const i=window.matchMedia(e);return l(),i.addListener?i.addListener(l):i.addEventListener("change",l),()=>{i.removeListener?i.removeListener(l):i.removeEventListener("change",l)}},[e]),n}function $w(e,t){const n=$.useCallback(()=>{if(typeof window>"u")return t;try{const s=window.sessionStorage.getItem(e);return s?Hw(s):t}catch(s){return console.warn(`Error reading sessionStorage key “${e}”:`,s),t}},[t,e]),[r,l]=$.useState(n),i=O1(s=>{typeof window>"u"&&console.warn(`Tried setting sessionStorage key “${e}” even though environment is not a client`);try{const u=s instanceof Function?s(r):s;window.sessionStorage.setItem(e,JSON.stringify(u)),l(u),window.dispatchEvent(new Event("session-storage"))}catch(u){console.warn(`Error setting sessionStorage key “${e}”:`,u)}});$.useEffect(()=>{l(n())},[]);const o=$.useCallback(s=>{s!=null&&s.key&&s.key!==e||l(n())},[e,n]);return To("storage",o),To("session-storage",o),[r,i]}function Hw(e){try{return e==="undefined"?void 0:JSON.parse(e??"")}catch{console.log("parsing error on",{value:e});return}}const b1=$.createContext({});function Vw({children:e}){const t=Gf("(prefers-color-scheme: dark)"),[n,r]=$w("theme",t?"dark":"light"),l={theme:n,themeClassName:n==="light"?Bw:Iw,setTheme:r};return j.jsx(b1.Provider,{value:l,children:e})}function pi(){const e=$.useContext(b1);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}const N1=$.createContext(void 0);function Uw({children:e}){const[t,n]=$.useState(),r={timeRange:t,setTimeRange:n};return j.jsx(N1.Provider,{value:r,children:e})}function Yf(){const e=$.useContext(N1);if(e===void 0)throw new Error("useTimeRange must be used within a TimeRangeProvider");return e}var Ww={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},qw={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Kw={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"},Gw={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},ju={black:"#000000",white:"#ffffff"},Yw={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},Qw={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},Zw={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},Jw={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},M1={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Xw={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},e2={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},t2={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},n2={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},t0={50:"#ffffff",100:"#D6DCFF",200:"#CED4EF",300:"#C2CAEF",400:"#B6C0EF",500:"#AAB6EF",600:"#3f486b",700:"#394160",800:"#2c324b",900:"#1F2537"},r2={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},l2={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},i2={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},o2={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},s2={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},a2={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};const ys={red:o2,pink:l2,purple:i2,deepPurple:Zw,indigo:Xw,blue:qw,lightBlue:e2,cyan:Yw,teal:s2,green:Jw,lightGreen:t2,lime:n2,yellow:a2,amber:Ww,orange:r2,deepOrange:Qw,brown:Gw,grey:M1,blueGrey:Kw},u2=["grey","teal","blue","purple","indigo","orange","pink","green","cyan","amber","lime","brown","lightGreen","red","deepPurple","lightBlue","yellow","deepOrange","blueGrey"],R1=e=>u2.map(t=>({stroke:e=="dark"?ys[t][500]:ys[t][800],fill:(e=="dark"?ys[t][300]:ys[t][600])+"20"})),c2=e=>Object.entries(e).reduce((t,[n,r])=>r===void 0?t:{...t,[n]:r},{}),f2=(e,t)=>Object.entries(t).reduce((n,[r,l])=>(e.includes(r)&&(n[r]=l),n),{}),d2=(e,t)=>({...e,...t}),p2=e=>(t,n)=>d2(t,f2(e,n));function n0(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function h2(e,t){var n=e;for(var r of t){if(!(r in n))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));n=n[r]}return n}function L1(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=e.constructor();for(var l in e){var i=e[l],o=[...n,l];typeof i=="string"||typeof i=="number"||i==null?r[l]=t(i,o):typeof i=="object"&&!Array.isArray(i)?r[l]=L1(i,t,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(i)?"Array":typeof i,'"'))}return r}function m2(e,t){var n={};if(typeof t=="object"){var r=e;L1(t,(o,s)=>{var u=h2(r,s);n[n0(u)]=String(o)})}else{var l=e;for(var i in l)n[n0(i)]=l[i]}return Object.defineProperty(n,"toString",{value:function(){return Object.keys(this).map(s=>"".concat(s,":").concat(this[s])).join(";")},writable:!1}),n}const Yn=(...e)=>e.filter(Boolean).join(" "),v2=(e,t)=>m2(e,c2(t));function g2(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y2(e){var t=g2(e,"string");return typeof t=="symbol"?t:String(t)}function w2(e,t,n){return t=y2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;tfunction(){for(var t=arguments.length,n=new Array(t),r=0;ru.styles)),i=Object.keys(l),o=i.filter(u=>"mappings"in l[u]),s=u=>{var a=[],c={},p=zu({},u),d=!1;for(var g of o){var _=u[g];if(_!=null){var x=l[g];d=!0;for(var P of x.mappings)c[P]=_,p[P]==null&&delete p[P]}}var y=d?zu(zu({},c),p):u,v=function(){var M=y[w],N=l[w];try{if(N.mappings)return"continue";if(typeof M=="string"||typeof M=="number")a.push(N.values[M].defaultClass);else if(Array.isArray(M))for(var R=0;Re,zo=function(){return _2(x2)(...arguments)},k2="wy7gkc15",S2={flexGrow:"var(--wy7gkc10)",flexShrink:"var(--wy7gkc11)",flexBasis:"var(--wy7gkc12)",height:"var(--wy7gkc13)",width:"var(--wy7gkc14)"},E2=zo({conditions:void 0,styles:{flexDirection:{values:{row:{defaultClass:"wy7gkc0"},column:{defaultClass:"wy7gkc1"}}},flexWrap:{values:{nowrap:{defaultClass:"wy7gkc2"},wrap:{defaultClass:"wy7gkc3"},"wrap-reverse":{defaultClass:"wy7gkc4"}}},alignItems:{values:{"flex-start":{defaultClass:"wy7gkc5"},"flex-end":{defaultClass:"wy7gkc6"},stretch:{defaultClass:"wy7gkc7"},center:{defaultClass:"wy7gkc8"},baseline:{defaultClass:"wy7gkc9"},start:{defaultClass:"wy7gkca"},end:{defaultClass:"wy7gkcb"},"self-start":{defaultClass:"wy7gkcc"},"self-end":{defaultClass:"wy7gkcd"}}},justifyContent:{values:{"flex-start":{defaultClass:"wy7gkce"},"flex-end":{defaultClass:"wy7gkcf"},start:{defaultClass:"wy7gkcg"},end:{defaultClass:"wy7gkch"},left:{defaultClass:"wy7gkci"},right:{defaultClass:"wy7gkcj"},center:{defaultClass:"wy7gkck"},"space-between":{defaultClass:"wy7gkcl"},"space-around":{defaultClass:"wy7gkcm"},"space-evenly":{defaultClass:"wy7gkcn"}}},gap:{values:{0:{defaultClass:"wy7gkco"},1:{defaultClass:"wy7gkcp"},2:{defaultClass:"wy7gkcq"},3:{defaultClass:"wy7gkcr"},4:{defaultClass:"wy7gkcs"},5:{defaultClass:"wy7gkct"}}},padding:{values:{0:{defaultClass:"wy7gkcu"},1:{defaultClass:"wy7gkcv"},2:{defaultClass:"wy7gkcw"},3:{defaultClass:"wy7gkcx"},4:{defaultClass:"wy7gkcy"},5:{defaultClass:"wy7gkcz"}}}}});function C2({as:e="div",align:t,basis:n,children:r,className:l,direction:i,gap:o=3,grow:s,height:u,justify:a,padding:c,shrink:p,width:d,wrap:g,..._},x){const P=E2({alignItems:t,flexDirection:i,flexWrap:g,gap:o,justifyContent:a,padding:c}),y=Yn(k2,P,l),v=v2(S2,{flexBasis:n,flexGrow:s,flexShrink:p,height:u,width:d});return j.jsx(e,{ref:x,className:y,style:v,..._,children:r})}const st=$.forwardRef(C2);var T2={fill:"_17y8ldl2 _17y8ldl1 _17y8ldl0",outline:"_17y8ldl3 _17y8ldl1 _17y8ldl0",text:"_17y8ldl0"};const P2=({as:e="button",children:t,className:n,variant:r="fill",...l},i)=>j.jsx(e,{ref:i,className:Yn(T2[r],n),...l,children:t}),Ao=$.forwardRef(P2),O2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},$.createElement("rect",{fill:"none",height:24,width:24}),$.createElement("path",{d:"M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36c-0.98,1.37-2.58,2.26-4.4,2.26 c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})),b2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},$.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),$.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"})),N2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},$.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),$.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),M2=e=>$.createElement("svg",{fill:"currentColor",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24px",height:"24px",viewBox:"796 796 200 200",enableBackground:"new 796 796 200 200",xmlSpace:"preserve",...e},$.createElement("g",null,$.createElement("path",{d:"M939.741,830.286c0.203-1.198-0.133-2.426-0.918-3.354s-1.938-1.461-3.153-1.461h-79.338c-1.214,0-2.365,0.536-3.149,1.463 c-0.784,0.928-1.124,2.155-0.92,3.352c2.866,16.875,12.069,32.797,25.945,42.713c7.737,5.529,13.827,8.003,17.793,8.003 c3.965,0,10.055-2.474,17.793-8.003C927.67,863.083,936.874,847.162,939.741,830.286z"}),$.createElement("path",{d:"M966.478,980.009h-5.074v-11.396c0-23.987-13.375-48.914-35.775-66.679l-7.485-5.936l7.485-5.934 c22.4-17.762,35.775-42.688,35.775-66.678v-11.396h5.074c4.416,0,7.996-3.58,7.996-7.995c0-4.416-3.58-7.996-7.996-7.996H825.521 c-4.415,0-7.995,3.58-7.995,7.996c0,4.415,3.58,7.995,7.995,7.995h5.077v9.202c0,27.228,13.175,53.007,35.243,68.962l8.085,5.843 l-8.085,5.847c-22.068,15.952-35.243,41.732-35.243,68.962v9.202h-5.077c-4.415,0-7.995,3.58-7.995,7.996 c0,4.415,3.58,7.995,7.995,7.995h140.956c4.416,0,7.996-3.58,7.996-7.995C974.474,983.589,970.894,980.009,966.478,980.009z M842.592,970.807c0-23.392,11.318-45.538,30.277-59.242l8.429-6.097c3.03-2.19,4.839-5.729,4.839-9.47 c0-3.739-1.809-7.279-4.84-9.471l-8.429-6.091c-18.958-13.707-30.276-35.853-30.276-59.243v-3.349c0-3.232,2.62-5.853,5.853-5.853 h95.112c3.232,0,5.854,2.621,5.854,5.853v5.543c0,20.36-11.676,41.774-31.232,57.279l-7.792,6.177 c-2.811,2.232-4.422,5.568-4.422,9.155c0,3.588,1.611,6.926,4.425,9.157l7.788,6.177c19.558,15.508,31.233,36.921,31.233,57.28 v5.544c0,3.232-2.621,5.854-5.854,5.854h-95.112c-3.232,0-5.853-2.621-5.853-5.854V970.807z"}))),R2=e=>$.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$.createElement("path",{d:"M12 11V16M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),$.createElement("circle",{cx:12,cy:7.5,r:1,fill:"currentColor"})),L2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"currentColor",...e},$.createElement("rect",{fill:"none",height:24,width:24}),$.createElement("path",{d:"M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})),j2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:37,height:34,viewBox:"0 0 37 34",fill:"currentColor",...e},$.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9129 12.4547L29.0217 0L36.6667 33.1967H0L12.2687 6.86803L19.9129 12.4547ZM15.1741 24.4166L17.3529 27.4205L19.6915 27.4198L17.1351 23.8957L19.3864 20.7907L17.8567 19.6768L15.1741 23.3764V17.7248L13.1575 16.2575V27.4205H15.1741V24.4166ZM20.0105 24.1067C20.0105 26.0056 21.5468 27.5452 23.4425 27.5452C25.3396 27.5452 26.8759 26.0056 26.8759 24.1075C26.8746 23.2903 26.5844 22.5003 26.0573 21.8786C25.5301 21.2569 24.8003 20.8441 23.9983 20.714L25.6403 18.45L24.1105 17.3361L20.6675 22.0832C20.2395 22.6699 20.0093 23.379 20.0105 24.1067ZM24.9179 24.1067C24.9179 24.9226 24.2579 25.5843 23.4432 25.5843C23.2499 25.5848 23.0583 25.547 22.8795 25.473C22.7007 25.399 22.5382 25.2903 22.4011 25.153C22.2641 25.0158 22.1553 24.8528 22.081 24.6733C22.0066 24.4937 21.9681 24.3012 21.9677 24.1067C21.9677 23.2908 22.6277 22.6291 23.4432 22.6291C24.2572 22.6291 24.9179 23.2908 24.9179 24.1067Z",fill:"#7D64FF"})),z2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"currentColor",...e},$.createElement("path",{d:"M12 2C12 0.89544 11.1046 0 10 0C8.8954 0 8 0.89544 8 2C8 3.10456 8.8954 4 10 4C11.1046 4 12 3.10456 12 2Z",fill:"currentColor"}),$.createElement("path",{d:"M12 9.33337C12 8.22881 11.1046 7.33337 10 7.33337C8.8954 7.33337 8 8.22881 8 9.33337C8 10.4379 8.8954 11.3334 10 11.3334C11.1046 11.3334 12 10.4379 12 9.33337Z",fill:"currentColor"}),$.createElement("path",{d:"M12 16.6666C12 15.5621 11.1046 14.6666 10 14.6666C8.8954 14.6666 8 15.5621 8 16.6666C8 17.7712 8.8954 18.6666 10 18.6666C11.1046 18.6666 12 17.7712 12 16.6666Z",fill:"currentColor"})),A2=e=>$.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},$.createElement("g",{id:"Page-1",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},$.createElement("g",{id:"add",fill:"currentColor",transform:"translate(42.666667, 42.666667)"},$.createElement("path",{d:"M291.76704,163.504 C291.76704,177.01952 288.33216,188.82176 281.479253,198.90112 C275.828267,207.371093 266.358187,216.549547 253.042987,226.434987 C245.378987,231.682347 240.331947,236.618667 237.916587,241.257813 C234.87744,246.90624 233.376213,255.371093 233.376213,266.666667 L190.710827,266.666667 C190.710827,249.530027 192.53504,237.027413 196.165333,229.162667 C200.394453,219.679573 209.571627,210.098773 223.686187,200.42048 C230.350293,195.374933 235.188693,190.2368 238.214827,184.994773 C241.839787,179.143253 243.664,172.49216 243.664,165.028693 C243.664,153.13024 240.125013,144.26304 233.070293,138.404907 C227.4336,134.177067 220.56768,132.059947 212.501333,132.059947 C199.39328,132.059947 189.911467,136.398507 184.065067,145.069013 C179.829333,151.518293 177.7056,159.787733 177.7056,169.868587 L177.7056,170.173227 L132.34368,170.173227 C132.34368,143.751253 140.703147,123.790507 157.43488,110.274773 C171.554773,98.9922133 189.007787,93.3346133 209.77344,93.3346133 C227.933653,93.3346133 243.865813,96.86848 257.571627,103.9232 C280.37504,115.62624 291.76704,135.494827 291.76704,163.504 Z M426.666667,213.333333 C426.666667,331.153707 331.153707,426.666667 213.333333,426.666667 C95.51296,426.666667 3.55271368e-14,331.153707 3.55271368e-14,213.333333 C3.55271368e-14,95.51168 95.51296,3.55271368e-14 213.333333,3.55271368e-14 C331.153707,3.55271368e-14 426.666667,95.51168 426.666667,213.333333 Z M384,213.333333 C384,119.226667 307.43872,42.6666667 213.333333,42.6666667 C119.227947,42.6666667 42.6666667,119.226667 42.6666667,213.333333 C42.6666667,307.43872 119.227947,384 213.333333,384 C307.43872,384 384,307.43872 384,213.333333 Z M213.332053,282.666667 C198.60416,282.666667 186.665387,294.60544 186.665387,309.333333 C186.665387,324.061227 198.60416,336 213.332053,336 C228.059947,336 239.99872,324.061227 239.99872,309.333333 C239.99872,294.60544 228.059947,282.666667 213.332053,282.666667 Z",id:"Shape"})))),D2=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:16,height:16,fill:"currentColor",...e},$.createElement("path",{d:"M12,2A10,10,0,0,0,5.12,4.77V3a1,1,0,0,0-2,0V7.5a1,1,0,0,0,1,1H8.62a1,1,0,0,0,0-2H6.22A8,8,0,1,1,4,12a1,1,0,0,0-2,0A10,10,0,1,0,12,2Zm0,6a1,1,0,0,0-1,1v3a1,1,0,0,0,1,1h2a1,1,0,0,0,0-2H13V9A1,1,0,0,0,12,8Z"})),F2=e=>$.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$.createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"}),$.createElement("path",{d:"M12 22C17.5228 22 22 17.5228 22 12H19C19 15.866 15.866 19 12 19V22Z",fill:"currentColor"}),$.createElement("path",{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"})),I2=e=>$.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"bi bi-stopwatch",...e},$.createElement("path",{d:"M8.5 5.6a.5.5 0 1 0-1 0v2.9h-3a.5.5 0 0 0 0 1H8a.5.5 0 0 0 .5-.5V5.6z"}),$.createElement("path",{d:"M6.5 1A.5.5 0 0 1 7 .5h2a.5.5 0 0 1 0 1v.57c1.36.196 2.594.78 3.584 1.64a.715.715 0 0 1 .012-.013l.354-.354-.354-.353a.5.5 0 0 1 .707-.708l1.414 1.415a.5.5 0 1 1-.707.707l-.353-.354-.354.354a.512.512 0 0 1-.013.012A7 7 0 1 1 7 2.071V1.5a.5.5 0 0 1-.5-.5zM8 3a6 6 0 1 0 .001 12A6 6 0 0 0 8 3z"}));function B2({className:e,name:t,title:n,...r},l){const i=$2[t];return j.jsx("span",{ref:l,children:j.jsx(i,{"aria-hidden":"true",className:e,title:n,...r})})}const $2={"chevron-down":N2,"chevron-up":b2,"hour-glass":M2,info:R2,options:z2,logo:j2,moon:O2,question:A2,"rewind-time":D2,spinner:F2,"stop-watch":I2,sun:L2},Fn=$.forwardRef(B2),j1=()=>{const{timeRange:e,setTimeRange:t}=Yf();return e?j.jsx(Ao,{variant:"outline",onClick:()=>t(void 0),children:j.jsxs(st,{align:"center",gap:2,children:[j.jsx(Fn,{name:"rewind-time"}),j.jsx("span",{children:"Reset"})]})}):null};var H2="_6j0qom0";const V2=()=>{const e=Gf(`(max-width: ${T1.breakpoints.header})`),{timeRange:t}=Yf();return!t||!e?null:j.jsx("footer",{className:H2,children:j.jsx(j1,{})})};var U2="_17unuvp0";const W2=({className:e,...t})=>j.jsx("div",{className:Yn(U2,e),...t});var l0=function(t){return t.reduce(function(n,r){var l=r[0],i=r[1];return n[l]=i,n},{})},i0=typeof window<"u"&&window.document&&window.document.createElement?$.useLayoutEffect:$.useEffect,Zt="top",Sn="bottom",En="right",Jt="left",Qf="auto",Do=[Zt,Sn,En,Jt],Xl="start",Po="end",q2="clippingParents",z1="viewport",Ii="popper",K2="reference",o0=Do.reduce(function(e,t){return e.concat([t+"-"+Xl,t+"-"+Po])},[]),A1=[].concat(Do,[Qf]).reduce(function(e,t){return e.concat([t,t+"-"+Xl,t+"-"+Po])},[]),G2="beforeRead",Y2="read",Q2="afterRead",Z2="beforeMain",J2="main",X2="afterMain",e_="beforeWrite",t_="write",n_="afterWrite",r_=[G2,Y2,Q2,Z2,J2,X2,e_,t_,n_];function Gn(e){return e?(e.nodeName||"").toLowerCase():null}function an(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ul(e){var t=an(e).Element;return e instanceof t||e instanceof Element}function _n(e){var t=an(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zf(e){if(typeof ShadowRoot>"u")return!1;var t=an(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function l_(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},l=t.attributes[n]||{},i=t.elements[n];!_n(i)||!Gn(i)||(Object.assign(i.style,r),Object.keys(l).forEach(function(o){var s=l[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function i_(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var l=t.elements[r],i=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=o.reduce(function(u,a){return u[a]="",u},{});!_n(l)||!Gn(l)||(Object.assign(l.style,s),Object.keys(i).forEach(function(u){l.removeAttribute(u)}))})}}const o_={name:"applyStyles",enabled:!0,phase:"write",fn:l_,effect:i_,requires:["computeStyles"]};function Kn(e){return e.split("-")[0]}var tl=Math.max,ua=Math.min,ei=Math.round;function Ic(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function D1(){return!/^((?!chrome|android).)*safari/i.test(Ic())}function ti(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),l=1,i=1;t&&_n(e)&&(l=e.offsetWidth>0&&ei(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&ei(r.height)/e.offsetHeight||1);var o=ul(e)?an(e):window,s=o.visualViewport,u=!D1()&&n,a=(r.left+(u&&s?s.offsetLeft:0))/l,c=(r.top+(u&&s?s.offsetTop:0))/i,p=r.width/l,d=r.height/i;return{width:p,height:d,top:c,right:a+p,bottom:c+d,left:a,x:a,y:c}}function Jf(e){var t=ti(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function F1(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Zf(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function fr(e){return an(e).getComputedStyle(e)}function s_(e){return["table","td","th"].indexOf(Gn(e))>=0}function $r(e){return((ul(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ma(e){return Gn(e)==="html"?e:e.assignedSlot||e.parentNode||(Zf(e)?e.host:null)||$r(e)}function s0(e){return!_n(e)||fr(e).position==="fixed"?null:e.offsetParent}function a_(e){var t=/firefox/i.test(Ic()),n=/Trident/i.test(Ic());if(n&&_n(e)){var r=fr(e);if(r.position==="fixed")return null}var l=Ma(e);for(Zf(l)&&(l=l.host);_n(l)&&["html","body"].indexOf(Gn(l))<0;){var i=fr(l);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return l;l=l.parentNode}return null}function Fo(e){for(var t=an(e),n=s0(e);n&&s_(n)&&fr(n).position==="static";)n=s0(n);return n&&(Gn(n)==="html"||Gn(n)==="body"&&fr(n).position==="static")?t:n||a_(e)||t}function Xf(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function lo(e,t,n){return tl(e,ua(t,n))}function u_(e,t,n){var r=lo(e,t,n);return r>n?n:r}function I1(){return{top:0,right:0,bottom:0,left:0}}function B1(e){return Object.assign({},I1(),e)}function $1(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var c_=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B1(typeof t!="number"?t:$1(t,Do))};function f_(e){var t,n=e.state,r=e.name,l=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Kn(n.placement),u=Xf(s),a=[Jt,En].indexOf(s)>=0,c=a?"height":"width";if(!(!i||!o)){var p=c_(l.padding,n),d=Jf(i),g=u==="y"?Zt:Jt,_=u==="y"?Sn:En,x=n.rects.reference[c]+n.rects.reference[u]-o[u]-n.rects.popper[c],P=o[u]-n.rects.reference[u],y=Fo(i),v=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,w=x/2-P/2,T=p[g],O=v-d[c]-p[_],M=v/2-d[c]/2+w,N=lo(T,M,O),R=u;n.modifiersData[r]=(t={},t[R]=N,t.centerOffset=N-M,t)}}function d_(e){var t=e.state,n=e.options,r=n.element,l=r===void 0?"[data-popper-arrow]":r;l!=null&&(typeof l=="string"&&(l=t.elements.popper.querySelector(l),!l)||F1(t.elements.popper,l)&&(t.elements.arrow=l))}const p_={name:"arrow",enabled:!0,phase:"main",fn:f_,effect:d_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ni(e){return e.split("-")[1]}var h_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function m_(e,t){var n=e.x,r=e.y,l=t.devicePixelRatio||1;return{x:ei(n*l)/l||0,y:ei(r*l)/l||0}}function a0(e){var t,n=e.popper,r=e.popperRect,l=e.placement,i=e.variation,o=e.offsets,s=e.position,u=e.gpuAcceleration,a=e.adaptive,c=e.roundOffsets,p=e.isFixed,d=o.x,g=d===void 0?0:d,_=o.y,x=_===void 0?0:_,P=typeof c=="function"?c({x:g,y:x}):{x:g,y:x};g=P.x,x=P.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),w=Jt,T=Zt,O=window;if(a){var M=Fo(n),N="clientHeight",R="clientWidth";if(M===an(n)&&(M=$r(n),fr(M).position!=="static"&&s==="absolute"&&(N="scrollHeight",R="scrollWidth")),M=M,l===Zt||(l===Jt||l===En)&&i===Po){T=Sn;var I=p&&M===O&&O.visualViewport?O.visualViewport.height:M[N];x-=I-r.height,x*=u?1:-1}if(l===Jt||(l===Zt||l===Sn)&&i===Po){w=En;var A=p&&M===O&&O.visualViewport?O.visualViewport.width:M[R];g-=A-r.width,g*=u?1:-1}}var D=Object.assign({position:s},a&&h_),V=c===!0?m_({x:g,y:x},an(n)):{x:g,y:x};if(g=V.x,x=V.y,u){var K;return Object.assign({},D,(K={},K[T]=v?"0":"",K[w]=y?"0":"",K.transform=(O.devicePixelRatio||1)<=1?"translate("+g+"px, "+x+"px)":"translate3d("+g+"px, "+x+"px, 0)",K))}return Object.assign({},D,(t={},t[T]=v?x+"px":"",t[w]=y?g+"px":"",t.transform="",t))}function v_(e){var t=e.state,n=e.options,r=n.gpuAcceleration,l=r===void 0?!0:r,i=n.adaptive,o=i===void 0?!0:i,s=n.roundOffsets,u=s===void 0?!0:s,a={placement:Kn(t.placement),variation:ni(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:l,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,a0(Object.assign({},a,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,a0(Object.assign({},a,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const g_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:v_,data:{}};var ws={passive:!0};function y_(e){var t=e.state,n=e.instance,r=e.options,l=r.scroll,i=l===void 0?!0:l,o=r.resize,s=o===void 0?!0:o,u=an(t.elements.popper),a=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&a.forEach(function(c){c.addEventListener("scroll",n.update,ws)}),s&&u.addEventListener("resize",n.update,ws),function(){i&&a.forEach(function(c){c.removeEventListener("scroll",n.update,ws)}),s&&u.removeEventListener("resize",n.update,ws)}}const w_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:y_,data:{}};var __={left:"right",right:"left",bottom:"top",top:"bottom"};function zs(e){return e.replace(/left|right|bottom|top/g,function(t){return __[t]})}var x_={start:"end",end:"start"};function u0(e){return e.replace(/start|end/g,function(t){return x_[t]})}function ed(e){var t=an(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function td(e){return ti($r(e)).left+ed(e).scrollLeft}function k_(e,t){var n=an(e),r=$r(e),l=n.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,u=0;if(l){i=l.width,o=l.height;var a=D1();(a||!a&&t==="fixed")&&(s=l.offsetLeft,u=l.offsetTop)}return{width:i,height:o,x:s+td(e),y:u}}function S_(e){var t,n=$r(e),r=ed(e),l=(t=e.ownerDocument)==null?void 0:t.body,i=tl(n.scrollWidth,n.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),o=tl(n.scrollHeight,n.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),s=-r.scrollLeft+td(e),u=-r.scrollTop;return fr(l||n).direction==="rtl"&&(s+=tl(n.clientWidth,l?l.clientWidth:0)-i),{width:i,height:o,x:s,y:u}}function nd(e){var t=fr(e),n=t.overflow,r=t.overflowX,l=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+l+r)}function H1(e){return["html","body","#document"].indexOf(Gn(e))>=0?e.ownerDocument.body:_n(e)&&nd(e)?e:H1(Ma(e))}function io(e,t){var n;t===void 0&&(t=[]);var r=H1(e),l=r===((n=e.ownerDocument)==null?void 0:n.body),i=an(r),o=l?[i].concat(i.visualViewport||[],nd(r)?r:[]):r,s=t.concat(o);return l?s:s.concat(io(Ma(o)))}function Bc(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E_(e,t){var n=ti(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function c0(e,t,n){return t===z1?Bc(k_(e,n)):ul(t)?E_(t,n):Bc(S_($r(e)))}function C_(e){var t=io(Ma(e)),n=["absolute","fixed"].indexOf(fr(e).position)>=0,r=n&&_n(e)?Fo(e):e;return ul(r)?t.filter(function(l){return ul(l)&&F1(l,r)&&Gn(l)!=="body"}):[]}function T_(e,t,n,r){var l=t==="clippingParents"?C_(e):[].concat(t),i=[].concat(l,[n]),o=i[0],s=i.reduce(function(u,a){var c=c0(e,a,r);return u.top=tl(c.top,u.top),u.right=ua(c.right,u.right),u.bottom=ua(c.bottom,u.bottom),u.left=tl(c.left,u.left),u},c0(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function V1(e){var t=e.reference,n=e.element,r=e.placement,l=r?Kn(r):null,i=r?ni(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,u;switch(l){case Zt:u={x:o,y:t.y-n.height};break;case Sn:u={x:o,y:t.y+t.height};break;case En:u={x:t.x+t.width,y:s};break;case Jt:u={x:t.x-n.width,y:s};break;default:u={x:t.x,y:t.y}}var a=l?Xf(l):null;if(a!=null){var c=a==="y"?"height":"width";switch(i){case Xl:u[a]=u[a]-(t[c]/2-n[c]/2);break;case Po:u[a]=u[a]+(t[c]/2-n[c]/2);break}}return u}function Oo(e,t){t===void 0&&(t={});var n=t,r=n.placement,l=r===void 0?e.placement:r,i=n.strategy,o=i===void 0?e.strategy:i,s=n.boundary,u=s===void 0?q2:s,a=n.rootBoundary,c=a===void 0?z1:a,p=n.elementContext,d=p===void 0?Ii:p,g=n.altBoundary,_=g===void 0?!1:g,x=n.padding,P=x===void 0?0:x,y=B1(typeof P!="number"?P:$1(P,Do)),v=d===Ii?K2:Ii,w=e.rects.popper,T=e.elements[_?v:d],O=T_(ul(T)?T:T.contextElement||$r(e.elements.popper),u,c,o),M=ti(e.elements.reference),N=V1({reference:M,element:w,strategy:"absolute",placement:l}),R=Bc(Object.assign({},w,N)),I=d===Ii?R:M,A={top:O.top-I.top+y.top,bottom:I.bottom-O.bottom+y.bottom,left:O.left-I.left+y.left,right:I.right-O.right+y.right},D=e.modifiersData.offset;if(d===Ii&&D){var V=D[l];Object.keys(A).forEach(function(K){var oe=[En,Sn].indexOf(K)>=0?1:-1,se=[Zt,Sn].indexOf(K)>=0?"y":"x";A[K]+=V[se]*oe})}return A}function P_(e,t){t===void 0&&(t={});var n=t,r=n.placement,l=n.boundary,i=n.rootBoundary,o=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,a=u===void 0?A1:u,c=ni(r),p=c?s?o0:o0.filter(function(_){return ni(_)===c}):Do,d=p.filter(function(_){return a.indexOf(_)>=0});d.length===0&&(d=p);var g=d.reduce(function(_,x){return _[x]=Oo(e,{placement:x,boundary:l,rootBoundary:i,padding:o})[Kn(x)],_},{});return Object.keys(g).sort(function(_,x){return g[_]-g[x]})}function O_(e){if(Kn(e)===Qf)return[];var t=zs(e);return[u0(e),t,u0(t)]}function b_(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var l=n.mainAxis,i=l===void 0?!0:l,o=n.altAxis,s=o===void 0?!0:o,u=n.fallbackPlacements,a=n.padding,c=n.boundary,p=n.rootBoundary,d=n.altBoundary,g=n.flipVariations,_=g===void 0?!0:g,x=n.allowedAutoPlacements,P=t.options.placement,y=Kn(P),v=y===P,w=u||(v||!_?[zs(P)]:O_(P)),T=[P].concat(w).reduce(function(X,pe){return X.concat(Kn(pe)===Qf?P_(t,{placement:pe,boundary:c,rootBoundary:p,padding:a,flipVariations:_,allowedAutoPlacements:x}):pe)},[]),O=t.rects.reference,M=t.rects.popper,N=new Map,R=!0,I=T[0],A=0;A=0,se=oe?"width":"height",fe=Oo(t,{placement:D,boundary:c,rootBoundary:p,altBoundary:d,padding:a}),ne=oe?K?En:Jt:K?Sn:Zt;O[se]>M[se]&&(ne=zs(ne));var q=zs(ne),J=[];if(i&&J.push(fe[V]<=0),s&&J.push(fe[ne]<=0,fe[q]<=0),J.every(function(X){return X})){I=D,R=!1;break}N.set(D,J)}if(R)for(var G=_?3:1,re=function(pe){var Re=T.find(function(Ue){var Be=N.get(Ue);if(Be)return Be.slice(0,pe).every(function(tt){return tt})});if(Re)return I=Re,"break"},Y=G;Y>0;Y--){var me=re(Y);if(me==="break")break}t.placement!==I&&(t.modifiersData[r]._skip=!0,t.placement=I,t.reset=!0)}}const N_={name:"flip",enabled:!0,phase:"main",fn:b_,requiresIfExists:["offset"],data:{_skip:!1}};function f0(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function d0(e){return[Zt,En,Sn,Jt].some(function(t){return e[t]>=0})}function M_(e){var t=e.state,n=e.name,r=t.rects.reference,l=t.rects.popper,i=t.modifiersData.preventOverflow,o=Oo(t,{elementContext:"reference"}),s=Oo(t,{altBoundary:!0}),u=f0(o,r),a=f0(s,l,i),c=d0(u),p=d0(a);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:a,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const R_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:M_};function L_(e,t,n){var r=Kn(e),l=[Jt,Zt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=i[0],s=i[1];return o=o||0,s=(s||0)*l,[Jt,En].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function j_(e){var t=e.state,n=e.options,r=e.name,l=n.offset,i=l===void 0?[0,0]:l,o=A1.reduce(function(c,p){return c[p]=L_(p,t.rects,i),c},{}),s=o[t.placement],u=s.x,a=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=a),t.modifiersData[r]=o}const z_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:j_};function A_(e){var t=e.state,n=e.name;t.modifiersData[n]=V1({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const D_={name:"popperOffsets",enabled:!0,phase:"read",fn:A_,data:{}};function F_(e){return e==="x"?"y":"x"}function I_(e){var t=e.state,n=e.options,r=e.name,l=n.mainAxis,i=l===void 0?!0:l,o=n.altAxis,s=o===void 0?!1:o,u=n.boundary,a=n.rootBoundary,c=n.altBoundary,p=n.padding,d=n.tether,g=d===void 0?!0:d,_=n.tetherOffset,x=_===void 0?0:_,P=Oo(t,{boundary:u,rootBoundary:a,padding:p,altBoundary:c}),y=Kn(t.placement),v=ni(t.placement),w=!v,T=Xf(y),O=F_(T),M=t.modifiersData.popperOffsets,N=t.rects.reference,R=t.rects.popper,I=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,A=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(M){if(i){var K,oe=T==="y"?Zt:Jt,se=T==="y"?Sn:En,fe=T==="y"?"height":"width",ne=M[T],q=ne+P[oe],J=ne-P[se],G=g?-R[fe]/2:0,re=v===Xl?N[fe]:R[fe],Y=v===Xl?-R[fe]:-N[fe],me=t.elements.arrow,X=g&&me?Jf(me):{width:0,height:0},pe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:I1(),Re=pe[oe],Ue=pe[se],Be=lo(0,N[fe],X[fe]),tt=w?N[fe]/2-G-Be-Re-A.mainAxis:re-Be-Re-A.mainAxis,Ct=w?-N[fe]/2+G+Be+Ue+A.mainAxis:Y+Be+Ue+A.mainAxis,at=t.elements.arrow&&Fo(t.elements.arrow),dn=at?T==="y"?at.clientTop||0:at.clientLeft||0:0,Qn=(K=D==null?void 0:D[T])!=null?K:0,pn=ne+tt-Qn-dn,Zn=ne+Ct-Qn,Cn=lo(g?ua(q,pn):q,ne,g?tl(J,Zn):J);M[T]=Cn,V[T]=Cn-ne}if(s){var hn,ht=T==="x"?Zt:Jt,ue=T==="x"?Sn:En,nt=M[O],Ft=O==="y"?"height":"width",ye=nt+P[ht],te=nt-P[ue],Oe=[Zt,Jt].indexOf(y)!==-1,$e=(hn=D==null?void 0:D[O])!=null?hn:0,h=Oe?ye:nt-N[Ft]-R[Ft]-$e+A.altAxis,S=Oe?nt+N[Ft]+R[Ft]-$e-A.altAxis:te,C=g&&Oe?u_(h,nt,S):lo(g?h:ye,nt,g?S:te);M[O]=C,V[O]=C-nt}t.modifiersData[r]=V}}const B_={name:"preventOverflow",enabled:!0,phase:"main",fn:I_,requiresIfExists:["offset"]};function $_(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function H_(e){return e===an(e)||!_n(e)?ed(e):$_(e)}function V_(e){var t=e.getBoundingClientRect(),n=ei(t.width)/e.offsetWidth||1,r=ei(t.height)/e.offsetHeight||1;return n!==1||r!==1}function U_(e,t,n){n===void 0&&(n=!1);var r=_n(t),l=_n(t)&&V_(t),i=$r(t),o=ti(e,l,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Gn(t)!=="body"||nd(i))&&(s=H_(t)),_n(t)?(u=ti(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=td(i))),{x:o.left+s.scrollLeft-u.x,y:o.top+s.scrollTop-u.y,width:o.width,height:o.height}}function W_(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function l(i){n.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var u=t.get(s);u&&l(u)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||l(i)}),r}function q_(e){var t=W_(e);return r_.reduce(function(n,r){return n.concat(t.filter(function(l){return l.phase===r}))},[])}function K_(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function G_(e){var t=e.reduce(function(n,r){var l=n[r.name];return n[r.name]=l?Object.assign({},l,r,{options:Object.assign({},l.options,r.options),data:Object.assign({},l.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var p0={placement:"bottom",modifiers:[],strategy:"absolute"};function h0(){for(var e=arguments.length,t=new Array(e),n=0;ne===null&&t===null?null:n=>{m0(e,n),m0(t,n)},[e,t])}const o3=({children:e,onClickAway:t})=>{const n=$.useRef(document),r=$.useRef(null),l=i3(r,e.ref),i=O1(o=>{if(!r.current)throw new Error("ClickAwayListener: missing ref");const s=!n.current.contains(o.target)||r.current.contains(o.target);o.type==="keyup"&&"key"in o&&(!["Escape","Tab"].includes(o.key)||o.key==="Tab"&&s)||o.type==="mouseup"&&s||t(o)});return To("mouseup",i,n),To("keyup",i,n),j.jsx(j.Fragment,{children:$.cloneElement(e,{ref:l})})};var s3="iy2n4g0",a3={fill:"iy2n4g1",outline:"iy2n4g2",text:"iy2n4g3"};function u3({className:e,name:t,title:n,variant:r="fill",...l},i){return j.jsx(Ao,{ref:i,className:Yn(s3,e),variant:r,...l,children:j.jsx(Fn,{className:a3[r],name:t,title:n})})}const c3=$.forwardRef(u3);var f3="_1sxwks00";function d3({children:e,className:t,...n},r){return j.jsx("div",{ref:r,className:Yn(f3,t),...n,children:e})}const Ra=$.forwardRef(d3);var p3="_1x45rmb3",h3={light:"_1x45rmb1 _1x45rmb0",dark:"_1x45rmb2 _1x45rmb0"};function m3({children:e}){const{theme:t}=pi(),[n,r]=$.useState(!1),[l,i]=$.useState(null),[o,s]=$.useState(null),{styles:u,attributes:a}=U1(l,o,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,10]}}]});return j.jsxs(j.Fragment,{children:[j.jsx(c3,{ref:i,"aria-expanded":n?"true":"false","aria-label":"Menu",name:"options",variant:"text",onClick:()=>r(!n)}),n&&j.jsx(o3,{onClickAway:()=>r(!1),children:j.jsx(Ra,{...a.popper,ref:s,className:h3[t],style:u.popper,onMouseLeave:()=>r(!1),children:j.jsx(st,{direction:"column",gap:0,children:e})})})]})}function v3({children:e,onClick:t}){return j.jsx(Ao,{variant:"text",onClick:t,children:j.jsx(st,{className:p3,align:"center",gap:2,children:e})})}const Au=Object.assign(m3,{Item:v3});var g3={active:"tz5dd56 tz5dd55",inactive:"tz5dd57 tz5dd55"};zo({conditions:{defaultCondition:"mobile",conditionNames:["mobile","desktop"],responsiveArray:void 0},styles:{display:{values:{none:{conditions:{mobile:"tz5dd51",desktop:"tz5dd52"},defaultClass:"tz5dd51"},block:{conditions:{mobile:"tz5dd53",desktop:"tz5dd54"},defaultClass:"tz5dd53"}}}}});var y3="tz5dd50";function w3({options:e,value:t,onChange:n}){return j.jsx("nav",{className:Yn(y3),children:j.jsx(st,{gap:2,children:e.map((r,l)=>j.jsx(_3,{label:r.title,index:l,value:t,onChange:n},r.id))})})}function _3({index:e,label:t,value:n,onChange:r,...l}){const i=e===n,o=i?"active":"inactive";return j.jsx(Ao,{"aria-current":i,className:g3[o],variant:"text",onClick:()=>r(e),...l,children:t})}var x3={loading:"_1e0qizf1",default:"_1e0qizf3 _1e0qizf1"},k3="_1e0qizf4",S3="_1e0qizf5";const E3=({children:e,isLoading:t=!1,max:n="100",value:r,...l})=>{const i=t?"loading":"default";return j.jsxs("div",{className:k3,children:[j.jsx("progress",{className:x3[i],max:n,value:r,...l}),e?j.jsx("div",{className:S3,children:e}):null]})},C3=e=>{var t;return(t=e==null?void 0:e.popper)==null?void 0:t["data-popper-placement"]},T3=e=>e?e.startsWith("top")?"top":e.startsWith("bottom")?"bottom":e.startsWith("right")?"right":"left":"left";var P3={top:"_1lpb9zp4 _1lpb9zp3",bottom:"_1lpb9zp5 _1lpb9zp3",left:"_1lpb9zp6 _1lpb9zp3",right:"_1lpb9zp7 _1lpb9zp3"},O3={light:"_1lpb9zp1 _1lpb9zp0",dark:"_1lpb9zp2 _1lpb9zp0"};function $c({children:e,placement:t="bottom-start",title:n}){const[r,l]=$.useState(!1),{theme:i}=pi(),[o,s]=$.useState(null),[u,a]=$.useState(null),[c,p]=$.useState(null),{styles:d,attributes:g}=U1(u,c,{placement:t,modifiers:[{name:"arrow",options:{element:o}},{name:"offset",options:{offset:[0,5]}}]}),_=T3(C3(g));return n?j.jsxs(j.Fragment,{children:[j.jsx("div",{ref:a,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:e}),r&&j.jsxs("div",{ref:p,className:O3[i],style:d.popper,...g.popper,children:[n,j.jsx("div",{ref:s,className:P3[_],style:d.arrow})]})]}):e}const v0=e=>e&&new Date(e).getTime(),W1=(e,t)=>e&&new Date(e.getTime()+t),b3=(e,t,n)=>{const r=v0(e)||0,l=v0(t)||0,i=n.getTime()-r,o=l-r;return i/o*100},N3=(e,t)=>{if(e.stop)return 100;const n=e.param.endOffset,r=W1(e.start,n),l=b3(e.start,r,t);return Math.round(l)},q1=(e=0)=>{const t=Math.round(e),n=Math.round(t%60);return t<0?"-":t<60?`${t}s`:n>0?`${Math.round((e-n)/60)}min ${n}s`:`${Math.round(t/60)}min`},M3=e=>{const t=e.param.period||0;return q1(t/1e3)},R3=e=>{const t=e.start,n=e.param.endOffset||0,r=e.stop||W1(e.start,n);if(!(!t||!r))return q1((r.getTime()-t.getTime())/1e3)};var L3="kfrms71",j3="kfrms73",z3="kfrms70",A3="kfrms74";function D3({config:e,tab:t,onTabChange:n}){const r=pl(),l=Gf(`(max-width: ${T1.breakpoints.header})`),i=!r.stop&&N3(r,new Date);return j.jsx(j.Fragment,{children:j.jsxs("header",{className:z3,children:[j.jsxs(st,{className:L3,align:"center",justify:"space-between",children:[j.jsxs(st,{align:"center",gap:4,children:[j.jsx(Fn,{name:"logo"}),j.jsx(w3,{options:e.tabs,value:t,onChange:n})]}),j.jsxs(st,{align:"center",children:[!l&&j.jsx(g0,{tab:t}),j.jsx(I3,{})]})]}),i?j.jsx(E3,{value:i}):j.jsx(W2,{className:j3}),l&&j.jsx(st,{align:"center",gap:3,justify:"end",padding:3,children:j.jsx(g0,{tab:t})})]})})}const F3=()=>{const e=pl();return j.jsx("div",{className:A3,children:j.jsxs(st,{align:"center",gap:3,children:[j.jsx($c,{placement:"bottom",title:"Refresh rate",children:j.jsxs(st,{align:"center",gap:2,children:[j.jsx(Fn,{name:"stop-watch",width:"12px",height:"12px"}),j.jsx("span",{children:M3(e)})]})}),j.jsx($c,{placement:"bottom",title:"Duration",children:j.jsxs(st,{align:"center",gap:2,children:[j.jsx(Fn,{name:"hour-glass",width:"12px",height:"12px"}),j.jsx("span",{children:R3(e)})]})})]})})},g0=({tab:e})=>{const t=e===2;return j.jsxs(j.Fragment,{children:[!t&&j.jsx(j1,{}),j.jsx(Ao,{onClick:()=>window.open("../report","k6-report"),children:"Report"}),j.jsx(F3,{})]})},I3=()=>{const{theme:e,setTheme:t}=pi();function n(){window.open("https://github.com/grafana/k6/blob/master/SUPPORT.md","_blank")}function r(){t(e==="light"?"dark":"light")}return j.jsxs(Au,{children:[j.jsxs(Au.Item,{onClick:n,children:[j.jsx(Fn,{name:"question"}),j.jsx("span",{children:"Help"})]}),j.jsxs(Au.Item,{onClick:r,children:[j.jsx(Fn,{name:e==="dark"?"sun":"moon"}),j.jsxs("span",{children:[e==="dark"?"Light":"Dark"," mode"]})]})]})};var B3="_1isundr0";function $3({children:e,message:t,isLoading:n}){return n?j.jsxs(st,{align:"center",justify:"center",children:[j.jsx(Fn,{className:B3,name:"spinner"}),j.jsx("h2",{children:t})]}):e}var K1={exports:{}};/*! @preserve - * numeral.js - * version : 2.0.6 - * author : Adam Draper - * license : MIT - * http://adamwdraper.github.com/Numeral-js/ - */(function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(rg,function(){var t,n,r="2.0.6",l={},i={},o={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},s={currentLocale:o.currentLocale,zeroFormat:o.zeroFormat,nullFormat:o.nullFormat,defaultFormat:o.defaultFormat,scalePercentBy100:o.scalePercentBy100};function u(a,c){this._input=a,this._value=c}return t=function(a){var c,p,d,g;if(t.isNumeral(a))c=a.value();else if(a===0||typeof a>"u")c=0;else if(a===null||n.isNaN(a))c=null;else if(typeof a=="string")if(s.zeroFormat&&a===s.zeroFormat)c=0;else if(s.nullFormat&&a===s.nullFormat||!a.replace(/[^0-9]+/g,"").length)c=null;else{for(p in l)if(g=typeof l[p].regexps.unformat=="function"?l[p].regexps.unformat():l[p].regexps.unformat,g&&a.match(g)){d=l[p].unformat;break}d=d||t._.stringToNumber,c=d(a)}else c=Number(a)||null;return new u(a,c)},t.version=r,t.isNumeral=function(a){return a instanceof u},t._=n={numberToFormat:function(a,c,p){var d=i[t.options.currentLocale],g=!1,_=!1,x=0,P="",y=1e12,v=1e9,w=1e6,T=1e3,O="",M=!1,N,R,I,A,D,V,K;if(a=a||0,R=Math.abs(a),t._.includes(c,"(")?(g=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(D=t._.includes(c,"+")?c.indexOf("+"):a<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(N=c.match(/a(k|m|b|t)?/),N=N?N[1]:!1,t._.includes(c," a")&&(P=" "),c=c.replace(new RegExp(P+"a[kmbt]?"),""),R>=y&&!N||N==="t"?(P+=d.abbreviations.trillion,a=a/y):R=v&&!N||N==="b"?(P+=d.abbreviations.billion,a=a/v):R=w&&!N||N==="m"?(P+=d.abbreviations.million,a=a/w):(R=T&&!N||N==="k")&&(P+=d.abbreviations.thousand,a=a/T)),t._.includes(c,"[.]")&&(_=!0,c=c.replace("[.]",".")),I=a.toString().split(".")[0],A=c.split(".")[1],V=c.indexOf(","),x=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,A?(t._.includes(A,"[")?(A=A.replace("]",""),A=A.split("["),O=t._.toFixed(a,A[0].length+A[1].length,p,A[1].length)):O=t._.toFixed(a,A.length,p),I=O.split(".")[0],t._.includes(O,".")?O=d.delimiters.decimal+O.split(".")[1]:O="",_&&Number(O.slice(1))===0&&(O="")):I=t._.toFixed(a,0,p),P&&!N&&Number(I)>=1e3&&P!==d.abbreviations.trillion)switch(I=String(Number(I)/1e3),P){case d.abbreviations.thousand:P=d.abbreviations.million;break;case d.abbreviations.million:P=d.abbreviations.billion;break;case d.abbreviations.billion:P=d.abbreviations.trillion;break}if(t._.includes(I,"-")&&(I=I.slice(1),M=!0),I.length0;oe--)I="0"+I;return V>-1&&(I=I.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),c.indexOf(".")===0&&(I=""),K=I+O+(P||""),g?K=(g&&M?"(":"")+K+(g&&M?")":""):D>=0?K=D===0?(M?"-":"+")+K:K+(M?"-":"+"):M&&(K="-"+K),K},stringToNumber:function(a){var c=i[s.currentLocale],p=a,d={thousand:3,million:6,billion:9,trillion:12},g,_,x;if(s.zeroFormat&&a===s.zeroFormat)_=0;else if(s.nullFormat&&a===s.nullFormat||!a.replace(/[^0-9]+/g,"").length)_=null;else{_=1,c.delimiters.decimal!=="."&&(a=a.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(g in d)if(x=new RegExp("[^a-zA-Z]"+c.abbreviations[g]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),p.match(x)){_*=Math.pow(10,d[g]);break}_*=(a.split("-").length+Math.min(a.split("(").length-1,a.split(")").length-1))%2?1:-1,a=a.replace(/[^0-9\.]+/g,""),_*=Number(a)}return _},isNaN:function(a){return typeof a=="number"&&isNaN(a)},includes:function(a,c){return a.indexOf(c)!==-1},insert:function(a,c,p){return a.slice(0,p)+c+a.slice(p)},reduce:function(a,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var p=Object(a),d=p.length>>>0,g=0,_;if(arguments.length===3)_=arguments[2];else{for(;g=d)throw new TypeError("Reduce of empty array with no initial value");_=p[g++]}for(;gd?c:d},1)},toFixed:function(a,c,p,d){var g=a.toString().split("."),_=c-(d||0),x,P,y,v;return g.length===2?x=Math.min(Math.max(g[1].length,_),c):x=_,y=Math.pow(10,x),v=(p(a+"e+"+x)/y).toFixed(x),d>c-x&&(P=new RegExp("\\.?0{1,"+(d-(c-x))+"}$"),v=v.replace(P,"")),v}},t.options=s,t.formats=l,t.locales=i,t.locale=function(a){return a&&(s.currentLocale=a.toLowerCase()),s.currentLocale},t.localeData=function(a){if(!a)return i[s.currentLocale];if(a=a.toLowerCase(),!i[a])throw new Error("Unknown locale : "+a);return i[a]},t.reset=function(){for(var a in o)s[a]=o[a]},t.zeroFormat=function(a){s.zeroFormat=typeof a=="string"?a:null},t.nullFormat=function(a){s.nullFormat=typeof a=="string"?a:null},t.defaultFormat=function(a){s.defaultFormat=typeof a=="string"?a:"0.0"},t.register=function(a,c,p){if(c=c.toLowerCase(),this[a+"s"][c])throw new TypeError(c+" "+a+" already registered.");return this[a+"s"][c]=p,p},t.validate=function(a,c){var p,d,g,_,x,P,y,v;if(typeof a!="string"&&(a+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",a)),a=a.trim(),a.match(/^\d+$/))return!0;if(a==="")return!1;try{y=t.localeData(c)}catch{y=t.localeData(t.locale())}return g=y.currency.symbol,x=y.abbreviations,p=y.delimiters.decimal,y.delimiters.thousands==="."?d="\\.":d=y.delimiters.thousands,v=a.match(/^[^\d]+/),v!==null&&(a=a.substr(1),v[0]!==g)||(v=a.match(/[^\d]+$/),v!==null&&(a=a.slice(0,-1),v[0]!==x.thousand&&v[0]!==x.million&&v[0]!==x.billion&&v[0]!==x.trillion))?!1:(P=new RegExp(d+"{2}"),a.match(/[^\d.,]/g)?!1:(_=a.split(p),_.length>2?!1:_.length<2?!!_[0].match(/^\d+.*\d$/)&&!_[0].match(P):_[0].length===1?!!_[0].match(/^\d+$/)&&!_[0].match(P)&&!!_[1].match(/^\d+$/):!!_[0].match(/^\d+.*\d$/)&&!_[0].match(P)&&!!_[1].match(/^\d+$/)))},t.fn=u.prototype={clone:function(){return t(this)},format:function(a,c){var p=this._value,d=a||s.defaultFormat,g,_,x;if(c=c||Math.round,p===0&&s.zeroFormat!==null)_=s.zeroFormat;else if(p===null&&s.nullFormat!==null)_=s.nullFormat;else{for(g in l)if(d.match(l[g].regexps.format)){x=l[g].format;break}x=x||t._.numberToFormat,_=x(p,d,c)}return _},value:function(){return this._value},input:function(){return this._input},set:function(a){return this._value=Number(a),this},add:function(a){var c=n.correctionFactor.call(null,this._value,a);function p(d,g,_,x){return d+Math.round(c*g)}return this._value=n.reduce([this._value,a],p,0)/c,this},subtract:function(a){var c=n.correctionFactor.call(null,this._value,a);function p(d,g,_,x){return d-Math.round(c*g)}return this._value=n.reduce([a],p,Math.round(this._value*c))/c,this},multiply:function(a){function c(p,d,g,_){var x=n.correctionFactor(p,d);return Math.round(p*x)*Math.round(d*x)/Math.round(x*x)}return this._value=n.reduce([this._value,a],c,1),this},divide:function(a){function c(p,d,g,_){var x=n.correctionFactor(p,d);return Math.round(p*x)/Math.round(d*x)}return this._value=n.reduce([this._value,a],c),this},difference:function(a){return Math.abs(t(this._value).subtract(a).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){var c=a%10;return~~(a%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(a,c,p){var d=t._.includes(c," BPS")?" ":"",g;return a=a*1e4,c=c.replace(/\s?BPS/,""),g=t._.numberToFormat(a,c,p),t._.includes(g,")")?(g=g.split(""),g.splice(-1,0,d+"BPS"),g=g.join("")):g=g+d+"BPS",g},unformat:function(a){return+(t._.stringToNumber(a)*1e-4).toFixed(15)}})}(),function(){var a={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},p=a.suffixes.concat(c.suffixes.filter(function(g){return a.suffixes.indexOf(g)<0})),d=p.join("|");d="("+d.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(d)},format:function(g,_,x){var P,y=t._.includes(_,"ib")?c:a,v=t._.includes(_," b")||t._.includes(_," ib")?" ":"",w,T,O;for(_=_.replace(/\s?i?b/,""),w=0;w<=y.suffixes.length;w++)if(T=Math.pow(y.base,w),O=Math.pow(y.base,w+1),g===null||g===0||g>=T&&g0&&(g=g/T);break}return P=t._.numberToFormat(g,_,x),P+v},unformat:function(g){var _=t._.stringToNumber(g),x,P;if(_){for(x=a.suffixes.length-1;x>=0;x--){if(t._.includes(g,a.suffixes[x])){P=Math.pow(a.base,x);break}if(t._.includes(g,c.suffixes[x])){P=Math.pow(c.base,x);break}}_*=P||1}return _}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(a,c,p){var d=t.locales[t.options.currentLocale],g={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},_,x,P;for(c=c.replace(/\s?\$\s?/,""),_=t._.numberToFormat(a,c,p),a>=0?(g.before=g.before.replace(/[\-\(]/,""),g.after=g.after.replace(/[\-\)]/,"")):a<0&&!t._.includes(g.before,"-")&&!t._.includes(g.before,"(")&&(g.before="-"+g.before),P=0;P=0;P--)switch(x=g.after[P],x){case"$":_=P===g.after.length-1?_+d.currency.symbol:t._.insert(_,d.currency.symbol,-(g.after.length-(1+P)));break;case" ":_=P===g.after.length-1?_+" ":t._.insert(_," ",-(g.after.length-(1+P)+d.currency.symbol.length-1));break}return _}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(a,c,p){var d,g=typeof a=="number"&&!t._.isNaN(a)?a.toExponential():"0e+0",_=g.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),d=t._.numberToFormat(Number(_[0]),c,p),d+"e"+_[1]},unformat:function(a){var c=t._.includes(a,"e+")?a.split("e+"):a.split("e-"),p=Number(c[0]),d=Number(c[1]);d=t._.includes(a,"e-")?d*=-1:d;function g(_,x,P,y){var v=t._.correctionFactor(_,x),w=_*v*(x*v)/(v*v);return w}return t._.reduce([p,Math.pow(10,d)],g,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(a,c,p){var d=t.locales[t.options.currentLocale],g,_=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),_+=d.ordinal(a),g=t._.numberToFormat(a,c,p),g+_}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(a,c,p){var d=t._.includes(c," %")?" ":"",g;return t.options.scalePercentBy100&&(a=a*100),c=c.replace(/\s?\%/,""),g=t._.numberToFormat(a,c,p),t._.includes(g,")")?(g=g.split(""),g.splice(-1,0,d+"%"),g=g.join("")):g=g+d+"%",g},unformat:function(a){var c=t._.stringToNumber(a);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(a,c,p){var d=Math.floor(a/60/60),g=Math.floor((a-d*60*60)/60),_=Math.round(a-d*60*60-g*60);return d+":"+(g<10?"0"+g:g)+":"+(_<10?"0"+_:_)},unformat:function(a){var c=a.split(":"),p=0;return c.length===3?(p=p+Number(c[0])*60*60,p=p+Number(c[1])*60,p=p+Number(c[2])):c.length===2&&(p=p+Number(c[0])*60,p=p+Number(c[1])),Number(p)}})}(),t})})(K1);var H3=K1.exports;const Du=ha(H3),V3=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],U3=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],W3=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],q3=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],y0=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function K3(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?q3:W3:t.binary?U3:V3,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const l=e<0,i=l?"-":t.signed?"+":"";l&&(e=-e);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1){const c=y0(e,t.locale,o);return i+c+r+n[0]}const s=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**s,o||(e=e.toPrecision(3));const u=y0(Number(e),t.locale,o),a=n[s];return i+u+r+a}function G3(e){if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}}const Y3=(e,t)=>t===1?e:`${e}s`,Q3=1e-7;function Z3(e,t={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const n=[],r=(o,s)=>{const u=Math.floor(o*10**s+Q3);return(Math.round(u)/10**s).toFixed(s)},l=(o,s,u,a)=>{if((n.length===0||!t.colonNotation)&&o===0&&!(t.colonNotation&&u==="m"))return;a=(a||o||"0").toString();let c,p;if(t.colonNotation){c=n.length>0?":":"",p="";const d=a.includes(".")?a.split(".")[0].length:a.length,g=n.length>0?2:1;a="0".repeat(Math.max(0,g-d))+a}else c="",p=t.verbose?" "+Y3(s,o):u;n.push(c+a+p)},i=G3(e);if(l(Math.trunc(i.days/365),"year","y"),l(i.days%365,"day","d"),l(i.hours,"hour","h"),l(i.minutes,"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(l(i.seconds,"second","s"),t.formatSubMilliseconds)l(i.milliseconds,"millisecond","ms"),l(i.microseconds,"microsecond","µs"),l(i.nanoseconds,"nanosecond","ns");else{const o=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,s=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=o>=1?Math.round(o):Math.ceil(o),a=s?o.toFixed(s):u;l(Number.parseFloat(a),"millisecond","ms",a)}else{const o=e/1e3%60,s=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=r(o,s),a=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");l(Number.parseFloat(a),"second","s",a)}if(n.length===0)return"0"+(t.verbose?" milliseconds":"ms");if(t.compact)return n[0];if(typeof t.unitCount=="number"){const o=t.colonNotation?"":" ";return n.slice(0,Math.max(t.unitCount,1)).join(o)}return t.colonNotation?n.join(""):n.join(" ")}const J3=!0,pt="u-",X3="uplot",ex=pt+"hz",tx=pt+"vt",nx=pt+"title",rx=pt+"wrap",lx=pt+"under",ix=pt+"over",ox=pt+"axis",Yr=pt+"off",sx=pt+"select",ax=pt+"cursor-x",ux=pt+"cursor-y",cx=pt+"cursor-pt",fx=pt+"legend",dx=pt+"live",px=pt+"inline",hx=pt+"series",mx=pt+"marker",w0=pt+"label",vx=pt+"value",qi="width",Ki="height",Bi="top",_0="bottom",El="left",Fu="right",rd="#000",x0=rd+"0",k0="mousemove",S0="mousedown",Iu="mouseup",E0="mouseenter",C0="mouseleave",T0="dblclick",gx="resize",yx="scroll",P0="change",ca="dppxchange",ld="--",hi=typeof window<"u",Hc=hi?document:null,Wl=hi?window:null,wx=hi?navigator:null;let Te,_s;function Vc(){let e=devicePixelRatio;Te!=e&&(Te=e,_s&&Wc(P0,_s,Vc),_s=matchMedia(`(min-resolution: ${Te-.001}dppx) and (max-resolution: ${Te+.001}dppx)`),nl(P0,_s,Vc),Wl.dispatchEvent(new CustomEvent(ca)))}function en(e,t){if(t!=null){let n=e.classList;!n.contains(t)&&n.add(t)}}function Uc(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function He(e,t,n){e.style[t]=n+"px"}function Mn(e,t,n,r){let l=Hc.createElement(e);return t!=null&&en(l,t),n!=null&&n.insertBefore(l,r),l}function mn(e,t){return Mn("div",e,t)}const O0=new WeakMap;function Cl(e,t,n,r,l){let i="translate("+t+"px,"+n+"px)",o=O0.get(e);i!=o&&(e.style.transform=i,O0.set(e,i),t<0||n<0||t>r||n>l?en(e,Yr):Uc(e,Yr))}const b0=new WeakMap;function _x(e,t,n){let r=t+n,l=b0.get(e);r!=l&&(b0.set(e,r),e.style.background=t,e.style.borderColor=n)}const N0=new WeakMap;function xx(e,t,n,r){let l=t+""+n,i=N0.get(e);l!=i&&(N0.set(e,l),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}const id={passive:!0},G1={...id,capture:!0};function nl(e,t,n,r){t.addEventListener(e,n,r?G1:id)}function Wc(e,t,n,r){t.removeEventListener(e,n,r?G1:id)}hi&&Vc();function _r(e,t,n,r){let l;n=n||0,r=r||t.length-1;let i=r<=2147483647;for(;r-n>1;)l=i?n+r>>1:on((n+r)/2),t[l]=t&&l<=n;l+=r)if(e[l]!=null)return l;return-1}function kx(e,t,n,r){let l=ke,i=-ke;if(r==1)l=e[t],i=e[n];else if(r==-1)l=e[n],i=e[t];else for(let o=t;o<=n;o++){let s=e[o];s!=null&&(si&&(i=s))}return[l,i]}function Sx(e,t,n){let r=ke,l=-ke;for(let i=t;i<=n;i++){let o=e[i];o!=null&&o>0&&(ol&&(l=o))}return[r==ke?1:r,l==-ke?10:l]}function La(e,t,n,r){let l=L0(e),i=L0(t),o=n==10?ir:Y1;e==t&&(l==-1?(e*=n,t/=n):(e/=n,t*=n));let s=l==1?on:li,u=i==1?li:on,a=s(o(xt(e))),c=u(o(xt(t))),p=ii(n,a),d=ii(n,c);return n==10&&(a<0&&(p=Le(p,-a)),c<0&&(d=Le(d,-c))),r||n==2?(e=p*l,t=d*i):(e=Z1(e,p),t=si(t,d)),[e,t]}function od(e,t,n,r){let l=La(e,t,n,r);return e==0&&(l[0]=0),t==0&&(l[1]=0),l}const sd=.1,M0={mode:3,pad:sd},oo={pad:0,soft:null,mode:0},Ex={min:oo,max:oo};function fa(e,t,n,r){return ja(n)?R0(e,t,n):(oo.pad=n,oo.soft=r?0:null,oo.mode=r?3:0,R0(e,t,Ex))}function Pe(e,t){return e??t}function Cx(e,t,n){for(t=Pe(t,0),n=Pe(n,e.length-1);t<=n;){if(e[t]!=null)return!0;t++}return!1}function R0(e,t,n){let r=n.min,l=n.max,i=Pe(r.pad,0),o=Pe(l.pad,0),s=Pe(r.hard,-ke),u=Pe(l.hard,ke),a=Pe(r.soft,ke),c=Pe(l.soft,-ke),p=Pe(r.mode,0),d=Pe(l.mode,0),g=t-e,_=ir(g),x=kt(xt(e),xt(t)),P=ir(x),y=xt(P-_);(g<1e-9||y>10)&&(g=0,(e==0||t==0)&&(g=1e-9,p==2&&a!=ke&&(i=0),d==2&&c!=-ke&&(o=0)));let v=g||x||1e3,w=ir(v),T=ii(10,on(w)),O=v*(g==0?e==0?.1:1:i),M=Le(Z1(e-O,T/10),9),N=e>=a&&(p==1||p==3&&M<=a||p==2&&M>=a)?a:ke,R=kt(s,M=N?N:nn(N,M)),I=v*(g==0?t==0?.1:1:o),A=Le(si(t+I,T/10),9),D=t<=c&&(d==1||d==3&&A>=c||d==2&&A<=c)?c:-ke,V=nn(u,A>D&&t<=D?D:kt(D,A));return R==V&&R==0&&(V=100),[R,V]}const Tx=new Intl.NumberFormat(hi?wx.language:"en-US"),ad=e=>Tx.format(e),fn=Math,Ds=fn.PI,xt=fn.abs,on=fn.floor,bt=fn.round,li=fn.ceil,nn=fn.min,kt=fn.max,ii=fn.pow,L0=fn.sign,ir=fn.log10,Y1=fn.log2,Px=(e,t=1)=>fn.sinh(e)*t,Bu=(e,t=1)=>fn.asinh(e/t),ke=1/0;function j0(e){return(ir((e^e>>31)-(e>>31))|0)+1}function z0(e,t,n){return nn(kt(e,t),n)}function xe(e){return typeof e=="function"?e:()=>e}const Ox=()=>{},bx=e=>e,Q1=(e,t)=>t,Nx=e=>null,A0=e=>!0,D0=(e,t)=>e==t,oi=e=>Le(e,14);function Gr(e,t){return oi(Le(oi(e/t))*t)}function si(e,t){return oi(li(oi(e/t))*t)}function Z1(e,t){return oi(on(oi(e/t))*t)}function Le(e,t=0){if(Mx(e))return e;let n=10**t,r=e*n*(1+Number.EPSILON);return bt(r)/n}const ai=new Map;function J1(e){return((""+e).split(".")[1]||"").length}function bo(e,t,n,r){let l=[],i=r.map(J1);for(let o=t;o=0&&o>=0?0:s)+(o>=i[a]?0:i[a]),d=Le(c,p);l.push(d),ai.set(d,p)}}return l}const so={},X1=[],ui=[null,null],Sr=Array.isArray,Mx=Number.isInteger,Rx=e=>e===void 0;function F0(e){return typeof e=="string"}function ja(e){let t=!1;if(e!=null){let n=e.constructor;t=n==null||n==Object}return t}function I0(e){return e!=null&&typeof e=="object"}const Lx=Object.getPrototypeOf(Uint8Array);function rl(e,t=ja){let n;if(Sr(e)){let r=e.find(l=>l!=null);if(Sr(r)||t(r)){n=Array(e.length);for(let l=0;li){for(l=o-1;l>=0&&e[l]==null;)e[l--]=null;for(l=o+1;lo-s)],l=r[0].length,i=new Map;for(let o=0;o"u"?e=>Promise.resolve().then(e):queueMicrotask;function Bx(e){let t=e[0],n=t.length,r=Array(n);for(let i=0;it[i]-t[o]);let l=[];for(let i=0;i=r&&e[l]==null;)l--;if(l<=r)return!0;const i=kt(1,on((l-r+1)/t));for(let o=e[r],s=r+i;s<=l;s+=i){const u=e[s];if(u!=null){if(u<=o)return!1;o=u}}return!0}const ev=["January","February","March","April","May","June","July","August","September","October","November","December"],tv=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function nv(e){return e.slice(0,3)}const Vx=tv.map(nv),Ux=ev.map(nv),Wx={MMMM:ev,MMM:Ux,WWWW:tv,WWW:Vx};function $i(e){return(e<10?"0":"")+e}function qx(e){return(e<10?"00":e<100?"0":"")+e}const Kx={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>$i(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>$i(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>$i(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>$i(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>$i(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>qx(e.getMilliseconds())};function ud(e,t){t=t||Wx;let n=[],r=/\{([a-z]+)\}|[^{]+/gi,l;for(;l=r.exec(e);)n.push(l[0][0]=="{"?Kx[l[1]]:l[0]);return i=>{let o="";for(let s=0;se%1==0,da=[1,2,2.5,5],Qx=bo(10,-16,0,da),lv=bo(10,0,16,da),Zx=lv.filter(rv),Jx=Qx.concat(lv),cd=` -`,iv="{YYYY}",B0=cd+iv,ov="{M}/{D}",Gi=cd+ov,xs=Gi+"/{YY}",sv="{aa}",Xx="{h}:{mm}",Tl=Xx+sv,$0=cd+Tl,H0=":{ss}",be=null;function av(e){let t=e*1e3,n=t*60,r=n*60,l=r*24,i=l*30,o=l*365,u=(e==1?bo(10,0,3,da).filter(rv):bo(10,-3,0,da)).concat([t,t*5,t*10,t*15,t*30,n,n*5,n*10,n*15,n*30,r,r*2,r*3,r*4,r*6,r*8,r*12,l,l*2,l*3,l*4,l*5,l*6,l*7,l*8,l*9,l*10,l*15,i,i*2,i*3,i*4,i*6,o,o*2,o*5,o*10,o*25,o*50,o*100]);const a=[[o,iv,be,be,be,be,be,be,1],[l*28,"{MMM}",B0,be,be,be,be,be,1],[l,ov,B0,be,be,be,be,be,1],[r,"{h}"+sv,xs,be,Gi,be,be,be,1],[n,Tl,xs,be,Gi,be,be,be,1],[t,H0,xs+" "+Tl,be,Gi+" "+Tl,be,$0,be,1],[e,H0+".{fff}",xs+" "+Tl,be,Gi+" "+Tl,be,$0,be,1]];function c(p){return(d,g,_,x,P,y)=>{let v=[],w=P>=o,T=P>=i&&P=l?l:P,A=on(_)-on(M),D=R+A+si(M-R,I);v.push(D);let V=p(D),K=V.getHours()+V.getMinutes()/n+V.getSeconds()/r,oe=P/r,se=d.axes[g]._space,fe=y/se;for(;D=Le(D+P,e==1?0:3),!(D>x);)if(oe>1){let ne=on(Le(K+oe,6))%24,G=p(D).getHours()-ne;G>1&&(G=-1),D-=G*r,K=(K+oe)%24;let re=v[v.length-1];Le((D-re)/P,3)*fe>=.7&&v.push(D)}else v.push(D)}return v}}return[u,a,c]}const[ek,tk,nk]=av(1),[rk,lk,ik]=av(.001);bo(2,-53,53,[1]);function V0(e,t){return e.map(n=>n.map((r,l)=>l==0||l==8||r==null?r:t(l==1||n[8]==0?r:n[1]+r)))}function U0(e,t){return(n,r,l,i,o)=>{let s=t.find(_=>o>=_[0])||t[t.length-1],u,a,c,p,d,g;return r.map(_=>{let x=e(_),P=x.getFullYear(),y=x.getMonth(),v=x.getDate(),w=x.getHours(),T=x.getMinutes(),O=x.getSeconds(),M=P!=u&&s[2]||y!=a&&s[3]||v!=c&&s[4]||w!=p&&s[5]||T!=d&&s[6]||O!=g&&s[7]||s[1];return u=P,a=y,c=v,p=w,d=T,g=O,M(x)})}}function ok(e,t){let n=ud(t);return(r,l,i,o,s)=>l.map(u=>n(e(u)))}function $u(e,t,n){return new Date(e,t,n)}function W0(e,t){return t(e)}const sk="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function q0(e,t){return(n,r,l,i)=>i==null?ld:t(e(r))}function ak(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null}function uk(e,t){return e.series[t].fill(e,t)}const ck={show:!0,live:!0,isolate:!1,mount:Ox,markers:{show:!0,width:2,stroke:ak,fill:uk,dash:"solid"},idx:null,idxs:null,values:[]};function fk(e,t){let n=e.cursor.points,r=mn(),l=n.size(e,t);He(r,qi,l),He(r,Ki,l);let i=l/-2;He(r,"marginLeft",i),He(r,"marginTop",i);let o=n.width(e,t,l);return o&&He(r,"borderWidth",o),r}function dk(e,t){let n=e.series[t].points;return n._fill||n._stroke}function pk(e,t){let n=e.series[t].points;return n._stroke||n._fill}function hk(e,t){return e.series[t].points.size}function mk(e,t,n){return n}const Hu=[0,0];function vk(e,t,n){return Hu[0]=t,Hu[1]=n,Hu}function ks(e,t,n,r=!0){return l=>{l.button==0&&(!r||l.target==t)&&n(l)}}function Vu(e,t,n,r=!0){return l=>{(!r||l.target==t)&&n(l)}}const gk={show:!0,x:!0,y:!0,lock:!1,move:vk,points:{show:fk,size:hk,width:0,stroke:pk,fill:dk},bind:{mousedown:ks,mouseup:ks,click:ks,dblclick:ks,mousemove:Vu,mouseleave:Vu,mouseenter:Vu},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{prox:-1,bias:0},left:-10,top:-10,idx:null,dataIdx:mk,idxs:null,event:null},uv={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},fd=it({},uv,{filter:Q1}),cv=it({},fd,{size:10}),fv=it({},uv,{show:!1}),dd='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',dv="bold "+dd,pv=1.5,K0={show:!0,scale:"x",stroke:rd,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:dv,side:2,grid:fd,ticks:cv,border:fv,font:dd,lineGap:pv,rotate:0},yk="Value",wk="Time",G0={show:!0,scale:"x",auto:!1,sorted:1,min:ke,max:-ke,idxs:[]};function _k(e,t,n,r,l){return t.map(i=>i==null?"":ad(i))}function xk(e,t,n,r,l,i,o){let s=[],u=ai.get(l)||0;n=o?n:Le(si(n,l),u);for(let a=n;a<=r;a=Le(a+l,u))s.push(Object.is(a,-0)?0:a);return s}function qc(e,t,n,r,l,i,o){const s=[],u=e.scales[e.axes[t].scale].log,a=u==10?ir:Y1,c=on(a(n));l=ii(u,c),u==10&&c<0&&(l=Le(l,-c));let p=n;do s.push(p),p=p+l,u==10&&(p=Le(p,ai.get(l))),p>=l*u&&(l=p);while(p<=r);return s}function kk(e,t,n,r,l,i,o){let u=e.scales[e.axes[t].scale].asinh,a=r>u?qc(e,t,kt(u,n),r,l):[u],c=r>=0&&n<=0?[0]:[];return(n<-u?qc(e,t,kt(u,-r),-n,l):[u]).reverse().map(d=>-d).concat(c,a)}const hv=/./,Sk=/[12357]/,Ek=/[125]/,Y0=/1/,Kc=(e,t,n,r)=>e.map((l,i)=>t==4&&l==0||i%r==0&&n.test(l.toExponential()[l<0?1:0])?l:null);function Ck(e,t,n,r,l){let i=e.axes[n],o=i.scale,s=e.scales[o],u=e.valToPos,a=i._space,c=u(10,o),p=u(9,o)-c>=a?hv:u(7,o)-c>=a?Sk:u(5,o)-c>=a?Ek:Y0;if(p==Y0){let d=xt(u(1,o)-c);if(dl,J0={show:!0,auto:!0,sorted:0,gaps:mv,alpha:1,facets:[it({},Z0,{scale:"x"}),it({},Z0,{scale:"y"})]},X0={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:mv,alpha:1,points:{show:bk,filter:null},values:null,min:ke,max:-ke,idxs:[],path:null,clip:null};function Nk(e,t,n,r,l){return n/10}const vv={time:J3,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Mk=it({},vv,{time:!1,ori:1}),eh={};function gv(e,t){let n=eh[e];return n||(n={key:e,plots:[],sub(r){n.plots.push(r)},unsub(r){n.plots=n.plots.filter(l=>l!=r)},pub(r,l,i,o,s,u,a){for(let c=0;c{let y=o.pxRound;const v=a.dir*(a.ori==0?1:-1),w=a.ori==0?mi:vi;let T,O;v==1?(T=n,O=r):(T=r,O=n);let M=y(p(s[T],a,x,g)),N=y(d(u[T],c,P,_)),R=y(p(s[O],a,x,g)),I=y(d(i==1?c.max:c.min,c,P,_)),A=new Path2D(l);return w(A,R,I),w(A,M,I),w(A,M,N),A})}function Aa(e,t,n,r,l,i){let o=null;if(e.length>0){o=new Path2D;const s=t==0?Ia:hd;let u=n;for(let p=0;pd[0]){let g=d[0]-u;g>0&&s(o,u,r,g,r+i),u=d[1]}}let a=n+l-u,c=10;a>0&&s(o,u,r-c/2,a,r+i+c)}return o}function Lk(e,t,n){let r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])}function pd(e,t,n,r,l,i,o){let s=[],u=e.length;for(let a=l==1?n:r;a>=n&&a<=r;a+=l)if(t[a]===null){let p=a,d=a;if(l==1)for(;++a<=r&&t[a]===null;)d=a;else for(;--a>=n&&t[a]===null;)d=a;let g=i(e[p]),_=d==p?g:i(e[d]),x=p-l;g=o<=0&&x>=0&&x=0&&y>=0&&y=g&&s.push([g,_])}return s}function th(e){return e==0?bx:e==1?bt:t=>Gr(t,e)}function yv(e){let t=e==0?Da:Fa,n=e==0?(l,i,o,s,u,a)=>{l.arcTo(i,o,s,u,a)}:(l,i,o,s,u,a)=>{l.arcTo(o,i,u,s,a)},r=e==0?(l,i,o,s,u)=>{l.rect(i,o,s,u)}:(l,i,o,s,u)=>{l.rect(o,i,u,s)};return(l,i,o,s,u,a=0,c=0)=>{a==0&&c==0?r(l,i,o,s,u):(a=nn(a,s/2,u/2),c=nn(c,s/2,u/2),t(l,i+a,o),n(l,i+s,o,i+s,o+u,a),n(l,i+s,o+u,i,o+u,c),n(l,i,o+u,i,o,c),n(l,i,o,i+s,o,a),l.closePath())}}const Da=(e,t,n)=>{e.moveTo(t,n)},Fa=(e,t,n)=>{e.moveTo(n,t)},mi=(e,t,n)=>{e.lineTo(t,n)},vi=(e,t,n)=>{e.lineTo(n,t)},Ia=yv(0),hd=yv(1),wv=(e,t,n,r,l,i)=>{e.arc(t,n,r,l,i)},_v=(e,t,n,r,l,i)=>{e.arc(n,t,r,l,i)},xv=(e,t,n,r,l,i,o)=>{e.bezierCurveTo(t,n,r,l,i,o)},kv=(e,t,n,r,l,i,o)=>{e.bezierCurveTo(n,t,l,r,o,i)};function Sv(e){return(t,n,r,l,i)=>hl(t,n,(o,s,u,a,c,p,d,g,_,x,P)=>{let{pxRound:y,points:v}=o,w,T;a.ori==0?(w=Da,T=wv):(w=Fa,T=_v);const O=Le(v.width*Te,3);let M=(v.size-v.width)/2*Te,N=Le(M*2,3),R=new Path2D,I=new Path2D,{left:A,top:D,width:V,height:K}=t.bbox;Ia(I,A-N,D-N,V+N*2,K+N*2);const oe=se=>{if(u[se]!=null){let fe=y(p(s[se],a,x,g)),ne=y(d(u[se],c,P,_));w(R,fe+M,ne),T(R,fe,ne,M,0,Ds*2)}};if(i)i.forEach(oe);else for(let se=r;se<=l;se++)oe(se);return{stroke:O>0?R:null,fill:R,clip:I,flags:cl|pa}})}function Ev(e){return(t,n,r,l,i,o)=>{r!=l&&(i!=r&&o!=r&&e(t,n,r),i!=l&&o!=l&&e(t,n,l),e(t,n,o))}}const jk=Ev(mi),zk=Ev(vi);function Cv(e){const t=Pe(e==null?void 0:e.alignGaps,0);return(n,r,l,i)=>hl(n,r,(o,s,u,a,c,p,d,g,_,x,P)=>{let y=o.pxRound,v=Y=>y(p(Y,a,x,g)),w=Y=>y(d(Y,c,P,_)),T,O;a.ori==0?(T=mi,O=jk):(T=vi,O=zk);const M=a.dir*(a.ori==0?1:-1),N={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:cl},R=N.stroke;let I=ke,A=-ke,D,V,K,oe=v(s[M==1?l:i]),se=ri(u,l,i,1*M),fe=ri(u,l,i,-1*M),ne=v(s[se]),q=v(s[fe]),J=!1;for(let Y=M==1?l:i;Y>=l&&Y<=i;Y+=M){let me=v(s[Y]),X=u[Y];me==oe?X!=null?(V=w(X),I==ke&&(T(R,me,V),D=V),I=nn(V,I),A=kt(V,A)):X===null&&(J=!0):(I!=ke&&(O(R,oe,I,A,D,V),K=oe),X!=null?(V=w(X),T(R,me,V),I=A=D=V):(I=ke,A=-ke,X===null&&(J=!0)),oe=me)}I!=ke&&I!=A&&K!=oe&&O(R,oe,I,A,D,V);let[G,re]=za(n,r);if(o.fill!=null||G!=0){let Y=N.fill=new Path2D(R),me=o.fillTo(n,r,o.min,o.max,G),X=w(me);T(Y,q,X),T(Y,ne,X)}if(!o.spanGaps){let Y=[];J&&Y.push(...pd(s,u,l,i,M,v,t)),N.gaps=Y=o.gaps(n,r,l,i,Y),N.clip=Aa(Y,a.ori,g,_,x,P)}return re!=0&&(N.band=re==2?[or(n,r,l,i,R,-1),or(n,r,l,i,R,1)]:or(n,r,l,i,R,re)),N})}function Ak(e){const t=Pe(e.align,1),n=Pe(e.ascDesc,!1),r=Pe(e.alignGaps,0),l=Pe(e.extend,!1);return(i,o,s,u)=>hl(i,o,(a,c,p,d,g,_,x,P,y,v,w)=>{let T=a.pxRound,{left:O,width:M}=i.bbox,N=G=>T(_(G,d,v,P)),R=G=>T(x(G,g,w,y)),I=d.ori==0?mi:vi;const A={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:cl},D=A.stroke,V=d.dir*(d.ori==0?1:-1);s=ri(p,s,u,1),u=ri(p,s,u,-1);let K=R(p[V==1?s:u]),oe=N(c[V==1?s:u]),se=oe,fe=oe;l&&t==-1&&(fe=O,I(D,fe,K)),I(D,oe,K);for(let G=V==1?s:u;G>=s&&G<=u;G+=V){let re=p[G];if(re==null)continue;let Y=N(c[G]),me=R(re);t==1?I(D,Y,K):I(D,se,me),I(D,Y,me),K=me,se=Y}let ne=se;l&&t==1&&(ne=O+M,I(D,ne,K));let[q,J]=za(i,o);if(a.fill!=null||q!=0){let G=A.fill=new Path2D(D),re=a.fillTo(i,o,a.min,a.max,q),Y=R(re);I(G,ne,Y),I(G,fe,Y)}if(!a.spanGaps){let G=[];G.push(...pd(c,p,s,u,V,N,r));let re=a.width*Te/2,Y=n||t==1?re:-re,me=n||t==-1?-re:re;G.forEach(X=>{X[0]+=Y,X[1]+=me}),A.gaps=G=a.gaps(i,o,s,u,G),A.clip=Aa(G,d.ori,P,y,v,w)}return J!=0&&(A.band=J==2?[or(i,o,s,u,D,-1),or(i,o,s,u,D,1)]:or(i,o,s,u,D,J)),A})}function Dk(e){e=e||so;const t=Pe(e.size,[.6,ke,1]),n=e.align||0,r=(e.gap||0)*Te;let l=e.radius;l=l==null?[0,0]:typeof l=="number"?[l,0]:l;const i=xe(l),o=1-t[0],s=Pe(t[1],ke)*Te,u=Pe(t[2],1)*Te,a=Pe(e.disp,so),c=Pe(e.each,g=>{}),{fill:p,stroke:d}=a;return(g,_,x,P)=>hl(g,_,(y,v,w,T,O,M,N,R,I,A,D)=>{let V=y.pxRound,K,oe;T.ori==0?[K,oe]=i(g,_):[oe,K]=i(g,_);const se=T.dir*(T.ori==0?1:-1),fe=O.dir*(O.ori==1?1:-1);let ne=T.ori==0?Ia:hd,q=T.ori==0?c:(te,Oe,$e,h,S,C,L)=>{c(te,Oe,$e,S,h,L,C)},[J,G]=za(g,_),re=O.distr==3?J==1?O.max:O.min:0,Y=N(re,O,D,I),me,X,pe=V(y.width*Te),Re=!1,Ue=null,Be=null,tt=null,Ct=null;p!=null&&(pe==0||d!=null)&&(Re=!0,Ue=p.values(g,_,x,P),Be=new Map,new Set(Ue).forEach(te=>{te!=null&&Be.set(te,new Path2D)}),pe>0&&(tt=d.values(g,_,x,P),Ct=new Map,new Set(tt).forEach(te=>{te!=null&&Ct.set(te,new Path2D)})));let{x0:at,size:dn}=a,Qn=!0;if(at!=null&&dn!=null){v=at.values(g,_,x,P),at.unit==2&&(v=v.map(Oe=>g.posToVal(R+Oe*A,T.key,!0)));let te=dn.values(g,_,x,P);dn.unit==2?X=te[0]*A:X=M(te[0],T,A,R)-M(0,T,A,R),X=V(X-pe),me=se==1?-pe/2:X+pe/2}else{let te=A;if(v.length>1){let $e=null;for(let h=0,S=1/0;hte&&(Qn=!1)}const pn={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:cl|pa};let Zn;G!=0&&(pn.band=new Path2D,Zn=V(N(G==1?O.max:O.min,O,D,I)));const Cn=Re?null:new Path2D,hn=pn.band;let{y0:ht,y1:ue}=a,nt=null;ht!=null&&ue!=null&&(w=ue.values(g,_,x,P),nt=ht.values(g,_,x,P));let Ft=K*X,ye=oe*X;for(let te=se==1?x:P;te>=x&&te<=P;te+=se){let Oe=w[te];if(Oe===void 0)continue;let $e=T.distr!=2||a!=null?v[te]:te,h=M($e,T,A,R),S=N(Pe(Oe,re),O,D,I);nt!=null&&Oe!=null&&(Y=N(nt[te],O,D,I));let C=V(h-me),L=V(kt(S,Y)),F=V(nn(S,Y)),Q=L-F;if(Oe!=null){let ae=Oe<0?ye:Ft,he=Oe<0?Ft:ye;Re?(pe>0&&tt[te]!=null&&ne(Ct.get(tt[te]),C,F+on(pe/2),X,kt(0,Q-pe),ae,he),Ue[te]!=null&&ne(Be.get(Ue[te]),C,F+on(pe/2),X,kt(0,Q-pe),ae,he)):ne(Cn,C,F+on(pe/2),X,kt(0,Q-pe),ae,he),q(g,_,te,C-pe/2,F,X+pe,Q)}G!=0&&(Oe!=null||Qn)&&(fe*G==1?(L=F,F=Zn):(F=L,L=Zn),Q=L-F,ne(hn,C-pe/2,F,X+pe,kt(0,Q),0,0))}return pe>0&&(pn.stroke=Re?Ct:Cn),pn.fill=Re?Be:Cn,pn})}function Fk(e,t){const n=Pe(t==null?void 0:t.alignGaps,0);return(r,l,i,o)=>hl(r,l,(s,u,a,c,p,d,g,_,x,P,y)=>{let v=s.pxRound,w=ne=>v(d(ne,c,P,_)),T=ne=>v(g(ne,p,y,x)),O,M,N;c.ori==0?(O=Da,N=mi,M=xv):(O=Fa,N=vi,M=kv);const R=c.dir*(c.ori==0?1:-1);i=ri(a,i,o,1),o=ri(a,i,o,-1);let I=w(u[R==1?i:o]),A=I,D=[],V=[];for(let ne=R==1?i:o;ne>=i&&ne<=o;ne+=R)if(a[ne]!=null){let J=u[ne],G=w(J);D.push(A=G),V.push(T(a[ne]))}const K={stroke:e(D,V,O,N,M,v),fill:null,clip:null,band:null,gaps:null,flags:cl},oe=K.stroke;let[se,fe]=za(r,l);if(s.fill!=null||se!=0){let ne=K.fill=new Path2D(oe),q=s.fillTo(r,l,s.min,s.max,se),J=T(q);N(ne,A,J),N(ne,I,J)}if(!s.spanGaps){let ne=[];ne.push(...pd(u,a,i,o,R,w,n)),K.gaps=ne=s.gaps(r,l,i,o,ne),K.clip=Aa(ne,c.ori,_,x,P,y)}return fe!=0&&(K.band=fe==2?[or(r,l,i,o,oe,-1),or(r,l,i,o,oe,1)]:or(r,l,i,o,oe,fe)),K})}function Ik(e){return Fk(Bk,e)}function Bk(e,t,n,r,l,i){const o=e.length;if(o<2)return null;const s=new Path2D;if(n(s,e[0],t[0]),o==2)r(s,e[1],t[1]);else{let u=Array(o),a=Array(o-1),c=Array(o-1),p=Array(o-1);for(let d=0;d0!=a[d]>0?u[d]=0:(u[d]=3*(p[d-1]+p[d])/((2*p[d]+p[d-1])/a[d-1]+(p[d]+2*p[d-1])/a[d]),isFinite(u[d])||(u[d]=0));u[o-1]=a[o-2];for(let d=0;d{Et.pxRatio=Te}));const $k=Cv(),Hk=Sv();function rh(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((i,o)=>Yc(i,o,t,n))}function Vk(e,t){return e.map((n,r)=>r==0?null:it({},t,n))}function Yc(e,t,n,r){return it({},t==0?n:r,e)}function Tv(e,t,n){return t==null?ui:[t,n]}const Uk=Tv;function Wk(e,t,n){return t==null?ui:fa(t,n,sd,!0)}function Pv(e,t,n,r){return t==null?ui:La(t,n,e.scales[r].log,!1)}const qk=Pv;function Ov(e,t,n,r){return t==null?ui:od(t,n,e.scales[r].log,!1)}const Kk=Ov;function Gk(e,t,n,r,l){let i=kt(j0(e),j0(t)),o=t-e,s=_r(l/r*o,n);do{let u=n[s],a=r*u/o;if(a>=l&&i+(u<5?ai.get(u):0)<=17)return[u,a]}while(++s(t=bt((n=+l)*Te))+"px"),[e,t,n]}function Yk(e){e.show&&[e.font,e.labelFont].forEach(t=>{let n=Le(t[2]*Te,1);t[0]=t[0].replace(/[0-9.]+px/,n+"px"),t[1]=n})}function Et(e,t,n){const r={mode:Pe(e.mode,1)},l=r.mode;function i(f,m){return((m.distr==3?ir(f>0?f:m.clamp(r,f,m.min,m.max,m.key)):m.distr==4?Bu(f,m.asinh):f)-m._min)/(m._max-m._min)}function o(f,m,k,E){let b=i(f,m);return E+k*(m.dir==-1?1-b:b)}function s(f,m,k,E){let b=i(f,m);return E+k*(m.dir==-1?b:1-b)}function u(f,m,k,E){return m.ori==0?o(f,m,k,E):s(f,m,k,E)}r.valToPosH=o,r.valToPosV=s;let a=!1;r.status=0;const c=r.root=mn(X3);if(e.id!=null&&(c.id=e.id),en(c,e.class),e.title){let f=mn(nx,c);f.textContent=e.title}const p=Mn("canvas"),d=r.ctx=p.getContext("2d"),g=mn(rx,c);nl("click",g,f=>{f.target===x&&(ze!=vl||Ae!=gl)&&Pt.click(r,f)},!0);const _=r.under=mn(lx,g);g.appendChild(p);const x=r.over=mn(ix,g);e=rl(e);const P=+Pe(e.pxAlign,1),y=th(P);(e.plugins||[]).forEach(f=>{f.opts&&(e=f.opts(r,e)||e)});const v=e.ms||.001,w=r.series=l==1?rh(e.series||[],G0,X0,!1):Vk(e.series||[null],J0),T=r.axes=rh(e.axes||[],K0,Q0,!0),O=r.scales={},M=r.bands=e.bands||[];M.forEach(f=>{f.fill=xe(f.fill||null),f.dir=Pe(f.dir,-1)});const N=l==2?w[1].facets[0].scale:w[0].scale,R={axes:Bv,series:zv},I=(e.drawOrder||["axes","series"]).map(f=>R[f]);function A(f){let m=O[f];if(m==null){let k=(e.scales||so)[f]||so;if(k.from!=null)A(k.from),O[f]=it({},O[k.from],k,{key:f});else{m=O[f]=it({},f==N?vv:Mk,k),m.key=f;let E=m.time,b=m.range,z=Sr(b);if((f!=N||l==2&&!E)&&(z&&(b[0]==null||b[1]==null)&&(b={min:b[0]==null?M0:{mode:1,hard:b[0],soft:b[0]},max:b[1]==null?M0:{mode:1,hard:b[1],soft:b[1]}},z=!1),!z&&ja(b))){let B=b;b=(W,Z,ie)=>Z==null?ui:fa(Z,ie,B)}m.range=xe(b||(E?Uk:f==N?m.distr==3?qk:m.distr==4?Kk:Tv:m.distr==3?Pv:m.distr==4?Ov:Wk)),m.auto=xe(z?!1:m.auto),m.clamp=xe(m.clamp||Nk),m._min=m._max=null}}}A("x"),A("y"),l==1&&w.forEach(f=>{A(f.scale)}),T.forEach(f=>{A(f.scale)});for(let f in e.scales)A(f);const D=O[N],V=D.distr;let K,oe;D.ori==0?(en(c,ex),K=o,oe=s):(en(c,tx),K=s,oe=o);const se={};for(let f in O){let m=O[f];(m.min!=null||m.max!=null)&&(se[f]={min:m.min,max:m.max},m.min=m.max=null)}const fe=e.tzDate||(f=>new Date(bt(f/v))),ne=e.fmtDate||ud,q=v==1?nk(fe):ik(fe),J=U0(fe,V0(v==1?tk:lk,ne)),G=q0(fe,W0(sk,ne)),re=[],Y=r.legend=it({},ck,e.legend),me=Y.show,X=Y.markers;Y.idxs=re,X.width=xe(X.width),X.dash=xe(X.dash),X.stroke=xe(X.stroke),X.fill=xe(X.fill);let pe,Re,Ue,Be=[],tt=[],Ct,at=!1,dn={};if(Y.live){const f=w[1]?w[1].values:null;at=f!=null,Ct=at?f(r,1,0):{_:0};for(let m in Ct)dn[m]=ld}if(me)if(pe=Mn("table",fx,c),Ue=Mn("tbody",null,pe),Y.mount(r,pe),at){Re=Mn("thead",null,pe,Ue);let f=Mn("tr",null,Re);Mn("th",null,f);for(var Qn in Ct)Mn("th",w0,f).textContent=Qn}else en(pe,px),Y.live&&en(pe,dx);const pn={show:!0},Zn={show:!1};function Cn(f,m){if(m==0&&(at||!Y.live||l==2))return ui;let k=[],E=Mn("tr",hx,Ue,Ue.childNodes[m]);en(E,f.class),f.show||en(E,Yr);let b=Mn("th",null,E);if(X.show){let W=mn(mx,b);if(m>0){let Z=X.width(r,m);Z&&(W.style.border=Z+"px "+X.dash(r,m)+" "+X.stroke(r,m)),W.style.background=X.fill(r,m)}}let z=mn(w0,b);z.textContent=f.label,m>0&&(X.show||(z.style.color=f.width>0?X.stroke(r,m):X.fill(r,m)),ht("click",b,W=>{if(de._lock)return;ct(W);let Z=w.indexOf(f);if((W.ctrlKey||W.metaKey)!=Y.isolate){let ie=w.some((U,le)=>le>0&&le!=Z&&U.show);w.forEach((U,le)=>{le>0&&Bn(le,ie?le==Z?pn:Zn:pn,!0,rt.setSeries)})}else Bn(Z,{show:!f.show},!0,rt.setSeries)},!1),pr&&ht(E0,b,W=>{de._lock||(ct(W),Bn(w.indexOf(f),_l,!0,rt.setSeries))},!1));for(var B in Ct){let W=Mn("td",vx,E);W.textContent="--",k.push(W)}return[E,k]}const hn=new Map;function ht(f,m,k,E=!0){const b=hn.get(m)||{},z=de.bind[f](r,m,k,E);z&&(nl(f,m,b[f]=z),hn.set(m,b))}function ue(f,m,k){const E=hn.get(m)||{};for(let b in E)(f==null||b==f)&&(Wc(b,m,E[b]),delete E[b]);f==null&&hn.delete(m)}let nt=0,Ft=0,ye=0,te=0,Oe=0,$e=0,h=0,S=0,C=0,L=0;r.bbox={};let F=!1,Q=!1,ae=!1,he=!1,ut=!1,Qe=!1;function We(f,m,k){(k||f!=r.width||m!=r.height)&&ce(f,m),ki(!1),ae=!0,Q=!0,de.left>=0&&(he=Qe=!0),Vr()}function ce(f,m){r.width=nt=ye=f,r.height=Ft=te=m,Oe=$e=0,Io(),Bo();let k=r.bbox;h=k.left=Gr(Oe*Te,.5),S=k.top=Gr($e*Te,.5),C=k.width=Gr(ye*Te,.5),L=k.height=Gr(te*Te,.5)}const Tn=3;function Ha(){let f=!1,m=0;for(;!f;){m++;let k=Fv(m),E=Iv(m);f=m==Tn||k&&E,f||(ce(r.width,r.height),Q=!0)}}function gi({width:f,height:m}){We(f,m)}r.setSize=gi;function Io(){let f=!1,m=!1,k=!1,E=!1;T.forEach((b,z)=>{if(b.show&&b._show){let{side:B,_size:W}=b,Z=B%2,ie=b.label!=null?b.labelSize:0,U=W+ie;U>0&&(Z?(ye-=U,B==3?(Oe+=U,E=!0):k=!0):(te-=U,B==0?($e+=U,f=!0):m=!0))}}),In[0]=f,In[1]=k,In[2]=m,In[3]=E,ye-=hr[1]+hr[3],Oe+=hr[3],te-=hr[2]+hr[0],$e+=hr[0]}function Bo(){let f=Oe+ye,m=$e+te,k=Oe,E=$e;function b(z,B){switch(z){case 1:return f+=B,f-B;case 2:return m+=B,m-B;case 3:return k-=B,k+B;case 0:return E-=B,E+B}}T.forEach((z,B)=>{if(z.show&&z._show){let W=z.side;z._pos=b(W,z._size),z.label!=null&&(z._lpos=b(W,z.labelSize))}})}const de=r.cursor=it({},gk,{drag:{y:l==2}},e.cursor),ct=f=>{de.event=f};de.idxs=re,de._lock=!1;let Xt=de.points;Xt.show=xe(Xt.show),Xt.size=xe(Xt.size),Xt.stroke=xe(Xt.stroke),Xt.width=xe(Xt.width),Xt.fill=xe(Xt.fill);const Jn=r.focus=it({},e.focus||{alpha:.3},de.focus),pr=Jn.prox>=0;let mt=[null];function yi(f,m){if(m>0){let k=de.points.show(r,m);if(k)return en(k,cx),en(k,f.class),Cl(k,-10,-10,ye,te),x.insertBefore(k,mt[m]),k}}function Hr(f,m){if(l==1||m>0){let k=l==1&&O[f.scale].time,E=f.value;f.value=k?F0(E)?q0(fe,W0(E,ne)):E||G:E||Pk,f.label=f.label||(k?wk:yk)}if(m>0){f.width=f.width==null?1:f.width,f.paths=f.paths||$k||Nx,f.fillTo=xe(f.fillTo||Rk),f.pxAlign=+Pe(f.pxAlign,P),f.pxRound=th(f.pxAlign),f.stroke=xe(f.stroke||null),f.fill=xe(f.fill||null),f._stroke=f._fill=f._paths=f._focus=null;let k=Ok(kt(1,f.width),1),E=f.points=it({},{size:k,width:kt(1,k*.2),stroke:f.stroke,space:k*2,paths:Hk,_stroke:null,_fill:null},f.points);E.show=xe(E.show),E.filter=xe(E.filter),E.fill=xe(E.fill),E.stroke=xe(E.stroke),E.paths=xe(E.paths),E.pxAlign=f.pxAlign}if(me){let k=Cn(f,m);Be.splice(m,0,k[0]),tt.splice(m,0,k[1]),Y.values.push(null)}if(de.show){re.splice(m,0,null);let k=yi(f,m);k&&mt.splice(m,0,k)}Ot("addSeries",m)}function wi(f,m){m=m??w.length,f=l==1?Yc(f,m,G0,X0):Yc(f,m,null,J0),w.splice(m,0,f),Hr(w[m],m)}r.addSeries=wi;function $o(f){if(w.splice(f,1),me){Y.values.splice(f,1),tt.splice(f,1);let m=Be.splice(f,1)[0];ue(null,m.firstChild),m.remove()}de.show&&(re.splice(f,1),mt.length>1&&mt.splice(f,1)[0].remove()),Ot("delSeries",f)}r.delSeries=$o;const In=[!1,!1,!1,!1];function Rv(f,m){if(f._show=f.show,f.show){let k=f.side%2,E=O[f.scale];E==null&&(f.scale=k?w[1].scale:N,E=O[f.scale]);let b=E.time;f.size=xe(f.size),f.space=xe(f.space),f.rotate=xe(f.rotate),Sr(f.incrs)&&f.incrs.forEach(B=>{!ai.has(B)&&ai.set(B,J1(B))}),f.incrs=xe(f.incrs||(E.distr==2?Zx:b?v==1?ek:rk:Jx)),f.splits=xe(f.splits||(b&&E.distr==1?q:E.distr==3?qc:E.distr==4?kk:xk)),f.stroke=xe(f.stroke),f.grid.stroke=xe(f.grid.stroke),f.ticks.stroke=xe(f.ticks.stroke),f.border.stroke=xe(f.border.stroke);let z=f.values;f.values=Sr(z)&&!Sr(z[0])?xe(z):b?Sr(z)?U0(fe,V0(z,ne)):F0(z)?ok(fe,z):z||J:z||_k,f.filter=xe(f.filter||(E.distr>=3&&E.log==10?Ck:E.distr==3&&E.log==2?Tk:Q1)),f.font=lh(f.font),f.labelFont=lh(f.labelFont),f._size=f.size(r,null,m,0),f._space=f._rotate=f._incrs=f._found=f._splits=f._values=null,f._size>0&&(In[m]=!0,f._el=mn(ox,g))}}function _i(f,m,k,E){let[b,z,B,W]=k,Z=m%2,ie=0;return Z==0&&(W||z)&&(ie=m==0&&!b||m==2&&!B?bt(K0.size/3):0),Z==1&&(b||B)&&(ie=m==1&&!z||m==3&&!W?bt(Q0.size/2):0),ie}const md=r.padding=(e.padding||[_i,_i,_i,_i]).map(f=>xe(Pe(f,_i))),hr=r._padding=md.map((f,m)=>f(r,m,In,0));let Tt,vt=null,gt=null;const Ho=l==1?w[0].idxs:null;let Pn=null,Vo=!1;function vd(f,m){if(t=f==null?[]:rl(f,I0),l==2){Tt=0;for(let k=1;k=0,Qe=!0,Vr()}}r.setData=vd;function Va(){Vo=!0;let f,m;l==1&&(Tt>0?(vt=Ho[0]=0,gt=Ho[1]=Tt-1,f=t[0][vt],m=t[0][gt],V==2?(f=vt,m=gt):f==m&&(V==3?[f,m]=La(f,f,D.log,!1):V==4?[f,m]=od(f,f,D.log,!1):D.time?m=f+bt(86400/v):[f,m]=fa(f,m,sd,!0))):(vt=Ho[0]=f=null,gt=Ho[1]=m=null)),yl(N,f,m)}let Uo,ml,Ua,Wa,qa,Ka,Ga,Ya,Qa,xi;function gd(f,m,k,E,b,z){f??(f=x0),k??(k=X1),E??(E="butt"),b??(b=x0),z??(z="round"),f!=Uo&&(d.strokeStyle=Uo=f),b!=ml&&(d.fillStyle=ml=b),m!=Ua&&(d.lineWidth=Ua=m),z!=qa&&(d.lineJoin=qa=z),E!=Ka&&(d.lineCap=Ka=E),k!=Wa&&d.setLineDash(Wa=k)}function yd(f,m,k,E){m!=ml&&(d.fillStyle=ml=m),f!=Ga&&(d.font=Ga=f),k!=Ya&&(d.textAlign=Ya=k),E!=Qa&&(d.textBaseline=Qa=E)}function Za(f,m,k,E,b=0){if(E.length>0&&f.auto(r,Vo)&&(m==null||m.min==null)){let z=Pe(vt,0),B=Pe(gt,E.length-1),W=k.min==null?f.distr==3?Sx(E,z,B):kx(E,z,B,b):[k.min,k.max];f.min=nn(f.min,k.min=W[0]),f.max=kt(f.max,k.max=W[1])}}function Lv(){let f=rl(O,I0);for(let E in f){let b=f[E],z=se[E];if(z!=null&&z.min!=null)it(b,z),E==N&&ki(!0);else if(E!=N||l==2)if(Tt==0&&b.from==null){let B=b.range(r,null,null,E);b.min=B[0],b.max=B[1]}else b.min=ke,b.max=-ke}if(Tt>0){w.forEach((E,b)=>{if(l==1){let z=E.scale,B=f[z],W=se[z];if(b==0){let Z=B.range(r,B.min,B.max,z);B.min=Z[0],B.max=Z[1],vt=_r(B.min,t[0]),gt=_r(B.max,t[0]),gt-vt>1&&(t[0][vt]B.max&>--),E.min=Pn[vt],E.max=Pn[gt]}else E.show&&E.auto&&Za(B,W,E,t[b],E.sorted);E.idxs[0]=vt,E.idxs[1]=gt}else if(b>0&&E.show&&E.auto){let[z,B]=E.facets,W=z.scale,Z=B.scale,[ie,U]=t[b];Za(f[W],se[W],z,ie,z.sorted),Za(f[Z],se[Z],B,U,B.sorted),E.min=B.min,E.max=B.max}});for(let E in f){let b=f[E],z=se[E];if(b.from==null&&(z==null||z.min==null)){let B=b.range(r,b.min==ke?null:b.min,b.max==-ke?null:b.max,E);b.min=B[0],b.max=B[1]}}}for(let E in f){let b=f[E];if(b.from!=null){let z=f[b.from];if(z.min==null)b.min=b.max=null;else{let B=b.range(r,z.min,z.max,E);b.min=B[0],b.max=B[1]}}}let m={},k=!1;for(let E in f){let b=f[E],z=O[E];if(z.min!=b.min||z.max!=b.max){z.min=b.min,z.max=b.max;let B=z.distr;z._min=B==3?ir(z.min):B==4?Bu(z.min,z.asinh):z.min,z._max=B==3?ir(z.max):B==4?Bu(z.max,z.asinh):z.max,m[E]=k=!0}}if(k){w.forEach((E,b)=>{l==2?b>0&&m.y&&(E._paths=null):m[E.scale]&&(E._paths=null)});for(let E in m)ae=!0,Ot("setScale",E);de.show&&de.left>=0&&(he=Qe=!0)}for(let E in se)se[E]=null}function jv(f){let m=z0(vt-1,0,Tt-1),k=z0(gt+1,0,Tt-1);for(;f[m]==null&&m>0;)m--;for(;f[k]==null&&k0&&(w.forEach((f,m)=>{if(m>0&&f.show&&f._paths==null){let k=l==2?[0,t[m][0].length-1]:jv(t[m]);f._paths=f.paths(r,m,k[0],k[1])}}),w.forEach((f,m)=>{if(m>0&&f.show){xi!=f.alpha&&(d.globalAlpha=xi=f.alpha),wd(m,!1),f._paths&&_d(m,!1);{wd(m,!0);let k=f._paths?f._paths.gaps:null,E=f.points.show(r,m,vt,gt,k),b=f.points.filter(r,m,E,k);(E||b)&&(f.points._paths=f.points.paths(r,m,vt,gt,b),_d(m,!0))}xi!=1&&(d.globalAlpha=xi=1),Ot("drawSeries",m)}}))}function wd(f,m){let k=m?w[f].points:w[f];k._stroke=k.stroke(r,f),k._fill=k.fill(r,f)}function _d(f,m){let k=m?w[f].points:w[f],E=k._stroke,b=k._fill,{stroke:z,fill:B,clip:W,flags:Z}=k._paths,ie=null,U=Le(k.width*Te,3),le=U%2/2;m&&b==null&&(b=U>0?"#fff":E);let ge=k.pxAlign==1&&le>0;if(ge&&d.translate(le,le),!m){let Ze=h-U/2,_e=S-U/2,Ce=C+U,Ee=L+U;ie=new Path2D,ie.rect(Ze,_e,Ce,Ee)}m?Ja(E,U,k.dash,k.cap,b,z,B,Z,W):Av(f,E,U,k.dash,k.cap,b,z,B,Z,ie,W),ge&&d.translate(-le,-le)}function Av(f,m,k,E,b,z,B,W,Z,ie,U){let le=!1;M.forEach((ge,Ze)=>{if(ge.series[0]==f){let _e=w[ge.series[1]],Ce=t[ge.series[1]],Ee=(_e._paths||so).band;Sr(Ee)&&(Ee=ge.dir==1?Ee[0]:Ee[1]);let Ne,qe=null;_e.show&&Ee&&Cx(Ce,vt,gt)?(qe=ge.fill(r,Ze)||z,Ne=_e._paths.clip):Ee=null,Ja(m,k,E,b,qe,B,W,Z,ie,U,Ne,Ee),le=!0}}),le||Ja(m,k,E,b,z,B,W,Z,ie,U)}const xd=cl|pa;function Ja(f,m,k,E,b,z,B,W,Z,ie,U,le){gd(f,m,k,E,b),(Z||ie||le)&&(d.save(),Z&&d.clip(Z),ie&&d.clip(ie)),le?(W&xd)==xd?(d.clip(le),U&&d.clip(U),qo(b,B),Wo(f,z,m)):W&pa?(qo(b,B),d.clip(le),Wo(f,z,m)):W&cl&&(d.save(),d.clip(le),U&&d.clip(U),qo(b,B),d.restore(),Wo(f,z,m)):(qo(b,B),Wo(f,z,m)),(Z||ie||le)&&d.restore()}function Wo(f,m,k){k>0&&(m instanceof Map?m.forEach((E,b)=>{d.strokeStyle=Uo=b,d.stroke(E)}):m!=null&&f&&d.stroke(m))}function qo(f,m){m instanceof Map?m.forEach((k,E)=>{d.fillStyle=ml=E,d.fill(k)}):m!=null&&f&&d.fill(m)}function Dv(f,m,k,E){let b=T[f],z;if(E<=0)z=[0,0];else{let B=b._space=b.space(r,f,m,k,E),W=b._incrs=b.incrs(r,f,m,k,E,B);z=Gk(m,k,W,E,B)}return b._found=z}function Xa(f,m,k,E,b,z,B,W,Z,ie){let U=B%2/2;P==1&&d.translate(U,U),gd(W,B,Z,ie,W),d.beginPath();let le,ge,Ze,_e,Ce=b+(E==0||E==3?-z:z);k==0?(ge=b,_e=Ce):(le=b,Ze=Ce);for(let Ee=0;Ee{if(!k.show)return;let b=O[k.scale];if(b.min==null){k._show&&(m=!1,k._show=!1,ki(!1));return}else k._show||(m=!1,k._show=!0,ki(!1));let z=k.side,B=z%2,{min:W,max:Z}=b,[ie,U]=Dv(E,W,Z,B==0?ye:te);if(U==0)return;let le=b.distr==2,ge=k._splits=k.splits(r,E,W,Z,ie,U,le),Ze=b.distr==2?ge.map(Ne=>Pn[Ne]):ge,_e=b.distr==2?Pn[ge[1]]-Pn[ge[0]]:ie,Ce=k._values=k.values(r,k.filter(r,Ze,E,U,_e),E,U,_e);k._rotate=z==2?k.rotate(r,Ce,E,U):0;let Ee=k._size;k._size=li(k.size(r,Ce,E,f)),Ee!=null&&k._size!=Ee&&(m=!1)}),m}function Iv(f){let m=!0;return md.forEach((k,E)=>{let b=k(r,E,In,f);b!=hr[E]&&(m=!1),hr[E]=b}),m}function Bv(){for(let f=0;fPn[bn]):_e,Ee=U.distr==2?Pn[_e[1]]-Pn[_e[0]]:Z,Ne=m.ticks,qe=m.border,Wt=Ne.show?bt(Ne.size*Te):0,De=m._rotate*-Ds/180,lt=y(m._pos*Te),Lt=(Wt+Ze)*W,Xe=lt+Lt;z=E==0?Xe:0,b=E==1?Xe:0;let Bt=m.font[0],On=m.align==1?El:m.align==2?Fu:De>0?El:De<0?Fu:E==0?"center":k==3?Fu:El,gr=De||E==1?"middle":k==2?Bi:_0;yd(Bt,B,On,gr);let Bd=m.font[1]*m.lineGap,Jo=_e.map(bn=>y(u(bn,U,le,ge))),$d=m._values;for(let bn=0;bn<$d.length;bn++){let Xn=$d[bn];if(Xn!=null){E==0?b=Jo[bn]:z=Jo[bn],Xn=""+Xn;let Hd=Xn.indexOf(` -`)==-1?[Xn]:Xn.split(/\n/gm);for(let Ni=0;Ni{k>0&&(m._paths=null,f&&(l==1?(m.min=null,m.max=null):m.facets.forEach(E=>{E.min=null,E.max=null})))})}let eu=!1;function Vr(){eu||(Ix($v),eu=!0)}function $v(){F&&(Lv(),F=!1),ae&&(Ha(),ae=!1),Q&&(He(_,El,Oe),He(_,Bi,$e),He(_,qi,ye),He(_,Ki,te),He(x,El,Oe),He(x,Bi,$e),He(x,qi,ye),He(x,Ki,te),He(g,qi,nt),He(g,Ki,Ft),p.width=bt(nt*Te),p.height=bt(Ft*Te),T.forEach(({_el:f,_show:m,_size:k,_pos:E,side:b})=>{if(f!=null)if(m){let z=b===3||b===0?k:0,B=b%2==1;He(f,B?"left":"top",E-z),He(f,B?"width":"height",k),He(f,B?"top":"left",B?$e:Oe),He(f,B?"height":"width",B?te:ye),Uc(f,Yr)}else en(f,Yr)}),Uo=ml=Ua=qa=Ka=Ga=Ya=Qa=Wa=null,xi=1,Oi(!0),Ot("setSize"),Q=!1),nt>0&&Ft>0&&(d.clearRect(0,0,p.width,p.height),Ot("drawClear"),I.forEach(f=>f()),Ot("draw")),It.show&&ut&&(Yo(It),ut=!1),de.show&&he&&(Ur(null,!0,!1),he=!1),Y.show&&Y.live&&Qe&&(lu(),Qe=!1),a||(a=!0,r.status=1,Ot("ready")),Vo=!1,eu=!1}r.redraw=(f,m)=>{ae=m||!1,f!==!1?yl(N,D.min,D.max):Vr()};function tu(f,m){let k=O[f];if(k.from==null){if(Tt==0){let E=k.range(r,m.min,m.max,f);m.min=E[0],m.max=E[1]}if(m.min>m.max){let E=m.min;m.min=m.max,m.max=E}if(Tt>1&&m.min!=null&&m.max!=null&&m.max-m.min<1e-16)return;f==N&&k.distr==2&&Tt>0&&(m.min=_r(m.min,t[0]),m.max=_r(m.max,t[0]),m.min==m.max&&m.max++),se[f]=m,F=!0,Vr()}}r.setScale=tu;let nu,ru,Ko,Go,kd,Sd,vl,gl,Ed,Cd,ze,Ae,mr=!1;const Pt=de.drag;let yt=Pt.x,wt=Pt.y;de.show&&(de.x&&(nu=mn(ax,x)),de.y&&(ru=mn(ux,x)),D.ori==0?(Ko=nu,Go=ru):(Ko=ru,Go=nu),ze=de.left,Ae=de.top);const It=r.select=it({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Si=It.show?mn(sx,It.over?x:_):null;function Yo(f,m){if(It.show){for(let k in f)It[k]=f[k],k in bd&&He(Si,k,f[k]);m!==!1&&Ot("setSelect")}}r.setSelect=Yo;function Hv(f,m){let k=w[f],E=me?Be[f]:null;k.show?E&&Uc(E,Yr):(E&&en(E,Yr),mt.length>1&&Cl(mt[f],-10,-10,ye,te))}function yl(f,m,k){tu(f,{min:m,max:k})}function Bn(f,m,k,E){m.focus!=null&&Kv(f),m.show!=null&&w.forEach((b,z)=>{z>0&&(f==z||f==null)&&(b.show=m.show,Hv(z,m.show),yl(l==2?b.facets[1].scale:b.scale,null,null),Vr())}),k!==!1&&Ot("setSeries",f,m),E&&bi("setSeries",r,f,m)}r.setSeries=Bn;function Vv(f,m){it(M[f],m)}function Uv(f,m){f.fill=xe(f.fill||null),f.dir=Pe(f.dir,-1),m=m??M.length,M.splice(m,0,f)}function Wv(f){f==null?M.length=0:M.splice(f,1)}r.addBand=Uv,r.setBand=Vv,r.delBand=Wv;function qv(f,m){w[f].alpha=m,de.show&&mt[f]&&(mt[f].style.opacity=m),me&&Be[f]&&(Be[f].style.opacity=m)}let wl,Ei,Ci;const _l={focus:!0};function Kv(f){if(f!=Ci){let m=f==null,k=Jn.alpha!=1;w.forEach((E,b)=>{let z=m||b==0||b==f;E._focus=m?null:z,k&&qv(b,z?1:Jn.alpha)}),Ci=f,k&&Vr()}}me&&pr&&ht(C0,pe,f=>{de._lock||(ct(f),Ci!=null&&Bn(null,_l,!0,rt.setSeries))});function $n(f,m,k){let E=O[m];k&&(f=f/Te-(E.ori==1?$e:Oe));let b=ye;E.ori==1&&(b=te,f=b-f),E.dir==-1&&(f=b-f);let z=E._min,B=E._max,W=f/b,Z=z+(B-z)*W,ie=E.distr;return ie==3?ii(10,Z):ie==4?Px(Z,E.asinh):Z}function Gv(f,m){let k=$n(f,N,m);return _r(k,t[0],vt,gt)}r.valToIdx=f=>_r(f,t[0]),r.posToIdx=Gv,r.posToVal=$n,r.valToPos=(f,m,k)=>O[m].ori==0?o(f,O[m],k?C:ye,k?h:0):s(f,O[m],k?L:te,k?S:0);function Yv(f){f(r),Vr()}r.batch=Yv,r.setCursor=(f,m,k)=>{ze=f.left,Ae=f.top,Ur(null,m,k)};function Td(f,m){He(Si,El,It.left=f),He(Si,qi,It.width=m)}function Pd(f,m){He(Si,Bi,It.top=f),He(Si,Ki,It.height=m)}let Ti=D.ori==0?Td:Pd,Pi=D.ori==1?Td:Pd;function Qv(){if(me&&Y.live)for(let f=l==2?1:0;f{re[E]=k}):Rx(f.idx)||re.fill(f.idx),Y.idx=re[0]);for(let k=0;k0||l==1&&!at)&&Zv(k,re[k]);me&&Y.live&&Qv(),Qe=!1,m!==!1&&Ot("setLegend")}r.setLegend=lu;function Zv(f,m){let k=w[f],E=f==0&&V==2?Pn:t[f],b;at?b=k.values(r,f,m)??dn:(b=k.value(r,m==null?null:E[m],f,m),b=b==null?dn:{_:b}),Y.values[f]=b}function Ur(f,m,k){Ed=ze,Cd=Ae,[ze,Ae]=de.move(r,ze,Ae),de.show&&(Ko&&Cl(Ko,bt(ze),0,ye,te),Go&&Cl(Go,0,bt(Ae),ye,te));let E,b=vt>gt;wl=ke;let z=D.ori==0?ye:te,B=D.ori==1?ye:te;if(ze<0||Tt==0||b){E=null;for(let W=0;W0&&mt.length>1&&Cl(mt[W],-10,-10,ye,te);pr&&Bn(null,_l,!0,f==null&&rt.setSeries),Y.live&&(re.fill(E),Qe=!0)}else{let W,Z,ie;l==1&&(W=D.ori==0?ze:Ae,Z=$n(W,N),E=_r(Z,t[0],vt,gt),ie=K(t[0][E],D,z,0));for(let U=l==2?1:0;U0&&le.show){let Ne=Ce==null?-10:si(oe(Ce,l==1?O[le.scale]:O[le.facets[1].scale],B,0),1);if(pr&&Ne>=0&&l==1){let De=xt(Ne-Ae);if(De=0?1:-1,On=Xe>=0?1:-1;On==Bt&&(On==1?lt==1?Ce>=Xe:Ce<=Xe:lt==1?Ce<=Xe:Ce>=Xe)&&(wl=De,Ei=U)}else wl=De,Ei=U}}let qe,Wt;if(D.ori==0?(qe=Ee,Wt=Ne):(qe=Ne,Wt=Ee),Qe&&mt.length>1){_x(mt[U],de.points.fill(r,U),de.points.stroke(r,U));let De,lt,Lt,Xe,Bt=!0,On=de.points.bbox;if(On!=null){Bt=!1;let gr=On(r,U);Lt=gr.left,Xe=gr.top,De=gr.width,lt=gr.height}else Lt=qe,Xe=Wt,De=lt=de.points.size(r,U);xx(mt[U],De,lt,Bt),Cl(mt[U],Lt,Xe,ye,te)}}}}if(de.idx=E,de.left=ze,de.top=Ae,Qe&&(Y.idx=E,lu()),It.show&&mr)if(f!=null){let[W,Z]=rt.scales,[ie,U]=rt.match,[le,ge]=f.cursor.sync.scales,Ze=f.cursor.drag;if(yt=Ze._x,wt=Ze._y,yt||wt){let{left:_e,top:Ce,width:Ee,height:Ne}=f.select,qe=f.scales[W].ori,Wt=f.posToVal,De,lt,Lt,Xe,Bt,On=W!=null&&ie(W,le),gr=Z!=null&&U(Z,ge);On&&yt?(qe==0?(De=_e,lt=Ee):(De=Ce,lt=Ne),Lt=O[W],Xe=K(Wt(De,le),Lt,z,0),Bt=K(Wt(De+lt,le),Lt,z,0),Ti(nn(Xe,Bt),xt(Bt-Xe))):Ti(0,z),gr&&wt?(qe==1?(De=_e,lt=Ee):(De=Ce,lt=Ne),Lt=O[Z],Xe=oe(Wt(De,ge),Lt,B,0),Bt=oe(Wt(De+lt,ge),Lt,B,0),Pi(nn(Xe,Bt),xt(Bt-Xe))):Pi(0,B)}else Qo()}else{let W=xt(Ed-kd),Z=xt(Cd-Sd);if(D.ori==1){let ge=W;W=Z,Z=ge}yt=Pt.x&&W>=Pt.dist,wt=Pt.y&&Z>=Pt.dist;let ie=Pt.uni;ie!=null?yt&&wt&&(yt=W>=ie,wt=Z>=ie,!yt&&!wt&&(Z>W?wt=!0:yt=!0)):Pt.x&&Pt.y&&(yt||wt)&&(yt=wt=!0);let U,le;yt&&(D.ori==0?(U=vl,le=ze):(U=gl,le=Ae),Ti(nn(U,le),xt(le-U)),wt||Pi(0,B)),wt&&(D.ori==1?(U=vl,le=ze):(U=gl,le=Ae),Pi(nn(U,le),xt(le-U)),yt||Ti(0,z)),!yt&&!wt&&(Ti(0,0),Pi(0,0))}if(Pt._x=yt,Pt._y=wt,f==null){if(k){if(Id!=null){let[W,Z]=rt.scales;rt.values[0]=W!=null?$n(D.ori==0?ze:Ae,W):null,rt.values[1]=Z!=null?$n(D.ori==1?ze:Ae,Z):null}bi(k0,r,ze,Ae,ye,te,E)}if(pr){let W=k&&rt.setSeries,Z=Jn.prox;Ci==null?wl<=Z&&Bn(Ei,_l,!0,W):wl>Z?Bn(null,_l,!0,W):Ei!=Ci&&Bn(Ei,_l,!0,W)}}m!==!1&&Ot("setCursor")}let vr=null;Object.defineProperty(r,"rect",{get(){return vr==null&&Oi(!1),vr}});function Oi(f=!1){f?vr=null:(vr=x.getBoundingClientRect(),Ot("syncRect",vr))}function Od(f,m,k,E,b,z,B){de._lock||mr&&f!=null&&f.movementX==0&&f.movementY==0||(iu(f,m,k,E,b,z,B,!1,f!=null),f!=null?Ur(null,!0,!0):Ur(m,!0,!1))}function iu(f,m,k,E,b,z,B,W,Z){if(vr==null&&Oi(!1),ct(f),f!=null)k=f.clientX-vr.left,E=f.clientY-vr.top;else{if(k<0||E<0){ze=-10,Ae=-10;return}let[ie,U]=rt.scales,le=m.cursor.sync,[ge,Ze]=le.values,[_e,Ce]=le.scales,[Ee,Ne]=rt.match,qe=m.axes[0].side%2==1,Wt=D.ori==0?ye:te,De=D.ori==1?ye:te,lt=qe?z:b,Lt=qe?b:z,Xe=qe?E:k,Bt=qe?k:E;if(_e!=null?k=Ee(ie,_e)?u(ge,O[ie],Wt,0):-10:k=Wt*(Xe/lt),Ce!=null?E=Ne(U,Ce)?u(Ze,O[U],De,0):-10:E=De*(Bt/Lt),D.ori==1){let On=k;k=E,E=On}}Z&&((k<=1||k>=ye-1)&&(k=Gr(k,ye)),(E<=1||E>=te-1)&&(E=Gr(E,te))),W?(kd=k,Sd=E,[vl,gl]=de.move(r,k,E)):(ze=k,Ae=E)}const bd={width:0,height:0,left:0,top:0};function Qo(){Yo(bd,!1)}let Nd,Md,Rd,Ld;function jd(f,m,k,E,b,z,B){mr=!0,yt=wt=Pt._x=Pt._y=!1,iu(f,m,k,E,b,z,B,!0,!1),f!=null&&(ht(Iu,Hc,zd,!1),bi(S0,r,vl,gl,ye,te,null));let{left:W,top:Z,width:ie,height:U}=It;Nd=W,Md=Z,Rd=ie,Ld=U,Qo()}function zd(f,m,k,E,b,z,B){mr=Pt._x=Pt._y=!1,iu(f,m,k,E,b,z,B,!1,!0);let{left:W,top:Z,width:ie,height:U}=It,le=ie>0||U>0,ge=Nd!=W||Md!=Z||Rd!=ie||Ld!=U;if(le&&ge&&Yo(It),Pt.setScale&&le&&ge){let Ze=W,_e=ie,Ce=Z,Ee=U;if(D.ori==1&&(Ze=Z,_e=U,Ce=W,Ee=ie),yt&&yl(N,$n(Ze,N),$n(Ze+_e,N)),wt)for(let Ne in O){let qe=O[Ne];Ne!=N&&qe.from==null&&qe.min!=ke&&yl(Ne,$n(Ce+Ee,Ne),$n(Ce,Ne))}Qo()}else de.lock&&(de._lock=!de._lock,de._lock||Ur(null,!0,!1));f!=null&&(ue(Iu,Hc),bi(Iu,r,ze,Ae,ye,te,null))}function Jv(f,m,k,E,b,z,B){if(de._lock)return;ct(f);let W=mr;if(mr){let Z=!0,ie=!0,U=10,le,ge;D.ori==0?(le=yt,ge=wt):(le=wt,ge=yt),le&&ge&&(Z=ze<=U||ze>=ye-U,ie=Ae<=U||Ae>=te-U),le&&Z&&(ze=ze{let b=rt.match[2];k=b(r,m,k),k!=-1&&Bn(k,E,!0,!1)},de.show&&(ht(S0,x,jd),ht(k0,x,Od),ht(E0,x,f=>{ct(f),Oi(!1)}),ht(C0,x,Jv),ht(T0,x,Ad),Gc.add(r),r.syncRect=Oi);const Zo=r.hooks=e.hooks||{};function Ot(f,m,k){f in Zo&&Zo[f].forEach(E=>{E.call(null,r,m,k)})}(e.plugins||[]).forEach(f=>{for(let m in f.hooks)Zo[m]=(Zo[m]||[]).concat(f.hooks[m])});const Fd=(f,m,k)=>k,rt=it({key:null,setSeries:!1,filters:{pub:A0,sub:A0},scales:[N,w[1]?w[1].scale:null],match:[D0,D0,Fd],values:[null,null]},de.sync);rt.match.length==2&&rt.match.push(Fd),de.sync=rt;const Id=rt.key,ou=gv(Id);function bi(f,m,k,E,b,z,B){rt.filters.pub(f,m,k,E,b,z,B)&&ou.pub(f,m,k,E,b,z,B)}ou.sub(r);function Xv(f,m,k,E,b,z,B){rt.filters.sub(f,m,k,E,b,z,B)&&xl[f](null,m,k,E,b,z,B)}r.pub=Xv;function eg(){ou.unsub(r),Gc.delete(r),hn.clear(),Wc(ca,Wl,Dd),c.remove(),pe==null||pe.remove(),Ot("destroy")}r.destroy=eg;function su(){Ot("init",e,t),vd(t||e.data,!1),se[N]?tu(N,se[N]):Va(),ut=It.show,he=Qe=!0,We(e.width,e.height)}return w.forEach(Hr),T.forEach(Rv),n?n instanceof HTMLElement?(n.appendChild(c),su()):n(r,su):su(),r}Et.assign=it;Et.fmtNum=ad;Et.rangeNum=fa;Et.rangeLog=La;Et.rangeAsinh=od;Et.orient=hl;Et.pxRatio=Te;Et.join=Fx;Et.fmtDate=ud,Et.tzDate=Yx;Et.sync=gv;{Et.addGap=Lk,Et.clipGaps=Aa;let e=Et.paths={points:Sv};e.linear=Cv,e.stepped=Ak,e.bars=Dk,e.spline=Ik}const Qk=Object.freeze(Object.defineProperty({__proto__:null,default:Et},Symbol.toStringTag,{value:"Module"}));function Zk(e,t){let[n,r]=Z3(e,{formatSubMilliseconds:!0,compact:t}).split(" ").slice(0,2);return n.match(/[0-9]+s/)&&!t?(n=n.replace("s","."),r?r=r.substring(0,1):r="0",n+r+"s"):(r&&(n+=" "+r),n)}function ih(e){return K3(e)}var Jk=Et.fmtDate("{YYYY}-{MM}-{DD} {HH}:{mm}:{ss}");function Ba(e,t,n=!1){switch(e){case wr.duration:return Zk(t,n);case wr.bytes:return ih(t);case wr.bps:return ih(t)+"/s";case wr.counter:return Du(t).format("0.[0]a");case wr.rps:return Du(t).format("0.[00]a")+"/s";case wr.timestamp:return Jk(new Date(t*1e3));case wr.percent:return Du(t).format("0.0%");default:return isNaN(t)||t==null?"0":t.toFixed(2)}}function Xk(e){return function(t,n,r,l){return l==null?"--":n==null?"":Ba(e,n)}}var bv=class{constructor(e,t,n){ve(this,"samples");ve(this,"series");const r=t.series.map(l=>l.query);this.samples=e.samples.select(r),this.samples.empty||(this.series=this.buildSeries(t.series,n))}get empty(){return this.samples.empty}get data(){const e=new Array;for(let t=0;t0&&(i=e[r].legend),n.push({stroke:t[l].stroke,fill:t[l].fill,value:Xk(this.samples[r].unit),points:{show:!1},label:i,scale:this.samples[r].unit})}return n}};function eS(e){let t;function n(i){t=document.createElement("div");const o={display:"none",position:"absolute",padding:"1rem",border:"1px solid #7b65fa",zIndex:"10",pointerEvents:"none",fontSize:"1.25rem"};Object.assign(t.style,o),i.over.appendChild(t),i.over.onmouseleave=()=>{t.style.display="none"},i.over.onmouseenter=()=>{t.style.display="block"}}function r(i){l(i)}function l(i){const o=i.over.getBoundingClientRect();t.style.background=e;const s=tS(i);if(!s){t.style.display="none";return}t.innerHTML=s;const{left:u,top:a}=i.cursor,c=u??0,p=a??0;t.innerHTML=s,ci.over.focus()}}}function tS(e){const{idx:t}=e.cursor;if(t==null)return"";let n;e.legend.values?n=e.legend.values[0]._:n="";let r=``;for(let l=1;l`}return r+="
    ${n}
    ${nS(i,o)}${s}${u}
    ",r}function nS(e,t){return``}var Fs=(e=>(e.chart="chart",e.stat="stat",e.summary="summary",e))(Fs||{}),rS=class{constructor(e,t){ve(this,"view");ve(this,"metrics");this.metrics=t.metrics;const n=e.series.map(r=>r.query);this.view=t.summary.select(n)}get empty(){return this.view.empty}get cols(){return this.view.aggregates.length}get header(){return new Array("metric",...this.view.aggregates.map(e=>e))}get body(){const e=new Array;for(let t=0;tthis.format(this.view[t],r))),e.push(n)}return e}format(e,t){var n;const r=this.metrics.unit(((n=e.metric)==null?void 0:n.name)??"",t);return Ba(r,e.values[t],!0)}};function lS(e,t){for(let n=0;nr.query)).empty}function sS(e,t){return t.summary.select(e.series.map(r=>r.query)).empty}var aS=zo({conditions:void 0,styles:{borderRadius:{values:{true:{defaultClass:"_1c9nzq10"},false:{defaultClass:"_1c9nzq11"}}}}}),uS="_1c9nzq14",cS="_1c9nzq12",fS="_1c9nzq13";const dS=({children:e,title:t,isOpen:n,onClick:r})=>j.jsxs("div",{children:[j.jsxs(st,{as:"button",align:"center","aria-expanded":n,className:Yn(cS,aS({borderRadius:String(n)})),width:"100%",onClick:r,children:[n?j.jsx(Fn,{name:"chevron-up"}):j.jsx(Fn,{name:"chevron-down"}),j.jsx("h2",{className:fS,children:t})]}),n&&j.jsx("div",{className:uS,children:e})]});var pS=zo({conditions:{defaultCondition:"xs",conditionNames:["xs","sm","md","lg","xl","xxl"],responsiveArray:void 0},styles:{gridColumn:{values:{1:{conditions:{xs:"ag5hlo6",sm:"ag5hlo7",md:"ag5hlo8",lg:"ag5hlo9",xl:"ag5hloa",xxl:"ag5hlob"},defaultClass:"ag5hlo6"},2:{conditions:{xs:"ag5hloc",sm:"ag5hlod",md:"ag5hloe",lg:"ag5hlof",xl:"ag5hlog",xxl:"ag5hloh"},defaultClass:"ag5hloc"},3:{conditions:{xs:"ag5hloi",sm:"ag5hloj",md:"ag5hlok",lg:"ag5hlol",xl:"ag5hlom",xxl:"ag5hlon"},defaultClass:"ag5hloi"},4:{conditions:{xs:"ag5hloo",sm:"ag5hlop",md:"ag5hloq",lg:"ag5hlor",xl:"ag5hlos",xxl:"ag5hlot"},defaultClass:"ag5hloo"},5:{conditions:{xs:"ag5hlou",sm:"ag5hlov",md:"ag5hlow",lg:"ag5hlox",xl:"ag5hloy",xxl:"ag5hloz"},defaultClass:"ag5hlou"},6:{conditions:{xs:"ag5hlo10",sm:"ag5hlo11",md:"ag5hlo12",lg:"ag5hlo13",xl:"ag5hlo14",xxl:"ag5hlo15"},defaultClass:"ag5hlo10"},7:{conditions:{xs:"ag5hlo16",sm:"ag5hlo17",md:"ag5hlo18",lg:"ag5hlo19",xl:"ag5hlo1a",xxl:"ag5hlo1b"},defaultClass:"ag5hlo16"},8:{conditions:{xs:"ag5hlo1c",sm:"ag5hlo1d",md:"ag5hlo1e",lg:"ag5hlo1f",xl:"ag5hlo1g",xxl:"ag5hlo1h"},defaultClass:"ag5hlo1c"},9:{conditions:{xs:"ag5hlo1i",sm:"ag5hlo1j",md:"ag5hlo1k",lg:"ag5hlo1l",xl:"ag5hlo1m",xxl:"ag5hlo1n"},defaultClass:"ag5hlo1i"},10:{conditions:{xs:"ag5hlo1o",sm:"ag5hlo1p",md:"ag5hlo1q",lg:"ag5hlo1r",xl:"ag5hlo1s",xxl:"ag5hlo1t"},defaultClass:"ag5hlo1o"},11:{conditions:{xs:"ag5hlo1u",sm:"ag5hlo1v",md:"ag5hlo1w",lg:"ag5hlo1x",xl:"ag5hlo1y",xxl:"ag5hlo1z"},defaultClass:"ag5hlo1u"},12:{conditions:{xs:"ag5hlo20",sm:"ag5hlo21",md:"ag5hlo22",lg:"ag5hlo23",xl:"ag5hlo24",xxl:"ag5hlo25"},defaultClass:"ag5hlo20"}}}}}),oh={root:"ag5hlo1",variants:zo({conditions:void 0,styles:{gap:{values:{1:{defaultClass:"ag5hlo2"},2:{defaultClass:"ag5hlo3"},3:{defaultClass:"ag5hlo4"},4:{defaultClass:"ag5hlo5"}}}}})};function hS({as:e="div",gap:t=3,children:n,className:r,...l},i){return j.jsx(e,{ref:i,className:Yn(r,oh.root,oh.variants({gap:t})),...l,children:n})}function mS({children:e,as:t="div",className:n,xs:r=12,sm:l,md:i,lg:o,xl:s,xxl:u,...a},c){return j.jsx(t,{ref:c,className:Yn(n,pS({gridColumn:{xs:r,sm:l,md:i,lg:o,xl:s,xxl:u}})),...a,children:e})}const $a=Object.assign($.forwardRef(hS),{Column:$.forwardRef(mS)});var Nv={exports:{}};const vS=lg(Qk);(function(e,t){(function(r,l){e.exports=l($,vS)})(self,(n,r)=>(()=>{var l={"./common/index.ts":(u,a,c)=>{c.r(a),c.d(a,{dataMatch:()=>g,optionsUpdateState:()=>d});var p=function(_,x){var P={};for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&x.indexOf(y)<0&&(P[y]=_[y]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,y=Object.getOwnPropertySymbols(_);v{u.exports=n},uplot:u=>{u.exports=r}},i={};function o(u){var a=i[u];if(a!==void 0)return a.exports;var c=i[u]={exports:{}};return l[u](c,c.exports,o),c.exports}o.n=u=>{var a=u&&u.__esModule?()=>u.default:()=>u;return o.d(a,{a}),a},o.d=(u,a)=>{for(var c in a)o.o(a,c)&&!o.o(u,c)&&Object.defineProperty(u,c,{enumerable:!0,get:a[c]})},o.o=(u,a)=>Object.prototype.hasOwnProperty.call(u,a),o.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var s={};return(()=>{/*!*******************************!*\ - !*** ./react/uplot-react.tsx ***! - \*******************************/o.r(s),o.d(s,{default:()=>g});var u=o("react"),a=o.n(u),c=o("uplot"),p=o.n(c),d=o("./common/index.ts");function g(_){var x=_.options,P=_.data,y=_.target,v=_.onDelete,w=v===void 0?function(){}:v,T=_.onCreate,O=T===void 0?function(){}:T,M=_.resetScales,N=M===void 0?!0:M,R=(0,u.useRef)(null),I=(0,u.useRef)(null);function A(K){K&&(w(K),K.destroy(),R.current=null)}function D(){var K=new(p())(x,P,y||I.current);R.current=K,O(K)}(0,u.useEffect)(function(){return D(),function(){A(R.current)}},[]);var V=(0,u.useRef)({options:x,data:P,target:y}).current;return(0,u.useEffect)(function(){if(V.options!==x){var K=(0,d.optionsUpdateState)(V.options,x);!R.current||K==="create"?(A(R.current),D()):K==="update"&&R.current.setSize({width:x.width,height:x.height})}return V.data!==P&&(R.current?(0,d.dataMatch)(V.data,P)||(N?R.current.setData(P,!0):(R.current.setData(P,!1),R.current.redraw())):D()),V.target!==y&&(A(R.current),D()),function(){V.options=x,V.data=P,V.target=y}},[x,P,y,N]),y?null:a().createElement("div",{ref:I})}})(),s=s.default,s})())})(Nv);var gS=Nv.exports;const Mv=ha(gS);var yS="_14dhllh0",wS="_14dhllh1",_S="_14dhllh3",xS="_14dhllh2";const kS=1,SS=70,ES=250,CS=Et.sync("chart"),TS=[[3600*24*365,"0",null,null,null,null,null,null,1],[3600*24*28,"0",null,null,null,null,null,null,1],[3600*24,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[3600,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[60,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[1,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1],[.001,"{HH}:{mm}:{ss}",null,null,null,null,null,null,1]],PS=e=>({tooltip:e==="dark"?t0[900]:ju.white,grid:e==="dark"?t0[700]:M1[300],axes:e==="dark"?ju.white:ju.black}),OS=(e,t)=>t===0?TS:(n,r)=>r.map(l=>Ba(e,l)),bS=(e,t)=>(n,r)=>{const l={stroke:e.axes,grid:{stroke:e.grid,width:1},ticks:{stroke:e.grid},values:OS(n,r),scale:n,space:n==="timestamp"?60:40};return r===2&&t>2&&(l.side=kS),r!==0&&(l.size=SS),l},NS=({height:e=ES,hooks:t,plot:n,scales:r,theme:l,width:i})=>{const o=PS(l),s=n.samples.units,u=s.map(bS(o,s.length));return{class:xS,width:i,height:e,hooks:t,cursor:{sync:{key:CS.key}},legend:{live:!1},scales:r,series:n.series,axes:u,plugins:[eS(o.tooltip)]}},MS=p2(["show"]),RS=(e=[],t=[])=>e.map((n,r)=>MS(n,t[r])),LS=e=>(e==null?void 0:e.type)==="dblclick",jS=e=>e!=null&&!e.ctrlKey&&!e.metaKey,zS=e=>{const[t,n]=$.useState(e);return[RS(e,t),i=>{n(i.series)}]},AS=({plot:e,theme:t,width:n})=>{const{timeRange:r,setTimeRange:l}=Yf(),[i,o]=zS(e.series),s={...e,series:i},u={timestamp:{min:r==null?void 0:r.from,max:r==null?void 0:r.to}};return NS({hooks:{setCursor:[d=>{LS(d.cursor.event)&&l(void 0)}],setSelect:[d=>{if(!jS(d.cursor.event))return;const g=d.posToVal(d.select.left,"timestamp"),_=d.posToVal(d.select.left+d.select.width,"timestamp");l({from:g,to:_})}],setSeries:[o]},plot:s,scales:u,theme:t,width:n})};function DS({panel:e,container:t}){const n=pl(),{theme:r}=pi(),[l,{width:i}]=P1(),o=new bv(n,e,R1(r)),s=!o.empty&&o.data[0].length>1,u=s?o.data:[],a=AS({plot:o,theme:r,width:i}),c=t?$.Fragment:Ra;function p(d){const g=r=="dark"?"#60606080":"#d0d0d080",_=d.root.querySelector(".u-select");_&&(_.style.background=g)}return j.jsx($a.Column,{xs:12,lg:e.fullWidth?12:6,children:j.jsx(c,{children:j.jsxs("div",{ref:l,children:[j.jsxs(st,{align:"center",gap:1,children:[j.jsx("h3",{className:_S,children:e.title}),j.jsx($c,{title:e.summary,children:j.jsx(Fn,{name:"info",width:"20px",height:"20px"})})]}),j.jsxs("div",{className:yS,children:[!s&&j.jsx("p",{className:wS,children:"no data"}),j.jsx(Mv,{options:a,data:u,onCreate:p})]})]})})})}var FS="ova0r31",IS="ova0r32",BS="ova0r30";const $S=32,HS=({digest:e,panel:t,plot:n,width:r})=>{const l=t.series[0].query,i=e.samples.query(l);let o;return i&&Array.isArray(i.values)&&i.values.length!==0&&(o=Ba(i.unit,Number(i.values.slice(-1)),!0)),{class:BS,width:r,height:$S,title:o,series:n.series,axes:[{show:!1},{show:!1}],legend:{show:!1},cursor:{show:!1}}};function VS({panel:e}){const t=pl(),{theme:n}=pi(),[r,{width:l}]=P1(),i=new bv(t,e,R1(n));if(i.empty)return null;const o=HS({digest:t,panel:e,plot:i,width:l});return j.jsx($a.Column,{xs:6,md:4,lg:2,children:j.jsx(Ra,{className:FS,children:j.jsxs(st,{direction:"column",justify:"end",gap:0,height:"100%",children:[j.jsx("p",{className:IS,children:e.title}),j.jsx("div",{ref:r,children:j.jsx(Mv,{options:o,data:i.data})})]})})})}var US="_12owwid0",WS="_12owwid4",qS="_12owwid1",KS={thead:"_12owwid2",tbody:"_12owwid3"};function GS({children:e,...t}){return j.jsx("table",{className:US,...t,children:e})}function YS({children:e,...t}){return j.jsx("thead",{...t,children:e})}function QS({children:e,...t}){return j.jsx("tbody",{...t,children:e})}function ZS({children:e,...t}){return j.jsx("th",{className:qS,...t,children:e})}function JS({children:e,isHead:t=!1,...n}){return j.jsx("tr",{className:KS[t?"thead":"tbody"],...n,children:e})}function XS({children:e,...t}){return j.jsx("td",{className:WS,...t,children:e})}function e5({children:e,...t}){return j.jsx("tfoot",{...t,children:e})}const Wr=Object.assign(GS,{Body:QS,Cell:XS,Footer:e5,Head:YS,Header:ZS,Row:JS});var t5="_57i9sh1",n5="_57i9sh0";var r5="_1jb2mvv0",l5="_1jb2mvv2",i5="_1jb2mvv1";function o5({children:e,className:t,title:n,...r},l){return j.jsxs(Ra,{ref:l,className:Yn(r5,t),...r,children:[n&&j.jsx("h3",{className:i5,children:n}),j.jsx("div",{className:l5,children:e})]})}const s5=$.forwardRef(o5);function a5({panel:e}){const t=pl(),n=new rS(e,t);if(n.empty)return j.jsx("div",{});const r=n.view.aggregates.length,l=r>6?12:r>1?6:3,i=r>6||r>1?12:6;return j.jsx($a.Column,{xs:12,md:i,lg:l,children:j.jsx(s5,{className:n5,title:e.title,children:j.jsx("div",{className:t5,children:j.jsxs(Wr,{children:[j.jsx(Wr.Head,{children:j.jsx(Wr.Row,{isHead:!0,children:n.header.map((o,s)=>j.jsx(Wr.Header,{align:s==0?"left":"right",children:o},e.id+"header"+o))})}),j.jsx(Wr.Body,{children:n.body.map((o,s)=>j.jsx(Wr.Row,{children:o.map((u,a)=>j.jsx(Wr.Cell,{align:a==0?"left":"right",children:u},e.id+"_value_"+s+"_"+a))},e.id+"row"+s))})]})})},e.id)})}function u5({container:e,panel:t}){switch(t.kind){case Fs.chart:return j.jsx(DS,{panel:t,container:e});case Fs.stat:return j.jsx(VS,{panel:t});case Fs.summary:return j.jsx(a5,{panel:t});default:return null}}var c5="_1ls5syl0";function sh({container:e,section:t}){return j.jsx($a,{gap:e?4:3,children:t.panels.map(n=>j.jsx(u5,{panel:n,container:e},n.id))})}function f5({section:e}){const[t,n]=$.useState(!0),r=pl();return lS(e,r)?null:e.title?j.jsx(st,{direction:"column",children:j.jsx(dS,{title:e.title,isOpen:t,onClick:()=>n(!t),children:j.jsx(sh,{container:!0,section:e})})}):j.jsxs(st,{direction:"column",children:[e.summary&&j.jsx("p",{className:c5,children:e.summary}),j.jsx(sh,{section:e})]})}var d5="_1t22owt0",p5="_1t22owt1";function h5(){const e=pl(),{themeClassName:t}=pi(),[n,r]=$.useState(0),l=!!e.samples.length;return j.jsxs(st,{className:`${t} ${d5}`,direction:"column",gap:0,children:[j.jsx(D3,{config:e.config,tab:n,onTabChange:r}),j.jsx(st,{as:"main",className:p5,direction:"column",grow:l?0:1,children:j.jsx($3,{isLoading:!l,message:"Loading...",children:e.config.tabs.map((i,o)=>j.jsx(m5,{active:n,idx:o,children:i.sections.map(s=>j.jsx(f5,{section:s},s.id))},i.id))})}),j.jsx(V2,{})]})}function m5({children:e,active:t,idx:n}){return t!==n?null:j.jsx(st,{direction:"column",gap:3,children:e})}const v5=new URLSearchParams(window.location.search).get("endpoint")||"http://localhost:5665/",g5=document.getElementById("root");Uu.createRoot(g5).render(j.jsx(Fw,{endpoint:v5+"events",children:j.jsx(Vw,{children:j.jsx(Uw,{children:j.jsx(h5,{})})})})); diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/index.html b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/index.html index 0af5ddb4582..079fe1ee60c 100644 --- a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/index.html +++ b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/ui/dist/index.html @@ -11,8 +11,8 @@ k6 dashboard - - + + diff --git a/vendor/modules.txt b/vendor/modules.txt index 3fbf335ebdf..836cc974ebc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -203,7 +203,7 @@ github.com/grafana/sobek/ftoa/internal/fast github.com/grafana/sobek/parser github.com/grafana/sobek/token github.com/grafana/sobek/unistring -# github.com/grafana/xk6-dashboard v0.7.9 +# github.com/grafana/xk6-dashboard v0.7.10 ## explicit; go 1.23.0 github.com/grafana/xk6-dashboard/dashboard # github.com/grafana/xk6-redis v0.3.4 From 4cab4d506f0efbd22b7868148f8e37c993d773f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Toulet?= <35176601+AgnesToulet@users.noreply.github.com> Date: Thu, 17 Jul 2025 14:42:19 +0200 Subject: [PATCH 103/136] Browser: Add locator.all (#4899) * Browser: Add locator.all * fix locator mapping --- .../k6/browser/browser/locator_mapping.go | 14 ++++++++++++++ .../k6/browser/browser/mapping_test.go | 1 + .../js/modules/k6/browser/common/locator.go | 16 ++++++++++++++++ .../modules/k6/browser/tests/locator_test.go | 19 +++++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/locator_mapping.go b/internal/js/modules/k6/browser/browser/locator_mapping.go index 9608647128d..5366751d825 100644 --- a/internal/js/modules/k6/browser/browser/locator_mapping.go +++ b/internal/js/modules/k6/browser/browser/locator_mapping.go @@ -13,6 +13,20 @@ import ( func mapLocator(vu moduleVU, lo *common.Locator) mapping { //nolint:funlen rt := vu.Runtime() return mapping{ + "all": func() *sobek.Promise { + return k6ext.Promise(vu.Context(), func() (any, error) { + all, err := lo.All() + if err != nil { + return nil, err + } + + res := make([]mapping, len(all)) + for i, el := range all { + res[i] = mapLocator(vu, el) + } + return res, nil + }) + }, "clear": func(opts sobek.Value) (*sobek.Promise, error) { copts := common.NewFrameFillOptions(lo.Timeout()) if err := copts.Parse(vu.Context(), opts); err != nil { diff --git a/internal/js/modules/k6/browser/browser/mapping_test.go b/internal/js/modules/k6/browser/browser/mapping_test.go index 439173edf77..8f3f7282af0 100644 --- a/internal/js/modules/k6/browser/browser/mapping_test.go +++ b/internal/js/modules/k6/browser/browser/mapping_test.go @@ -517,6 +517,7 @@ type responseAPI interface { //nolint:interfacebloat // locatorAPI represents a way to find element(s) on a page at any moment. type locatorAPI interface { //nolint:interfacebloat + All() ([]*common.Locator, error) Clear(opts *common.FrameFillOptions) error Click(opts sobek.Value) error Count() (int, error) diff --git a/internal/js/modules/k6/browser/common/locator.go b/internal/js/modules/k6/browser/common/locator.go index caa80b004eb..45f0d3d079c 100644 --- a/internal/js/modules/k6/browser/common/locator.go +++ b/internal/js/modules/k6/browser/common/locator.go @@ -81,6 +81,22 @@ func (l *Locator) click(opts *FrameClickOptions) error { return l.frame.click(l.selector, opts) } +func (l *Locator) All() ([]*Locator, error) { + l.log.Debugf("Locator:All", "fid:%s furl:%q sel:%q", l.frame.ID(), l.frame.URL(), l.selector) + + count, err := l.Count() + if err != nil { + return nil, err + } + + locators := make([]*Locator, count) + for i := 0; i < count; i++ { + locators[i] = l.Nth(i) + } + + return locators, nil +} + // Count APIs do not wait for the element to be present. It also does not set // strict to true, allowing it to return the total number of elements matching // the selector. diff --git a/internal/js/modules/k6/browser/tests/locator_test.go b/internal/js/modules/k6/browser/tests/locator_test.go index 5d89f1d90a3..78e6b0abeeb 100644 --- a/internal/js/modules/k6/browser/tests/locator_test.go +++ b/internal/js/modules/k6/browser/tests/locator_test.go @@ -35,6 +35,25 @@ func TestLocator(t *testing.T) { name string do func(*testBrowser, *common.Page) }{ + { + "All", func(_ *testBrowser, p *common.Page) { + locators, err := p.Locator("a", nil).All() + require.NoError(t, err) + require.Len(t, locators, 3) + + firstText, err := locators[0].InnerText(nil) + assert.NoError(t, err) + assert.Equal(t, `Click`, firstText) + + secondText, err := locators[1].InnerText(nil) + assert.NoError(t, err) + assert.Equal(t, `Dblclick`, secondText) + + thirdText, err := locators[2].InnerText(nil) + assert.NoError(t, err) + assert.Equal(t, `Click`, thirdText) + }, + }, { "Check", func(_ *testBrowser, p *common.Page) { check := func() bool { From 8f8fffa24feb11f91b68663c4dbe6b9370bee316 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:20:01 +0100 Subject: [PATCH 104/136] Add a new type for use when working with the... ...Sobek runtime to work with the JS regex engine instead of the Go regex engine to be consistent when users provide regex in their JS scripts. --- internal/js/modules/k6/browser/common/frame_options.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/js/modules/k6/browser/common/frame_options.go b/internal/js/modules/k6/browser/common/frame_options.go index aba1fd51333..f5f8c63bccf 100644 --- a/internal/js/modules/k6/browser/common/frame_options.go +++ b/internal/js/modules/k6/browser/common/frame_options.go @@ -186,6 +186,9 @@ type FrameWaitForLoadStateOptions struct { Timeout time.Duration `json:"timeout"` } +// JSRegexChecker is a function that performs regex matching using JavaScript's regex engine +type JSRegexChecker func(pattern, url string) (bool, error) + type FrameWaitForNavigationOptions struct { URL string `json:"url"` WaitUntil LifecycleEvent `json:"waitUntil" js:"waitUntil"` From 66943cb740b4240f08be8a28a46ba0504ab2840e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:21:24 +0100 Subject: [PATCH 105/136] Add regex engine matcher This can be called to inject the regex matching engine. The return value will be used to call the injected function on a taskqueue in the Sobek JS runtime. --- .../k6/browser/browser/page_mapping.go | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/internal/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go index 893e7f4edad..4b46494247a 100644 --- a/internal/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -670,6 +670,54 @@ func prepK6BrowserRegExChecker(rt *sobek.Runtime) func() error { } } +// injectRegexMatcherScript injects a JavaScript regex checker function into the runtime +// for URL pattern matching. This handles regex patterns only using JavaScript's regex +// engine for consistency. It returns a function that can be used to check if a URL +// matches a given pattern in the JS runtime's eventloop. +func injectRegexMatcherScript(ctx context.Context, vu moduleVU, targetID string) (common.JSRegexChecker, error) { + rt := vu.Runtime() + + err := prepK6BrowserRegExChecker(rt)() + if err != nil { + return nil, fmt.Errorf("preparing k6 browser regex checker: %w", err) + } + + return func(pattern, url string) (bool, error) { + var ( + result bool + err error + ) + + tq := vu.get(ctx, targetID) + done := make(chan struct{}) + + tq.Queue(func() error { + defer close(done) + + // Regex pattern is unquoted string whereas the url needs to be quoted + // so that it is treated as a string. + js := fmt.Sprintf(`_k6BrowserCheckRegEx(%s, '%s')`, pattern, url) + + val, jsErr := rt.RunString(js) + if jsErr != nil { + err = fmt.Errorf("evaluating pattern: %w", jsErr) + return nil + } + + result = val.ToBoolean() + return nil + }) + + select { + case <-done: + case <-ctx.Done(): + err = fmt.Errorf("context canceled while evaluating URL pattern") + } + + return result, err + }, nil +} + func parseWaitForFunctionArgs( ctx context.Context, timeout time.Duration, pageFunc, opts sobek.Value, gargs ...sobek.Value, ) (string, *common.FrameWaitForFunctionOptions, []any, error) { From 81e59736a670ccfdff6837d3e857d3c8287a61b4 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 15 Jul 2025 16:43:26 +0100 Subject: [PATCH 106/136] Update waitForNavigation options parser We need to be able to distinguish between a string and regex pattern. I've borrowed a workaround from how this distinction comes about from working on getByRole. An exact string pattern needs quotes, whereas a regex pattern doesn't. --- internal/js/modules/k6/browser/common/frame_options.go | 10 +++++++++- .../js/modules/k6/browser/common/frame_options_test.go | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/common/frame_options.go b/internal/js/modules/k6/browser/common/frame_options.go index f5f8c63bccf..9854b8bf529 100644 --- a/internal/js/modules/k6/browser/common/frame_options.go +++ b/internal/js/modules/k6/browser/common/frame_options.go @@ -685,7 +685,15 @@ func (o *FrameWaitForNavigationOptions) Parse(ctx context.Context, opts sobek.Va for _, k := range opts.Keys() { switch k { case "url": - o.URL = opts.Get(k).String() + var val string + switch opts.Get(k).ExportType() { + case reflect.TypeOf(string("")): + val = fmt.Sprintf("'%s'", opts.Get(k).String()) // Strings require quotes + default: // JS Regex, CSS, numbers or booleans + val = opts.Get(k).String() // No quotes + } + + o.URL = val case "timeout": o.Timeout = time.Duration(opts.Get(k).ToInteger()) * time.Millisecond case "waitUntil": diff --git a/internal/js/modules/k6/browser/common/frame_options_test.go b/internal/js/modules/k6/browser/common/frame_options_test.go index 8b7ece0acfd..0fa1383752d 100644 --- a/internal/js/modules/k6/browser/common/frame_options_test.go +++ b/internal/js/modules/k6/browser/common/frame_options_test.go @@ -98,7 +98,7 @@ func TestFrameWaitForNavigationOptionsParse(t *testing.T) { err := navOpts.Parse(vu.Context(), opts) require.NoError(t, err) - assert.Equal(t, "https://example.com/", navOpts.URL) + assert.Equal(t, "'https://example.com/'", navOpts.URL) assert.Equal(t, time.Second, navOpts.Timeout) assert.Equal(t, LifecycleEventNetworkIdle, navOpts.WaitUntil) }) From a5ec63c29ce73c28a1afeef14610111a4f03bbf2 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:24:30 +0100 Subject: [PATCH 107/136] Add a urlMatcher which does some validation This function will run some validation before returning a matcher that can be used to match a pattern against a url. This will be used in waitForNavigation. --- .../js/modules/k6/browser/common/frame.go | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index 70149c355d0..22f084923c3 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -79,6 +79,34 @@ func (s *DOMElementState) UnmarshalJSON(b []byte) error { return nil } +func isExactString(s string) bool { + return len(s) > 0 && s[0] == '\'' && s[len(s)-1] == '\'' +} + +// urlMatcher matches URLs based on pattern type. It can match on exact and regex +// patterns. If the pattern is empty or a single quote, it matches any URL. +func urlMatcher(pattern string, jsRegexChecker JSRegexChecker) (func(string) (bool, error), error) { + if pattern == "" || pattern == "''" { + return func(url string) (bool, error) { return true, nil }, nil + } + + if isExactString(pattern) { + return func(url string) (bool, error) { return "'"+url+"'" == pattern, nil }, nil + } + + if jsRegexChecker == nil { + return nil, fmt.Errorf("JavaScript pattern matcher is required for URL matching") + } + + return func(url string) (bool, error) { + matched, err := jsRegexChecker(pattern, url) + if err != nil { + return false, fmt.Errorf("URL pattern matching error for pattern %q and URL %q: %w", pattern, url, err) + } + return matched, nil + }, nil +} + // Frame represents a frame in an HTML document. type Frame struct { BaseEventEmitter From 5aff0d630379dd3505f5e01d36540d36822f773f Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:29:13 +0100 Subject: [PATCH 108/136] Update waitForNavigation to take JSRegexChecker We're not using it in this commit, just making sure all tests still work. --- internal/js/modules/k6/browser/browser/frame_mapping.go | 2 +- internal/js/modules/k6/browser/browser/page_mapping.go | 2 +- internal/js/modules/k6/browser/common/frame.go | 9 ++++++++- internal/js/modules/k6/browser/common/page.go | 8 ++++++-- .../js/modules/k6/browser/tests/frame_manager_test.go | 4 ++-- internal/js/modules/k6/browser/tests/frame_test.go | 2 +- .../js/modules/k6/browser/tests/lifecycle_wait_test.go | 4 ++-- internal/js/modules/k6/browser/tests/page_test.go | 3 +-- internal/js/modules/k6/browser/tests/webvital_test.go | 3 +-- 9 files changed, 23 insertions(+), 14 deletions(-) diff --git a/internal/js/modules/k6/browser/browser/frame_mapping.go b/internal/js/modules/k6/browser/browser/frame_mapping.go index 527398fc0f2..cfc52c361e3 100644 --- a/internal/js/modules/k6/browser/browser/frame_mapping.go +++ b/internal/js/modules/k6/browser/browser/frame_mapping.go @@ -388,7 +388,7 @@ func mapFrame(vu moduleVU, f *common.Frame) mapping { } return k6ext.Promise(vu.Context(), func() (result any, reason error) { - resp, err := f.WaitForNavigation(popts) + resp, err := f.WaitForNavigation(popts, nil) if err != nil { return nil, err //nolint:wrapcheck } diff --git a/internal/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go index 4b46494247a..3fcf5ca58b0 100644 --- a/internal/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -501,7 +501,7 @@ func mapPage(vu moduleVU, p *common.Page) mapping { //nolint:gocognit,cyclop } return k6ext.Promise(vu.Context(), func() (result any, reason error) { - resp, err := p.WaitForNavigation(popts) + resp, err := p.WaitForNavigation(popts, nil) if err != nil { return nil, err //nolint:wrapcheck } diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index 22f084923c3..74fdf934b15 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -1894,7 +1894,13 @@ func (f *Frame) WaitForLoadState(state string, popts *FrameWaitForLoadStateOptio } // WaitForNavigation waits for the given navigation lifecycle event to happen. -func (f *Frame) WaitForNavigation(opts *FrameWaitForNavigationOptions) (*Response, error) { +// jsRegexChecker should be non-nil to be able to test against a URL pattern in the options. +// +//nolint:funlen +func (f *Frame) WaitForNavigation( + opts *FrameWaitForNavigationOptions, + jsRegexChecker JSRegexChecker, +) (*Response, error) { f.log.Debugf("Frame:WaitForNavigation", "fid:%s furl:%s", f.ID(), f.URL()) defer f.log.Debugf("Frame:WaitForNavigation:return", @@ -1910,6 +1916,7 @@ func (f *Frame) WaitForNavigation(opts *FrameWaitForNavigationOptions) (*Respons lifecycleEvtCh, lifecycleEvtCancel := createWaitForEventPredicateHandler( timeoutCtx, f, []string{EventFrameAddLifecycle}, func(data any) bool { + // Wait for the lifecycle event to happen. if le, ok := data.(FrameLifecycleEvent); ok { return le.Event == opts.WaitUntil } diff --git a/internal/js/modules/k6/browser/common/page.go b/internal/js/modules/k6/browser/common/page.go index 3c1346e2b98..dde153c44a6 100644 --- a/internal/js/modules/k6/browser/common/page.go +++ b/internal/js/modules/k6/browser/common/page.go @@ -1576,12 +1576,16 @@ func (p *Page) WaitForLoadState(state string, popts *FrameWaitForLoadStateOption } // WaitForNavigation waits for the given navigation lifecycle event to happen. -func (p *Page) WaitForNavigation(opts *FrameWaitForNavigationOptions) (*Response, error) { +// jsRegexChecker should be non-nil to be able to test against a URL pattern in the options. +func (p *Page) WaitForNavigation( + opts *FrameWaitForNavigationOptions, + jsRegexChecker JSRegexChecker, +) (*Response, error) { p.logger.Debugf("Page:WaitForNavigation", "sid:%v", p.sessionID()) _, span := TraceAPICall(p.ctx, p.targetID.String(), "page.waitForNavigation") defer span.End() - resp, err := p.frameManager.MainFrame().WaitForNavigation(opts) + resp, err := p.frameManager.MainFrame().WaitForNavigation(opts, jsRegexChecker) if err != nil { spanRecordError(span, err) return nil, err diff --git a/internal/js/modules/k6/browser/tests/frame_manager_test.go b/internal/js/modules/k6/browser/tests/frame_manager_test.go index 4a89cc2c1a7..e8c6d717e15 100644 --- a/internal/js/modules/k6/browser/tests/frame_manager_test.go +++ b/internal/js/modules/k6/browser/tests/frame_manager_test.go @@ -45,7 +45,7 @@ func TestWaitForFrameNavigationWithinDocument(t *testing.T) { waitForNav := func() error { opts := &common.FrameWaitForNavigationOptions{Timeout: timeout} - _, err := p.WaitForNavigation(opts) + _, err := p.WaitForNavigation(opts, nil) return err } click := func() error { @@ -103,7 +103,7 @@ func TestWaitForFrameNavigation(t *testing.T) { opts := &common.FrameWaitForNavigationOptions{ Timeout: 5000 * time.Millisecond, } - _, err := p.WaitForNavigation(opts) + _, err := p.WaitForNavigation(opts, nil) return err } click := func() error { diff --git a/internal/js/modules/k6/browser/tests/frame_test.go b/internal/js/modules/k6/browser/tests/frame_test.go index 54796f344e8..042deb8a5b9 100644 --- a/internal/js/modules/k6/browser/tests/frame_test.go +++ b/internal/js/modules/k6/browser/tests/frame_test.go @@ -149,7 +149,7 @@ func TestFrameNoPanicNavigateAndClickOnPageWithIFrames(t *testing.T) { func() error { return p.Click(`a[href="/iframeSignIn"]`, common.NewFrameClickOptions(p.Timeout())) }, func() error { _, err := p.WaitForNavigation( - common.NewFrameWaitForNavigationOptions(p.Timeout()), + common.NewFrameWaitForNavigationOptions(p.Timeout()), nil, ) return err }, diff --git a/internal/js/modules/k6/browser/tests/lifecycle_wait_test.go b/internal/js/modules/k6/browser/tests/lifecycle_wait_test.go index 627d90b3d1e..4afe028572b 100644 --- a/internal/js/modules/k6/browser/tests/lifecycle_wait_test.go +++ b/internal/js/modules/k6/browser/tests/lifecycle_wait_test.go @@ -138,7 +138,7 @@ func TestLifecycleWaitForNavigation(t *testing.T) { Timeout: 1000 * time.Millisecond, WaitUntil: common.LifecycleEventNetworkIdle, } - _, err = p.WaitForNavigation(opts) + _, err = p.WaitForNavigation(opts, nil) return err }, @@ -182,7 +182,7 @@ func TestLifecycleWaitForNavigation(t *testing.T) { Timeout: 30000 * time.Millisecond, WaitUntil: tt.waitUntil, } - _, err := p.WaitForNavigation(opts) + _, err := p.WaitForNavigation(opts, nil) return err } click := func() error { diff --git a/internal/js/modules/k6/browser/tests/page_test.go b/internal/js/modules/k6/browser/tests/page_test.go index 1395b628269..e536b666e81 100644 --- a/internal/js/modules/k6/browser/tests/page_test.go +++ b/internal/js/modules/k6/browser/tests/page_test.go @@ -950,8 +950,7 @@ func TestPageWaitForNavigationErrOnCtxDone(t *testing.T) { go b.cancelContext() <-b.context().Done() _, err := p.WaitForNavigation( - common.NewFrameWaitForNavigationOptions(p.Timeout()), - ) + common.NewFrameWaitForNavigationOptions(p.Timeout()), nil) require.ErrorContains(t, err, "canceled") } diff --git a/internal/js/modules/k6/browser/tests/webvital_test.go b/internal/js/modules/k6/browser/tests/webvital_test.go index a6ccb667de6..8c0284c1106 100644 --- a/internal/js/modules/k6/browser/tests/webvital_test.go +++ b/internal/js/modules/k6/browser/tests/webvital_test.go @@ -75,8 +75,7 @@ func TestWebVitalMetric(t *testing.T) { func() error { return page.Click("#clickMe", common.NewFrameClickOptions(page.Timeout())) }, func() error { _, err := page.WaitForNavigation( - common.NewFrameWaitForNavigationOptions(page.Timeout()), - ) + common.NewFrameWaitForNavigationOptions(page.Timeout()), nil) return err }, ) From 01cd1f2dbde25eecccd5244d2c8179659d2a0783 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:30:34 +0100 Subject: [PATCH 109/136] Update logging in waitForNavigation --- internal/js/modules/k6/browser/common/frame.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index 74fdf934b15..5b0acc00799 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -1902,7 +1902,7 @@ func (f *Frame) WaitForNavigation( jsRegexChecker JSRegexChecker, ) (*Response, error) { f.log.Debugf("Frame:WaitForNavigation", - "fid:%s furl:%s", f.ID(), f.URL()) + "fid:%s furl:%s url:%s", f.ID(), f.URL(), opts.URL) defer f.log.Debugf("Frame:WaitForNavigation:return", "fid:%s furl:%s", f.ID(), f.URL()) @@ -1931,6 +1931,9 @@ func (f *Frame) WaitForNavigation( Err: err, Timeout: opts.Timeout, } + if opts.URL != "" { + return fmt.Errorf("waiting for navigation to URL matching %q: %w", opts.URL, e) + } return fmt.Errorf("waiting for navigation: %w", e) } From c0779be794ab130b8f64b1fcc934b7d9b4c20ac2 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:31:31 +0100 Subject: [PATCH 110/136] Update to create and use the matcher The event handler is also updated to createWaitForEventPredicateHandler so that it will wait until the predicate returns true. --- .../js/modules/k6/browser/common/frame.go | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index 5b0acc00799..fba2e0b635b 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -1908,9 +1908,25 @@ func (f *Frame) WaitForNavigation( timeoutCtx, timeoutCancel := context.WithTimeout(f.ctx, opts.Timeout) - navEvtCh, navEvtCancel := createWaitForEventHandler(timeoutCtx, f, []string{EventFrameNavigation}, + // Create URL matcher based on the pattern + matcher, err := urlMatcher(opts.URL, jsRegexChecker) + if err != nil { + timeoutCancel() + return nil, fmt.Errorf("parsing URL pattern: %w", err) + } + + navEvtCh, navEvtCancel := createWaitForEventPredicateHandler(timeoutCtx, f, []string{EventFrameNavigation}, func(data any) bool { - return true // Both successful and failed navigations are considered + if navEvt, ok := data.(*NavigationEvent); ok { + // Check if the navigation URL matches the pattern + matched, err := matcher(navEvt.url) + if err != nil { + f.log.Error(err) + return false + } + return matched + } + return false }) lifecycleEvtCh, lifecycleEvtCancel := createWaitForEventPredicateHandler( From 303e0d5af5b685b8384ec277f8054f8487d38378 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:32:40 +0100 Subject: [PATCH 111/136] Update the page.waitForNavigate mapping We're now injecting and retrieving the jsRegexChecker to pass into WaitForNavigation that will be used to perform a url match against the pattern input from the user script. --- .../js/modules/k6/browser/browser/page_mapping.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/browser/page_mapping.go b/internal/js/modules/k6/browser/browser/page_mapping.go index 3fcf5ca58b0..4d8e3e4a30c 100644 --- a/internal/js/modules/k6/browser/browser/page_mapping.go +++ b/internal/js/modules/k6/browser/browser/page_mapping.go @@ -500,8 +500,15 @@ func mapPage(vu moduleVU, p *common.Page) mapping { //nolint:gocognit,cyclop return nil, fmt.Errorf("parsing page wait for navigation options: %w", err) } - return k6ext.Promise(vu.Context(), func() (result any, reason error) { - resp, err := p.WaitForNavigation(popts, nil) + // Inject JS regex checker for URL regex pattern matching + ctx := vu.Context() + jsRegexChecker, err := injectRegexMatcherScript(ctx, vu, p.TargetID()) + if err != nil { + return nil, err + } + + return k6ext.Promise(ctx, func() (result any, reason error) { + resp, err := p.WaitForNavigation(popts, jsRegexChecker) if err != nil { return nil, err //nolint:wrapcheck } From bd417a12cab26ceb49bded903e2433f36c9d3151 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:34:05 +0100 Subject: [PATCH 112/136] Update the frame.waitForNavigate mapping We're now injecting and retrieving the jsRegexChecker to pass into WaitForNavigation that will be used to perform a url match against the pattern input from the user script. --- .../js/modules/k6/browser/browser/frame_mapping.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/browser/frame_mapping.go b/internal/js/modules/k6/browser/browser/frame_mapping.go index cfc52c361e3..8f04cfd4e67 100644 --- a/internal/js/modules/k6/browser/browser/frame_mapping.go +++ b/internal/js/modules/k6/browser/browser/frame_mapping.go @@ -387,8 +387,15 @@ func mapFrame(vu moduleVU, f *common.Frame) mapping { return nil, fmt.Errorf("parsing frame wait for navigation options: %w", err) } - return k6ext.Promise(vu.Context(), func() (result any, reason error) { - resp, err := f.WaitForNavigation(popts, nil) + // Inject JS regex checker for URL regex pattern matching + ctx := vu.Context() + jsRegexChecker, err := injectRegexMatcherScript(ctx, vu, f.Page().TargetID()) + if err != nil { + return nil, err + } + + return k6ext.Promise(ctx, func() (result any, reason error) { + resp, err := f.WaitForNavigation(popts, jsRegexChecker) if err != nil { return nil, err //nolint:wrapcheck } From 0bb3d937b40d8b5ecff65ff6e67ec2ee3042bfb9 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 10 Jul 2025 16:34:56 +0100 Subject: [PATCH 113/136] Add a test for waitForNavigation with url --- .../js/modules/k6/browser/tests/page_test.go | 78 +++++++++++++++++++ .../tests/static/waitfornavigation_test.html | 8 ++ 2 files changed, 86 insertions(+) create mode 100644 internal/js/modules/k6/browser/tests/static/waitfornavigation_test.html diff --git a/internal/js/modules/k6/browser/tests/page_test.go b/internal/js/modules/k6/browser/tests/page_test.go index e536b666e81..52f976bbf2c 100644 --- a/internal/js/modules/k6/browser/tests/page_test.go +++ b/internal/js/modules/k6/browser/tests/page_test.go @@ -2786,3 +2786,81 @@ func TestPageMustUseNativeJavaScriptObjects(t *testing.T) { _, err = page.QueryAll("#textField") require.NoErrorf(t, err, "page should not override the native objects, but it did") } + +func TestWaitForNavigationWithURL(t *testing.T) { + t.Parallel() + + tb := newTestBrowser(t, withFileServer()) + tb.vu.ActivateVU() + tb.vu.StartIteration(t) + + got := tb.vu.RunPromise(t, ` + const page = await browser.newPage(); + const testURL = '%s'; + + try { + await page.goto(testURL); + + // Test exact URL match + await Promise.all([ + page.waitForNavigation({ url: '%s' }), + page.locator('#page1').click() + ]); + let currentURL = page.url(); + if (!currentURL.endsWith('page1.html')) { + throw new Error('Expected to navigate to page1.html but got ' + currentURL); + } + + await page.goto(testURL); + + // Test regex pattern - matches any page with .html extension + await Promise.all([ + page.waitForNavigation({ url: /.*\.html$/ }), + page.locator('#page2').click() + ]); + currentURL = page.url(); + if (!currentURL.endsWith('.html')) { + throw new Error('Expected URL to end with .html but got ' + currentURL); + } + + await page.goto(testURL); + + // Test timeout when URL doesn't match + let timedOut = false; + try { + await Promise.all([ + page.waitForNavigation({ url: /.*nonexistent.html$/, timeout: 500 }), + page.locator('#page1').click() // This goes to page1.html, not nonexistent.html + ]); + } catch (error) { + if (error.toString().includes('waiting for navigation')) { + timedOut = true; + } else { + throw error; + } + } + if (!timedOut) { + throw new Error('Expected timeout error when URL does not match'); + } + + await page.goto(testURL); + + // Test empty pattern (matches any navigation) + await Promise.all([ + page.waitForNavigation({ url: '' }), + page.locator('#page2').click() + ]); + currentURL = page.url(); + if (!currentURL.endsWith('page2.html')) { + throw new Error('Expected empty pattern to match any navigation but got ' + currentURL); + } + } finally { + // Must call close() which will clean up the taskqueue. + await page.close(); + } + `, + tb.staticURL("waitfornavigation_test.html"), + tb.staticURL("page1.html"), + ) + assert.Equal(t, sobek.Undefined(), got.Result()) +} diff --git a/internal/js/modules/k6/browser/tests/static/waitfornavigation_test.html b/internal/js/modules/k6/browser/tests/static/waitfornavigation_test.html new file mode 100644 index 00000000000..9dd2e330962 --- /dev/null +++ b/internal/js/modules/k6/browser/tests/static/waitfornavigation_test.html @@ -0,0 +1,8 @@ + + + + + Go to Page 1 + Go to Page 2 + + \ No newline at end of file From a3221c778e5b9e95f0fb8196789ce12f08a031ee Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 16 Jul 2025 11:36:42 +0100 Subject: [PATCH 114/136] Add error propagation if matcher fails with error --- internal/js/modules/k6/browser/common/frame.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/js/modules/k6/browser/common/frame.go b/internal/js/modules/k6/browser/common/frame.go index fba2e0b635b..461f3ff2396 100644 --- a/internal/js/modules/k6/browser/common/frame.go +++ b/internal/js/modules/k6/browser/common/frame.go @@ -1915,14 +1915,18 @@ func (f *Frame) WaitForNavigation( return nil, fmt.Errorf("parsing URL pattern: %w", err) } + var matcherErr error navEvtCh, navEvtCancel := createWaitForEventPredicateHandler(timeoutCtx, f, []string{EventFrameNavigation}, func(data any) bool { if navEvt, ok := data.(*NavigationEvent); ok { // Check if the navigation URL matches the pattern matched, err := matcher(navEvt.url) if err != nil { - f.log.Error(err) - return false + matcherErr = err + // Return true here even though it's not correct and no match + // was found. We need this to exit asap so that the error can be + // propagated to the caller. + return true } return matched } @@ -1968,6 +1972,9 @@ func (f *Frame) WaitForNavigation( ) select { case evt := <-navEvtCh: + if matcherErr != nil { + return nil, matcherErr + } if e, ok := evt.(*NavigationEvent); ok { if e.newDocument == nil { sameDocNav = true From a101a27b4815525d9324d25067ebf03c5dd14c8f Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 16 Jul 2025 11:43:55 +0100 Subject: [PATCH 115/136] Add test for regex failure case --- .../js/modules/k6/browser/tests/page_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/internal/js/modules/k6/browser/tests/page_test.go b/internal/js/modules/k6/browser/tests/page_test.go index 52f976bbf2c..e426a6e4030 100644 --- a/internal/js/modules/k6/browser/tests/page_test.go +++ b/internal/js/modules/k6/browser/tests/page_test.go @@ -2864,3 +2864,24 @@ func TestWaitForNavigationWithURL(t *testing.T) { ) assert.Equal(t, sobek.Undefined(), got.Result()) } + +func TestWaitForNavigationWithURL_RegexFailure(t *testing.T) { + t.Parallel() + + tb := newTestBrowser(t, withFileServer()) + tb.vu.ActivateVU() + tb.vu.StartIteration(t) + + _, err := tb.vu.RunAsync(t, ` + const page = await browser.newPage(); + await page.goto('%s'); + + await Promise.all([ + page.waitForNavigation({ url: /^.*/my_messages.*$/ }), + page.locator('#page2').click() + ]); + `, + tb.staticURL("waitfornavigation_test.html"), + ) + assert.ErrorContains(t, err, "Unexpected token *") +} From 105277be8ab8fbec031888346638dd3671b33f9e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 16 Jul 2025 16:33:57 +0100 Subject: [PATCH 116/136] Add a condition to prevent test from running on.. ... Windows for now. --- internal/js/modules/k6/browser/tests/page_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/js/modules/k6/browser/tests/page_test.go b/internal/js/modules/k6/browser/tests/page_test.go index e426a6e4030..728fdf6119d 100644 --- a/internal/js/modules/k6/browser/tests/page_test.go +++ b/internal/js/modules/k6/browser/tests/page_test.go @@ -2788,6 +2788,10 @@ func TestPageMustUseNativeJavaScriptObjects(t *testing.T) { } func TestWaitForNavigationWithURL(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Skipped due to https://github.com/grafana/k6/issues/4937") + } + t.Parallel() tb := newTestBrowser(t, withFileServer()) From 9cf2033a2e859a5deeabc831b9af9e721078d253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= <5459617+joanlopez@users.noreply.github.com> Date: Fri, 18 Jul 2025 13:27:10 +0200 Subject: [PATCH 117/136] k6packager: Adjust versions of dependencies (s3cmd, aws) (#4879) * k6packager: Update s3cmd and aws * Hard-code k6packager dependencies version * Setup dependabot for k6packager dependencies * Update the repository URLs to point to the Debian Archive --- .github/dependabot.yml | 7 +++++++ .github/workflows/packager.yml | 4 +--- packaging/Dockerfile | 13 +++++++------ packaging/docker-compose.yml | 3 --- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8c1136e1579..9aed462f2b1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -40,3 +40,10 @@ updates: - dependency-name: "github.com/mstoykov/k6-taskqueue-lib" - dependency-name: "github.com/stretchr/testify" - dependency-name: "go.opentelemetry.io/*" + + # Update k6packager dependencies + - package-ecosystem: "docker" + directory: "/packaging" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 diff --git a/.github/workflows/packager.yml b/.github/workflows/packager.yml index 30b9d613dde..3ea16b29c07 100644 --- a/.github/workflows/packager.yml +++ b/.github/workflows/packager.yml @@ -13,9 +13,7 @@ jobs: publish-packager: runs-on: ubuntu-latest env: - VERSION: 0.0.3 - AWSCLI_VERSION: 2.1.36 - S3CMD_VERSION: 2.1.0 + VERSION: 0.0.4 DOCKER_IMAGE_ID: ghcr.io/grafana/k6packager GITHUB_ACTOR: ${{ github.actor }} permissions: diff --git a/packaging/Dockerfile b/packaging/Dockerfile index 3554c6fd7f2..e30dfe5b2b9 100644 --- a/packaging/Dockerfile +++ b/packaging/Dockerfile @@ -4,21 +4,22 @@ LABEL maintainer="k6 Developers " ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y && \ +RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \ + sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \ + echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \ + apt-get update -y && \ apt-get install -y apt-utils createrepo curl git gnupg2 python3-pip unzip -ARG S3CMD_VERSION -RUN pip3 install "s3cmd${S3CMD_VERSION:+==$S3CMD_VERSION}" +RUN pip3 install "s3cmd==2.4.0" -COPY ./awscli-key.gpg . -ARG AWSCLI_VERSION # Download awscli, check GPG signature and install. +COPY ./awscli-key.gpg . RUN export GNUPGHOME="$(mktemp -d)" && \ gpg2 --import ./awscli-key.gpg && \ fpr="$(gpg2 --with-colons --fingerprint aws-cli | grep '^fpr' | cut -d: -f10)" && \ gpg2 --export-ownertrust && echo "${fpr}:6:" | gpg2 --import-ownertrust && \ curl -fsSL --remote-name-all \ - "https://awscli.amazonaws.com/awscli-exe-linux-x86_64${AWSCLI_VERSION:+-$AWSCLI_VERSION}.zip"{,.sig} && \ + "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.26.5.zip"{,.sig} && \ gpg2 --verify awscli*.sig awscli*.zip && \ unzip -q awscli*.zip && \ ./aws/install && \ diff --git a/packaging/docker-compose.yml b/packaging/docker-compose.yml index ecd557fddd2..369eb16e0a1 100644 --- a/packaging/docker-compose.yml +++ b/packaging/docker-compose.yml @@ -2,9 +2,6 @@ services: packager: build: context: . - args: - - AWSCLI_VERSION=${AWSCLI_VERSION:-2.26.5} - - S3CMD_VERSION=${S3CMD_VERSION:-2.4.0} image: ghcr.io/grafana/k6packager:latest environment: - AWS_ACCESS_KEY_ID From 31a6f8ed367a689946213e19945fde44fe95db2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 11:27:45 +0000 Subject: [PATCH 118/136] build(deps): bump debian in /packaging Bumps debian from buster-20210311 to buster-20240612. --- updated-dependencies: - dependency-name: debian dependency-version: buster-20240612 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- packaging/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/Dockerfile b/packaging/Dockerfile index e30dfe5b2b9..ae5251be506 100644 --- a/packaging/Dockerfile +++ b/packaging/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-20210311 +FROM debian:buster-20240612 LABEL maintainer="k6 Developers " From 7a5b33e28e63d7100469b9dfe90c791282b34fbc Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Fri, 18 Jul 2025 16:12:53 +0300 Subject: [PATCH 119/136] chore: move to enumer versions that are working The previous enumer implementation doesn't work with go > 1.20 which practically makes it unusable. It has also have not been updated in years. There is a fork that unfortunately adds some additional functionality so I decided to fork and bump versions. But we already use this in a couple of places. At this point I will make certain that the current code works as before and we can agree on whether we use my minimal fork or the other one with the additional (forced) functionality. --- .github/workflows/lint.yml | 2 +- internal/cmd/outputs.go | 2 +- internal/js/modules/k6/experimental/fs/errors.go | 2 +- internal/output/csv/config.go | 3 ++- lib/execution_status_gen.go | 1 - lib/types/dns_policy_gen.go | 1 - lib/types/dns_select_gen.go | 1 - 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5d9636559d4..177e6315987 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,7 +32,7 @@ jobs: go mod verify - name: Check code generation run: | - go install github.com/alvaroloes/enumer@v1.1.2 + go install github.com/mstoykov/enumer@v0.0.1 go install github.com/mailru/easyjson/easyjson@v0.7.7 test -z "$(go generate ./... && git status --porcelain)" diff --git a/internal/cmd/outputs.go b/internal/cmd/outputs.go index 143e2d5cce4..28eb4dfc477 100644 --- a/internal/cmd/outputs.go +++ b/internal/cmd/outputs.go @@ -24,7 +24,7 @@ import ( // // NOTE: that the enumer is the github.com/dmarkham/enumer // -//go:generate enumer -type=builtinOutput -trimprefix builtinOutput -transform=kebab -output builtin_output_gen.go +//go:generate go run github.com/dmarkham/enumer@v1.5.11 -type=builtinOutput -trimprefix builtinOutput -transform=kebab -output builtin_output_gen.go type builtinOutput uint32 const ( diff --git a/internal/js/modules/k6/experimental/fs/errors.go b/internal/js/modules/k6/experimental/fs/errors.go index 95fcb9e0167..0914dfb5a17 100644 --- a/internal/js/modules/k6/experimental/fs/errors.go +++ b/internal/js/modules/k6/experimental/fs/errors.go @@ -18,7 +18,7 @@ func newFsError(k errorKind, message string) *fsError { // The tool itself is not tracked as part of the k6 go.mod file, and // therefore must be installed manually using `go install github.com/dmarkham/enumer`. // -//go:generate enumer -type=errorKind -output errors_gen.go +//go:generate go run github.com/dmarkham/enumer@v1.5.11 -type=errorKind -output errors_gen.go type errorKind uint8 const ( diff --git a/internal/output/csv/config.go b/internal/output/csv/config.go index 5f5afa91b0a..59dfbff9e4c 100644 --- a/internal/output/csv/config.go +++ b/internal/output/csv/config.go @@ -9,6 +9,7 @@ import ( "gopkg.in/guregu/null.v3" "github.com/mstoykov/envconfig" + "go.k6.io/k6/lib/types" ) @@ -22,7 +23,7 @@ type Config struct { // TimeFormat custom enum type // -//go:generate enumer -type=TimeFormat -transform=snake -trimprefix TimeFormat -output time_format_gen.go +//go:generate go run github.com/dmarkham/enumer@v1.5.11 -type=TimeFormat -transform=snake -trimprefix TimeFormat -output time_format_gen.go type TimeFormat uint8 // valid defined values for TimeFormat diff --git a/lib/execution_status_gen.go b/lib/execution_status_gen.go index 3c8e670e4f5..e1a4dbeb5ae 100644 --- a/lib/execution_status_gen.go +++ b/lib/execution_status_gen.go @@ -1,6 +1,5 @@ // Code generated by "enumer -type=ExecutionStatus -trimprefix ExecutionStatus -output execution_status_gen.go"; DO NOT EDIT. -// package lib import ( diff --git a/lib/types/dns_policy_gen.go b/lib/types/dns_policy_gen.go index 85feb6d24a7..9c25eba59c2 100644 --- a/lib/types/dns_policy_gen.go +++ b/lib/types/dns_policy_gen.go @@ -1,6 +1,5 @@ // Code generated by "enumer -type=DNSPolicy -trimprefix DNS -output dns_policy_gen.go"; DO NOT EDIT. -// package types import ( diff --git a/lib/types/dns_select_gen.go b/lib/types/dns_select_gen.go index 347aaec7a61..4eb744127df 100644 --- a/lib/types/dns_select_gen.go +++ b/lib/types/dns_select_gen.go @@ -1,6 +1,5 @@ // Code generated by "enumer -type=DNSSelect -trimprefix DNS -output dns_select_gen.go"; DO NOT EDIT. -// package types import ( From 9bb8f770a6594f16aa5892c3d5986251a8285cb2 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Fri, 18 Jul 2025 14:24:53 +0300 Subject: [PATCH 120/136] k6/html: move wrongly moved gen/gen_elements.go back out of internal --- {internal/js => js}/modules/k6/html/gen/gen_elements.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {internal/js => js}/modules/k6/html/gen/gen_elements.go (100%) diff --git a/internal/js/modules/k6/html/gen/gen_elements.go b/js/modules/k6/html/gen/gen_elements.go similarity index 100% rename from internal/js/modules/k6/html/gen/gen_elements.go rename to js/modules/k6/html/gen/gen_elements.go From d64b14216dd6c5e2e77c5cd6451de5c7f4fd563b Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Fri, 18 Jul 2025 12:50:09 +0300 Subject: [PATCH 121/136] cloudapi: fix proto definitions after move to internal --- .../cloudapi/insights/proto/v1/common/common.pb.go | 9 +++++---- .../cloudapi/insights/proto/v1/common/common.proto | 2 +- .../cloudapi/insights/proto/v1/ingester/ingester.pb.go | 9 +++++---- .../cloudapi/insights/proto/v1/ingester/ingester.proto | 2 +- internal/cloudapi/insights/proto/v1/k6/labels.pb.go | 10 +++++----- internal/cloudapi/insights/proto/v1/k6/labels.proto | 2 +- .../insights/proto/v1/k6/request_metadata.pb.go | 9 +++++---- .../insights/proto/v1/k6/request_metadata.proto | 2 +- internal/cloudapi/insights/proto/v1/trace/labels.pb.go | 9 +++++---- internal/cloudapi/insights/proto/v1/trace/labels.proto | 2 +- internal/cloudapi/insights/proto/v1/trace/span.pb.go | 9 +++++---- internal/cloudapi/insights/proto/v1/trace/span.proto | 2 +- 12 files changed, 36 insertions(+), 31 deletions(-) diff --git a/internal/cloudapi/insights/proto/v1/common/common.pb.go b/internal/cloudapi/insights/proto/v1/common/common.pb.go index b68fb4b4a6a..c915b20f12f 100644 --- a/internal/cloudapi/insights/proto/v1/common/common.pb.go +++ b/internal/cloudapi/insights/proto/v1/common/common.pb.go @@ -387,10 +387,11 @@ var file_v1_common_common_proto_rawDesc = []byte{ 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x38, 0x5a, 0x36, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, + 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/internal/cloudapi/insights/proto/v1/common/common.proto b/internal/cloudapi/insights/proto/v1/common/common.proto index 09584d382a9..f40b3874958 100644 --- a/internal/cloudapi/insights/proto/v1/common/common.proto +++ b/internal/cloudapi/insights/proto/v1/common/common.proto @@ -18,7 +18,7 @@ syntax = "proto3"; package k6.cloud.insights.proto.v1.common; -option go_package = "go.k6.io/k6/cloudapi/insights/proto/v1/common"; +option go_package = "go.k6.io/k6/internal/cloudapi/insights/proto/v1/common"; // AnyValue is used to represent any type of attribute value. AnyValue may contain a // primitive value such as a string or integer or it may contain an arbitrary nested diff --git a/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go b/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go index 76df2bf33c8..f02671bbe14 100644 --- a/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go +++ b/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go @@ -378,10 +378,11 @@ var file_v1_ingester_ingester_proto_rawDesc = []byte{ 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x31, 0x5a, 0x2f, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x3a, 0x5a, 0x38, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, + 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/internal/cloudapi/insights/proto/v1/ingester/ingester.proto b/internal/cloudapi/insights/proto/v1/ingester/ingester.proto index 70b03867b6b..99d0da4b848 100644 --- a/internal/cloudapi/insights/proto/v1/ingester/ingester.proto +++ b/internal/cloudapi/insights/proto/v1/ingester/ingester.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package k6.cloud.insights.proto.v1.ingester; -option go_package = "go.k6.io/k6/cloudapi/insights/proto/v1/ingester"; +option go_package = "go.k6.io/k6/internal/cloudapi/insights/proto/v1/ingester"; import "v1/k6/request_metadata.proto"; import "v1/trace/span.proto"; diff --git a/internal/cloudapi/insights/proto/v1/k6/labels.pb.go b/internal/cloudapi/insights/proto/v1/k6/labels.pb.go index 98bad511594..28d4591e816 100644 --- a/internal/cloudapi/insights/proto/v1/k6/labels.pb.go +++ b/internal/cloudapi/insights/proto/v1/k6/labels.pb.go @@ -162,11 +162,11 @@ var file_v1_k6_labels_proto_rawDesc = []byte{ 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x2b, - 0x5a, 0x29, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x28, 0x03, 0x52, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x34, + 0x5a, 0x32, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, + 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, + 0x31, 0x2f, 0x6b, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/cloudapi/insights/proto/v1/k6/labels.proto b/internal/cloudapi/insights/proto/v1/k6/labels.proto index bda67ef82dc..43bee457336 100644 --- a/internal/cloudapi/insights/proto/v1/k6/labels.proto +++ b/internal/cloudapi/insights/proto/v1/k6/labels.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package k6.cloud.insights.proto.v1.k6; -option go_package = "go.k6.io/k6/cloudapi/insights/proto/v1/k6"; +option go_package = "go.k6.io/k6/internal/cloudapi/insights/proto/v1/k6"; message TestRunLabels { int64 ID = 1; diff --git a/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go b/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go index f58dbc6a057..80e8430b72f 100644 --- a/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go +++ b/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go @@ -146,10 +146,11 @@ var file_v1_k6_request_metadata_proto_rawDesc = []byte{ 0x68, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x6b, 0x36, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x6f, - 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, - 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x63, 0x6f, 0x6c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x6f, + 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, + 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x36, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/cloudapi/insights/proto/v1/k6/request_metadata.proto b/internal/cloudapi/insights/proto/v1/k6/request_metadata.proto index cd32d1c83ae..ead924aff41 100644 --- a/internal/cloudapi/insights/proto/v1/k6/request_metadata.proto +++ b/internal/cloudapi/insights/proto/v1/k6/request_metadata.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package k6.cloud.insights.proto.v1.k6; -option go_package = "go.k6.io/k6/cloudapi/insights/proto/v1/k6"; +option go_package = "go.k6.io/k6/internal/cloudapi/insights/proto/v1/k6"; import "v1/k6/labels.proto"; diff --git a/internal/cloudapi/insights/proto/v1/trace/labels.pb.go b/internal/cloudapi/insights/proto/v1/trace/labels.pb.go index c414d450783..1ade90c2ed2 100644 --- a/internal/cloudapi/insights/proto/v1/trace/labels.pb.go +++ b/internal/cloudapi/insights/proto/v1/trace/labels.pb.go @@ -112,10 +112,11 @@ var file_v1_trace_labels_proto_rawDesc = []byte{ 0x75, 0x64, 0x2e, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, - 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, - 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x72, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, + 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/cloudapi/insights/proto/v1/trace/labels.proto b/internal/cloudapi/insights/proto/v1/trace/labels.proto index b5a479546d1..2306b3605e7 100644 --- a/internal/cloudapi/insights/proto/v1/trace/labels.proto +++ b/internal/cloudapi/insights/proto/v1/trace/labels.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package k6.cloud.insights.proto.v1.trace; -option go_package = "go.k6.io/k6/cloudapi/insights/proto/v1/trace"; +option go_package = "go.k6.io/k6/internal/cloudapi/insights/proto/v1/trace"; import "v1/trace/span.proto"; diff --git a/internal/cloudapi/insights/proto/v1/trace/span.pb.go b/internal/cloudapi/insights/proto/v1/trace/span.pb.go index 83ce6b0b3d5..daa037cda85 100644 --- a/internal/cloudapi/insights/proto/v1/trace/span.pb.go +++ b/internal/cloudapi/insights/proto/v1/trace/span.pb.go @@ -313,10 +313,11 @@ var file_v1_trace_span_proto_rawDesc = []byte{ 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x6f, 0x2e, 0x6b, 0x36, - 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, - 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, - 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x6f, 0x2e, 0x6b, 0x36, + 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/cloudapi/insights/proto/v1/trace/span.proto b/internal/cloudapi/insights/proto/v1/trace/span.proto index 97e9942f7da..c31f9d2f656 100644 --- a/internal/cloudapi/insights/proto/v1/trace/span.proto +++ b/internal/cloudapi/insights/proto/v1/trace/span.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package k6.cloud.insights.proto.v1.trace; -option go_package = "go.k6.io/k6/cloudapi/insights/proto/v1/trace"; +option go_package = "go.k6.io/k6/internal/cloudapi/insights/proto/v1/trace"; import "v1/common/common.proto"; From 9ea333cf263baa8c805883bab2bf45b055be46e0 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Fri, 18 Jul 2025 14:35:49 +0300 Subject: [PATCH 122/136] output/json: regenerate easyjson after move to internal --- internal/output/json/json_easyjson.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/output/json/json_easyjson.go b/internal/output/json/json_easyjson.go index 95a8d8bda1e..be8e47b3a08 100644 --- a/internal/output/json/json_easyjson.go +++ b/internal/output/json/json_easyjson.go @@ -19,7 +19,7 @@ var ( _ easyjson.Marshaler ) -func easyjson42239ddeDecodeGoK6IoK6OutputJson(in *jlexer.Lexer, out *sampleEnvelope) { +func easyjson42239ddeDecodeGoK6IoK6InternalOutputJson(in *jlexer.Lexer, out *sampleEnvelope) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -54,7 +54,7 @@ func easyjson42239ddeDecodeGoK6IoK6OutputJson(in *jlexer.Lexer, out *sampleEnvel in.Consumed() } } -func easyjson42239ddeEncodeGoK6IoK6OutputJson(out *jwriter.Writer, in sampleEnvelope) { +func easyjson42239ddeEncodeGoK6IoK6InternalOutputJson(out *jwriter.Writer, in sampleEnvelope) { out.RawByte('{') first := true _ = first @@ -78,12 +78,12 @@ func easyjson42239ddeEncodeGoK6IoK6OutputJson(out *jwriter.Writer, in sampleEnve // MarshalEasyJSON supports easyjson.Marshaler interface func (v sampleEnvelope) MarshalEasyJSON(w *jwriter.Writer) { - easyjson42239ddeEncodeGoK6IoK6OutputJson(w, v) + easyjson42239ddeEncodeGoK6IoK6InternalOutputJson(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *sampleEnvelope) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson42239ddeDecodeGoK6IoK6OutputJson(l, v) + easyjson42239ddeDecodeGoK6IoK6InternalOutputJson(l, v) } func easyjson42239ddeDecode(in *jlexer.Lexer, out *struct { Time time.Time `json:"time"` @@ -204,7 +204,7 @@ func easyjson42239ddeEncode(out *jwriter.Writer, in struct { } out.RawByte('}') } -func easyjson42239ddeDecodeGoK6IoK6OutputJson1(in *jlexer.Lexer, out *metricEnvelope) { +func easyjson42239ddeDecodeGoK6IoK6InternalOutputJson1(in *jlexer.Lexer, out *metricEnvelope) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -239,7 +239,7 @@ func easyjson42239ddeDecodeGoK6IoK6OutputJson1(in *jlexer.Lexer, out *metricEnve in.Consumed() } } -func easyjson42239ddeEncodeGoK6IoK6OutputJson1(out *jwriter.Writer, in metricEnvelope) { +func easyjson42239ddeEncodeGoK6IoK6InternalOutputJson1(out *jwriter.Writer, in metricEnvelope) { out.RawByte('{') first := true _ = first @@ -263,12 +263,12 @@ func easyjson42239ddeEncodeGoK6IoK6OutputJson1(out *jwriter.Writer, in metricEnv // MarshalEasyJSON supports easyjson.Marshaler interface func (v metricEnvelope) MarshalEasyJSON(w *jwriter.Writer) { - easyjson42239ddeEncodeGoK6IoK6OutputJson1(w, v) + easyjson42239ddeEncodeGoK6IoK6InternalOutputJson1(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *metricEnvelope) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson42239ddeDecodeGoK6IoK6OutputJson1(l, v) + easyjson42239ddeDecodeGoK6IoK6InternalOutputJson1(l, v) } func easyjson42239ddeDecode1(in *jlexer.Lexer, out *struct { Name string `json:"name"` From e8f572ee7c2b1e77ba99eebfef563e3e55acdb47 Mon Sep 17 00:00:00 2001 From: Ivan <2103732+codebien@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:47:09 +0200 Subject: [PATCH 123/136] Add Dependabot rule for the main Dockerfile --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9aed462f2b1..111ab1d1efb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -41,6 +41,12 @@ updates: - dependency-name: "github.com/stretchr/testify" - dependency-name: "go.opentelemetry.io/*" + - package-ecosystem: "docker" + directory: "/" + schedule: + # We don't update immediately. We usually wait for `vX.Y.1` to be out. + interval: "quarterly" + # Update k6packager dependencies - package-ecosystem: "docker" directory: "/packaging" From b5fb22bd71cd65bce75df594d016d359a44eac38 Mon Sep 17 00:00:00 2001 From: Ivan <2103732+codebien@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:37:06 +0200 Subject: [PATCH 124/136] Use alpine 3.22 for the builder --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2b69b44e4f..5d02e15d8f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.22 as builder WORKDIR $GOPATH/src/go.k6.io/k6 COPY . . ARG TARGETOS TARGETARCH From dea6d518d82a84d19420fa86356fb465abe8c9cb Mon Sep 17 00:00:00 2001 From: Mihail Stoykov <312246+mstoykov@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:00:09 +0300 Subject: [PATCH 125/136] ci/deps: fail on go generate failing + refactor Move the whole generation part in the Makefile and pin everything used in it. Including protoc, which will only work on linux or WSL, maybe. This has to do some ... updates to some of the protobuf generated files as they are now build with a specific version. All versions are the highest one used so far, but no more recent to decrease need to change stuff. --- .github/workflows/lint.yml | 5 +- .gitignore | 1 + Makefile | 24 ++++ .../insights/proto/v1/common/common.pb.go | 19 ++- .../insights/proto/v1/ingester/ingester.pb.go | 2 +- .../insights/proto/v1/k6/labels.pb.go | 2 +- .../proto/v1/k6/request_metadata.pb.go | 2 +- .../insights/proto/v1/trace/labels.pb.go | 2 +- .../insights/proto/v1/trace/span.pb.go | 2 +- .../testutils/grpcservice/route_guide.pb.go | 4 +- .../grpcservice/route_guide_grpc.pb.go | 38 +++++- .../grpc_wrappers_testing/test.pb.go | 18 +-- .../grpc_wrappers_testing/test_grpc.pb.go | 129 ++++++++++-------- .../output/cloud/insights/collect_test.go | 4 +- internal/output/cloud/insights/flush_test.go | 4 +- 15 files changed, 168 insertions(+), 88 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 177e6315987..bf17d95ac7a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,9 +32,8 @@ jobs: go mod verify - name: Check code generation run: | - go install github.com/mstoykov/enumer@v0.0.1 - go install github.com/mailru/easyjson/easyjson@v0.7.7 - test -z "$(go generate ./... && git status --porcelain)" + make generate + test -z "$(git status --porcelain | tee >(cat 1>&2))" lint: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 5d66d4b7368..9d399904294 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /internal/js/tc39/TestTC39 /internal/js/modules/k6/experimental/streams/tests/wpt /internal/js/modules/k6/webcrypto/tests/wpt/ +/.protoc .vscode *.sublime-workspace diff --git a/Makefile b/Makefile index 458e42ede2a..ba267e27e7f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,29 @@ MAKEFLAGS += --silent GOLANGCI_LINT_VERSION = $(shell head -n 1 .golangci.yml | tr -d '\# ') +PROTOC_VERSION := 21.12 +PROTOC_ARCHIVE := protoc-$(PROTOC_VERSION)-linux-x86_64.zip +PROTOC_DOWNLOAD_URL := https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/$(PROTOC_ARCHIVE) + +proto-dependencies: + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0 + @if [ "$$(uname)" != "Linux" ]; then \ + echo "Error: Can't install protoc on your OS, please install protoc-$(PROTOC_VERSION) manually." >&2; \ + exit 1; \ + fi + @echo "Downloading $(PROTOC_ARCHIVE)" + curl --show-error --fail --no-location -LO $(PROTOC_DOWNLOAD_URL) + unzip -o $(PROTOC_ARCHIVE) -d ./.protoc + rm $(PROTOC_ARCHIVE) + +generate-tools-installs: proto-dependencies + go install github.com/mstoykov/enumer@v0.0.1 # TODO figure out if we shouldn't move to a different fork + go install mvdan.cc/gofumpt@v0.8.0 # TODO maybe just use go fmt for this case + go install github.com/mailru/easyjson/easyjson@v0.7.7 # TODO remove this in the future + +generate: generate-tools-installs + PATH="$(PWD)/.protoc/bin:$(PATH)" go generate ./... + all: clean format tests build diff --git a/internal/cloudapi/insights/proto/v1/common/common.pb.go b/internal/cloudapi/insights/proto/v1/common/common.pb.go index c915b20f12f..7046853deff 100644 --- a/internal/cloudapi/insights/proto/v1/common/common.pb.go +++ b/internal/cloudapi/insights/proto/v1/common/common.pb.go @@ -1,6 +1,22 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Messages below are copied from https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: v1/common/common.proto @@ -20,7 +36,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Messages below are copied from https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto // AnyValue is used to represent any type of attribute value. AnyValue may contain a // primitive value such as a string or integer or it may contain an arbitrary nested // object containing arrays, key-value lists and primitives. diff --git a/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go b/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go index f02671bbe14..0fa097e9f4f 100644 --- a/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go +++ b/internal/cloudapi/insights/proto/v1/ingester/ingester.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: v1/ingester/ingester.proto diff --git a/internal/cloudapi/insights/proto/v1/k6/labels.pb.go b/internal/cloudapi/insights/proto/v1/k6/labels.pb.go index 28d4591e816..59c7d157bd8 100644 --- a/internal/cloudapi/insights/proto/v1/k6/labels.pb.go +++ b/internal/cloudapi/insights/proto/v1/k6/labels.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: v1/k6/labels.proto diff --git a/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go b/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go index 80e8430b72f..03ccb356286 100644 --- a/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go +++ b/internal/cloudapi/insights/proto/v1/k6/request_metadata.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: v1/k6/request_metadata.proto diff --git a/internal/cloudapi/insights/proto/v1/trace/labels.pb.go b/internal/cloudapi/insights/proto/v1/trace/labels.pb.go index 1ade90c2ed2..d5d79632a80 100644 --- a/internal/cloudapi/insights/proto/v1/trace/labels.pb.go +++ b/internal/cloudapi/insights/proto/v1/trace/labels.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: v1/trace/labels.proto diff --git a/internal/cloudapi/insights/proto/v1/trace/span.pb.go b/internal/cloudapi/insights/proto/v1/trace/span.pb.go index daa037cda85..db365b85fd0 100644 --- a/internal/cloudapi/insights/proto/v1/trace/span.pb.go +++ b/internal/cloudapi/insights/proto/v1/trace/span.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.21.12 // source: v1/trace/span.proto diff --git a/internal/lib/testutils/grpcservice/route_guide.pb.go b/internal/lib/testutils/grpcservice/route_guide.pb.go index bb5837f6de4..6b48c926e06 100644 --- a/internal/lib/testutils/grpcservice/route_guide.pb.go +++ b/internal/lib/testutils/grpcservice/route_guide.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.12.4 +// protoc-gen-go v1.31.0 +// protoc v3.21.12 // source: route_guide.proto package grpcservice diff --git a/internal/lib/testutils/grpcservice/route_guide_grpc.pb.go b/internal/lib/testutils/grpcservice/route_guide_grpc.pb.go index 2552b6adbb4..c11bf78c077 100644 --- a/internal/lib/testutils/grpcservice/route_guide_grpc.pb.go +++ b/internal/lib/testutils/grpcservice/route_guide_grpc.pb.go @@ -1,4 +1,22 @@ +// Copyright 2015 gRPC authors, with some modification by the k6 team (2021). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.12 +// source: route_guide.proto package grpcservice @@ -14,6 +32,11 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + FeatureExplorer_GetFeature_FullMethodName = "/main.FeatureExplorer/GetFeature" + FeatureExplorer_ListFeatures_FullMethodName = "/main.FeatureExplorer/ListFeatures" +) + // FeatureExplorerClient is the client API for FeatureExplorer service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -44,7 +67,7 @@ func NewFeatureExplorerClient(cc grpc.ClientConnInterface) FeatureExplorerClient func (c *featureExplorerClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { out := new(Feature) - err := c.cc.Invoke(ctx, "/main.FeatureExplorer/GetFeature", in, out, opts...) + err := c.cc.Invoke(ctx, FeatureExplorer_GetFeature_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -52,7 +75,7 @@ func (c *featureExplorerClient) GetFeature(ctx context.Context, in *Point, opts } func (c *featureExplorerClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (FeatureExplorer_ListFeaturesClient, error) { - stream, err := c.cc.NewStream(ctx, &FeatureExplorer_ServiceDesc.Streams[0], "/main.FeatureExplorer/ListFeatures", opts...) + stream, err := c.cc.NewStream(ctx, &FeatureExplorer_ServiceDesc.Streams[0], FeatureExplorer_ListFeatures_FullMethodName, opts...) if err != nil { return nil, err } @@ -137,7 +160,7 @@ func _FeatureExplorer_GetFeature_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/main.FeatureExplorer/GetFeature", + FullMethod: FeatureExplorer_GetFeature_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FeatureExplorerServer).GetFeature(ctx, req.(*Point)) @@ -188,6 +211,11 @@ var FeatureExplorer_ServiceDesc = grpc.ServiceDesc{ Metadata: "route_guide.proto", } +const ( + RouteGuide_RecordRoute_FullMethodName = "/main.RouteGuide/RecordRoute" + RouteGuide_RouteChat_FullMethodName = "/main.RouteGuide/RouteChat" +) + // RouteGuideClient is the client API for RouteGuide service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -213,7 +241,7 @@ func NewRouteGuideClient(cc grpc.ClientConnInterface) RouteGuideClient { } func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { - stream, err := c.cc.NewStream(ctx, &RouteGuide_ServiceDesc.Streams[0], "/main.RouteGuide/RecordRoute", opts...) + stream, err := c.cc.NewStream(ctx, &RouteGuide_ServiceDesc.Streams[0], RouteGuide_RecordRoute_FullMethodName, opts...) if err != nil { return nil, err } @@ -247,7 +275,7 @@ func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { } func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { - stream, err := c.cc.NewStream(ctx, &RouteGuide_ServiceDesc.Streams[1], "/main.RouteGuide/RouteChat", opts...) + stream, err := c.cc.NewStream(ctx, &RouteGuide_ServiceDesc.Streams[1], RouteGuide_RouteChat_FullMethodName, opts...) if err != nil { return nil, err } diff --git a/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go index b11e8500b82..89539ed0ccc 100644 --- a/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go +++ b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test.pb.go @@ -1,16 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.12.4 +// protoc-gen-go v1.31.0 +// protoc v3.21.12 // source: test.proto package grpc_wrappers_testing import ( - _struct "github.com/golang/protobuf/ptypes/struct" - wrappers "github.com/golang/protobuf/ptypes/wrappers" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" ) @@ -63,11 +63,11 @@ var file_test_proto_rawDesc = []byte{ } var file_test_proto_goTypes = []interface{}{ - (*wrappers.StringValue)(nil), // 0: google.protobuf.StringValue - (*wrappers.Int64Value)(nil), // 1: google.protobuf.Int64Value - (*wrappers.BoolValue)(nil), // 2: google.protobuf.BoolValue - (*wrappers.DoubleValue)(nil), // 3: google.protobuf.DoubleValue - (*_struct.Value)(nil), // 4: google.protobuf.Value + (*wrapperspb.StringValue)(nil), // 0: google.protobuf.StringValue + (*wrapperspb.Int64Value)(nil), // 1: google.protobuf.Int64Value + (*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue + (*wrapperspb.DoubleValue)(nil), // 3: google.protobuf.DoubleValue + (*structpb.Value)(nil), // 4: google.protobuf.Value } var file_test_proto_depIdxs = []int32{ 0, // 0: grpc.wrappers.testing.Service.TestString:input_type -> google.protobuf.StringValue diff --git a/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go index 0af4769311e..c4c9b7f4cd7 100644 --- a/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go +++ b/internal/lib/testutils/httpmultibin/grpc_wrappers_testing/test_grpc.pb.go @@ -1,14 +1,18 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.12 +// source: test.proto package grpc_wrappers_testing import ( context "context" - _struct "github.com/golang/protobuf/ptypes/struct" - wrappers "github.com/golang/protobuf/ptypes/wrappers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + structpb "google.golang.org/protobuf/types/known/structpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" ) // This is a compile-time assertion to ensure that this generated file @@ -16,15 +20,24 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Service_TestString_FullMethodName = "/grpc.wrappers.testing.Service/TestString" + Service_TestInteger_FullMethodName = "/grpc.wrappers.testing.Service/TestInteger" + Service_TestBoolean_FullMethodName = "/grpc.wrappers.testing.Service/TestBoolean" + Service_TestDouble_FullMethodName = "/grpc.wrappers.testing.Service/TestDouble" + Service_TestValue_FullMethodName = "/grpc.wrappers.testing.Service/TestValue" + Service_TestStream_FullMethodName = "/grpc.wrappers.testing.Service/TestStream" +) + // ServiceClient is the client API for Service service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ServiceClient interface { - TestString(ctx context.Context, in *wrappers.StringValue, opts ...grpc.CallOption) (*wrappers.StringValue, error) - TestInteger(ctx context.Context, in *wrappers.Int64Value, opts ...grpc.CallOption) (*wrappers.Int64Value, error) - TestBoolean(ctx context.Context, in *wrappers.BoolValue, opts ...grpc.CallOption) (*wrappers.BoolValue, error) - TestDouble(ctx context.Context, in *wrappers.DoubleValue, opts ...grpc.CallOption) (*wrappers.DoubleValue, error) - TestValue(ctx context.Context, in *_struct.Value, opts ...grpc.CallOption) (*_struct.Value, error) + TestString(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) + TestInteger(ctx context.Context, in *wrapperspb.Int64Value, opts ...grpc.CallOption) (*wrapperspb.Int64Value, error) + TestBoolean(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) + TestDouble(ctx context.Context, in *wrapperspb.DoubleValue, opts ...grpc.CallOption) (*wrapperspb.DoubleValue, error) + TestValue(ctx context.Context, in *structpb.Value, opts ...grpc.CallOption) (*structpb.Value, error) TestStream(ctx context.Context, opts ...grpc.CallOption) (Service_TestStreamClient, error) } @@ -36,45 +49,45 @@ func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { return &serviceClient{cc} } -func (c *serviceClient) TestString(ctx context.Context, in *wrappers.StringValue, opts ...grpc.CallOption) (*wrappers.StringValue, error) { - out := new(wrappers.StringValue) - err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestString", in, out, opts...) +func (c *serviceClient) TestString(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) { + out := new(wrapperspb.StringValue) + err := c.cc.Invoke(ctx, Service_TestString_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *serviceClient) TestInteger(ctx context.Context, in *wrappers.Int64Value, opts ...grpc.CallOption) (*wrappers.Int64Value, error) { - out := new(wrappers.Int64Value) - err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestInteger", in, out, opts...) +func (c *serviceClient) TestInteger(ctx context.Context, in *wrapperspb.Int64Value, opts ...grpc.CallOption) (*wrapperspb.Int64Value, error) { + out := new(wrapperspb.Int64Value) + err := c.cc.Invoke(ctx, Service_TestInteger_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *serviceClient) TestBoolean(ctx context.Context, in *wrappers.BoolValue, opts ...grpc.CallOption) (*wrappers.BoolValue, error) { - out := new(wrappers.BoolValue) - err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestBoolean", in, out, opts...) +func (c *serviceClient) TestBoolean(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) { + out := new(wrapperspb.BoolValue) + err := c.cc.Invoke(ctx, Service_TestBoolean_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *serviceClient) TestDouble(ctx context.Context, in *wrappers.DoubleValue, opts ...grpc.CallOption) (*wrappers.DoubleValue, error) { - out := new(wrappers.DoubleValue) - err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestDouble", in, out, opts...) +func (c *serviceClient) TestDouble(ctx context.Context, in *wrapperspb.DoubleValue, opts ...grpc.CallOption) (*wrapperspb.DoubleValue, error) { + out := new(wrapperspb.DoubleValue) + err := c.cc.Invoke(ctx, Service_TestDouble_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *serviceClient) TestValue(ctx context.Context, in *_struct.Value, opts ...grpc.CallOption) (*_struct.Value, error) { - out := new(_struct.Value) - err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestValue", in, out, opts...) +func (c *serviceClient) TestValue(ctx context.Context, in *structpb.Value, opts ...grpc.CallOption) (*structpb.Value, error) { + out := new(structpb.Value) + err := c.cc.Invoke(ctx, Service_TestValue_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -82,7 +95,7 @@ func (c *serviceClient) TestValue(ctx context.Context, in *_struct.Value, opts . } func (c *serviceClient) TestStream(ctx context.Context, opts ...grpc.CallOption) (Service_TestStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[0], "/grpc.wrappers.testing.Service/TestStream", opts...) + stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[0], Service_TestStream_FullMethodName, opts...) if err != nil { return nil, err } @@ -91,8 +104,8 @@ func (c *serviceClient) TestStream(ctx context.Context, opts ...grpc.CallOption) } type Service_TestStreamClient interface { - Send(*wrappers.StringValue) error - CloseAndRecv() (*wrappers.StringValue, error) + Send(*wrapperspb.StringValue) error + CloseAndRecv() (*wrapperspb.StringValue, error) grpc.ClientStream } @@ -100,15 +113,15 @@ type serviceTestStreamClient struct { grpc.ClientStream } -func (x *serviceTestStreamClient) Send(m *wrappers.StringValue) error { +func (x *serviceTestStreamClient) Send(m *wrapperspb.StringValue) error { return x.ClientStream.SendMsg(m) } -func (x *serviceTestStreamClient) CloseAndRecv() (*wrappers.StringValue, error) { +func (x *serviceTestStreamClient) CloseAndRecv() (*wrapperspb.StringValue, error) { if err := x.ClientStream.CloseSend(); err != nil { return nil, err } - m := new(wrappers.StringValue) + m := new(wrapperspb.StringValue) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -119,11 +132,11 @@ func (x *serviceTestStreamClient) CloseAndRecv() (*wrappers.StringValue, error) // All implementations must embed UnimplementedServiceServer // for forward compatibility type ServiceServer interface { - TestString(context.Context, *wrappers.StringValue) (*wrappers.StringValue, error) - TestInteger(context.Context, *wrappers.Int64Value) (*wrappers.Int64Value, error) - TestBoolean(context.Context, *wrappers.BoolValue) (*wrappers.BoolValue, error) - TestDouble(context.Context, *wrappers.DoubleValue) (*wrappers.DoubleValue, error) - TestValue(context.Context, *_struct.Value) (*_struct.Value, error) + TestString(context.Context, *wrapperspb.StringValue) (*wrapperspb.StringValue, error) + TestInteger(context.Context, *wrapperspb.Int64Value) (*wrapperspb.Int64Value, error) + TestBoolean(context.Context, *wrapperspb.BoolValue) (*wrapperspb.BoolValue, error) + TestDouble(context.Context, *wrapperspb.DoubleValue) (*wrapperspb.DoubleValue, error) + TestValue(context.Context, *structpb.Value) (*structpb.Value, error) TestStream(Service_TestStreamServer) error mustEmbedUnimplementedServiceServer() } @@ -132,19 +145,19 @@ type ServiceServer interface { type UnimplementedServiceServer struct { } -func (UnimplementedServiceServer) TestString(context.Context, *wrappers.StringValue) (*wrappers.StringValue, error) { +func (UnimplementedServiceServer) TestString(context.Context, *wrapperspb.StringValue) (*wrapperspb.StringValue, error) { return nil, status.Errorf(codes.Unimplemented, "method TestString not implemented") } -func (UnimplementedServiceServer) TestInteger(context.Context, *wrappers.Int64Value) (*wrappers.Int64Value, error) { +func (UnimplementedServiceServer) TestInteger(context.Context, *wrapperspb.Int64Value) (*wrapperspb.Int64Value, error) { return nil, status.Errorf(codes.Unimplemented, "method TestInteger not implemented") } -func (UnimplementedServiceServer) TestBoolean(context.Context, *wrappers.BoolValue) (*wrappers.BoolValue, error) { +func (UnimplementedServiceServer) TestBoolean(context.Context, *wrapperspb.BoolValue) (*wrapperspb.BoolValue, error) { return nil, status.Errorf(codes.Unimplemented, "method TestBoolean not implemented") } -func (UnimplementedServiceServer) TestDouble(context.Context, *wrappers.DoubleValue) (*wrappers.DoubleValue, error) { +func (UnimplementedServiceServer) TestDouble(context.Context, *wrapperspb.DoubleValue) (*wrapperspb.DoubleValue, error) { return nil, status.Errorf(codes.Unimplemented, "method TestDouble not implemented") } -func (UnimplementedServiceServer) TestValue(context.Context, *_struct.Value) (*_struct.Value, error) { +func (UnimplementedServiceServer) TestValue(context.Context, *structpb.Value) (*structpb.Value, error) { return nil, status.Errorf(codes.Unimplemented, "method TestValue not implemented") } func (UnimplementedServiceServer) TestStream(Service_TestStreamServer) error { @@ -164,7 +177,7 @@ func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { } func _Service_TestString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(wrappers.StringValue) + in := new(wrapperspb.StringValue) if err := dec(in); err != nil { return nil, err } @@ -173,16 +186,16 @@ func _Service_TestString_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/grpc.wrappers.testing.Service/TestString", + FullMethod: Service_TestString_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).TestString(ctx, req.(*wrappers.StringValue)) + return srv.(ServiceServer).TestString(ctx, req.(*wrapperspb.StringValue)) } return interceptor(ctx, in, info, handler) } func _Service_TestInteger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(wrappers.Int64Value) + in := new(wrapperspb.Int64Value) if err := dec(in); err != nil { return nil, err } @@ -191,16 +204,16 @@ func _Service_TestInteger_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/grpc.wrappers.testing.Service/TestInteger", + FullMethod: Service_TestInteger_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).TestInteger(ctx, req.(*wrappers.Int64Value)) + return srv.(ServiceServer).TestInteger(ctx, req.(*wrapperspb.Int64Value)) } return interceptor(ctx, in, info, handler) } func _Service_TestBoolean_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(wrappers.BoolValue) + in := new(wrapperspb.BoolValue) if err := dec(in); err != nil { return nil, err } @@ -209,16 +222,16 @@ func _Service_TestBoolean_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/grpc.wrappers.testing.Service/TestBoolean", + FullMethod: Service_TestBoolean_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).TestBoolean(ctx, req.(*wrappers.BoolValue)) + return srv.(ServiceServer).TestBoolean(ctx, req.(*wrapperspb.BoolValue)) } return interceptor(ctx, in, info, handler) } func _Service_TestDouble_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(wrappers.DoubleValue) + in := new(wrapperspb.DoubleValue) if err := dec(in); err != nil { return nil, err } @@ -227,16 +240,16 @@ func _Service_TestDouble_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/grpc.wrappers.testing.Service/TestDouble", + FullMethod: Service_TestDouble_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).TestDouble(ctx, req.(*wrappers.DoubleValue)) + return srv.(ServiceServer).TestDouble(ctx, req.(*wrapperspb.DoubleValue)) } return interceptor(ctx, in, info, handler) } func _Service_TestValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(_struct.Value) + in := new(structpb.Value) if err := dec(in); err != nil { return nil, err } @@ -245,10 +258,10 @@ func _Service_TestValue_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/grpc.wrappers.testing.Service/TestValue", + FullMethod: Service_TestValue_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).TestValue(ctx, req.(*_struct.Value)) + return srv.(ServiceServer).TestValue(ctx, req.(*structpb.Value)) } return interceptor(ctx, in, info, handler) } @@ -258,8 +271,8 @@ func _Service_TestStream_Handler(srv interface{}, stream grpc.ServerStream) erro } type Service_TestStreamServer interface { - SendAndClose(*wrappers.StringValue) error - Recv() (*wrappers.StringValue, error) + SendAndClose(*wrapperspb.StringValue) error + Recv() (*wrapperspb.StringValue, error) grpc.ServerStream } @@ -267,12 +280,12 @@ type serviceTestStreamServer struct { grpc.ServerStream } -func (x *serviceTestStreamServer) SendAndClose(m *wrappers.StringValue) error { +func (x *serviceTestStreamServer) SendAndClose(m *wrapperspb.StringValue) error { return x.ServerStream.SendMsg(m) } -func (x *serviceTestStreamServer) Recv() (*wrappers.StringValue, error) { - m := new(wrappers.StringValue) +func (x *serviceTestStreamServer) Recv() (*wrapperspb.StringValue, error) { + m := new(wrapperspb.StringValue) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } diff --git a/internal/output/cloud/insights/collect_test.go b/internal/output/cloud/insights/collect_test.go index 08cf324512f..ab3148c508b 100644 --- a/internal/output/cloud/insights/collect_test.go +++ b/internal/output/cloud/insights/collect_test.go @@ -114,14 +114,14 @@ func Test_Collector_PopAll_DoesNothingWithEmptyData(t *testing.T) { // Given data := insights.RequestMetadatas{ - { + insights.RequestMetadata{ TraceID: "test-trace-id-1", Start: time.Unix(9, 0), End: time.Unix(10, 0), TestRunLabels: insights.TestRunLabels{ID: 1337, Scenario: "test-scenario-1", Group: "test-group-1"}, ProtocolLabels: insights.ProtocolHTTPLabels{URL: "test-url-1", Method: "test-method-1", StatusCode: 200}, }, - { + insights.RequestMetadata{ TraceID: "test-trace-id-2", Start: time.Unix(19, 0), End: time.Unix(20, 0), diff --git a/internal/output/cloud/insights/flush_test.go b/internal/output/cloud/insights/flush_test.go index f67333bc3aa..7b79107bd2e 100644 --- a/internal/output/cloud/insights/flush_test.go +++ b/internal/output/cloud/insights/flush_test.go @@ -63,14 +63,14 @@ func (m *mockRequestMetadatasCollector) PopAll() insights.RequestMetadatas { func newMockRequestMetadatas() insights.RequestMetadatas { return insights.RequestMetadatas{ - { + insights.RequestMetadata{ TraceID: "test-trace-id-1", Start: time.Unix(1337, 0), End: time.Unix(1338, 0), TestRunLabels: insights.TestRunLabels{ID: 1, Scenario: "test-scenario-1", Group: "test-group-1"}, ProtocolLabels: insights.ProtocolHTTPLabels{URL: "test-url-1", Method: "test-method-1", StatusCode: 200}, }, - { + insights.RequestMetadata{ TraceID: "test-trace-id-2", Start: time.Unix(2337, 0), End: time.Unix(2338, 0), From d4d0c2a3fc1cf23fdbf51b61c599046e45b5a38b Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 22 May 2025 19:01:53 +0200 Subject: [PATCH 126/136] initial integration Signed-off-by: Pablo Chacin --- cmd/execute.go | 11 -- internal/cmd/launcher.go | 169 ++++++++--------------- internal/cmd/launcher_test.go | 244 +++++++++------------------------- internal/cmd/root.go | 23 +++- 4 files changed, 145 insertions(+), 302 deletions(-) diff --git a/cmd/execute.go b/cmd/execute.go index b43892101ba..a2990407e81 100644 --- a/cmd/execute.go +++ b/cmd/execute.go @@ -13,16 +13,5 @@ import ( func Execute() { gs := state.NewGlobalState(context.Background()) - if gs.Flags.BinaryProvisioning { - internalcmd.NewLauncher(gs).Launch() - return - } - - // If Binary Provisioning is not enabled, continue with the regular k6 execution path - - // TODO: this is temporary defensive programming - // The Launcher has already the support for this specific execution path, but we decided to play safe here. - // After the v1.0 release, we want to fully delegate this control to the Launcher. - gs.Logger.Debug("Binary Provisioning feature is disabled.") internalcmd.ExecuteWithGlobalState(gs) } diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index b273ac6767f..c081845b128 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -12,6 +12,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/grafana/k6deps" "github.com/grafana/k6provider" + "github.com/spf13/cobra" "go.k6.io/k6/cloudapi" "go.k6.io/k6/cmd/state" "go.k6.io/k6/internal/build" @@ -25,12 +26,20 @@ var ( // commandExecutor executes the requested k6 command line command. // It abstract the execution path from the concrete binary. type commandExecutor interface { - run(*state.GlobalState) + run(*state.GlobalState) error } -// Launcher is a k6 launcher. It analyses the requirements of a k6 execution, +// customBinary runs the requested commands +// on a different binary on a subprocess passing the original arguments +type customBinary struct { + // path represents the local file path + // on the file system of the binary + path string +} + +// launcher is a k6 launcher. It analyses the requirements of a k6 execution, // then if required, it provisions a binary executor to satisfy the requirements. -type Launcher struct { +type launcher struct { // gs is the global state of k6. gs *state.GlobalState @@ -42,46 +51,42 @@ type Launcher struct { commandExecutor commandExecutor } -// NewLauncher creates a new Launcher from a GlobalState using the default fallback and provision functions -func NewLauncher(gs *state.GlobalState) *Launcher { - defaultExecutor := ¤tBinary{} - return &Launcher{ - gs: gs, - provision: k6buildProvision, - commandExecutor: defaultExecutor, +// newLauncher creates a new Launcher from a GlobalState using the default provision function +func newLauncher(gs *state.GlobalState) *launcher { + return &launcher{ + gs: gs, + provision: k6buildProvision, } } -// Launch executes k6 either by launching a provisioned binary or defaulting to the -// current binary if this is not necessary. -// The commandExecutor can exit the process so don't assume it will return -func (l *Launcher) Launch() { - // If binary provisioning is not enabled, continue with the regular k6 execution path - if !l.gs.Flags.BinaryProvisioning { - l.gs.Logger.Debug("Binary Provisioning feature is disabled.") - l.commandExecutor.run(l.gs) - return +// launch analyzies the command to be executed and its input (e.g. script) +// to identify if its dependencies. It it has dependencies tha cannot be satisfied by the +// current binary, it obtains a custom binary usign the provision function and delegates +// the execution of the command to this binary. if not, continues with the execution of the +// command in the current binary. +func (l *launcher) launch(cmd *cobra.Command, args []string) error { + if !isAnalysisRequired(cmd) { + l.gs.Logger. + WithField("command", cmd.Name()). + Debug("command does not require dependency analysis") + return nil } - l.gs.Logger. - Debug("Binary Provisioning feature is enabled.") - deps, err := analyze(l.gs, l.gs.CmdArgs[1:]) + deps, err := analyze(l.gs, args) if err != nil { l.gs.Logger. WithError(err). Error("Binary provisioning is enabled but it failed to analyze the dependencies." + " Please, make sure to report this issue by opening a bug report.") - l.gs.OSExit(1) - return // this is required for testing + return err } // if the command does not have dependencies nor a custom build is required - if !customBuildRequired(build.Version, deps) { + if !isCustomBuildRequired(build.Version, deps) { l.gs.Logger. Debug("The current k6 binary already satisfies all the required dependencies," + " it isn't required to provision a new binary.") - l.commandExecutor.run(l.gs) - return + return nil } l.gs.Logger. @@ -96,23 +101,24 @@ func (l *Launcher) Launch() { WithError(err). Error("Failed to provision a k6 binary with required dependencies." + " Please, make sure to report this issue by opening a bug report.") - l.gs.OSExit(1) - return + return err } - customBinary.run(l.gs) + l.commandExecutor = customBinary + + // override command's RunE method to be processed by the command executor + cmd.RunE = l.runE + + return nil } -// customBinary runs the requested commands -// on a different binary on a subprocess passing the original arguments -type customBinary struct { - // path represents the local file path - // on the file system of the binary - path string +// runE executes the k6 command using a command executor +func (l *launcher) runE(_ *cobra.Command, _ []string) error { + return l.commandExecutor.run(l.gs) } //nolint:forbidigo -func (b *customBinary) run(gs *state.GlobalState) { +func (b *customBinary) run(gs *state.GlobalState) error { cmd := exec.CommandContext(gs.Ctx, b.path, gs.CmdArgs[1:]...) //nolint:gosec // we pass os stdout, err, in because passing them from GlobalState changes how @@ -124,6 +130,8 @@ func (b *customBinary) run(gs *state.GlobalState) { // Copy environment variables to the k6 process and skip binary provisioning feature flag to disable it. // If not disabled, then the executed k6 binary would enter an infinite loop, where it continuously // process the input script, detect dependencies, and retrigger provisioning. + // This can be avoided by checking if the current binary has already extensins that + // satisfies the dependencies. See comment in isCustomBuildRequired function. env := []string{} for k, v := range gs.Env { if k == state.BinaryProvisioningFeatureFlag { @@ -143,7 +151,7 @@ func (b *customBinary) run(gs *state.GlobalState) { gs.Logger. WithError(err). Error("Failed to run the provisioned k6 binary") - gs.OSExit(1) + return err } // wait for the subprocess to end @@ -155,15 +163,7 @@ func (b *customBinary) run(gs *state.GlobalState) { for { select { case err := <-done: - rc := 0 - if err != nil { - rc = 1 - var eerr *exec.ExitError - if errors.As(err, &eerr) { - rc = eerr.ExitCode() - } - } - gs.OSExit(rc) + return err case sig := <-sigC: gs.Logger. WithField("signal", sig.String()). @@ -172,18 +172,11 @@ func (b *customBinary) run(gs *state.GlobalState) { } } -// currentBinary runs the requested commands on the current binary -type currentBinary struct{} - -func (b *currentBinary) run(gs *state.GlobalState) { - ExecuteWithGlobalState(gs) -} - -// customBuildRequired checks if the build is required +// isCustomBuildRequired checks if the build is required // it's required if there is one or more dependencies other than k6 itself // or if the required k6 version is not satisfied by the current binary's version // TODO: get the version of any built-in extension and check if they satisfy the dependencies -func customBuildRequired(baseK6Version string, deps k6deps.Dependencies) bool { +func isCustomBuildRequired(baseK6Version string, deps k6deps.Dependencies) bool { if len(deps) == 0 { return false } @@ -283,19 +276,13 @@ func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) Manifest: k6deps.Source{Ignore: true}, } - if !isAnalysisRequired(args) { - gs.Logger. - Debug("The command to execute does not require dependency analysis.") - return k6deps.Dependencies{}, nil - } - - scriptname := scriptNameFromArgs(args) - if len(scriptname) == 0 { + if len(args) == 0 { gs.Logger. Debug("The command did not receive an input script.") return nil, errScriptNotFound } + scriptname := args[0] if scriptname == "-" { gs.Logger. Debug("Test script provided by Stdin is not yet supported from Binary provisioning feature.") @@ -319,56 +306,18 @@ func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) return k6deps.Analyze(dopts) } -// isAnalysisRequired searches for the command and returns a boolean indicating if dependency analysis is required -func isAnalysisRequired(args []string) bool { - // return early if no arguments passed - if len(args) == 0 { - return false - } - - // search for a command that requires binary provisioning and then get the target script or archive - // we handle cloud login subcommand as a special case because it does not require binary provisioning - for i, arg := range args { - switch arg { - case "--help", "-h": - return false - case "cloud": - for _, arg = range args[i+1:] { - if arg == "login" || arg == "--help" || arg == "-h" { - return false - } - } - return true - case "archive", "inspect": +// isAnalysisRequired returns a boolean indicating if dependency analysis is required for the command +func isAnalysisRequired(cmd *cobra.Command) bool { + switch cmd.Name() { + case "run": + if cmd.Parent() != nil && cmd.Parent().Name() == "cloud" { return true } + return false + case "archive", "inspect", "upload", "cloud": + return true } // not found return false } - -// scriptNameFromArgs returns the file name passed as input and true if it's a valid script name -func scriptNameFromArgs(args []string) string { - // return early if no arguments passed - if len(args) == 0 { - return "" - } - - for _, arg := range args { - if strings.HasPrefix(arg, "-") { - if arg == "-" { // we are running a script from stdin - return arg - } - continue - } - if strings.HasSuffix(arg, ".js") || - strings.HasSuffix(arg, ".tar") || - strings.HasSuffix(arg, ".ts") { - return arg - } - } - - // not found - return "" -} diff --git a/internal/cmd/launcher_test.go b/internal/cmd/launcher_test.go index c4e382effb8..eb5317b3d21 100644 --- a/internal/cmd/launcher_test.go +++ b/internal/cmd/launcher_test.go @@ -2,26 +2,32 @@ package cmd import ( "errors" + "fmt" "os" "path/filepath" "testing" "github.com/grafana/k6deps" "github.com/spf13/afero" + "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "go.k6.io/k6/cmd/state" + + "go.k6.io/k6/errext" "go.k6.io/k6/internal/build" "go.k6.io/k6/internal/cmd/tests" ) -type mockRunner struct { +// mockExecutor mocks commandExecutor +// Records the invocation of the run function and returns the defined error +type mockExecutor struct { invoked bool - rc int + err error } -func (m *mockRunner) run(gs *state.GlobalState) { +func (m *mockExecutor) run(_ *state.GlobalState) error { m.invoked = true - gs.OSExit(m.rc) + return m.err } const ( @@ -83,9 +89,9 @@ func TestLauncherLaunch(t *testing.T) { k6Args []string expectProvision bool provisionError error + expectCmdRunE bool expectK6Run bool - expectDefault bool - k6ReturnCode int + k6ExecutorErr error expectOsExit int }{ { @@ -94,8 +100,8 @@ func TestLauncherLaunch(t *testing.T) { disableBP: true, script: fakerTest, expectProvision: false, + expectCmdRunE: true, expectK6Run: false, - expectDefault: true, expectOsExit: 0, }, { @@ -103,8 +109,8 @@ func TestLauncherLaunch(t *testing.T) { k6Cmd: "cloud", script: fakerTest, expectProvision: true, + expectCmdRunE: false, expectK6Run: true, - expectDefault: false, expectOsExit: 0, }, { @@ -112,17 +118,18 @@ func TestLauncherLaunch(t *testing.T) { k6Cmd: "cloud", script: requireUnsatisfiedK6Version, expectProvision: true, - expectK6Run: true, - expectDefault: false, - expectOsExit: 0, + expectCmdRunE: false, + expectK6Run: false, + provisionError: fmt.Errorf("unsatisfied version"), + expectOsExit: -1, }, { name: "require satisfied k6 version", k6Cmd: "cloud", script: requireSatisfiedK6Version, expectProvision: false, + expectCmdRunE: true, expectK6Run: false, - expectDefault: true, expectOsExit: 0, }, { @@ -130,24 +137,25 @@ func TestLauncherLaunch(t *testing.T) { k6Cmd: "cloud", script: noDepsTest, expectProvision: false, + expectCmdRunE: true, expectK6Run: false, - expectDefault: true, expectOsExit: 0, }, { name: "command don't require binary provisioning", k6Cmd: "version", expectProvision: false, + expectCmdRunE: true, expectK6Run: false, - expectDefault: true, expectOsExit: 0, }, { name: "binary provisioning is not enabled for run command", k6Cmd: "run", + script: noDepsTest, expectProvision: false, + expectCmdRunE: true, expectK6Run: false, - expectDefault: true, expectOsExit: 0, }, { @@ -156,39 +164,29 @@ func TestLauncherLaunch(t *testing.T) { script: fakerTest, provisionError: errors.New("test error"), expectProvision: true, - expectDefault: false, + expectCmdRunE: false, expectK6Run: false, - expectOsExit: 1, + expectOsExit: -1, }, { name: "failed k6 execution", k6Cmd: "cloud", script: fakerTest, - k6ReturnCode: 108, + k6ExecutorErr: errext.WithExitCodeIfNone(errors.New("execution failed"), 108), expectProvision: true, - expectDefault: false, + expectCmdRunE: false, expectK6Run: true, expectOsExit: 108, }, { - name: "missing input script", - k6Cmd: "cloud", - k6Args: []string{}, - script: "", - expectProvision: false, - expectK6Run: false, - expectDefault: false, - expectOsExit: 1, - }, - { - name: "script in stdin", + name: "script in stdin (unsupported)", k6Cmd: "cloud", k6Args: []string{"-"}, script: "", expectProvision: false, + expectCmdRunE: false, expectK6Run: false, - expectDefault: false, - expectOsExit: 1, + expectOsExit: -1, }, } @@ -222,133 +220,40 @@ func TestLauncherLaunch(t *testing.T) { // the exit code is checked by the TestGlobalState when the test ends ts.ExpectedExitCode = tc.expectOsExit - defaultRunner := &mockRunner{} - provisionRunner := &mockRunner{rc: tc.k6ReturnCode} + cmdExecutor := mockExecutor{err: tc.k6ExecutorErr} + + // mock launcher's provision function recording the invocation and + // returning the mock command executor provisionCalled := false - launcher := &Launcher{ + launcher := &launcher{ gs: ts.GlobalState, provision: func(_ *state.GlobalState, _ k6deps.Dependencies) (commandExecutor, error) { provisionCalled = true - return provisionRunner, tc.provisionError + return &cmdExecutor, tc.provisionError }, - commandExecutor: defaultRunner, } - launcher.Launch() + rootCommand := newRootWithLauncher(ts.GlobalState, launcher) - assert.Equal(t, tc.expectProvision, provisionCalled) - assert.Equal(t, tc.expectK6Run, provisionRunner.invoked) - assert.Equal(t, tc.expectDefault, defaultRunner.invoked) - }) - } -} - -func TestScriptNameFromArgs(t *testing.T) { - t.Parallel() - testCases := []struct { - name string - args []string - expected string - }{ - { - name: "empty args", - args: []string{}, - expected: "", - }, - { - name: "only flags", - args: []string{"-v", "--verbose"}, - expected: "", - }, - { - name: "run with script at end", - args: []string{"run", "script.js"}, - expected: "script.js", - }, - { - name: "run with script and flags", - args: []string{"run", "script.js", "-v"}, - expected: "script.js", - }, - { - name: "run with flags before script", - args: []string{"run", "-v", "script.js"}, - expected: "script.js", - }, - { - name: "run with verbose flag before script", - args: []string{"run", "--verbose", "script.js"}, - expected: "script.js", - }, - { - name: "run with flag with value before script", - args: []string{"run", "--console-output", "loadtest.log", "script.js"}, - expected: "script.js", - }, - { - name: "run with script before flag with value", - args: []string{"run", "script.js", "--console-output", "loadtest2.log"}, - expected: "script.js", - }, - { - name: "cloud run with script", - args: []string{"cloud", "run", "archive.tar"}, - expected: "archive.tar", - }, - { - name: "cloud run with script and flags", - args: []string{"cloud", "run", "archive.tar", "-v"}, - expected: "archive.tar", - }, - { - name: "cloud with script and flags", - args: []string{"cloud", "archive.tar", "-v"}, - expected: "archive.tar", - }, - { - name: "cloud with flags and script", - args: []string{"cloud", "--console-output", "loadtest.log", "script.js"}, - expected: "script.js", - }, - { - name: "cloud with script and flags with value", - args: []string{"cloud", "script.js", "--console-output", "loadtest2.log"}, - expected: "script.js", - }, - { - name: "flags before command", - args: []string{"-v", "run", "script.js"}, - expected: "script.js", - }, - { - name: "complex case with multiple flags", - args: []string{"-v", "--quiet", "cloud", "run", "-o", "output.json", "--console-output", "loadtest.log", "script.js", "--tag", "env=staging"}, - expected: "script.js", - }, - { - name: "no script file", - args: []string{"run", "-v", "--quiet"}, - expected: "", - }, - { - name: "non-script file", - args: []string{"run", "notascript.txt"}, - expected: "", - }, - { - name: "ts extension", - args: []string{"run", "script.ts"}, - expected: "script.ts", - }, - } + // find the command to be executed + cmd, _, err := rootCommand.cmd.Find(k6Args[1:]) + if err != nil { + t.Fatalf("parsing args %v", err) + } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - t.Parallel() + // replace command's the RunE function by a mock that indicates if the command was executed + runECalled := false + cmd.RunE = func(_ *cobra.Command, _ []string) error { + runECalled = true + return nil + } - script := scriptNameFromArgs(tc.args) + // TODO: check error + rootCommand.execute() - assert.Equal(t, tc.expected, script) + assert.Equal(t, tc.expectProvision, provisionCalled) + assert.Equal(t, tc.expectCmdRunE, runECalled) + assert.Equal(t, tc.expectK6Run, cmdExecutor.invoked) }) } } @@ -390,36 +295,6 @@ func TestIsAnalysisRequired(t *testing.T) { args: []string{"cloud", "run", "script.js"}, expected: true, }, - { - name: "cloud run command with help", - args: []string{"cloud", "run", "--help"}, - expected: false, - }, - { - name: "cloud run command with short help", - args: []string{"cloud", "run", "-h"}, - expected: false, - }, - { - name: "cloud command with short help in front", - args: []string{"-h", "cloud"}, - expected: false, - }, - { - name: "flag before command", - args: []string{"-v", "cloud", "script.js"}, - expected: true, - }, - { - name: "verbose flag before command", - args: []string{"--verbose", "cloud", "script.js"}, - expected: true, - }, - { - name: "cloud run with flag in the middle", - args: []string{"cloud", "-v", "cloud", "archive.tar"}, - expected: true, - }, { name: "cloud upload command", args: []string{"cloud", "upload", "script.js"}, @@ -451,7 +326,18 @@ func TestIsAnalysisRequired(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - actual := isAnalysisRequired(tc.args) + args := append([]string{"k6"}, tc.args...) + ts := tests.NewGlobalTestState(t) + ts.CmdArgs = args + rootCommand := newRootCommand(ts.GlobalState) + + // find the command to be executed + cmd, _, err := rootCommand.cmd.Find(tc.args) + if err != nil { + t.Fatalf("parsing args %v", err) + } + + actual := isAnalysisRequired(cmd) assert.Equal(t, tc.expected, actual) }) } diff --git a/internal/cmd/root.go b/internal/cmd/root.go index bd6bfe41590..43259f31ee0 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -43,12 +43,20 @@ type rootCommand struct { stopLoggersCh chan struct{} loggersWg sync.WaitGroup loggerIsRemote bool + launcher *launcher } +// creates a root command with a default launcher func newRootCommand(gs *state.GlobalState) *rootCommand { + return newRootWithLauncher(gs, newLauncher(gs)) +} + +// creates a root command with a launcher. Used to facilitate testing +func newRootWithLauncher(gs *state.GlobalState, l *launcher) *rootCommand { c := &rootCommand{ globalState: gs, stopLoggersCh: make(chan struct{}), + launcher: l, } // the base command when called without any subcommands. rootCmd := &cobra.Command{ @@ -89,13 +97,24 @@ func newRootCommand(gs *state.GlobalState) *rootCommand { return c } -func (c *rootCommand) persistentPreRunE(_ *cobra.Command, _ []string) error { +func (c *rootCommand) persistentPreRunE(cmd *cobra.Command, args []string) error { err := c.setupLoggers(c.stopLoggersCh) if err != nil { return err } + c.globalState.Logger.Debugf("k6 version: v%s", fullVersion()) - return nil + + // If binary provisioning is not enabled, continue with the regular k6 execution path + if !c.globalState.Flags.BinaryProvisioning { + c.globalState.Logger.Debug("Binary Provisioning feature is disabled.") + return nil + } + + c.globalState.Logger. + Debug("Binary Provisioning feature is enabled.") + + return c.launcher.launch(cmd, args) } func (c *rootCommand) execute() { From 4cc25dc068fa15d873bd49c772880250f7c2a38a Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Tue, 20 May 2025 18:25:47 +0200 Subject: [PATCH 127/136] refactor provisioning into an interface Signed-off-by: Pablo Chacin --- internal/cmd/launcher.go | 45 ++++++++++++++++++++--------------- internal/cmd/launcher_test.go | 25 ++++++++++++------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index c081845b128..fe57c9de933 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -37,25 +37,24 @@ type customBinary struct { path string } +// provider defines the interface for provisioning a custom k6 binary for a set of dependencies +type provider interface { + provision(k6deps.Dependencies) (commandExecutor, error) +} + // launcher is a k6 launcher. It analyses the requirements of a k6 execution, // then if required, it provisions a binary executor to satisfy the requirements. type launcher struct { - // gs is the global state of k6. - gs *state.GlobalState - - // provision generates a custom binary from the received list of dependencies - // with their constrains, and it returns an executor that satisfies them. - provision func(*state.GlobalState, k6deps.Dependencies) (commandExecutor, error) - - // commandExecutor executes the requested k6 command line command + gs *state.GlobalState + provider provider commandExecutor commandExecutor } // newLauncher creates a new Launcher from a GlobalState using the default provision function func newLauncher(gs *state.GlobalState) *launcher { return &launcher{ - gs: gs, - provision: k6buildProvision, + gs: gs, + provider: newK6BuildProvider(gs), } } @@ -95,7 +94,7 @@ func (l *launcher) launch(cmd *cobra.Command, args []string) error { " The current k6 binary doesn't satisfy all dependencies, it's required to" + " provision a custom binary.") - customBinary, err := l.provision(l.gs, deps) + customBinary, err := l.provider.provision(deps) if err != nil { l.gs.Logger. WithError(err). @@ -208,11 +207,19 @@ func isCustomBuildRequired(baseK6Version string, deps k6deps.Dependencies) bool return !k6Dependency.Constraints.Check(k6Ver) } -// k6buildProvision returns the path to a k6 binary that satisfies the dependencies and the list of versions it provides -func k6buildProvision(gs *state.GlobalState, deps k6deps.Dependencies) (commandExecutor, error) { - token, err := extractToken(gs) +// k6buildProvider provides a k6 binary that satisfies the dependencies using the k6build service +type k6buildProvider struct { + gs *state.GlobalState +} + +func newK6BuildProvider(gs *state.GlobalState) provider { + return &k6buildProvider{gs: gs} +} + +func (p *k6buildProvider) provision(deps k6deps.Dependencies) (commandExecutor, error) { + token, err := extractToken(p.gs) if err != nil { - gs.Logger.WithError(err).Debug("Failed to get a valid token") + p.gs.Logger.WithError(err).Debug("Failed to get a valid token") } if token == "" { @@ -221,9 +228,9 @@ func k6buildProvision(gs *state.GlobalState, deps k6deps.Dependencies) (commandE } config := k6provider.Config{ - BuildServiceURL: gs.Flags.BuildServiceURL, + BuildServiceURL: p.gs.Flags.BuildServiceURL, BuildServiceAuth: token, - BinaryCacheDir: gs.Flags.BinaryCache, + BinaryCacheDir: p.gs.Flags.BinaryCache, } provider, err := k6provider.NewProvider(config) @@ -231,12 +238,12 @@ func k6buildProvision(gs *state.GlobalState, deps k6deps.Dependencies) (commandE return nil, err } - binary, err := provider.GetBinary(gs.Ctx, deps) + binary, err := provider.GetBinary(p.gs.Ctx, deps) if err != nil { return nil, err } - gs.Logger. + p.gs.Logger. Info("A new k6 binary has been provisioned with version(s): ", formatDependencies(binary.Dependencies)) return &customBinary{binary.Path}, nil diff --git a/internal/cmd/launcher_test.go b/internal/cmd/launcher_test.go index eb5317b3d21..a4a900d689a 100644 --- a/internal/cmd/launcher_test.go +++ b/internal/cmd/launcher_test.go @@ -30,6 +30,17 @@ func (m *mockExecutor) run(_ *state.GlobalState) error { return m.err } +type mockProvider struct { + invoked bool + executor commandExecutor + err error +} + +func (m *mockProvider) provision(_ k6deps.Dependencies) (commandExecutor, error) { + m.invoked = true + return m.executor, m.err +} + const ( fakerTest = ` import { Faker } from "k6/x/faker"; @@ -222,15 +233,11 @@ func TestLauncherLaunch(t *testing.T) { cmdExecutor := mockExecutor{err: tc.k6ExecutorErr} - // mock launcher's provision function recording the invocation and - // returning the mock command executor - provisionCalled := false + // use a provider returning the mock command executor + provider := mockProvider{executor: &cmdExecutor, err: tc.provisionError} launcher := &launcher{ - gs: ts.GlobalState, - provision: func(_ *state.GlobalState, _ k6deps.Dependencies) (commandExecutor, error) { - provisionCalled = true - return &cmdExecutor, tc.provisionError - }, + gs: ts.GlobalState, + provider: &provider, } rootCommand := newRootWithLauncher(ts.GlobalState, launcher) @@ -251,7 +258,7 @@ func TestLauncherLaunch(t *testing.T) { // TODO: check error rootCommand.execute() - assert.Equal(t, tc.expectProvision, provisionCalled) + assert.Equal(t, tc.expectProvision, provider.invoked) assert.Equal(t, tc.expectCmdRunE, runECalled) assert.Equal(t, tc.expectK6Run, cmdExecutor.invoked) }) From 9846eaf3d67d913f71361b384d2e9d6a3cc2fc59 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 22 May 2025 13:56:49 +0200 Subject: [PATCH 128/136] use loadsurce to read source file Signed-off-by: Pablo Chacin --- go.mod | 2 +- go.sum | 4 +- internal/cmd/launcher.go | 45 ++-- vendor/github.com/grafana/k6deps/analyze.go | 225 ++++++++---------- vendor/github.com/grafana/k6deps/archive.go | 18 +- .../grafana/k6deps/internal/pack/pack.go | 32 ++- .../internal/pack/plugins/file/plugin.go | 105 ++++++++ .../grafana/k6deps/internal/rootfs/rootfs.go | 62 +++++ vendor/github.com/grafana/k6deps/options.go | 201 +++++++++------- vendor/modules.txt | 4 +- 10 files changed, 444 insertions(+), 254 deletions(-) create mode 100644 vendor/github.com/grafana/k6deps/internal/pack/plugins/file/plugin.go create mode 100644 vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go diff --git a/go.mod b/go.mod index 7e050c83fda..18e2b4135d1 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 - github.com/grafana/k6deps v0.2.6 + github.com/grafana/k6deps v0.3.0 github.com/grafana/k6provider v0.1.15 github.com/grafana/sobek v0.0.0-20250320150027-203dc85b6d98 github.com/grafana/xk6-dashboard v0.7.10 diff --git a/go.sum b/go.sum index ebfe4b1c45e..e3a5e3c13ed 100644 --- a/go.sum +++ b/go.sum @@ -85,8 +85,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grafana/k6build v0.5.11 h1:nuYV5DOMz5PEU8/XFRcDcfgzxUlLujeYNkU7NVEbdfc= github.com/grafana/k6build v0.5.11/go.mod h1:SA6/5cnnCLQ99IpFrqVfcuO+SxCRo/yLGtcnj3bfpII= -github.com/grafana/k6deps v0.2.6 h1:T9t5pGnL4697SJ6fCF36fNCNSFSH/kDBI9Do/W+5TqA= -github.com/grafana/k6deps v0.2.6/go.mod h1:y+pBsBemOJHML6ObuJFVgcNgO9RSfRvBklltI194aTE= +github.com/grafana/k6deps v0.3.0 h1:jmI+miMW28hfteRhLvtzERbjJ1+JVK/b3V3spo3dghY= +github.com/grafana/k6deps v0.3.0/go.mod h1:31pACKFJApQMMcu4hb4N3ti+Kz4s6PomUR63Y6S0bWM= github.com/grafana/k6foundry v0.4.6 h1:fFgR72Pw0dzo8wVWyggu35SGGjdt31Dktil1bDE1MCM= github.com/grafana/k6foundry v0.4.6/go.mod h1:eLsr0whhH+5Y1y7YpDxJi3Jv5wHMuf+80vdRyMH10pg= github.com/grafana/k6provider v0.1.15 h1:aUStpqDMEnEL9aGCcSKmpcreHRZsr8IELna+ttKMOYI= diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index fe57c9de933..36e6acbac64 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "strings" "syscall" @@ -18,11 +19,6 @@ import ( "go.k6.io/k6/internal/build" ) -var ( - errScriptNotFound = errors.New("script not found") - errUnsupportedFeature = errors.New("not supported") -) - // commandExecutor executes the requested k6 command line command. // It abstract the execution path from the concrete binary. type commandExecutor interface { @@ -71,7 +67,7 @@ func (l *launcher) launch(cmd *cobra.Command, args []string) error { return nil } - deps, err := analyze(l.gs, args) + deps, err := analyze(l.gs, cmd, args) if err != nil { l.gs.Logger. WithError(err). @@ -277,37 +273,32 @@ func extractToken(gs *state.GlobalState) (string, error) { // Presently, only the k6 input script or archive (if any) is passed to k6deps for scanning. // TODO: if k6 receives the input from stdin, it is not used for scanning because we don't know // if it is a script or an archive -func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) { +func analyze(gs *state.GlobalState, _ *cobra.Command, args []string) (k6deps.Dependencies, error) { dopts := &k6deps.Options{ LookupEnv: func(key string) (string, bool) { v, ok := gs.Env[key]; return v, ok }, Manifest: k6deps.Source{Ignore: true}, } - if len(args) == 0 { - gs.Logger. - Debug("The command did not receive an input script.") - return nil, errScriptNotFound - } - - scriptname := args[0] - if scriptname == "-" { - gs.Logger. - Debug("Test script provided by Stdin is not yet supported from Binary provisioning feature.") - return nil, errUnsupportedFeature + if len(args) < 1 { + return nil, fmt.Errorf("k6 needs at least one argument to load the test") } - if _, err := gs.FS.Stat(scriptname); err != nil { - gs.Logger. - WithField("path", scriptname). - WithError(err). - Debug("The requested test script's file is not available on the file system.") - return nil, errScriptNotFound + sourceRootPath := args[0] + gs.Logger.Debugf("Resolving and reading test '%s'...", sourceRootPath) + src, _, pwd, err := readSource(gs, sourceRootPath) + if err != nil { + return nil, err } - if strings.HasSuffix(scriptname, ".tar") { - dopts.Archive.Name = scriptname + if strings.HasSuffix(sourceRootPath, ".tar") { + dopts.Archive.Contents = src.Data } else { - dopts.Script.Name = scriptname + if !filepath.IsAbs(sourceRootPath) { + sourceRootPath = filepath.Join(pwd, sourceRootPath) + } + dopts.Script.Name = sourceRootPath + dopts.Script.Contents = src.Data + dopts.Fs = gs.FS } return k6deps.Analyze(dopts) diff --git a/vendor/github.com/grafana/k6deps/analyze.go b/vendor/github.com/grafana/k6deps/analyze.go index 73eeabfd182..783f90a6cf1 100644 --- a/vendor/github.com/grafana/k6deps/analyze.go +++ b/vendor/github.com/grafana/k6deps/analyze.go @@ -4,173 +4,154 @@ import ( "bytes" "encoding/json" "errors" - "os" + "io" ) -// Analyze searches, loads and analyzes the specified sources, -// extracting the k6 extensions and their version constraints. -// Note: if archive is specified, the other three sources will not be taken into account, -// since the archive may contain them. -func Analyze(opts *Options) (Dependencies, error) { - if !opts.Archive.Ignore && !opts.Archive.IsEmpty() { - return archiveAnalizer(opts.Archive)() - } - - // if the manifest is not provided, we try to find it - // if not found, it will be empty and ignored by the analyzer - if !opts.Manifest.Ignore && opts.Manifest.IsEmpty() { - if err := opts.setManifest(); err != nil { - return nil, err - } - } +// analyzer defines the interface for a dependency analyzer +type analyzer interface { + analyze() (Dependencies, error) +} - if !opts.Script.Ignore { - if err := loadScript(opts); err != nil { - return nil, err - } - } +// emptyAnalyzer returns empty Dependencies +type emptyAnalyzer struct{} - if !opts.Env.Ignore { - loadEnv(opts) - } +func newEmptyAnalyzer() analyzer { + return &emptyAnalyzer{} +} - return mergeAnalyzers( - scriptAnalyzer(opts.Script), - manifestAnalyzer(opts.Manifest), - envAnalyzer(opts.Env), - )() +func (e *emptyAnalyzer) analyze() (Dependencies, error) { + return make(Dependencies), nil } -type analyzer func() (Dependencies, error) +type manifestAnalyzer struct { + src io.ReadCloser +} -func empty() (Dependencies, error) { - return make(Dependencies), nil +func newManifestAnalyzer(src io.ReadCloser) analyzer { + return &manifestAnalyzer{src: src} } -func filterInvalid(from Dependencies) Dependencies { - deps := make(Dependencies) +func (m *manifestAnalyzer) analyze() (Dependencies, error) { + defer m.src.Close() //nolint:errcheck - for name, dep := range from { - if reName.MatchString(name) { - deps[name] = dep - } + var manifest struct { + Dependencies Dependencies `json:"dependencies,omitempty"` } - return deps -} + err := json.NewDecoder(m.src).Decode(&manifest) -func manifestAnalyzer(src Source) analyzer { - if src.IsEmpty() { - return empty + if err == nil { + return filterInvalid(manifest.Dependencies), nil } - return func() (Dependencies, error) { - reader, closer, err := src.contentReader() + if errors.Is(err, io.EOF) { + return make(Dependencies), nil + } - // we tolerate the manifest file not existing - if errors.Is(err, os.ErrNotExist) { //nolint:forbidigo - return make(Dependencies), nil - } + return nil, err +} - if err != nil { - return nil, err - } - defer closer() //nolint:errcheck +type scriptAnalyzer struct { + src io.ReadCloser +} - var manifest struct { - Dependencies Dependencies `json:"dependencies,omitempty"` - } +func newScriptAnalyzer(src io.ReadCloser) analyzer { + return &scriptAnalyzer{src: src} +} - err = json.NewDecoder(reader).Decode(&manifest) - if err != nil { - return nil, err - } +func (s *scriptAnalyzer) analyze() (Dependencies, error) { + var deps Dependencies + defer s.src.Close() //nolint:errcheck - return filterInvalid(manifest.Dependencies), nil + buffer := new(bytes.Buffer) + if _, err := buffer.ReadFrom(s.src); err != nil { + return nil, err } -} -func scriptAnalyzer(src Source) analyzer { - if src.IsEmpty() { - return empty + if err := (&deps).UnmarshalJS(buffer.Bytes()); err != nil { + return nil, err } - return func() (Dependencies, error) { - var deps Dependencies + return deps, nil +} - reader, closer, err := src.contentReader() - if err != nil { - return nil, err - } - defer closer() //nolint:errcheck +// textAnalyzer analyzes dependencies from a text format +type textAnalyzer struct { + src io.ReadCloser +} - buffer := new(bytes.Buffer) - _, err = buffer.ReadFrom(reader) - if err != nil { - return nil, err - } +func newTextAnalyzer(src io.ReadCloser) analyzer { + return &textAnalyzer{src: src} +} - if err := (&deps).UnmarshalJS(buffer.Bytes()); err != nil { - return nil, err - } +func (e *textAnalyzer) analyze() (Dependencies, error) { + var deps Dependencies + content := &bytes.Buffer{} + _, err := content.ReadFrom(e.src) + if err != nil { + return nil, err + } - return deps, nil + if content.Len() == 0 { + return make(Dependencies), nil } -} -func envAnalyzer(src Source) analyzer { - if len(src.Contents) == 0 { - return empty + if err := (&deps).UnmarshalText(content.Bytes()); err != nil { + return nil, err } - return func() (Dependencies, error) { - var deps Dependencies + return filterInvalid(deps), nil +} - if err := (&deps).UnmarshalText(src.Contents); err != nil { - return nil, err - } +// archiveAnalizer analizes a k6 archive in .tar format +type archiveAnalizer struct { + src io.ReadCloser +} - return filterInvalid(deps), nil - } +func newArchiveAnalyzer(src io.ReadCloser) analyzer { + return &archiveAnalizer{src: src} } -func archiveAnalizer(src Source) analyzer { - if src.IsEmpty() { - return empty - } +func (a *archiveAnalizer) analyze() (Dependencies, error) { + defer a.src.Close() //nolint:errcheck - return func() (Dependencies, error) { - input := src.Reader - if input == nil { - tar, err := os.Open(src.Name) //nolint:forbidigo - if err != nil { - return nil, err - } - defer tar.Close() //nolint:errcheck + return processArchive(a.src) +} - input = tar - } +type mergeAnalyzer struct { + analyzers []analyzer +} - return processArchive(input) - } +func newMergeAnalyzer(analyzers ...analyzer) analyzer { + return &mergeAnalyzer{analyzers: analyzers} } -func mergeAnalyzers(sources ...analyzer) analyzer { - return func() (Dependencies, error) { - deps := make(Dependencies) +func (m *mergeAnalyzer) analyze() (Dependencies, error) { + deps := make(Dependencies) - for _, src := range sources { - dep, err := src() - if err != nil { - return nil, err - } + for _, a := range m.analyzers { + dep, err := a.analyze() + if err != nil { + return nil, err + } - err = deps.Merge(dep) - if err != nil { - return nil, err - } + err = deps.Merge(dep) + if err != nil { + return nil, err } + } + + return deps, nil +} - return deps, nil +func filterInvalid(from Dependencies) Dependencies { + deps := make(Dependencies) + + for name, dep := range from { + if reName.MatchString(name) { + deps[name] = dep + } } + + return deps } diff --git a/vendor/github.com/grafana/k6deps/archive.go b/vendor/github.com/grafana/k6deps/archive.go index 4ef101aecd5..653cc026140 100644 --- a/vendor/github.com/grafana/k6deps/archive.go +++ b/vendor/github.com/grafana/k6deps/archive.go @@ -2,6 +2,7 @@ package k6deps import ( "archive/tar" + "bytes" "encoding/json" "errors" "io" @@ -51,13 +52,8 @@ func processArchive(input io.Reader) (Dependencies, error) { } // analize the file content as an script - target := filepath.Clean(filepath.FromSlash(header.Name)) - src := Source{ - Name: target, - Reader: io.LimitReader(reader, maxFileSize), - } - - d, err := scriptAnalyzer(src)() + src := io.NopCloser(io.LimitReader(reader, maxFileSize)) + d, err := newScriptAnalyzer(src).analyze() if err != nil { return nil, err } @@ -84,12 +80,8 @@ func analizeMetadata(input io.Reader) (Dependencies, error) { } if value, found := metadata.Env[EnvDependencies]; found { - src := Source{ - Name: EnvDependencies, - Contents: []byte(value), - } - - return envAnalyzer(src)() + content := bytes.NewBuffer([]byte(value)) + return newTextAnalyzer(io.NopCloser(content)).analyze() } return Dependencies{}, nil diff --git a/vendor/github.com/grafana/k6deps/internal/pack/pack.go b/vendor/github.com/grafana/k6deps/internal/pack/pack.go index 3bdf891d184..e09ed579b4b 100644 --- a/vendor/github.com/grafana/k6deps/internal/pack/pack.go +++ b/vendor/github.com/grafana/k6deps/internal/pack/pack.go @@ -4,14 +4,17 @@ package pack import ( "encoding/json" + "os" "path/filepath" "text/scanner" "time" "github.com/evanw/esbuild/pkg/api" + "github.com/grafana/k6deps/internal/pack/plugins/file" "github.com/grafana/k6deps/internal/pack/plugins/http" "github.com/grafana/k6deps/internal/pack/plugins/k6" + "github.com/grafana/k6deps/internal/rootfs" ) // Metadata holds k6 related metadata, emitted under "k6" key of Metafile. @@ -26,6 +29,7 @@ type packError struct { // Options used to specify transform/build options. type Options struct { + FS rootfs.FS Directory string Filename string Timeout time.Duration @@ -57,20 +61,44 @@ func (o *Options) loaderType() api.Loader { return api.LoaderJS } +func (o *Options) fs() (rootfs.FS, error) { + if o.FS != nil { + return o.FS, nil + } + + if len(o.Directory) > 0 { + return rootfs.NewFromDir(o.Directory) + } + + wdir, err := os.Getwd() //nolint:forbidigo + if err != nil { + return nil, err + } + + return rootfs.NewFromDir(wdir) +} + // Pack gathers dependencies and transforms TypeScript/JavaScript sources into single k6 compatible JavaScript test // script. func Pack(source string, opts *Options) ([]byte, *Metadata, error) { + fs, err := opts.fs() + if err != nil { + return nil, nil, err + } + result := api.Build(api.BuildOptions{ //nolint:exhaustruct Stdin: opts.stdinOptions(source), Bundle: true, LogLevel: api.LogLevelSilent, Sourcemap: api.SourceMapNone, SourceRoot: opts.SourceRoot, - Plugins: []api.Plugin{http.New(), k6.New()}, + Plugins: []api.Plugin{http.New(), k6.New(), file.New(fs)}, External: opts.Externals, Metafile: true, + // esbuild makes all relative paths in the code absolute by joining this working dir + // we must pass this from the fs. Otherwise pack uses the CWD + AbsWorkingDir: fs.Root(), }) - if has, err := checkError(&result); has { return nil, nil, err } diff --git a/vendor/github.com/grafana/k6deps/internal/pack/plugins/file/plugin.go b/vendor/github.com/grafana/k6deps/internal/pack/plugins/file/plugin.go new file mode 100644 index 00000000000..7d8d35e952b --- /dev/null +++ b/vendor/github.com/grafana/k6deps/internal/pack/plugins/file/plugin.go @@ -0,0 +1,105 @@ +// Package file contains esbuild file plugin. +package file + +import ( + "io" + "path/filepath" + + "github.com/evanw/esbuild/pkg/api" + "github.com/grafana/k6deps/internal/rootfs" +) + +const ( + pluginName = "file" +) + +var loaderByExtension = map[string]api.Loader{ //nolint:gochecknoglobals + ".js": api.LoaderJS, + ".json": api.LoaderJSON, + ".txt": api.LoaderText, + ".ts": api.LoaderTS, +} + +type plugin struct { + fs rootfs.FS + resolve func(path string, options api.ResolveOptions) api.ResolveResult + options *api.BuildOptions +} + +// New creates new http plugin instance. +func New(fs rootfs.FS) api.Plugin { + plugin := &plugin{ + fs: fs, + } + + return api.Plugin{ + Name: pluginName, + Setup: plugin.setup, + } +} + +func (plugin *plugin) setup(build api.PluginBuild) { + plugin.resolve = build.Resolve + plugin.options = build.InitialOptions + + build.OnResolve(api.OnResolveOptions{Filter: ".*", Namespace: "file"}, plugin.onResolve) + build.OnLoad(api.OnLoadOptions{Filter: ".*", Namespace: "file"}, plugin.onLoad) +} + +func (plugin *plugin) load(path string) (*api.OnLoadResult, error) { + file, err := plugin.fs.Open(path) + if err != nil { + return nil, err + } + defer file.Close() //nolint:errcheck + + bytes, err := io.ReadAll(file) + if err != nil { + return nil, err + } + + contents := string(bytes) + + // FIXME: what happens if the extension is not supported? + var loader api.Loader + if ldr, ok := loaderByExtension[filepath.Ext(path)]; ok { + loader = ldr + } + + return &api.OnLoadResult{ + Contents: &contents, + PluginName: pluginName, + Loader: loader, + }, + nil +} + +func (plugin *plugin) onLoad(args api.OnLoadArgs) (api.OnLoadResult, error) { + loadResult, err := plugin.load(args.Path) + if err != nil { + return onLoadError(args, err) + } + + return *loadResult, nil +} + +func onLoadError(_ api.OnLoadArgs, err error) (api.OnLoadResult, error) { + return api.OnLoadResult{}, err +} + +func newOnResolveResult(path string) api.OnResolveResult { + return api.OnResolveResult{ + Namespace: "file", + Path: path, + } +} + +func (plugin *plugin) onResolve(args api.OnResolveArgs) (api.OnResolveResult, error) { + path := args.Path + + if !filepath.IsAbs(path) { + path = filepath.Join(filepath.Dir(args.Importer), path) + } + + return newOnResolveResult(path), nil +} diff --git a/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go b/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go new file mode 100644 index 00000000000..d3d3224ab46 --- /dev/null +++ b/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go @@ -0,0 +1,62 @@ +// Package rootfs implements extensions to go's fs.FS to work around its limitations +package rootfs + +import ( + "errors" + "fmt" + "io/fs" + "path/filepath" + "strings" + + "github.com/spf13/afero" +) + +var ErrInvalidPath = errors.New("invalid path") //nolint:revive + +// FS defines an interface that extends go's fs.FS with a mechanism for working with absolute paths +type FS interface { + // Opens a File given its path. Path can be absolute or relative. + // If path is relative, it is joined to the root to get the effective path. + // The path must be within the FS's root directory + Open(path string) (fs.File, error) + // returns FS's root dir + Root() string +} + +type rootFS struct { + afero.Fs + root string +} + +// NewFromDir create a rootFS from a root directory. The root must be an absolute path +func NewFromDir(root string) (FS, error) { + if !filepath.IsAbs(root) { + return nil, fmt.Errorf("%w: %q is not absolute", ErrInvalidPath, root) + } + + return &rootFS{ + Fs: afero.NewOsFs(), + root: root, + }, nil +} + +func (f *rootFS) Root() string { + return f.root +} + +func (f *rootFS) Open(path string) (fs.File, error) { + if !filepath.IsAbs(path) { + path = filepath.Join(f.root, path) + } + // check if the path is outside the root + if !strings.HasPrefix(path, f.root) { + return nil, &fs.PathError{Path: path, Err: fs.ErrNotExist} + } + + return f.Fs.Open(filepath.Clean(path)) +} + +// NewFromFS return a FS from a FS +func NewFromFS(root string, fs afero.Fs) FS { + return &rootFS{root: root, Fs: fs} +} diff --git a/vendor/github.com/grafana/k6deps/options.go b/vendor/github.com/grafana/k6deps/options.go index 8fa14f97c11..904f222e549 100644 --- a/vendor/github.com/grafana/k6deps/options.go +++ b/vendor/github.com/grafana/k6deps/options.go @@ -2,16 +2,19 @@ package k6deps import ( "bytes" - "errors" "io" "os" - "path/filepath" + + "github.com/spf13/afero" "github.com/grafana/k6deps/internal/pack" + "github.com/grafana/k6deps/internal/rootfs" ) -// EnvDependencies holds the name of the environment variable thet describes additional dependencies. -const EnvDependencies = "K6_DEPENDENCIES" +const ( + // EnvDependencies holds the name of the environment variable that describes additional dependencies. + EnvDependencies = "K6_DEPENDENCIES" +) // Source describes a generic dependency source. // Such a source can be the k6 script, the manifest file, or an environment variable (e.g. K6_DEPENDENCIES). @@ -19,7 +22,7 @@ type Source struct { // Name contains the name of the source (file, environment variable, etc.). Name string // Reader provides streaming access to the source content as an alternative to Contents. - Reader io.Reader + Reader io.ReadCloser // Contents contains the content of the source (e.g. script) Contents []byte // Ignore disables automatic search and processing of that source. @@ -31,33 +34,6 @@ func (s *Source) IsEmpty() bool { return len(s.Contents) == 0 && s.Reader == nil && len(s.Name) == 0 } -func nopCloser() error { - return nil -} - -// contentReader returns a reader for the source content. -func (s *Source) contentReader() (io.Reader, func() error, error) { - if s.Reader != nil { - return s.Reader, nopCloser, nil - } - - if len(s.Contents) > 0 { - return bytes.NewReader(s.Contents), nopCloser, nil - } - - fileName, err := filepath.Abs(s.Name) - if err != nil { - return nil, nil, err - } - - file, err := os.Open(filepath.Clean(fileName)) //nolint:forbidigo - if err != nil { - return nil, nil, err - } - - return file, file.Close, nil -} - // Options contains the parameters of the dependency analysis. type Options struct { // Script contains the properties of the k6 test script to be analyzed. @@ -81,14 +57,12 @@ type Options struct { Env Source // LookupEnv function is used to query the value of the environment variable // specified in the Env option Name if the Contents of the Env option is empty. - // If empty, os.LookupEnv will be used. + // If not provided, os.LookupEnv will be used. LookupEnv func(key string) (value string, ok bool) - // FindManifest function is used to find manifest file for the given script file - // if the Contents of Manifest option is empty. - // If the scriptfile parameter is empty, FindManifest starts searching - // for the manifest file from the current directory - // If missing, the closest manifest file will be used. - FindManifest func(scriptfile string) (filename string, ok bool, err error) + // Fs is the file system to use for accessing files. If not provided, os file system is used + Fs afero.Fs + // Root directory for searching for files. Must an absolute path. If omitted, CWD is used + RootDir string } func (opts *Options) lookupEnv(key string) (string, bool) { @@ -99,85 +73,140 @@ func (opts *Options) lookupEnv(key string) (string, bool) { return os.LookupEnv(key) //nolint:forbidigo } -func loadScript(opts *Options) error { - if len(opts.Script.Name) == 0 || len(opts.Script.Contents) > 0 || opts.Script.Ignore { - return nil +// returns the FS to use with this options +func (opts *Options) fs() (rootfs.FS, error) { + var err error + + dir := opts.RootDir + if dir == "" { + dir, err = os.Getwd() //nolint:forbidigo + if err != nil { + return nil, err + } } - scriptfile, err := filepath.Abs(opts.Script.Name) - if err != nil { - return err + if opts.Fs == nil { + return rootfs.NewFromDir(dir) } - contents, err := os.ReadFile(scriptfile) //nolint:forbidigo,gosec - if err != nil { - return err + return rootfs.NewFromFS(dir, opts.Fs), nil +} + +// Analyze searches, loads and analyzes the specified sources, +// extracting the k6 extensions and their version constraints. +// Note: if archive is specified, the other three sources will not be taken into account, +// since the archive may contain them. +func Analyze(opts *Options) (Dependencies, error) { + var err error + + if !opts.Archive.Ignore && !opts.Archive.IsEmpty() { + archiveAnalyzer, err := opts.archiveAnalyzer() + if err != nil { + return nil, err + } + return archiveAnalyzer.analyze() } - script, _, err := pack.Pack(string(contents), &pack.Options{Filename: scriptfile}) + manifestAnalyzer, err := opts.manifestAnalyzer() if err != nil { - return err + return nil, err } - opts.Script.Name = scriptfile - opts.Script.Contents = script + scriptAnalyzeer, err := opts.scriptAnalyzer() + if err != nil { + return nil, err + } - return nil + return newMergeAnalyzer(scriptAnalyzeer, manifestAnalyzer, opts.envAnalyzer()).analyze() } -func loadEnv(opts *Options) { - if len(opts.Env.Contents) > 0 || opts.Env.Ignore { - return +// scriptAnalyzer loads a script Source and alls its dependencies into the Script's content +// from either a file of a reader +func (opts *Options) scriptAnalyzer() (analyzer, error) { + source, err := opts.loadSource(&opts.Script) + if err != nil { + return nil, err } + defer source.Close() //nolint:errcheck - key := opts.Env.Name - if len(key) == 0 { - key = EnvDependencies + contents := &bytes.Buffer{} + _, err = contents.ReadFrom(source) + if err != nil { + return nil, err } - value, found := opts.lookupEnv(key) - if !found || len(value) == 0 { - return + fs, err := opts.fs() + if err != nil { + return nil, err + } + script, _, err := pack.Pack(contents.String(), &pack.Options{FS: fs, Filename: opts.Script.Name}) + if err != nil { + return nil, err } - opts.Env.Name = key - opts.Env.Contents = []byte(value) + return newScriptAnalyzer(io.NopCloser(bytes.NewReader(script))), nil } -func (opts *Options) setManifest() error { - // if the manifest is not provided, we try to find it - // starting from the location of the script - path, found, err := findManifest(opts.Script.Name) +func (opts *Options) manifestAnalyzer() (analyzer, error) { + source, err := opts.loadSource(&opts.Manifest) if err != nil { - return err + return nil, err } - if found { - opts.Manifest.Name = path + + return newManifestAnalyzer(source), nil +} + +func (opts *Options) archiveAnalyzer() (analyzer, error) { + source, err := opts.loadSource(&opts.Archive) + if err != nil { + return nil, err } - return nil + return newArchiveAnalyzer(source), nil } -func findManifest(filename string) (string, bool, error) { - if len(filename) == 0 { - filename = "any_file" +func (opts *Options) loadSource(s *Source) (io.ReadCloser, error) { + var err error + if s.Ignore || s.IsEmpty() { + return io.NopCloser(bytes.NewReader(nil)), nil } - abs, err := filepath.Abs(filename) - if err != nil { - return "", false, err + if len(s.Contents) != 0 { + return io.NopCloser(bytes.NewReader(s.Contents)), nil } - for dir := filepath.Dir(abs); ; dir = filepath.Dir(dir) { - filename := filepath.Clean(filepath.Join(dir, "package.json")) - if _, err := os.Stat(filename); !errors.Is(err, os.ErrNotExist) { //nolint:forbidigo - return filename, err == nil, err + fs, err := opts.fs() + if err != nil { + return nil, err + } + reader := s.Reader + if reader == nil { + reader, err = fs.Open(s.Name) + if err != nil { + return nil, err } + } - if dir[len(dir)-1] == filepath.Separator { - break - } + return reader, nil +} + +func (opts *Options) envAnalyzer() analyzer { + if opts.Env.Ignore { + return newEmptyAnalyzer() + } + + if len(opts.Env.Contents) > 0 { + content := io.NopCloser(bytes.NewBuffer(opts.Env.Contents)) + return newTextAnalyzer(content) } - return "", false, nil + key := opts.Env.Name + if len(key) == 0 { + key = EnvDependencies + } + + value, _ := opts.lookupEnv(key) + + content := io.NopCloser(bytes.NewBuffer([]byte(value))) + return newTextAnalyzer(content) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 836cc974ebc..1df018609f4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -184,12 +184,14 @@ github.com/gorilla/websocket github.com/grafana/k6build github.com/grafana/k6build/pkg/api github.com/grafana/k6build/pkg/client -# github.com/grafana/k6deps v0.2.6 +# github.com/grafana/k6deps v0.3.0 ## explicit; go 1.23.0 github.com/grafana/k6deps github.com/grafana/k6deps/internal/pack +github.com/grafana/k6deps/internal/pack/plugins/file github.com/grafana/k6deps/internal/pack/plugins/http github.com/grafana/k6deps/internal/pack/plugins/k6 +github.com/grafana/k6deps/internal/rootfs # github.com/grafana/k6provider v0.1.15 ## explicit; go 1.23.0 github.com/grafana/k6provider From 34c9fcbc9bfaffe86ef5605ca9bef9a7af5e7949 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 22 May 2025 15:16:45 +0200 Subject: [PATCH 129/136] handle stdin Signed-off-by: Pablo Chacin --- internal/cmd/launcher.go | 10 ++++- internal/cmd/launcher_test.go | 69 +++++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 13 deletions(-) diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index 36e6acbac64..ca6b4e9cb86 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -120,7 +120,10 @@ func (b *customBinary) run(gs *state.GlobalState) error { // the subprocess detects the type of terminal cmd.Stderr = os.Stderr cmd.Stdout = os.Stdout - cmd.Stdin = os.Stdin + + // is we are here, it is possible that the analyze function read the stdin to analyse it + // and restored the content into gs.Stdin, so we pass it to the command + cmd.Stdin = gs.Stdin // Copy environment variables to the k6 process and skip binary provisioning feature flag to disable it. // If not disabled, then the executed k6 binary would enter an infinite loop, where it continuously @@ -290,6 +293,11 @@ func analyze(gs *state.GlobalState, _ *cobra.Command, args []string) (k6deps.Dep return nil, err } + // if sourceRooPath is stdin ('-') we need to preserve the content + if sourceRootPath == "-" { + gs.Stdin = bytes.NewBuffer(src.Data) + } + if strings.HasSuffix(sourceRootPath, ".tar") { dopts.Archive.Contents = src.Data } else { diff --git a/internal/cmd/launcher_test.go b/internal/cmd/launcher_test.go index a4a900d689a..6d5c7d515f8 100644 --- a/internal/cmd/launcher_test.go +++ b/internal/cmd/launcher_test.go @@ -1,6 +1,7 @@ package cmd import ( + "bytes" "errors" "fmt" "os" @@ -64,7 +65,7 @@ export default function() { ` requireUnsatisfiedK6Version = ` -"use k6 = v0.99" +"use k6 = v9.99" import { sleep, check } from 'k6'; @@ -189,16 +190,6 @@ func TestLauncherLaunch(t *testing.T) { expectK6Run: true, expectOsExit: 108, }, - { - name: "script in stdin (unsupported)", - k6Cmd: "cloud", - k6Args: []string{"-"}, - script: "", - expectProvision: false, - expectCmdRunE: false, - expectK6Run: false, - expectOsExit: -1, - }, } for _, tc := range testCases { @@ -255,7 +246,6 @@ func TestLauncherLaunch(t *testing.T) { return nil } - // TODO: check error rootCommand.execute() assert.Equal(t, tc.expectProvision, provider.invoked) @@ -265,6 +255,61 @@ func TestLauncherLaunch(t *testing.T) { } } +func TestStdin(t *testing.T) { + t.Parallel() + + k6Args := []string{"k6", "archive", "-"} + + ts := tests.NewGlobalTestState(t) + ts.CmdArgs = k6Args + + // k6deps uses os package to access files. So we need to use it in the global state + ts.FS = afero.NewOsFs() + + // NewGlobalTestState does not set the Binary provisioning flag even if we set + // the K6_BINARY_PROVISIONING variable in the global state, so we do it manually + ts.Flags.BinaryProvisioning = true + + // pass script using stdin + stdin := bytes.NewBuffer([]byte(requireUnsatisfiedK6Version)) + ts.Stdin = stdin + + // the exit code is checked by the TestGlobalState when the test ends + ts.ExpectedExitCode = 0 + + rootCommand := newRootCommand(ts.GlobalState) + cmdExecutor := mockExecutor{} + + // use a provider returning the mock command executor + provider := mockProvider{executor: &cmdExecutor} + launcher := &launcher{ + gs: ts.GlobalState, + provider: &provider, + } + + // override the rootCommand launcher + rootCommand.launcher = launcher + + // find the command to be executed + cmd, _, err := rootCommand.cmd.Find(k6Args[1:]) + if err != nil { + t.Fatalf("parsing args %v", err) + } + + // replace command's the RunE function by a mock that indicates if the command was executed + runECalled := false + cmd.RunE = func(_ *cobra.Command, _ []string) error { + runECalled = true + return nil + } + + rootCommand.execute() + + assert.Equal(t, true, provider.invoked) + assert.Equal(t, false, runECalled) + assert.Equal(t, true, cmdExecutor.invoked) +} + func TestIsAnalysisRequired(t *testing.T) { t.Parallel() testCases := []struct { From 96bfa9a911e3b29aa9855a8679ed6267b86e5872 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Tue, 17 Jun 2025 10:58:59 +0200 Subject: [PATCH 130/136] attend review comments Signed-off-by: Pablo Chacin --- internal/cmd/launcher.go | 11 ++++++----- internal/cmd/launcher_test.go | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index ca6b4e9cb86..5f78d259ada 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -67,7 +67,7 @@ func (l *launcher) launch(cmd *cobra.Command, args []string) error { return nil } - deps, err := analyze(l.gs, cmd, args) + deps, err := analyze(l.gs, args) if err != nil { l.gs.Logger. WithError(err). @@ -276,21 +276,22 @@ func extractToken(gs *state.GlobalState) (string, error) { // Presently, only the k6 input script or archive (if any) is passed to k6deps for scanning. // TODO: if k6 receives the input from stdin, it is not used for scanning because we don't know // if it is a script or an archive -func analyze(gs *state.GlobalState, _ *cobra.Command, args []string) (k6deps.Dependencies, error) { +func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) { dopts := &k6deps.Options{ LookupEnv: func(key string) (string, bool) { v, ok := gs.Env[key]; return v, ok }, Manifest: k6deps.Source{Ignore: true}, } if len(args) < 1 { - return nil, fmt.Errorf("k6 needs at least one argument to load the test") + return nil, fmt.Errorf("the invoked command needs a file path or pass the test via Stdin") } sourceRootPath := args[0] - gs.Logger.Debugf("Resolving and reading test '%s'...", sourceRootPath) + gs.Logger.WithField("source", "sourceRootPath"). + Debug("Launcher is resolving and reading the test") src, _, pwd, err := readSource(gs, sourceRootPath) if err != nil { - return nil, err + return nil, fmt.Errorf("reading source for analysis %w", err) } // if sourceRooPath is stdin ('-') we need to preserve the content diff --git a/internal/cmd/launcher_test.go b/internal/cmd/launcher_test.go index 6d5c7d515f8..63325b629b5 100644 --- a/internal/cmd/launcher_test.go +++ b/internal/cmd/launcher_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/grafana/k6deps" - "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "go.k6.io/k6/cmd/state" @@ -17,6 +16,7 @@ import ( "go.k6.io/k6/errext" "go.k6.io/k6/internal/build" "go.k6.io/k6/internal/cmd/tests" + "go.k6.io/k6/lib/fsext" ) // mockExecutor mocks commandExecutor @@ -213,7 +213,7 @@ func TestLauncherLaunch(t *testing.T) { ts.CmdArgs = k6Args // k6deps uses os package to access files. So we need to use it in the global state - ts.FS = afero.NewOsFs() + ts.FS = fsext.NewOsFs() // NewGlobalTestState does not set the Binary provisioning flag even if we set // the K6_BINARY_PROVISIONING variable in the global state, so we do it manually @@ -264,7 +264,7 @@ func TestStdin(t *testing.T) { ts.CmdArgs = k6Args // k6deps uses os package to access files. So we need to use it in the global state - ts.FS = afero.NewOsFs() + ts.FS = fsext.NewOsFs() // NewGlobalTestState does not set the Binary provisioning flag even if we set // the K6_BINARY_PROVISIONING variable in the global state, so we do it manually From a8582f022aa916017fa1e9c63a09d5641afd7e04 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Wed, 18 Jun 2025 20:06:14 +0200 Subject: [PATCH 131/136] fix comment Signed-off-by: Pablo Chacin --- internal/cmd/launcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index 5f78d259ada..2f3560ca0dc 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -121,7 +121,7 @@ func (b *customBinary) run(gs *state.GlobalState) error { cmd.Stderr = os.Stderr cmd.Stdout = os.Stdout - // is we are here, it is possible that the analyze function read the stdin to analyse it + // if we are here, it is possible that the analyze function read the stdin to analyse it // and restored the content into gs.Stdin, so we pass it to the command cmd.Stdin = gs.Stdin From 4918704af0d16839e56be8824ee0c652601e6387 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 19 Jun 2025 15:59:01 +0200 Subject: [PATCH 132/136] add fsext bridge Signed-off-by: Pablo Chacin --- lib/fsext/bridge.go | 27 +++++++++++++++++++++++++++ lib/fsext/bridge_test.go | 31 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 lib/fsext/bridge.go create mode 100644 lib/fsext/bridge_test.go diff --git a/lib/fsext/bridge.go b/lib/fsext/bridge.go new file mode 100644 index 00000000000..1184da8152c --- /dev/null +++ b/lib/fsext/bridge.go @@ -0,0 +1,27 @@ +package fsext + +import ( + "fmt" + "io/fs" +) + +// IOFSBridge allows an afero.Fs to implement the Go standard library io/fs.FS. +type IOFSBridge struct { + FSExt Fs +} + +// NewIOFSBridge returns an IOFSBridge from a Fs +func NewIOFSBridge(fs Fs) fs.FS { + return &IOFSBridge{ + FSExt: fs, + } +} + +// Open implements fs.Fs Open +func (b *IOFSBridge) Open(name string) (fs.File, error) { + f, err := b.FSExt.Open(name) + if err != nil { + return nil, fmt.Errorf("opening file %w", err) + } + return f, nil +} diff --git a/lib/fsext/bridge_test.go b/lib/fsext/bridge_test.go new file mode 100644 index 00000000000..02ae6fc8d11 --- /dev/null +++ b/lib/fsext/bridge_test.go @@ -0,0 +1,31 @@ +package fsext + +import ( + "io" + "io/fs" + "testing" + + "github.com/spf13/afero" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestBridgeOpen(t *testing.T) { + t.Parallel() + + testfs := afero.NewMemMapFs() + require.NoError(t, WriteFile(testfs, "abasicpath/onetwo.txt", []byte(`test123`), 0o644)) + + bridge := &IOFSBridge{FSExt: testfs} + + // it asserts that bridge implements io/fs.FS + goiofs := fs.FS(bridge) + f, err := goiofs.Open("abasicpath/onetwo.txt") + require.NoError(t, err) + require.NotNil(t, f) + + content, err := io.ReadAll(f) + require.NoError(t, err) + + assert.Equal(t, "test123", string(content)) +} From 4234f7e2f71c894a78ea28f2e0a64f27e01a9a46 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Thu, 19 Jun 2025 16:00:00 +0200 Subject: [PATCH 133/136] pass bridge to ksdeps Signed-off-by: Pablo Chacin --- go.mod | 2 +- go.sum | 4 +-- internal/cmd/launcher.go | 3 +- vendor/github.com/grafana/k6deps/README.md | 30 ++++++++++--------- vendor/github.com/grafana/k6deps/analyze.go | 20 +++++-------- .../github.com/grafana/k6deps/dependencies.go | 27 +++++++++++++++-- .../grafana/k6deps/internal/rootfs/rootfs.go | 29 +++++++++--------- vendor/github.com/grafana/k6deps/options.go | 25 ++++++++-------- vendor/modules.txt | 2 +- 9 files changed, 80 insertions(+), 62 deletions(-) diff --git a/go.mod b/go.mod index 18e2b4135d1..79147b282bc 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 - github.com/grafana/k6deps v0.3.0 + github.com/grafana/k6deps v0.4.0 github.com/grafana/k6provider v0.1.15 github.com/grafana/sobek v0.0.0-20250320150027-203dc85b6d98 github.com/grafana/xk6-dashboard v0.7.10 diff --git a/go.sum b/go.sum index e3a5e3c13ed..8938e6ea976 100644 --- a/go.sum +++ b/go.sum @@ -85,8 +85,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grafana/k6build v0.5.11 h1:nuYV5DOMz5PEU8/XFRcDcfgzxUlLujeYNkU7NVEbdfc= github.com/grafana/k6build v0.5.11/go.mod h1:SA6/5cnnCLQ99IpFrqVfcuO+SxCRo/yLGtcnj3bfpII= -github.com/grafana/k6deps v0.3.0 h1:jmI+miMW28hfteRhLvtzERbjJ1+JVK/b3V3spo3dghY= -github.com/grafana/k6deps v0.3.0/go.mod h1:31pACKFJApQMMcu4hb4N3ti+Kz4s6PomUR63Y6S0bWM= +github.com/grafana/k6deps v0.4.0 h1:YJ2xJyy3VM8/YWmCeX2vyoWzuq9dwdDTA5qCXIsnS0w= +github.com/grafana/k6deps v0.4.0/go.mod h1:31pACKFJApQMMcu4hb4N3ti+Kz4s6PomUR63Y6S0bWM= github.com/grafana/k6foundry v0.4.6 h1:fFgR72Pw0dzo8wVWyggu35SGGjdt31Dktil1bDE1MCM= github.com/grafana/k6foundry v0.4.6/go.mod h1:eLsr0whhH+5Y1y7YpDxJi3Jv5wHMuf+80vdRyMH10pg= github.com/grafana/k6provider v0.1.15 h1:aUStpqDMEnEL9aGCcSKmpcreHRZsr8IELna+ttKMOYI= diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index 2f3560ca0dc..359df8a2f5e 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -17,6 +17,7 @@ import ( "go.k6.io/k6/cloudapi" "go.k6.io/k6/cmd/state" "go.k6.io/k6/internal/build" + "go.k6.io/k6/lib/fsext" ) // commandExecutor executes the requested k6 command line command. @@ -307,7 +308,7 @@ func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) } dopts.Script.Name = sourceRootPath dopts.Script.Contents = src.Data - dopts.Fs = gs.FS + dopts.Fs = fsext.NewIOFSBridge(gs.FS) } return k6deps.Analyze(dopts) diff --git a/vendor/github.com/grafana/k6deps/README.md b/vendor/github.com/grafana/k6deps/README.md index 29046f16fc0..9ef3e739d26 100644 --- a/vendor/github.com/grafana/k6deps/README.md +++ b/vendor/github.com/grafana/k6deps/README.md @@ -15,19 +15,10 @@ k6deps is primarily used as a [go library](https://pkg.go.dev/github.com/grafana The command line tool can be integrated into other command line tools as a subcommand. For this purpose, the library also contains the functionality of the command line tool as a factrory function that returns [cobra.Command](https://pkg.go.dev/github.com/spf13/cobra#Command). -## Install - -Precompiled binaries can be downloaded and installed from the [Releases](https://github.com/grafana/k6deps/releases) page. - -If you have a go development environment, the installation can also be done with the following command: -``` -go install github.com/grafana/k6deps/cmd/k6deps@latest -``` +## Library Usage -## Usage - -Dependencies can come from three [sources](#sources): k6 test script, manifest file, `K6_DEPENDENCIES` environment variable. Instead of these three sources, a k6 archive can also be specified, which can contain all three sources (currently two actually, because the manifest file is not yet included in the k6 archive). +Dependencies come from [sources](#sources): k6 test script or k6 archive files. These dependencies are combined with overrides from a manifest file and the `K6_DEPENDENCIES` environment variable. Only dependencies that do not specify a constrain or specify a general "*" constrain are overriden from those sources. In the simplest use, we only extract the dependencies from the script source. @@ -123,6 +114,16 @@ func ExampleAnalyze_without_pragma() { ## CLI +## Install + +Precompiled binaries can be downloaded and installed from the [Releases](https://github.com/grafana/k6deps/releases) page. + +If you have a go development environment, the installation can also be done with the following command: + +``` +go install github.com/grafana/k6deps/cmd/k6deps@latest +``` + ## k6deps @@ -134,7 +135,7 @@ Analyze the k6 test script and extract the extensions that the script depends on ### Sources -Dependencies can come from three sources: k6 test script, manifest file, `K6_DEPENDENCIES` environment variable. Instead of these three sources, a k6 archive can also be specified, which can contain all three sources (currently two actually, because the manifest file is not yet included in the k6 archive). An archive is a tar file, which can be created using the k6 archive command. +Dependencies come from [sources](#sources): k6 test script or k6 archive files. These dependencies are combined with overrides from a manifest file and the `K6_DEPENDENCIES` environment variable. Only dependencies that do not specify a constrain or specify a general "*" constrain are overriden from those sources. > *NOTE*: It is assumed that the script and all dependencies are in the archive. No external dependencies are analyzed. @@ -158,6 +159,8 @@ Dependencies and version constraints can also be specified in the `K6_DEPENDENCI k6>0.54;k6/x/faker>0.4.0;k6/x/sql>=v1.0.1 +> *NOTE*: dependencies specied in the manifest or environment variables are used only to override the constrains of the dependencies found in the script or achive. If they are not referenced in the source, they are ignored. + ### Format By default, dependencies are written as a JSON object. The property name is the name of the dependency and the property value is the version constraints of the dependency. @@ -191,7 +194,6 @@ k6deps [flags] [script-file] --format json|text|js output format, possible values: json,env,script (default json) -h, --help help for k6deps --ignore-manifest disable package.json detection and processing - --ignore-script disable script processing --ingnore-env ignore K6_DEPENDENCIES environment variable processing -i, --input string input format ('js', 'ts' or 'tar' for archives) --manifest string manifest file to analyze (default 'package.json' nearest to script-file) @@ -202,5 +204,5 @@ k6deps [flags] [script-file] ## Contribute -If you want to contribute or help with the development of **k6pack**, start by +If you want to contribute or help with the development of **k6deps**, start by reading [CONTRIBUTING.md](CONTRIBUTING.md). diff --git a/vendor/github.com/grafana/k6deps/analyze.go b/vendor/github.com/grafana/k6deps/analyze.go index 783f90a6cf1..086d11b484d 100644 --- a/vendor/github.com/grafana/k6deps/analyze.go +++ b/vendor/github.com/grafana/k6deps/analyze.go @@ -118,24 +118,20 @@ func (a *archiveAnalizer) analyze() (Dependencies, error) { return processArchive(a.src) } -type mergeAnalyzer struct { - analyzers []analyzer -} - -func newMergeAnalyzer(analyzers ...analyzer) analyzer { - return &mergeAnalyzer{analyzers: analyzers} -} - -func (m *mergeAnalyzer) analyze() (Dependencies, error) { - deps := make(Dependencies) +// resolve the overides of the dependencies from multiple analyzers +func resolveOverrides(src analyzer, overrides ...analyzer) (Dependencies, error) { + deps, err := src.analyze() + if err != nil { + return nil, err + } - for _, a := range m.analyzers { + for _, a := range overrides { dep, err := a.analyze() if err != nil { return nil, err } - err = deps.Merge(dep) + err = deps.Override(dep) if err != nil { return nil, err } diff --git a/vendor/github.com/grafana/k6deps/dependencies.go b/vendor/github.com/grafana/k6deps/dependencies.go index e78c0b44e84..6bfd7db3c75 100644 --- a/vendor/github.com/grafana/k6deps/dependencies.go +++ b/vendor/github.com/grafana/k6deps/dependencies.go @@ -52,11 +52,10 @@ func (deps Dependencies) update(from *Dependency) error { return dep.update(from) } -// Merge updates deps dependencies based on from dependencies. -// Adds a dependency that doesn't exist yet. +// Merge combines two sets of dependencies. // If the dependency exists in both collections, but one of them does not have version constraints, // then the dependency with version constraints is placed in deps. -// Otherwise, i.e. if the dependency is included in both collections and in both with version constraints, +// If the dependency is included in both collections and in both with version constraints, // an error is generated. func (deps Dependencies) Merge(from Dependencies) error { for _, dep := range from { @@ -68,6 +67,28 @@ func (deps Dependencies) Merge(from Dependencies) error { return nil } +// Override updates dependencies without constrains. +func (deps Dependencies) Override(from Dependencies) error { + if len(from) == 0 { + return nil + } + + for _, dep := range deps { + over, found := from[dep.Name] + if !found { + continue + } + + if dep.GetConstraints().String() != defaultConstraintsString { + continue + } + + dep.Constraints = over.Constraints + } + + return nil +} + // Sorted returns dependencies as an array, with "k6" as a first element (if any) and the // rest of the array is sorted by name lexicographically. func (deps Dependencies) Sorted() []*Dependency { diff --git a/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go b/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go index d3d3224ab46..d211a70c9a4 100644 --- a/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go +++ b/vendor/github.com/grafana/k6deps/internal/rootfs/rootfs.go @@ -5,10 +5,9 @@ import ( "errors" "fmt" "io/fs" + "os" + "path" "path/filepath" - "strings" - - "github.com/spf13/afero" ) var ErrInvalidPath = errors.New("invalid path") //nolint:revive @@ -24,7 +23,7 @@ type FS interface { } type rootFS struct { - afero.Fs + fs fs.FS root string } @@ -35,7 +34,7 @@ func NewFromDir(root string) (FS, error) { } return &rootFS{ - Fs: afero.NewOsFs(), + fs: os.DirFS(root), //nolint:forbidigo root: root, }, nil } @@ -44,19 +43,19 @@ func (f *rootFS) Root() string { return f.root } -func (f *rootFS) Open(path string) (fs.File, error) { - if !filepath.IsAbs(path) { - path = filepath.Join(f.root, path) - } - // check if the path is outside the root - if !strings.HasPrefix(path, f.root) { - return nil, &fs.PathError{Path: path, Err: fs.ErrNotExist} +func (f *rootFS) Open(filePath string) (fs.File, error) { + var err error + if filepath.IsAbs(filePath) { + filePath, err = filepath.Rel(f.root, filePath) + if err != nil { + return nil, err + } } - return f.Fs.Open(filepath.Clean(path)) + return f.fs.Open(filepath.ToSlash(path.Clean(filePath))) } // NewFromFS return a FS from a FS -func NewFromFS(root string, fs afero.Fs) FS { - return &rootFS{root: root, Fs: fs} +func NewFromFS(root string, fs fs.FS) FS { + return &rootFS{root: root, fs: fs} } diff --git a/vendor/github.com/grafana/k6deps/options.go b/vendor/github.com/grafana/k6deps/options.go index 904f222e549..bf08652a45a 100644 --- a/vendor/github.com/grafana/k6deps/options.go +++ b/vendor/github.com/grafana/k6deps/options.go @@ -3,10 +3,9 @@ package k6deps import ( "bytes" "io" + "io/fs" "os" - "github.com/spf13/afero" - "github.com/grafana/k6deps/internal/pack" "github.com/grafana/k6deps/internal/rootfs" ) @@ -60,7 +59,7 @@ type Options struct { // If not provided, os.LookupEnv will be used. LookupEnv func(key string) (value string, ok bool) // Fs is the file system to use for accessing files. If not provided, os file system is used - Fs afero.Fs + Fs fs.FS // Root directory for searching for files. Must an absolute path. If omitted, CWD is used RootDir string } @@ -94,30 +93,30 @@ func (opts *Options) fs() (rootfs.FS, error) { // Analyze searches, loads and analyzes the specified sources, // extracting the k6 extensions and their version constraints. -// Note: if archive is specified, the other three sources will not be taken into account, -// since the archive may contain them. +// The constrains from the script or archive are complemented with the +// overrides from the manifest or environment func Analyze(opts *Options) (Dependencies, error) { var err error + manifestAnalyzer, err := opts.manifestAnalyzer() + if err != nil { + return nil, err + } + if !opts.Archive.Ignore && !opts.Archive.IsEmpty() { archiveAnalyzer, err := opts.archiveAnalyzer() if err != nil { return nil, err } - return archiveAnalyzer.analyze() - } - - manifestAnalyzer, err := opts.manifestAnalyzer() - if err != nil { - return nil, err + return resolveOverrides(archiveAnalyzer, manifestAnalyzer, opts.envAnalyzer()) } - scriptAnalyzeer, err := opts.scriptAnalyzer() + scriptAnalyzer, err := opts.scriptAnalyzer() if err != nil { return nil, err } - return newMergeAnalyzer(scriptAnalyzeer, manifestAnalyzer, opts.envAnalyzer()).analyze() + return resolveOverrides(scriptAnalyzer, manifestAnalyzer, opts.envAnalyzer()) } // scriptAnalyzer loads a script Source and alls its dependencies into the Script's content diff --git a/vendor/modules.txt b/vendor/modules.txt index 1df018609f4..6545fdfd942 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -184,7 +184,7 @@ github.com/gorilla/websocket github.com/grafana/k6build github.com/grafana/k6build/pkg/api github.com/grafana/k6build/pkg/client -# github.com/grafana/k6deps v0.3.0 +# github.com/grafana/k6deps v0.4.0 ## explicit; go 1.23.0 github.com/grafana/k6deps github.com/grafana/k6deps/internal/pack From 70282cf0ec37509a4ec23c568ca0c9bd60b34fdd Mon Sep 17 00:00:00 2001 From: pablochacin Date: Thu, 19 Jun 2025 16:31:17 +0200 Subject: [PATCH 134/136] address review comments Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com> --- lib/fsext/bridge.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fsext/bridge.go b/lib/fsext/bridge.go index 1184da8152c..b86a2e5f2c6 100644 --- a/lib/fsext/bridge.go +++ b/lib/fsext/bridge.go @@ -21,7 +21,7 @@ func NewIOFSBridge(fs Fs) fs.FS { func (b *IOFSBridge) Open(name string) (fs.File, error) { f, err := b.FSExt.Open(name) if err != nil { - return nil, fmt.Errorf("opening file %w", err) + return nil, fmt.Errorf("opening file: %w", err) } return f, nil } From 0e1b95d07b4f8e011e0bdb75fa1379a60a4a67a5 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Tue, 15 Jul 2025 19:57:14 +0200 Subject: [PATCH 135/136] move fs bridge to launcher Signed-off-by: Pablo Chacin --- internal/cmd/launcher.go | 24 +++++++++++++++++++++++- internal/cmd/launcher_test.go | 23 +++++++++++++++++++++++ lib/fsext/bridge.go | 27 --------------------------- lib/fsext/bridge_test.go | 31 ------------------------------- 4 files changed, 46 insertions(+), 59 deletions(-) delete mode 100644 lib/fsext/bridge.go delete mode 100644 lib/fsext/bridge_test.go diff --git a/internal/cmd/launcher.go b/internal/cmd/launcher.go index 359df8a2f5e..b24169f2ec3 100644 --- a/internal/cmd/launcher.go +++ b/internal/cmd/launcher.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "io/fs" "os" "os/exec" "path/filepath" @@ -20,6 +21,27 @@ import ( "go.k6.io/k6/lib/fsext" ) +// OFSBridge allows an afero.Fs to implement the Go standard library io/fs.FS. +type iofSBridge struct { + fsext fsext.Fs +} + +// newIofsBridge returns an IOFSBridge from a Fs +func newIofsBridge(fs fsext.Fs) fs.FS { + return &iofSBridge{ + fsext: fs, + } +} + +// Open implements fs.Fs Open +func (b *iofSBridge) Open(name string) (fs.File, error) { + f, err := b.fsext.Open(name) + if err != nil { + return nil, fmt.Errorf("opening file: %w", err) + } + return f, nil +} + // commandExecutor executes the requested k6 command line command. // It abstract the execution path from the concrete binary. type commandExecutor interface { @@ -308,7 +330,7 @@ func analyze(gs *state.GlobalState, args []string) (k6deps.Dependencies, error) } dopts.Script.Name = sourceRootPath dopts.Script.Contents = src.Data - dopts.Fs = fsext.NewIOFSBridge(gs.FS) + dopts.Fs = newIofsBridge(gs.FS) } return k6deps.Analyze(dopts) diff --git a/internal/cmd/launcher_test.go b/internal/cmd/launcher_test.go index 63325b629b5..985cabc6e94 100644 --- a/internal/cmd/launcher_test.go +++ b/internal/cmd/launcher_test.go @@ -4,6 +4,8 @@ import ( "bytes" "errors" "fmt" + "io" + "io/fs" "os" "path/filepath" "testing" @@ -11,6 +13,7 @@ import ( "github.com/grafana/k6deps" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.k6.io/k6/cmd/state" "go.k6.io/k6/errext" @@ -394,3 +397,23 @@ func TestIsAnalysisRequired(t *testing.T) { }) } } + +func TestBridgeOpen(t *testing.T) { + t.Parallel() + + testfs := afero.NewMemMapFs() + require.NoError(t, fsext.WriteFile(testfs, "abasicpath/onetwo.txt", []byte(`test123`), 0o644)) + + bridge := &iofSBridge{fsext: testfs} + + // it asserts that bridge implements io/fs.FS + goiofs := fs.FS(bridge) + f, err := goiofs.Open("abasicpath/onetwo.txt") + require.NoError(t, err) + require.NotNil(t, f) + + content, err := io.ReadAll(f) + require.NoError(t, err) + + assert.Equal(t, "test123", string(content)) +} diff --git a/lib/fsext/bridge.go b/lib/fsext/bridge.go deleted file mode 100644 index b86a2e5f2c6..00000000000 --- a/lib/fsext/bridge.go +++ /dev/null @@ -1,27 +0,0 @@ -package fsext - -import ( - "fmt" - "io/fs" -) - -// IOFSBridge allows an afero.Fs to implement the Go standard library io/fs.FS. -type IOFSBridge struct { - FSExt Fs -} - -// NewIOFSBridge returns an IOFSBridge from a Fs -func NewIOFSBridge(fs Fs) fs.FS { - return &IOFSBridge{ - FSExt: fs, - } -} - -// Open implements fs.Fs Open -func (b *IOFSBridge) Open(name string) (fs.File, error) { - f, err := b.FSExt.Open(name) - if err != nil { - return nil, fmt.Errorf("opening file: %w", err) - } - return f, nil -} diff --git a/lib/fsext/bridge_test.go b/lib/fsext/bridge_test.go deleted file mode 100644 index 02ae6fc8d11..00000000000 --- a/lib/fsext/bridge_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package fsext - -import ( - "io" - "io/fs" - "testing" - - "github.com/spf13/afero" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestBridgeOpen(t *testing.T) { - t.Parallel() - - testfs := afero.NewMemMapFs() - require.NoError(t, WriteFile(testfs, "abasicpath/onetwo.txt", []byte(`test123`), 0o644)) - - bridge := &IOFSBridge{FSExt: testfs} - - // it asserts that bridge implements io/fs.FS - goiofs := fs.FS(bridge) - f, err := goiofs.Open("abasicpath/onetwo.txt") - require.NoError(t, err) - require.NotNil(t, f) - - content, err := io.ReadAll(f) - require.NoError(t, err) - - assert.Equal(t, "test123", string(content)) -} From 6360295f933a7eff11ebebe43905fb72d65df698 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Wed, 16 Jul 2025 14:08:02 +0200 Subject: [PATCH 136/136] add missing import Signed-off-by: Pablo Chacin --- internal/cmd/launcher_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cmd/launcher_test.go b/internal/cmd/launcher_test.go index 985cabc6e94..333e5545b78 100644 --- a/internal/cmd/launcher_test.go +++ b/internal/cmd/launcher_test.go @@ -11,6 +11,7 @@ import ( "testing" "github.com/grafana/k6deps" + "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require"