@riverbankcms/sdk 0.121.0 → 0.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/{PreviewEditorSidebar-lZ600tJx.mjs → PreviewEditorSidebar-DvJFmC29.mjs} +6 -6
  2. package/dist/{PreviewEditorUI-CTBWzLSb.mjs → PreviewEditorUI-DVHP4bCo.mjs} +3 -3
  3. package/dist/{PreviewQueryProvider-BHT8CJvZ.mjs → PreviewQueryProvider-07EE4uWL.mjs} +1 -1
  4. package/dist/{SdkPreviewModeRuntime-DhPU58s7.mjs → SdkPreviewModeRuntime-BE5eFayo.mjs} +5 -5
  5. package/dist/{SiteChromeCustomizeContext-BkNvpzNZ.mjs → SiteChromeCustomizeContext-4hn4A0HX.mjs} +3 -3
  6. package/dist/_dts/api/src/bookingConfig.d.ts +32 -6
  7. package/dist/_dts/api/src/endpoints.d.ts +1 -1
  8. package/dist/_dts/api/src/index.d.ts +2 -2
  9. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +3 -3
  10. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +23 -11
  11. package/dist/_dts/sdk/src/version.d.ts +1 -1
  12. package/dist/cli/index.mjs +142 -2511
  13. package/dist/client/client.mjs +2 -1
  14. package/dist/preview-next/before-render.mjs +1 -0
  15. package/dist/preview-next/client/runtime.mjs +4 -4
  16. package/dist/preview-next/middleware.mjs +1 -0
  17. package/dist/{previewAuthStore-31xH13Jc.mjs → previewAuthStore-ShY26RNz.mjs} +1 -0
  18. package/dist/{sdk-runtime-BE_vcGua.mjs → sdk-runtime-CJxkFq2B.mjs} +2 -2
  19. package/dist/{separator-CiffYtk3.mjs → separator-CoFmo8uA.mjs} +1 -1
  20. package/dist/server/components.mjs +32 -2401
  21. package/dist/server/index.mjs +2 -1
  22. package/dist/server/next.mjs +34 -2401
  23. package/dist/server/prebuild.mjs +1 -1
  24. package/dist/server/rendering/server.mjs +32 -2404
  25. package/dist/server/rendering.mjs +32 -2401
  26. package/dist/server/server.mjs +2 -1
  27. package/package.json +1 -1
@@ -1,13 +1,8 @@
1
- import { createRequire } from "node:module";
2
1
  import { BlocksIslandsHydrator } from "#sdk-rendering-client";
3
2
  import * as React$1 from "react";
4
3
  import React, { forwardRef } from "react";
5
4
  import z, { z as z$1 } from "zod";
6
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- //#region \0rolldown/runtime.js
8
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
10
- //#endregion
11
6
  //#region ../blocks/src/system/manifest/augmentManifest.ts
12
7
  /**
13
8
  * Augments a block manifest with synthetic fields and other transformations.
@@ -45155,2395 +45150,7 @@ function resolveButtonAffordance(input) {
45155
45150
  return null;
45156
45151
  }
45157
45152
  //#endregion
45158
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/shared.js
45159
- var require_shared = /* @__PURE__ */ __commonJSMin(((exports) => {
45160
- Object.defineProperty(exports, "__esModule", { value: true });
45161
- exports.throttle = exports.EndpointType = exports.isNoPrettyPrint = void 0;
45162
- exports.requestToJSON = requestToJSON;
45163
- exports.isNoPrettyPrint = process.env.AXIOM_NO_PRETTY_PRINT == "true" ? true : false;
45164
- var EndpointType;
45165
- (function(EndpointType) {
45166
- EndpointType["webVitals"] = "web-vitals";
45167
- EndpointType["logs"] = "logs";
45168
- })(EndpointType || (exports.EndpointType = EndpointType = {}));
45169
- /**
45170
- * Transforms a NextRequest or Request object into a JSON-serializable object
45171
- */
45172
- async function requestToJSON(request) {
45173
- const headers = {};
45174
- request.headers.forEach((value, key) => {
45175
- headers[key] = value;
45176
- });
45177
- let cookiesData = {};
45178
- if ("cookies" in request) request.cookies.getAll().forEach((cookie) => {
45179
- cookiesData[cookie.name] = cookie.value;
45180
- });
45181
- else {
45182
- const cookieHeader = headers["cookie"];
45183
- if (cookieHeader) cookiesData = Object.fromEntries(cookieHeader.split(";").map((cookie) => {
45184
- const [key, value] = cookie.trim().split("=");
45185
- return [key, value];
45186
- }));
45187
- }
45188
- let nextUrlData;
45189
- if ("nextUrl" in request) {
45190
- const nextUrl = request.nextUrl;
45191
- nextUrlData = {
45192
- basePath: nextUrl.basePath,
45193
- buildId: nextUrl.buildId,
45194
- hash: nextUrl.hash,
45195
- host: nextUrl.host,
45196
- hostname: nextUrl.hostname,
45197
- href: nextUrl.href,
45198
- origin: nextUrl.origin,
45199
- password: nextUrl.password,
45200
- pathname: nextUrl.pathname,
45201
- port: nextUrl.port,
45202
- protocol: nextUrl.protocol,
45203
- search: nextUrl.search,
45204
- searchParams: Object.fromEntries(nextUrl.searchParams.entries()),
45205
- username: nextUrl.username
45206
- };
45207
- }
45208
- let body;
45209
- if (request.body) try {
45210
- const clonedRequest = request.clone();
45211
- try {
45212
- body = await clonedRequest.json();
45213
- clonedRequest.body?.getReader;
45214
- } catch {
45215
- body = await clonedRequest.text();
45216
- }
45217
- } catch (error) {
45218
- console.warn("Could not parse request body:", error);
45219
- }
45220
- const cache = {
45221
- mode: request.cache,
45222
- credentials: request.credentials,
45223
- redirect: request.redirect,
45224
- referrerPolicy: request.referrerPolicy,
45225
- integrity: request.integrity
45226
- };
45227
- let ip;
45228
- if ("ip" in request) ip = request.ip;
45229
- let geo;
45230
- if ("geo" in request) geo = request.geo;
45231
- return {
45232
- method: request.method,
45233
- url: request.url,
45234
- headers,
45235
- cookies: cookiesData,
45236
- nextUrl: nextUrlData,
45237
- ip,
45238
- geo,
45239
- body,
45240
- cache,
45241
- mode: request.mode,
45242
- destination: request.destination,
45243
- referrer: request.referrer,
45244
- keepalive: request.keepalive,
45245
- signal: {
45246
- aborted: request.signal.aborted,
45247
- reason: request.signal.reason
45248
- }
45249
- };
45250
- }
45251
- const throttle = (fn, wait) => {
45252
- let lastFn, lastTime;
45253
- return function() {
45254
- const context = this, args = arguments;
45255
- if (lastTime == null) lastTime = Date.now();
45256
- clearTimeout(lastFn);
45257
- lastFn = setTimeout(() => {
45258
- if (Date.now() - lastTime >= wait) {
45259
- fn.apply(context, args);
45260
- lastTime = Date.now();
45261
- }
45262
- }, Math.max(wait - (Date.now() - lastTime), 0));
45263
- };
45264
- };
45265
- exports.throttle = throttle;
45266
- }));
45267
- //#endregion
45268
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/generic.js
45269
- var require_generic = /* @__PURE__ */ __commonJSMin(((exports) => {
45270
- Object.defineProperty(exports, "__esModule", { value: true });
45271
- const shared_1 = require_shared();
45272
- const config_1 = require_config();
45273
- var GenericConfig = class {
45274
- constructor() {
45275
- this.proxyPath = "/_axiom";
45276
- this.shouldSendEdgeReport = false;
45277
- this.token = process.env.NEXT_PUBLIC_AXIOM_TOKEN || process.env.AXIOM_TOKEN;
45278
- this.dataset = process.env.NEXT_PUBLIC_AXIOM_DATASET || process.env.AXIOM_DATASET;
45279
- this.environment = process.env.NODE_ENV;
45280
- this.axiomUrl = process.env.NEXT_PUBLIC_AXIOM_URL || process.env.AXIOM_URL || "https://api.axiom.co";
45281
- this.region = process.env.REGION || void 0;
45282
- this.customEndpoint = process.env.NEXT_PUBLIC_AXIOM_CUSTOM_ENDPOINT;
45283
- }
45284
- isEnvVarsSet() {
45285
- return !!(this.axiomUrl && this.dataset && this.token) || !!this.customEndpoint;
45286
- }
45287
- getIngestURL(_) {
45288
- return `${this.axiomUrl}/v1/datasets/${this.dataset}/ingest`;
45289
- }
45290
- getLogsEndpoint() {
45291
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
45292
- return config_1.isBrowser ? `${this.proxyPath}/logs` : this.getIngestURL(shared_1.EndpointType.logs);
45293
- }
45294
- getWebVitalsEndpoint() {
45295
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
45296
- return config_1.isBrowser ? `${this.proxyPath}/web-vitals` : this.getIngestURL(shared_1.EndpointType.webVitals);
45297
- }
45298
- wrapWebVitalsObject(metrics) {
45299
- return metrics.map((m) => ({
45300
- webVital: m,
45301
- _time: (/* @__PURE__ */ new Date()).getTime(),
45302
- platform: {
45303
- environment: this.environment,
45304
- source: "web-vital"
45305
- },
45306
- source: "web-vital"
45307
- }));
45308
- }
45309
- injectPlatformMetadata(logEvent, source) {
45310
- let key = "platform";
45311
- if (config_1.isVercel) key = "vercel";
45312
- logEvent.source = source;
45313
- logEvent[key] = {
45314
- environment: this.environment,
45315
- region: this.region,
45316
- source
45317
- };
45318
- if (config_1.isVercel) {
45319
- logEvent[key].region = process.env.VERCEL_REGION;
45320
- logEvent[key].deploymentId = process.env.VERCEL_DEPLOYMENT_ID;
45321
- logEvent[key].deploymentUrl = process.env.NEXT_PUBLIC_VERCEL_URL;
45322
- logEvent[key].project = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL;
45323
- logEvent.git = {
45324
- commit: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
45325
- repo: process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG,
45326
- ref: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF
45327
- };
45328
- }
45329
- }
45330
- getHeaderOrDefault(req, headerName, defaultValue) {
45331
- return req.headers[headerName] ? req.headers[headerName] : defaultValue;
45332
- }
45333
- };
45334
- exports.default = GenericConfig;
45335
- }));
45336
- //#endregion
45337
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/vercel.js
45338
- var require_vercel = /* @__PURE__ */ __commonJSMin(((exports) => {
45339
- var __importDefault = exports && exports.__importDefault || function(mod) {
45340
- return mod && mod.__esModule ? mod : { "default": mod };
45341
- };
45342
- Object.defineProperty(exports, "__esModule", { value: true });
45343
- const config_1 = require_config();
45344
- const shared_1 = require_shared();
45345
- const generic_1 = __importDefault(require_generic());
45346
- const ingestEndpoint = process.env.NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT || process.env.AXIOM_INGEST_ENDPOINT || "";
45347
- var VercelConfig = class extends generic_1.default {
45348
- constructor(..._args) {
45349
- super(..._args);
45350
- this.provider = "vercel";
45351
- this.shouldSendEdgeReport = true;
45352
- this.region = process.env.VERCEL_REGION || void 0;
45353
- this.environment = process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.VERCEL_ENV || process.env.NODE_ENV || "";
45354
- this.token = void 0;
45355
- this.axiomUrl = ingestEndpoint;
45356
- }
45357
- isEnvVarsSet() {
45358
- return ingestEndpoint != void 0 && ingestEndpoint != "" || !!this.customEndpoint;
45359
- }
45360
- getIngestURL(t) {
45361
- const url = new URL(this.axiomUrl);
45362
- url.searchParams.set("type", t.toString());
45363
- return url.toString();
45364
- }
45365
- getWebVitalsEndpoint() {
45366
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
45367
- return `${this.proxyPath}/web-vitals`;
45368
- }
45369
- getLogsEndpoint() {
45370
- if (config_1.isBrowser && this.customEndpoint) return this.customEndpoint;
45371
- return config_1.isBrowser ? `${this.proxyPath}/logs` : this.getIngestURL(shared_1.EndpointType.logs);
45372
- }
45373
- wrapWebVitalsObject(metrics) {
45374
- return {
45375
- webVitals: metrics,
45376
- environment: this.environment
45377
- };
45378
- }
45379
- injectPlatformMetadata(logEvent, source) {
45380
- logEvent.vercel = {
45381
- environment: this.environment,
45382
- region: this.region,
45383
- source
45384
- };
45385
- }
45386
- };
45387
- exports.default = VercelConfig;
45388
- }));
45389
- //#endregion
45390
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/netlify.js
45391
- var require_netlify = /* @__PURE__ */ __commonJSMin(((exports) => {
45392
- var __importDefault = exports && exports.__importDefault || function(mod) {
45393
- return mod && mod.__esModule ? mod : { "default": mod };
45394
- };
45395
- Object.defineProperty(exports, "__esModule", { value: true });
45396
- const generic_1 = __importDefault(require_generic());
45397
- const netlifySiteId = process.env.SITE_ID;
45398
- const netlifyBuildId = process.env.BUILD_ID;
45399
- const netlifyContext = process.env.CONTEXT;
45400
- const netlifyDeploymentUrl = process.env.DEPLOYMENT_URL;
45401
- const netlifyDeploymentId = process.env.DEPLOYMENT_ID;
45402
- var NetlifyConfig = class extends generic_1.default {
45403
- wrapWebVitalsObject(metrics) {
45404
- return metrics.map((m) => ({
45405
- webVital: m,
45406
- _time: (/* @__PURE__ */ new Date()).getTime(),
45407
- netlify: {
45408
- environment: this.environment,
45409
- source: "web-vital",
45410
- siteId: netlifySiteId,
45411
- buildId: netlifyBuildId,
45412
- context: netlifyContext,
45413
- deploymentUrl: netlifyDeploymentUrl,
45414
- deploymentId: netlifyDeploymentId
45415
- }
45416
- }));
45417
- }
45418
- injectPlatformMetadata(logEvent, source) {
45419
- logEvent.netlify = {
45420
- environment: this.environment,
45421
- region: source === "edge" ? process.env.DENO_REGION : process.env.AWS_REGION,
45422
- source,
45423
- siteId: netlifySiteId,
45424
- buildId: netlifyBuildId,
45425
- context: netlifyContext,
45426
- deploymentUrl: netlifyDeploymentUrl,
45427
- deploymentId: source === "edge" ? process.env.DENO_DEPLOYMENT_ID : netlifyDeploymentId
45428
- };
45429
- }
45430
- };
45431
- exports.default = NetlifyConfig;
45432
- }));
45433
- //#endregion
45434
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/package.json
45435
- var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45436
- module.exports = {
45437
- "name": "next-axiom",
45438
- "description": "Send WebVitals from your Next.js project to Axiom.",
45439
- "version": "1.10.0",
45440
- "author": "Axiom, Inc.",
45441
- "license": "MIT",
45442
- "contributors": ["Arne Bahlo <arne@axiom.co>", "Islam Shehata <islam@axiom.co>"],
45443
- "engines": { "node": ">=18" },
45444
- "main": "dist/index.js",
45445
- "types": "dist/index.d.ts",
45446
- "repository": {
45447
- "type": "git",
45448
- "url": "git+https://github.com/axiomhq/next-axiom.git"
45449
- },
45450
- "keywords": [
45451
- "web-vitals",
45452
- "axiom",
45453
- "observability",
45454
- "performance",
45455
- "nextjs"
45456
- ],
45457
- "bugs": { "url": "https://github.com/axiomhq/next-axiom/issues" },
45458
- "homepage": "https://github.com/axiomhq/next-axiom#readme",
45459
- "peerDependencies": {
45460
- "next": ">=14.0",
45461
- "react": ">=18.0.0"
45462
- },
45463
- "devDependencies": {
45464
- "@types/node": "^20.19.26",
45465
- "@types/react": "^18.3.27",
45466
- "@vitest/coverage-v8": "^2.1.9",
45467
- "next": "^14.2.33",
45468
- "prettier": "^3.7.4",
45469
- "react-dom": "^19.2.1",
45470
- "ts-node": "^10.9.2",
45471
- "typescript": "^5.9.3",
45472
- "vitest": "^2.1.9"
45473
- },
45474
- "dependencies": {
45475
- "@vercel/functions": "^2.2.13",
45476
- "use-deep-compare": "^1.3.0",
45477
- "whatwg-fetch": "^3.6.20"
45478
- },
45479
- "scripts": {
45480
- "build": "tsc",
45481
- "format": "prettier --write src/*.ts tests/*.ts",
45482
- "check-format": "prettier -c src/*.ts tests/*.ts",
45483
- "test": "vitest run tests --coverage"
45484
- }
45485
- };
45486
- }));
45487
- //#endregion
45488
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/config.js
45489
- var require_config = /* @__PURE__ */ __commonJSMin(((exports) => {
45490
- var __importDefault = exports && exports.__importDefault || function(mod) {
45491
- return mod && mod.__esModule ? mod : { "default": mod };
45492
- };
45493
- Object.defineProperty(exports, "__esModule", { value: true });
45494
- exports.config = exports.isEdgeRuntime = exports.isBrowser = exports.isWebWorker = exports.isNetlify = exports.isVercel = exports.isVercelIntegration = exports.Version = void 0;
45495
- const generic_1 = __importDefault(require_generic());
45496
- const vercel_1 = __importDefault(require_vercel());
45497
- const netlify_1 = __importDefault(require_netlify());
45498
- exports.Version = require_package().version;
45499
- exports.isVercelIntegration = process.env.NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT || process.env.AXIOM_INGEST_ENDPOINT;
45500
- exports.isVercel = process.env.NEXT_PUBLIC_VERCEL || process.env.VERCEL;
45501
- exports.isNetlify = process.env.NETLIFY == "true";
45502
- exports.isWebWorker = typeof self !== "undefined" && typeof globalThis.WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
45503
- exports.isBrowser = typeof window !== "undefined" || exports.isWebWorker;
45504
- exports.isEdgeRuntime = globalThis.EdgeRuntime ? true : false;
45505
- let config = new generic_1.default();
45506
- exports.config = config;
45507
- if (exports.isVercelIntegration) exports.config = config = new vercel_1.default();
45508
- else if (exports.isNetlify) exports.config = config = new netlify_1.default();
45509
- }));
45510
- //#endregion
45511
- //#region ../../node_modules/.pnpm/whatwg-fetch@3.6.20/node_modules/whatwg-fetch/dist/fetch.umd.js
45512
- var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45513
- (function(global, factory) {
45514
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global.WHATWGFetch = {});
45515
- })(exports, (function(exports$2) {
45516
- "use strict";
45517
- var g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof global !== "undefined" && global || {};
45518
- var support = {
45519
- searchParams: "URLSearchParams" in g,
45520
- iterable: "Symbol" in g && "iterator" in Symbol,
45521
- blob: "FileReader" in g && "Blob" in g && (function() {
45522
- try {
45523
- new Blob();
45524
- return true;
45525
- } catch (e) {
45526
- return false;
45527
- }
45528
- })(),
45529
- formData: "FormData" in g,
45530
- arrayBuffer: "ArrayBuffer" in g
45531
- };
45532
- function isDataView(obj) {
45533
- return obj && DataView.prototype.isPrototypeOf(obj);
45534
- }
45535
- if (support.arrayBuffer) {
45536
- var viewClasses = [
45537
- "[object Int8Array]",
45538
- "[object Uint8Array]",
45539
- "[object Uint8ClampedArray]",
45540
- "[object Int16Array]",
45541
- "[object Uint16Array]",
45542
- "[object Int32Array]",
45543
- "[object Uint32Array]",
45544
- "[object Float32Array]",
45545
- "[object Float64Array]"
45546
- ];
45547
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
45548
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
45549
- };
45550
- }
45551
- function normalizeName(name) {
45552
- if (typeof name !== "string") name = String(name);
45553
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") throw new TypeError("Invalid character in header field name: \"" + name + "\"");
45554
- return name.toLowerCase();
45555
- }
45556
- function normalizeValue(value) {
45557
- if (typeof value !== "string") value = String(value);
45558
- return value;
45559
- }
45560
- function iteratorFor(items) {
45561
- var iterator = { next: function() {
45562
- var value = items.shift();
45563
- return {
45564
- done: value === void 0,
45565
- value
45566
- };
45567
- } };
45568
- if (support.iterable) iterator[Symbol.iterator] = function() {
45569
- return iterator;
45570
- };
45571
- return iterator;
45572
- }
45573
- function Headers(headers) {
45574
- this.map = {};
45575
- if (headers instanceof Headers) headers.forEach(function(value, name) {
45576
- this.append(name, value);
45577
- }, this);
45578
- else if (Array.isArray(headers)) headers.forEach(function(header) {
45579
- if (header.length != 2) throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + header.length);
45580
- this.append(header[0], header[1]);
45581
- }, this);
45582
- else if (headers) Object.getOwnPropertyNames(headers).forEach(function(name) {
45583
- this.append(name, headers[name]);
45584
- }, this);
45585
- }
45586
- Headers.prototype.append = function(name, value) {
45587
- name = normalizeName(name);
45588
- value = normalizeValue(value);
45589
- var oldValue = this.map[name];
45590
- this.map[name] = oldValue ? oldValue + ", " + value : value;
45591
- };
45592
- Headers.prototype["delete"] = function(name) {
45593
- delete this.map[normalizeName(name)];
45594
- };
45595
- Headers.prototype.get = function(name) {
45596
- name = normalizeName(name);
45597
- return this.has(name) ? this.map[name] : null;
45598
- };
45599
- Headers.prototype.has = function(name) {
45600
- return this.map.hasOwnProperty(normalizeName(name));
45601
- };
45602
- Headers.prototype.set = function(name, value) {
45603
- this.map[normalizeName(name)] = normalizeValue(value);
45604
- };
45605
- Headers.prototype.forEach = function(callback, thisArg) {
45606
- for (var name in this.map) if (this.map.hasOwnProperty(name)) callback.call(thisArg, this.map[name], name, this);
45607
- };
45608
- Headers.prototype.keys = function() {
45609
- var items = [];
45610
- this.forEach(function(value, name) {
45611
- items.push(name);
45612
- });
45613
- return iteratorFor(items);
45614
- };
45615
- Headers.prototype.values = function() {
45616
- var items = [];
45617
- this.forEach(function(value) {
45618
- items.push(value);
45619
- });
45620
- return iteratorFor(items);
45621
- };
45622
- Headers.prototype.entries = function() {
45623
- var items = [];
45624
- this.forEach(function(value, name) {
45625
- items.push([name, value]);
45626
- });
45627
- return iteratorFor(items);
45628
- };
45629
- if (support.iterable) Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
45630
- function consumed(body) {
45631
- if (body._noBody) return;
45632
- if (body.bodyUsed) return Promise.reject(/* @__PURE__ */ new TypeError("Already read"));
45633
- body.bodyUsed = true;
45634
- }
45635
- function fileReaderReady(reader) {
45636
- return new Promise(function(resolve, reject) {
45637
- reader.onload = function() {
45638
- resolve(reader.result);
45639
- };
45640
- reader.onerror = function() {
45641
- reject(reader.error);
45642
- };
45643
- });
45644
- }
45645
- function readBlobAsArrayBuffer(blob) {
45646
- var reader = new FileReader();
45647
- var promise = fileReaderReady(reader);
45648
- reader.readAsArrayBuffer(blob);
45649
- return promise;
45650
- }
45651
- function readBlobAsText(blob) {
45652
- var reader = new FileReader();
45653
- var promise = fileReaderReady(reader);
45654
- var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
45655
- var encoding = match ? match[1] : "utf-8";
45656
- reader.readAsText(blob, encoding);
45657
- return promise;
45658
- }
45659
- function readArrayBufferAsText(buf) {
45660
- var view = new Uint8Array(buf);
45661
- var chars = new Array(view.length);
45662
- for (var i = 0; i < view.length; i++) chars[i] = String.fromCharCode(view[i]);
45663
- return chars.join("");
45664
- }
45665
- function bufferClone(buf) {
45666
- if (buf.slice) return buf.slice(0);
45667
- else {
45668
- var view = new Uint8Array(buf.byteLength);
45669
- view.set(new Uint8Array(buf));
45670
- return view.buffer;
45671
- }
45672
- }
45673
- function Body() {
45674
- this.bodyUsed = false;
45675
- this._initBody = function(body) {
45676
- this.bodyUsed = this.bodyUsed;
45677
- this._bodyInit = body;
45678
- if (!body) {
45679
- this._noBody = true;
45680
- this._bodyText = "";
45681
- } else if (typeof body === "string") this._bodyText = body;
45682
- else if (support.blob && Blob.prototype.isPrototypeOf(body)) this._bodyBlob = body;
45683
- else if (support.formData && FormData.prototype.isPrototypeOf(body)) this._bodyFormData = body;
45684
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this._bodyText = body.toString();
45685
- else if (support.arrayBuffer && support.blob && isDataView(body)) {
45686
- this._bodyArrayBuffer = bufferClone(body.buffer);
45687
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
45688
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) this._bodyArrayBuffer = bufferClone(body);
45689
- else this._bodyText = body = Object.prototype.toString.call(body);
45690
- if (!this.headers.get("content-type")) {
45691
- if (typeof body === "string") this.headers.set("content-type", "text/plain;charset=UTF-8");
45692
- else if (this._bodyBlob && this._bodyBlob.type) this.headers.set("content-type", this._bodyBlob.type);
45693
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
45694
- }
45695
- };
45696
- if (support.blob) this.blob = function() {
45697
- var rejected = consumed(this);
45698
- if (rejected) return rejected;
45699
- if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
45700
- else if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
45701
- else if (this._bodyFormData) throw new Error("could not read FormData body as blob");
45702
- else return Promise.resolve(new Blob([this._bodyText]));
45703
- };
45704
- this.arrayBuffer = function() {
45705
- if (this._bodyArrayBuffer) {
45706
- var isConsumed = consumed(this);
45707
- if (isConsumed) return isConsumed;
45708
- else if (ArrayBuffer.isView(this._bodyArrayBuffer)) return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
45709
- else return Promise.resolve(this._bodyArrayBuffer);
45710
- } else if (support.blob) return this.blob().then(readBlobAsArrayBuffer);
45711
- else throw new Error("could not read as ArrayBuffer");
45712
- };
45713
- this.text = function() {
45714
- var rejected = consumed(this);
45715
- if (rejected) return rejected;
45716
- if (this._bodyBlob) return readBlobAsText(this._bodyBlob);
45717
- else if (this._bodyArrayBuffer) return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
45718
- else if (this._bodyFormData) throw new Error("could not read FormData body as text");
45719
- else return Promise.resolve(this._bodyText);
45720
- };
45721
- if (support.formData) this.formData = function() {
45722
- return this.text().then(decode);
45723
- };
45724
- this.json = function() {
45725
- return this.text().then(JSON.parse);
45726
- };
45727
- return this;
45728
- }
45729
- var methods = [
45730
- "CONNECT",
45731
- "DELETE",
45732
- "GET",
45733
- "HEAD",
45734
- "OPTIONS",
45735
- "PATCH",
45736
- "POST",
45737
- "PUT",
45738
- "TRACE"
45739
- ];
45740
- function normalizeMethod(method) {
45741
- var upcased = method.toUpperCase();
45742
- return methods.indexOf(upcased) > -1 ? upcased : method;
45743
- }
45744
- function Request(input, options) {
45745
- if (!(this instanceof Request)) throw new TypeError("Please use the \"new\" operator, this DOM object constructor cannot be called as a function.");
45746
- options = options || {};
45747
- var body = options.body;
45748
- if (input instanceof Request) {
45749
- if (input.bodyUsed) throw new TypeError("Already read");
45750
- this.url = input.url;
45751
- this.credentials = input.credentials;
45752
- if (!options.headers) this.headers = new Headers(input.headers);
45753
- this.method = input.method;
45754
- this.mode = input.mode;
45755
- this.signal = input.signal;
45756
- if (!body && input._bodyInit != null) {
45757
- body = input._bodyInit;
45758
- input.bodyUsed = true;
45759
- }
45760
- } else this.url = String(input);
45761
- this.credentials = options.credentials || this.credentials || "same-origin";
45762
- if (options.headers || !this.headers) this.headers = new Headers(options.headers);
45763
- this.method = normalizeMethod(options.method || this.method || "GET");
45764
- this.mode = options.mode || this.mode || null;
45765
- this.signal = options.signal || this.signal || function() {
45766
- if ("AbortController" in g) return new AbortController().signal;
45767
- }();
45768
- this.referrer = null;
45769
- if ((this.method === "GET" || this.method === "HEAD") && body) throw new TypeError("Body not allowed for GET or HEAD requests");
45770
- this._initBody(body);
45771
- if (this.method === "GET" || this.method === "HEAD") {
45772
- if (options.cache === "no-store" || options.cache === "no-cache") {
45773
- var reParamSearch = /([?&])_=[^&]*/;
45774
- if (reParamSearch.test(this.url)) this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
45775
- else {
45776
- var reQueryString = /\?/;
45777
- this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
45778
- }
45779
- }
45780
- }
45781
- }
45782
- Request.prototype.clone = function() {
45783
- return new Request(this, { body: this._bodyInit });
45784
- };
45785
- function decode(body) {
45786
- var form = new FormData();
45787
- body.trim().split("&").forEach(function(bytes) {
45788
- if (bytes) {
45789
- var split = bytes.split("=");
45790
- var name = split.shift().replace(/\+/g, " ");
45791
- var value = split.join("=").replace(/\+/g, " ");
45792
- form.append(decodeURIComponent(name), decodeURIComponent(value));
45793
- }
45794
- });
45795
- return form;
45796
- }
45797
- function parseHeaders(rawHeaders) {
45798
- var headers = new Headers();
45799
- rawHeaders.replace(/\r?\n[\t ]+/g, " ").split("\r").map(function(header) {
45800
- return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
45801
- }).forEach(function(line) {
45802
- var parts = line.split(":");
45803
- var key = parts.shift().trim();
45804
- if (key) {
45805
- var value = parts.join(":").trim();
45806
- try {
45807
- headers.append(key, value);
45808
- } catch (error) {
45809
- console.warn("Response " + error.message);
45810
- }
45811
- }
45812
- });
45813
- return headers;
45814
- }
45815
- Body.call(Request.prototype);
45816
- function Response(bodyInit, options) {
45817
- if (!(this instanceof Response)) throw new TypeError("Please use the \"new\" operator, this DOM object constructor cannot be called as a function.");
45818
- if (!options) options = {};
45819
- this.type = "default";
45820
- this.status = options.status === void 0 ? 200 : options.status;
45821
- if (this.status < 200 || this.status > 599) throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
45822
- this.ok = this.status >= 200 && this.status < 300;
45823
- this.statusText = options.statusText === void 0 ? "" : "" + options.statusText;
45824
- this.headers = new Headers(options.headers);
45825
- this.url = options.url || "";
45826
- this._initBody(bodyInit);
45827
- }
45828
- Body.call(Response.prototype);
45829
- Response.prototype.clone = function() {
45830
- return new Response(this._bodyInit, {
45831
- status: this.status,
45832
- statusText: this.statusText,
45833
- headers: new Headers(this.headers),
45834
- url: this.url
45835
- });
45836
- };
45837
- Response.error = function() {
45838
- var response = new Response(null, {
45839
- status: 200,
45840
- statusText: ""
45841
- });
45842
- response.ok = false;
45843
- response.status = 0;
45844
- response.type = "error";
45845
- return response;
45846
- };
45847
- var redirectStatuses = [
45848
- 301,
45849
- 302,
45850
- 303,
45851
- 307,
45852
- 308
45853
- ];
45854
- Response.redirect = function(url, status) {
45855
- if (redirectStatuses.indexOf(status) === -1) throw new RangeError("Invalid status code");
45856
- return new Response(null, {
45857
- status,
45858
- headers: { location: url }
45859
- });
45860
- };
45861
- exports$2.DOMException = g.DOMException;
45862
- try {
45863
- new exports$2.DOMException();
45864
- } catch (err) {
45865
- exports$2.DOMException = function(message, name) {
45866
- this.message = message;
45867
- this.name = name;
45868
- var error = Error(message);
45869
- this.stack = error.stack;
45870
- };
45871
- exports$2.DOMException.prototype = Object.create(Error.prototype);
45872
- exports$2.DOMException.prototype.constructor = exports$2.DOMException;
45873
- }
45874
- function fetch(input, init) {
45875
- return new Promise(function(resolve, reject) {
45876
- var request = new Request(input, init);
45877
- if (request.signal && request.signal.aborted) return reject(new exports$2.DOMException("Aborted", "AbortError"));
45878
- var xhr = new XMLHttpRequest();
45879
- function abortXhr() {
45880
- xhr.abort();
45881
- }
45882
- xhr.onload = function() {
45883
- var options = {
45884
- statusText: xhr.statusText,
45885
- headers: parseHeaders(xhr.getAllResponseHeaders() || "")
45886
- };
45887
- if (request.url.indexOf("file://") === 0 && (xhr.status < 200 || xhr.status > 599)) options.status = 200;
45888
- else options.status = xhr.status;
45889
- options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
45890
- var body = "response" in xhr ? xhr.response : xhr.responseText;
45891
- setTimeout(function() {
45892
- resolve(new Response(body, options));
45893
- }, 0);
45894
- };
45895
- xhr.onerror = function() {
45896
- setTimeout(function() {
45897
- reject(/* @__PURE__ */ new TypeError("Network request failed"));
45898
- }, 0);
45899
- };
45900
- xhr.ontimeout = function() {
45901
- setTimeout(function() {
45902
- reject(/* @__PURE__ */ new TypeError("Network request timed out"));
45903
- }, 0);
45904
- };
45905
- xhr.onabort = function() {
45906
- setTimeout(function() {
45907
- reject(new exports$2.DOMException("Aborted", "AbortError"));
45908
- }, 0);
45909
- };
45910
- function fixUrl(url) {
45911
- try {
45912
- return url === "" && g.location.href ? g.location.href : url;
45913
- } catch (e) {
45914
- return url;
45915
- }
45916
- }
45917
- xhr.open(request.method, fixUrl(request.url), true);
45918
- if (request.credentials === "include") xhr.withCredentials = true;
45919
- else if (request.credentials === "omit") xhr.withCredentials = false;
45920
- if ("responseType" in xhr) {
45921
- if (support.blob) xhr.responseType = "blob";
45922
- else if (support.arrayBuffer) xhr.responseType = "arraybuffer";
45923
- }
45924
- if (init && typeof init.headers === "object" && !(init.headers instanceof Headers || g.Headers && init.headers instanceof g.Headers)) {
45925
- var names = [];
45926
- Object.getOwnPropertyNames(init.headers).forEach(function(name) {
45927
- names.push(normalizeName(name));
45928
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
45929
- });
45930
- request.headers.forEach(function(value, name) {
45931
- if (names.indexOf(name) === -1) xhr.setRequestHeader(name, value);
45932
- });
45933
- } else request.headers.forEach(function(value, name) {
45934
- xhr.setRequestHeader(name, value);
45935
- });
45936
- if (request.signal) {
45937
- request.signal.addEventListener("abort", abortXhr);
45938
- xhr.onreadystatechange = function() {
45939
- if (xhr.readyState === 4) request.signal.removeEventListener("abort", abortXhr);
45940
- };
45941
- }
45942
- xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit);
45943
- });
45944
- }
45945
- fetch.polyfill = true;
45946
- if (!g.fetch) {
45947
- g.fetch = fetch;
45948
- g.Headers = Headers;
45949
- g.Request = Request;
45950
- g.Response = Response;
45951
- }
45952
- exports$2.Headers = Headers;
45953
- exports$2.Request = Request;
45954
- exports$2.Response = Response;
45955
- exports$2.fetch = fetch;
45956
- Object.defineProperty(exports$2, "__esModule", { value: true });
45957
- }));
45958
- }));
45959
- //#endregion
45960
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/logger.js
45961
- var require_logger = /* @__PURE__ */ __commonJSMin(((exports) => {
45962
- Object.defineProperty(exports, "__esModule", { value: true });
45963
- exports.log = exports.Logger = exports.LogLevel = void 0;
45964
- exports.prettyPrint = prettyPrint;
45965
- const config_1 = require_config();
45966
- const shared_1 = require_shared();
45967
- const url = config_1.config.getLogsEndpoint();
45968
- const LOG_LEVEL = process.env.NEXT_PUBLIC_AXIOM_LOG_LEVEL || "debug";
45969
- var LogLevel;
45970
- (function(LogLevel) {
45971
- LogLevel[LogLevel["debug"] = 0] = "debug";
45972
- LogLevel[LogLevel["info"] = 1] = "info";
45973
- LogLevel[LogLevel["warn"] = 2] = "warn";
45974
- LogLevel[LogLevel["error"] = 3] = "error";
45975
- LogLevel[LogLevel["off"] = 100] = "off";
45976
- })(LogLevel || (exports.LogLevel = LogLevel = {}));
45977
- var Logger = class Logger {
45978
- constructor(initConfig = {}) {
45979
- this.logEvents = [];
45980
- this.throttledSendLogs = (0, shared_1.throttle)(this.sendLogs, 1e3);
45981
- this.children = [];
45982
- this.logLevel = LogLevel.debug;
45983
- this.config = {
45984
- autoFlush: true,
45985
- source: "frontend-log",
45986
- prettyPrint
45987
- };
45988
- this.debug = (message, args = {}) => {
45989
- this.log(LogLevel.debug, message, args);
45990
- };
45991
- this.info = (message, args = {}) => {
45992
- this.log(LogLevel.info, message, args);
45993
- };
45994
- this.warn = (message, args = {}) => {
45995
- this.log(LogLevel.warn, message, args);
45996
- };
45997
- this.error = (message, args = {}) => {
45998
- this.log(LogLevel.error, message, args);
45999
- };
46000
- this.with = (args) => {
46001
- const child = new Logger({
46002
- ...this.config,
46003
- args: {
46004
- ...this.config.args,
46005
- ...args
46006
- }
46007
- });
46008
- this.children.push(child);
46009
- return child;
46010
- };
46011
- this.withRequest = (req) => {
46012
- return new Logger({
46013
- ...this.config,
46014
- req: {
46015
- ...this.config.req,
46016
- ...req
46017
- }
46018
- });
46019
- };
46020
- this._transformEvent = (level, message, args = {}) => {
46021
- const logEvent = {
46022
- level: LogLevel[level].toString(),
46023
- message,
46024
- _time: new Date(Date.now()).toISOString(),
46025
- source: this.config.source,
46026
- fields: this.config.args || {},
46027
- "@app": { "next-axiom-version": config_1.Version }
46028
- };
46029
- if (args instanceof Error) logEvent.fields = {
46030
- ...logEvent.fields,
46031
- message: args.message,
46032
- stack: args.stack,
46033
- name: args.name,
46034
- cause: args.cause
46035
- };
46036
- else if (typeof args === "object" && args !== null && Object.keys(args).length > 0) {
46037
- const parsedArgs = JSON.parse(JSON.stringify(args, jsonFriendlyErrorReplacer));
46038
- logEvent.fields = {
46039
- ...logEvent.fields,
46040
- ...parsedArgs
46041
- };
46042
- } else if (args && args.length) logEvent.fields = {
46043
- ...logEvent.fields,
46044
- args
46045
- };
46046
- config_1.config.injectPlatformMetadata(logEvent, this.config.source);
46047
- if (this.config.req != null) {
46048
- logEvent.request = this.config.req;
46049
- if (logEvent.platform) logEvent.platform.route = this.config.req.path;
46050
- else if (logEvent.vercel) logEvent.vercel.route = this.config.req.path;
46051
- }
46052
- return logEvent;
46053
- };
46054
- this.log = (level, message, args = {}) => {
46055
- if (level < this.logLevel) return;
46056
- const logEvent = this._transformEvent(level, message, args);
46057
- this.logEvents.push(logEvent);
46058
- if (this.config.autoFlush) this.throttledSendLogs();
46059
- };
46060
- this.attachResponseStatus = (statusCode) => {
46061
- this.logEvents = this.logEvents.map((log) => {
46062
- if (log.request) log.request.statusCode = statusCode;
46063
- return log;
46064
- });
46065
- };
46066
- this.flush = async () => {
46067
- await Promise.all([this.sendLogs(), ...this.children.map((c) => c.flush())]);
46068
- };
46069
- this.initConfig = initConfig;
46070
- if (this.initConfig.logLevel != void 0 && this.initConfig.logLevel >= 0) this.logLevel = this.initConfig.logLevel;
46071
- else if (LOG_LEVEL) this.logLevel = LogLevel[LOG_LEVEL];
46072
- this.config = {
46073
- ...this.config,
46074
- ...initConfig
46075
- };
46076
- }
46077
- logHttpRequest(level, message, request, args) {
46078
- const logEvent = this._transformEvent(level, message, args);
46079
- logEvent.request = request;
46080
- this.logEvents.push(logEvent);
46081
- if (this.config.autoFlush) this.throttledSendLogs();
46082
- }
46083
- middleware(request, config) {
46084
- const req = {
46085
- ip: request.ip,
46086
- region: request.geo?.region,
46087
- method: request.method,
46088
- host: request.nextUrl.hostname,
46089
- path: request.nextUrl.pathname,
46090
- scheme: request.nextUrl.protocol.split(":")[0],
46091
- referer: request.headers.get("Referer"),
46092
- userAgent: request.headers.get("user-agent")
46093
- };
46094
- const message = `${request.method} ${request.nextUrl.pathname}`;
46095
- if (config?.logRequestDetails) return (0, shared_1.requestToJSON)(request).then((details) => {
46096
- const newReq = {
46097
- ...req,
46098
- details: Array.isArray(config.logRequestDetails) ? Object.fromEntries(Object.entries(details).filter(([key]) => config.logRequestDetails.includes(key))) : details
46099
- };
46100
- return this.logHttpRequest(LogLevel.info, message, newReq, {});
46101
- });
46102
- return this.logHttpRequest(LogLevel.info, message, req, {});
46103
- }
46104
- async sendLogs() {
46105
- if (!this.logEvents.length) return;
46106
- if (!config_1.config.isEnvVarsSet()) {
46107
- this.logEvents.forEach((ev) => this.config.prettyPrint ? this.config.prettyPrint(ev) : prettyPrint(ev));
46108
- this.logEvents = [];
46109
- return;
46110
- }
46111
- const method = "POST";
46112
- const keepalive = true;
46113
- const body = JSON.stringify(this.logEvents);
46114
- this.logEvents = [];
46115
- const headers = {
46116
- "Content-Type": "application/json",
46117
- "User-Agent": "next-axiom/v" + config_1.Version
46118
- };
46119
- if (config_1.config.token) headers["Authorization"] = `Bearer ${config_1.config.token}`;
46120
- const reqOptions = {
46121
- body,
46122
- method,
46123
- keepalive,
46124
- headers
46125
- };
46126
- function sendFallback() {
46127
- return fetch(url, reqOptions).catch(console.error);
46128
- }
46129
- try {
46130
- if (typeof fetch === "undefined") return (await require_fetch_umd())(url, reqOptions).catch(console.error);
46131
- else if (config_1.isBrowser && config_1.isVercelIntegration && navigator.sendBeacon) try {
46132
- if (!navigator.sendBeacon.bind(navigator)(url, body)) return sendFallback();
46133
- } catch (error) {
46134
- return sendFallback();
46135
- }
46136
- else return sendFallback();
46137
- } catch (e) {
46138
- console.warn(`Failed to send logs to Axiom: ${e}`);
46139
- this.logEvents = [...this.logEvents, JSON.parse(body)];
46140
- }
46141
- }
46142
- };
46143
- exports.Logger = Logger;
46144
- exports.log = new Logger({});
46145
- const levelColors = {
46146
- info: {
46147
- terminal: "32",
46148
- browser: "lightgreen"
46149
- },
46150
- debug: {
46151
- terminal: "36",
46152
- browser: "lightblue"
46153
- },
46154
- warn: {
46155
- terminal: "33",
46156
- browser: "yellow"
46157
- },
46158
- error: {
46159
- terminal: "31",
46160
- browser: "red"
46161
- }
46162
- };
46163
- function prettyPrint(ev) {
46164
- const hasFields = Object.keys(ev.fields).length > 0;
46165
- if (shared_1.isNoPrettyPrint) {
46166
- let msg = `${ev.level} - ${ev.message}`;
46167
- if (hasFields) msg += " " + JSON.stringify(ev.fields);
46168
- console.log(msg);
46169
- return;
46170
- }
46171
- let msgString = "";
46172
- let args = [ev.level, ev.message];
46173
- if (config_1.isBrowser) {
46174
- msgString = "%c%s - %s";
46175
- args = [`color: ${levelColors[ev.level].browser};`, ...args];
46176
- } else msgString = `\x1b[${levelColors[ev.level].terminal}m%s\x1b[0m - %s`;
46177
- if (hasFields) {
46178
- msgString += " %o";
46179
- args.push(ev.fields);
46180
- }
46181
- if (ev.request) {
46182
- msgString += " %o";
46183
- args.push(ev.request);
46184
- }
46185
- console.log.apply(console, [msgString, ...args]);
46186
- }
46187
- function jsonFriendlyErrorReplacer(key, value) {
46188
- if (value instanceof Error) return {
46189
- ...value,
46190
- name: value.name,
46191
- message: value.message,
46192
- stack: value.stack,
46193
- cause: jsonFriendlyErrorReplacer("", value.cause)
46194
- };
46195
- return value;
46196
- }
46197
- }));
46198
- //#endregion
46199
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/platform/base.js
46200
- var require_base = /* @__PURE__ */ __commonJSMin(((exports) => {
46201
- Object.defineProperty(exports, "__esModule", { value: true });
46202
- }));
46203
- //#endregion
46204
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/headers.js
46205
- var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46206
- var __defProp = Object.defineProperty;
46207
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46208
- var __getOwnPropNames = Object.getOwnPropertyNames;
46209
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46210
- var __export = (target, all) => {
46211
- for (var name in all) __defProp(target, name, {
46212
- get: all[name],
46213
- enumerable: true
46214
- });
46215
- };
46216
- var __copyProps = (to, from, except, desc) => {
46217
- if (from && typeof from === "object" || typeof from === "function") {
46218
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46219
- get: () => from[key],
46220
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46221
- });
46222
- }
46223
- return to;
46224
- };
46225
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46226
- var headers_exports = {};
46227
- __export(headers_exports, {
46228
- CITY_HEADER_NAME: () => CITY_HEADER_NAME,
46229
- COUNTRY_HEADER_NAME: () => COUNTRY_HEADER_NAME,
46230
- EMOJI_FLAG_UNICODE_STARTING_POSITION: () => EMOJI_FLAG_UNICODE_STARTING_POSITION,
46231
- IP_HEADER_NAME: () => IP_HEADER_NAME,
46232
- LATITUDE_HEADER_NAME: () => LATITUDE_HEADER_NAME,
46233
- LONGITUDE_HEADER_NAME: () => LONGITUDE_HEADER_NAME,
46234
- POSTAL_CODE_HEADER_NAME: () => POSTAL_CODE_HEADER_NAME,
46235
- REGION_HEADER_NAME: () => REGION_HEADER_NAME,
46236
- REQUEST_ID_HEADER_NAME: () => REQUEST_ID_HEADER_NAME,
46237
- geolocation: () => geolocation,
46238
- ipAddress: () => ipAddress
46239
- });
46240
- module.exports = __toCommonJS(headers_exports);
46241
- const CITY_HEADER_NAME = "x-vercel-ip-city";
46242
- const COUNTRY_HEADER_NAME = "x-vercel-ip-country";
46243
- const IP_HEADER_NAME = "x-real-ip";
46244
- const LATITUDE_HEADER_NAME = "x-vercel-ip-latitude";
46245
- const LONGITUDE_HEADER_NAME = "x-vercel-ip-longitude";
46246
- const REGION_HEADER_NAME = "x-vercel-ip-country-region";
46247
- const POSTAL_CODE_HEADER_NAME = "x-vercel-ip-postal-code";
46248
- const REQUEST_ID_HEADER_NAME = "x-vercel-id";
46249
- const EMOJI_FLAG_UNICODE_STARTING_POSITION = 127397;
46250
- function getHeader(headers, key) {
46251
- return headers.get(key) ?? void 0;
46252
- }
46253
- function getHeaderWithDecode(request, key) {
46254
- const header = getHeader(request.headers, key);
46255
- return header ? decodeURIComponent(header) : void 0;
46256
- }
46257
- function getFlag(countryCode) {
46258
- const regex = (/* @__PURE__ */ new RegExp("^[A-Z]{2}$")).test(countryCode);
46259
- if (!countryCode || !regex) return void 0;
46260
- return String.fromCodePoint(...countryCode.split("").map((char) => EMOJI_FLAG_UNICODE_STARTING_POSITION + char.charCodeAt(0)));
46261
- }
46262
- function ipAddress(input) {
46263
- return getHeader("headers" in input ? input.headers : input, IP_HEADER_NAME);
46264
- }
46265
- function getRegionFromRequestId(requestId) {
46266
- if (!requestId) return "dev1";
46267
- return requestId.split(":")[0];
46268
- }
46269
- function geolocation(request) {
46270
- return {
46271
- city: getHeaderWithDecode(request, CITY_HEADER_NAME),
46272
- country: getHeader(request.headers, COUNTRY_HEADER_NAME),
46273
- flag: getFlag(getHeader(request.headers, COUNTRY_HEADER_NAME)),
46274
- countryRegion: getHeader(request.headers, REGION_HEADER_NAME),
46275
- region: getRegionFromRequestId(getHeader(request.headers, REQUEST_ID_HEADER_NAME)),
46276
- latitude: getHeader(request.headers, LATITUDE_HEADER_NAME),
46277
- longitude: getHeader(request.headers, LONGITUDE_HEADER_NAME),
46278
- postalCode: getHeader(request.headers, POSTAL_CODE_HEADER_NAME)
46279
- };
46280
- }
46281
- 0 && (module.exports = {
46282
- CITY_HEADER_NAME,
46283
- COUNTRY_HEADER_NAME,
46284
- EMOJI_FLAG_UNICODE_STARTING_POSITION,
46285
- IP_HEADER_NAME,
46286
- LATITUDE_HEADER_NAME,
46287
- LONGITUDE_HEADER_NAME,
46288
- POSTAL_CODE_HEADER_NAME,
46289
- REGION_HEADER_NAME,
46290
- REQUEST_ID_HEADER_NAME,
46291
- geolocation,
46292
- ipAddress
46293
- });
46294
- }));
46295
- //#endregion
46296
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/get-env.js
46297
- var require_get_env = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46298
- var __defProp = Object.defineProperty;
46299
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46300
- var __getOwnPropNames = Object.getOwnPropertyNames;
46301
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46302
- var __export = (target, all) => {
46303
- for (var name in all) __defProp(target, name, {
46304
- get: all[name],
46305
- enumerable: true
46306
- });
46307
- };
46308
- var __copyProps = (to, from, except, desc) => {
46309
- if (from && typeof from === "object" || typeof from === "function") {
46310
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46311
- get: () => from[key],
46312
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46313
- });
46314
- }
46315
- return to;
46316
- };
46317
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46318
- var get_env_exports = {};
46319
- __export(get_env_exports, { getEnv: () => getEnv });
46320
- module.exports = __toCommonJS(get_env_exports);
46321
- const getEnv = (env = process.env) => ({
46322
- /**
46323
- * An indicator to show that System Environment Variables have been exposed to your project's Deployments.
46324
- * @example "1"
46325
- */
46326
- VERCEL: get(env, "VERCEL"),
46327
- /**
46328
- * An indicator that the code is running in a Continuous Integration environment.
46329
- * @example "1"
46330
- */
46331
- CI: get(env, "CI"),
46332
- /**
46333
- * The Environment that the app is deployed and running on.
46334
- * @example "production"
46335
- */
46336
- VERCEL_ENV: get(env, "VERCEL_ENV"),
46337
- /**
46338
- * The domain name of the generated deployment URL. The value does not include the protocol scheme https://.
46339
- * NOTE: This Variable cannot be used in conjunction with Standard Deployment Protection.
46340
- * @example "*.vercel.app"
46341
- */
46342
- VERCEL_URL: get(env, "VERCEL_URL"),
46343
- /**
46344
- * The domain name of the generated Git branch URL. The value does not include the protocol scheme https://.
46345
- * @example "*-git-*.vercel.app"
46346
- */
46347
- VERCEL_BRANCH_URL: get(env, "VERCEL_BRANCH_URL"),
46348
- /**
46349
- * A production domain name of the project. This is useful to reliably generate links that point to production such as OG-image URLs.
46350
- * The value does not include the protocol scheme https://.
46351
- * @example "myproject.vercel.app"
46352
- */
46353
- VERCEL_PROJECT_PRODUCTION_URL: get(env, "VERCEL_PROJECT_PRODUCTION_URL"),
46354
- /**
46355
- * The ID of the Region where the app is running.
46356
- *
46357
- * Possible values:
46358
- * - arn1 (Stockholm, Sweden)
46359
- * - bom1 (Mumbai, India)
46360
- * - cdg1 (Paris, France)
46361
- * - cle1 (Cleveland, USA)
46362
- * - cpt1 (Cape Town, South Africa)
46363
- * - dub1 (Dublin, Ireland)
46364
- * - fra1 (Frankfurt, Germany)
46365
- * - gru1 (São Paulo, Brazil)
46366
- * - hkg1 (Hong Kong)
46367
- * - hnd1 (Tokyo, Japan)
46368
- * - iad1 (Washington, D.C., USA)
46369
- * - icn1 (Seoul, South Korea)
46370
- * - kix1 (Osaka, Japan)
46371
- * - lhr1 (London, United Kingdom)
46372
- * - pdx1 (Portland, USA)
46373
- * - sfo1 (San Francisco, USA)
46374
- * - sin1 (Singapore)
46375
- * - syd1 (Sydney, Australia)
46376
- * - dev1 (Development Region)
46377
- *
46378
- * @example "iad1"
46379
- */
46380
- VERCEL_REGION: get(env, "VERCEL_REGION"),
46381
- /**
46382
- * The unique identifier for the deployment, which can be used to implement Skew Protection.
46383
- * @example "dpl_7Gw5ZMBpQA8h9GF832KGp7nwbuh3"
46384
- */
46385
- VERCEL_DEPLOYMENT_ID: get(env, "VERCEL_DEPLOYMENT_ID"),
46386
- /**
46387
- * When Skew Protection is enabled in Project Settings, this value is set to 1.
46388
- * @example "1"
46389
- */
46390
- VERCEL_SKEW_PROTECTION_ENABLED: get(env, "VERCEL_SKEW_PROTECTION_ENABLED"),
46391
- /**
46392
- * The Protection Bypass for Automation value, if the secret has been generated in the project's Deployment Protection settings.
46393
- */
46394
- VERCEL_AUTOMATION_BYPASS_SECRET: get(env, "VERCEL_AUTOMATION_BYPASS_SECRET"),
46395
- /**
46396
- * The Git Provider the deployment is triggered from.
46397
- * @example "github"
46398
- */
46399
- VERCEL_GIT_PROVIDER: get(env, "VERCEL_GIT_PROVIDER"),
46400
- /**
46401
- * The origin repository the deployment is triggered from.
46402
- * @example "my-site"
46403
- */
46404
- VERCEL_GIT_REPO_SLUG: get(env, "VERCEL_GIT_REPO_SLUG"),
46405
- /**
46406
- * The account that owns the repository the deployment is triggered from.
46407
- * @example "acme"
46408
- */
46409
- VERCEL_GIT_REPO_OWNER: get(env, "VERCEL_GIT_REPO_OWNER"),
46410
- /**
46411
- * The ID of the repository the deployment is triggered from.
46412
- * @example "117716146"
46413
- */
46414
- VERCEL_GIT_REPO_ID: get(env, "VERCEL_GIT_REPO_ID"),
46415
- /**
46416
- * The git branch of the commit the deployment was triggered by.
46417
- * @example "improve-about-page"
46418
- */
46419
- VERCEL_GIT_COMMIT_REF: get(env, "VERCEL_GIT_COMMIT_REF"),
46420
- /**
46421
- * The git SHA of the commit the deployment was triggered by.
46422
- * @example "fa1eade47b73733d6312d5abfad33ce9e4068081"
46423
- */
46424
- VERCEL_GIT_COMMIT_SHA: get(env, "VERCEL_GIT_COMMIT_SHA"),
46425
- /**
46426
- * The message attached to the commit the deployment was triggered by.
46427
- * @example "Update about page"
46428
- */
46429
- VERCEL_GIT_COMMIT_MESSAGE: get(env, "VERCEL_GIT_COMMIT_MESSAGE"),
46430
- /**
46431
- * The username attached to the author of the commit that the project was deployed by.
46432
- * @example "johndoe"
46433
- */
46434
- VERCEL_GIT_COMMIT_AUTHOR_LOGIN: get(env, "VERCEL_GIT_COMMIT_AUTHOR_LOGIN"),
46435
- /**
46436
- * The name attached to the author of the commit that the project was deployed by.
46437
- * @example "John Doe"
46438
- */
46439
- VERCEL_GIT_COMMIT_AUTHOR_NAME: get(env, "VERCEL_GIT_COMMIT_AUTHOR_NAME"),
46440
- /**
46441
- * The git SHA of the last successful deployment for the project and branch.
46442
- * NOTE: This Variable is only exposed when an Ignored Build Step is provided.
46443
- * @example "fa1eade47b73733d6312d5abfad33ce9e4068080"
46444
- */
46445
- VERCEL_GIT_PREVIOUS_SHA: get(env, "VERCEL_GIT_PREVIOUS_SHA"),
46446
- /**
46447
- * The pull request id the deployment was triggered by. If a deployment is created on a branch before a pull request is made, this value will be an empty string.
46448
- * @example "23"
46449
- */
46450
- VERCEL_GIT_PULL_REQUEST_ID: get(env, "VERCEL_GIT_PULL_REQUEST_ID")
46451
- });
46452
- const get = (env, key) => {
46453
- const value = env[key];
46454
- return value === "" ? void 0 : value;
46455
- };
46456
- 0 && (module.exports = { getEnv });
46457
- }));
46458
- //#endregion
46459
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/get-context.js
46460
- var require_get_context = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46461
- var __defProp = Object.defineProperty;
46462
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46463
- var __getOwnPropNames = Object.getOwnPropertyNames;
46464
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46465
- var __export = (target, all) => {
46466
- for (var name in all) __defProp(target, name, {
46467
- get: all[name],
46468
- enumerable: true
46469
- });
46470
- };
46471
- var __copyProps = (to, from, except, desc) => {
46472
- if (from && typeof from === "object" || typeof from === "function") {
46473
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46474
- get: () => from[key],
46475
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46476
- });
46477
- }
46478
- return to;
46479
- };
46480
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46481
- var get_context_exports = {};
46482
- __export(get_context_exports, {
46483
- SYMBOL_FOR_REQ_CONTEXT: () => SYMBOL_FOR_REQ_CONTEXT,
46484
- getContext: () => getContext
46485
- });
46486
- module.exports = __toCommonJS(get_context_exports);
46487
- const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
46488
- function getContext() {
46489
- return globalThis[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
46490
- }
46491
- 0 && (module.exports = {
46492
- SYMBOL_FOR_REQ_CONTEXT,
46493
- getContext
46494
- });
46495
- }));
46496
- //#endregion
46497
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/wait-until.js
46498
- var require_wait_until = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46499
- var __defProp = Object.defineProperty;
46500
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46501
- var __getOwnPropNames = Object.getOwnPropertyNames;
46502
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46503
- var __export = (target, all) => {
46504
- for (var name in all) __defProp(target, name, {
46505
- get: all[name],
46506
- enumerable: true
46507
- });
46508
- };
46509
- var __copyProps = (to, from, except, desc) => {
46510
- if (from && typeof from === "object" || typeof from === "function") {
46511
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46512
- get: () => from[key],
46513
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46514
- });
46515
- }
46516
- return to;
46517
- };
46518
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46519
- var wait_until_exports = {};
46520
- __export(wait_until_exports, { waitUntil: () => waitUntil });
46521
- module.exports = __toCommonJS(wait_until_exports);
46522
- var import_get_context = require_get_context();
46523
- const waitUntil = (promise) => {
46524
- if (promise === null || typeof promise !== "object" || typeof promise.then !== "function") throw new TypeError(`waitUntil can only be called with a Promise, got ${typeof promise}`);
46525
- return (0, import_get_context.getContext)().waitUntil?.(promise);
46526
- };
46527
- 0 && (module.exports = { waitUntil });
46528
- }));
46529
- //#endregion
46530
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/middleware.js
46531
- var require_middleware = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46532
- var __defProp = Object.defineProperty;
46533
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46534
- var __getOwnPropNames = Object.getOwnPropertyNames;
46535
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46536
- var __export = (target, all) => {
46537
- for (var name in all) __defProp(target, name, {
46538
- get: all[name],
46539
- enumerable: true
46540
- });
46541
- };
46542
- var __copyProps = (to, from, except, desc) => {
46543
- if (from && typeof from === "object" || typeof from === "function") {
46544
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46545
- get: () => from[key],
46546
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46547
- });
46548
- }
46549
- return to;
46550
- };
46551
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46552
- var middleware_exports = {};
46553
- __export(middleware_exports, {
46554
- next: () => next,
46555
- rewrite: () => rewrite
46556
- });
46557
- module.exports = __toCommonJS(middleware_exports);
46558
- function handleMiddlewareField(init, headers) {
46559
- if (init?.request?.headers) {
46560
- if (!(init.request.headers instanceof Headers)) throw new Error("request.headers must be an instance of Headers");
46561
- const keys = [];
46562
- for (const [key, value] of init.request.headers) {
46563
- headers.set("x-middleware-request-" + key, value);
46564
- keys.push(key);
46565
- }
46566
- headers.set("x-middleware-override-headers", keys.join(","));
46567
- }
46568
- }
46569
- function rewrite(destination, init) {
46570
- const headers = new Headers(init?.headers ?? {});
46571
- headers.set("x-middleware-rewrite", String(destination));
46572
- handleMiddlewareField(init, headers);
46573
- return new Response(null, {
46574
- ...init,
46575
- headers
46576
- });
46577
- }
46578
- function next(init) {
46579
- const headers = new Headers(init?.headers ?? {});
46580
- headers.set("x-middleware-next", "1");
46581
- handleMiddlewareField(init, headers);
46582
- return new Response(null, {
46583
- ...init,
46584
- headers
46585
- });
46586
- }
46587
- 0 && (module.exports = {
46588
- next,
46589
- rewrite
46590
- });
46591
- }));
46592
- //#endregion
46593
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/cache/in-memory-cache.js
46594
- var require_in_memory_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46595
- var __defProp = Object.defineProperty;
46596
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46597
- var __getOwnPropNames = Object.getOwnPropertyNames;
46598
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46599
- var __export = (target, all) => {
46600
- for (var name in all) __defProp(target, name, {
46601
- get: all[name],
46602
- enumerable: true
46603
- });
46604
- };
46605
- var __copyProps = (to, from, except, desc) => {
46606
- if (from && typeof from === "object" || typeof from === "function") {
46607
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46608
- get: () => from[key],
46609
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46610
- });
46611
- }
46612
- return to;
46613
- };
46614
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46615
- var in_memory_cache_exports = {};
46616
- __export(in_memory_cache_exports, { InMemoryCache: () => InMemoryCache });
46617
- module.exports = __toCommonJS(in_memory_cache_exports);
46618
- var InMemoryCache = class {
46619
- constructor() {
46620
- this.cache = {};
46621
- }
46622
- async get(key) {
46623
- const entry = this.cache[key];
46624
- if (entry) {
46625
- if (entry.ttl && entry.lastModified + entry.ttl * 1e3 < Date.now()) {
46626
- await this.delete(key);
46627
- return null;
46628
- }
46629
- return entry.value;
46630
- }
46631
- return null;
46632
- }
46633
- async set(key, value, options) {
46634
- this.cache[key] = {
46635
- value,
46636
- lastModified: Date.now(),
46637
- ttl: options?.ttl,
46638
- tags: new Set(options?.tags || [])
46639
- };
46640
- }
46641
- async delete(key) {
46642
- delete this.cache[key];
46643
- }
46644
- async expireTag(tag) {
46645
- const tags = Array.isArray(tag) ? tag : [tag];
46646
- for (const key in this.cache) if (Object.prototype.hasOwnProperty.call(this.cache, key)) {
46647
- const entry = this.cache[key];
46648
- if (tags.some((t) => entry.tags.has(t))) delete this.cache[key];
46649
- }
46650
- }
46651
- };
46652
- 0 && (module.exports = { InMemoryCache });
46653
- }));
46654
- //#endregion
46655
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/cache/build-client.js
46656
- var require_build_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46657
- var __defProp = Object.defineProperty;
46658
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46659
- var __getOwnPropNames = Object.getOwnPropertyNames;
46660
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46661
- var __export = (target, all) => {
46662
- for (var name in all) __defProp(target, name, {
46663
- get: all[name],
46664
- enumerable: true
46665
- });
46666
- };
46667
- var __copyProps = (to, from, except, desc) => {
46668
- if (from && typeof from === "object" || typeof from === "function") {
46669
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46670
- get: () => from[key],
46671
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46672
- });
46673
- }
46674
- return to;
46675
- };
46676
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46677
- var build_client_exports = {};
46678
- __export(build_client_exports, { BuildCache: () => BuildCache });
46679
- module.exports = __toCommonJS(build_client_exports);
46680
- var import_index = require_cache();
46681
- var BuildCache = class {
46682
- constructor({ endpoint, headers, onError }) {
46683
- this.get = async (key) => {
46684
- try {
46685
- const res = await fetch(`${this.endpoint}${key}`, {
46686
- headers: this.headers,
46687
- method: "GET"
46688
- });
46689
- if (res.status === 404) return null;
46690
- if (res.status === 200) {
46691
- if (res.headers.get(import_index.HEADERS_VERCEL_CACHE_STATE) !== import_index.PkgCacheState.Fresh) {
46692
- res.body?.cancel?.();
46693
- return null;
46694
- }
46695
- return await res.json();
46696
- } else throw new Error(`Failed to get cache: ${res.statusText}`);
46697
- } catch (error) {
46698
- this.onError?.(error);
46699
- return null;
46700
- }
46701
- };
46702
- this.set = async (key, value, options) => {
46703
- try {
46704
- const optionalHeaders = {};
46705
- if (options?.ttl) optionalHeaders[import_index.HEADERS_VERCEL_REVALIDATE] = options.ttl.toString();
46706
- if (options?.tags && options.tags.length > 0) optionalHeaders[import_index.HEADERS_VERCEL_CACHE_TAGS] = options.tags.join(",");
46707
- if (options?.name) optionalHeaders[import_index.HEADERS_VERCEL_CACHE_ITEM_NAME] = options.name;
46708
- const res = await fetch(`${this.endpoint}${key}`, {
46709
- method: "POST",
46710
- headers: {
46711
- ...this.headers,
46712
- ...optionalHeaders
46713
- },
46714
- body: JSON.stringify(value)
46715
- });
46716
- if (res.status !== 200) throw new Error(`Failed to set cache: ${res.status} ${res.statusText}`);
46717
- } catch (error) {
46718
- this.onError?.(error);
46719
- }
46720
- };
46721
- this.delete = async (key) => {
46722
- try {
46723
- const res = await fetch(`${this.endpoint}${key}`, {
46724
- method: "DELETE",
46725
- headers: this.headers
46726
- });
46727
- if (res.status !== 200) throw new Error(`Failed to delete cache: ${res.statusText}`);
46728
- } catch (error) {
46729
- this.onError?.(error);
46730
- }
46731
- };
46732
- this.expireTag = async (tag) => {
46733
- try {
46734
- if (Array.isArray(tag)) tag = tag.join(",");
46735
- const res = await fetch(`${this.endpoint}revalidate?tags=${tag}`, {
46736
- method: "POST",
46737
- headers: this.headers
46738
- });
46739
- if (res.status !== 200) throw new Error(`Failed to revalidate tag: ${res.statusText}`);
46740
- } catch (error) {
46741
- this.onError?.(error);
46742
- }
46743
- };
46744
- this.endpoint = endpoint;
46745
- this.headers = headers;
46746
- this.onError = onError;
46747
- }
46748
- };
46749
- 0 && (module.exports = { BuildCache });
46750
- }));
46751
- //#endregion
46752
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/cache/index.js
46753
- var require_cache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46754
- var __defProp = Object.defineProperty;
46755
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46756
- var __getOwnPropNames = Object.getOwnPropertyNames;
46757
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46758
- var __export = (target, all) => {
46759
- for (var name in all) __defProp(target, name, {
46760
- get: all[name],
46761
- enumerable: true
46762
- });
46763
- };
46764
- var __copyProps = (to, from, except, desc) => {
46765
- if (from && typeof from === "object" || typeof from === "function") {
46766
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46767
- get: () => from[key],
46768
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46769
- });
46770
- }
46771
- return to;
46772
- };
46773
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46774
- var cache_exports = {};
46775
- __export(cache_exports, {
46776
- HEADERS_VERCEL_CACHE_ITEM_NAME: () => HEADERS_VERCEL_CACHE_ITEM_NAME,
46777
- HEADERS_VERCEL_CACHE_STATE: () => HEADERS_VERCEL_CACHE_STATE,
46778
- HEADERS_VERCEL_CACHE_TAGS: () => HEADERS_VERCEL_CACHE_TAGS,
46779
- HEADERS_VERCEL_REVALIDATE: () => HEADERS_VERCEL_REVALIDATE,
46780
- PkgCacheState: () => PkgCacheState,
46781
- getCache: () => getCache
46782
- });
46783
- module.exports = __toCommonJS(cache_exports);
46784
- var import_get_context = require_get_context();
46785
- var import_in_memory_cache = require_in_memory_cache();
46786
- var import_build_client = require_build_client();
46787
- const defaultKeyHashFunction = (key) => {
46788
- let hash = 5381;
46789
- for (let i = 0; i < key.length; i++) hash = hash * 33 ^ key.charCodeAt(i);
46790
- return (hash >>> 0).toString(16);
46791
- };
46792
- const defaultNamespaceSeparator = "$";
46793
- let inMemoryCacheInstance = null;
46794
- let buildCacheInstance = null;
46795
- const getCache = (cacheOptions) => {
46796
- const resolveCache = () => {
46797
- let cache;
46798
- if ((0, import_get_context.getContext)().cache) cache = (0, import_get_context.getContext)().cache;
46799
- else cache = getCacheImplementation(process.env.SUSPENSE_CACHE_DEBUG === "true");
46800
- return cache;
46801
- };
46802
- return wrapWithKeyTransformation(resolveCache, createKeyTransformer(cacheOptions));
46803
- };
46804
- function createKeyTransformer(cacheOptions) {
46805
- const hashFunction = cacheOptions?.keyHashFunction || defaultKeyHashFunction;
46806
- return (key) => {
46807
- if (!cacheOptions?.namespace) return hashFunction(key);
46808
- const separator = cacheOptions.namespaceSeparator || defaultNamespaceSeparator;
46809
- return `${cacheOptions.namespace}${separator}${hashFunction(key)}`;
46810
- };
46811
- }
46812
- function wrapWithKeyTransformation(resolveCache, makeKey) {
46813
- return {
46814
- get: (key) => {
46815
- return resolveCache().get(makeKey(key));
46816
- },
46817
- set: (key, value, options) => {
46818
- return resolveCache().set(makeKey(key), value, options);
46819
- },
46820
- delete: (key) => {
46821
- return resolveCache().delete(makeKey(key));
46822
- },
46823
- expireTag: (tag) => {
46824
- return resolveCache().expireTag(tag);
46825
- }
46826
- };
46827
- }
46828
- let warnedCacheUnavailable = false;
46829
- function getCacheImplementation(debug) {
46830
- if (!inMemoryCacheInstance) inMemoryCacheInstance = new import_in_memory_cache.InMemoryCache();
46831
- if (process.env.RUNTIME_CACHE_DISABLE_BUILD_CACHE === "true") {
46832
- debug && console.log("Using InMemoryCache as build cache is disabled");
46833
- return inMemoryCacheInstance;
46834
- }
46835
- const { RUNTIME_CACHE_ENDPOINT, RUNTIME_CACHE_HEADERS } = process.env;
46836
- if (debug) console.log("Runtime cache environment variables:", {
46837
- RUNTIME_CACHE_ENDPOINT,
46838
- RUNTIME_CACHE_HEADERS
46839
- });
46840
- if (!RUNTIME_CACHE_ENDPOINT || !RUNTIME_CACHE_HEADERS) {
46841
- if (!warnedCacheUnavailable) {
46842
- console.warn("Runtime Cache unavailable in this environment. Falling back to in-memory cache.");
46843
- warnedCacheUnavailable = true;
46844
- }
46845
- return inMemoryCacheInstance;
46846
- }
46847
- if (!buildCacheInstance) {
46848
- let parsedHeaders = {};
46849
- try {
46850
- parsedHeaders = JSON.parse(RUNTIME_CACHE_HEADERS);
46851
- } catch (e) {
46852
- console.error("Failed to parse RUNTIME_CACHE_HEADERS:", e);
46853
- return inMemoryCacheInstance;
46854
- }
46855
- buildCacheInstance = new import_build_client.BuildCache({
46856
- endpoint: RUNTIME_CACHE_ENDPOINT,
46857
- headers: parsedHeaders,
46858
- onError: (error) => console.error(error)
46859
- });
46860
- }
46861
- return buildCacheInstance;
46862
- }
46863
- var PkgCacheState = /* @__PURE__ */ ((PkgCacheState2) => {
46864
- PkgCacheState2["Fresh"] = "fresh";
46865
- PkgCacheState2["Stale"] = "stale";
46866
- PkgCacheState2["Expired"] = "expired";
46867
- PkgCacheState2["NotFound"] = "notFound";
46868
- PkgCacheState2["Error"] = "error";
46869
- return PkgCacheState2;
46870
- })(PkgCacheState || {});
46871
- const HEADERS_VERCEL_CACHE_STATE = "x-vercel-cache-state";
46872
- const HEADERS_VERCEL_REVALIDATE = "x-vercel-revalidate";
46873
- const HEADERS_VERCEL_CACHE_TAGS = "x-vercel-cache-tags";
46874
- const HEADERS_VERCEL_CACHE_ITEM_NAME = "x-vercel-cache-item-name";
46875
- 0 && (module.exports = {
46876
- HEADERS_VERCEL_CACHE_ITEM_NAME,
46877
- HEADERS_VERCEL_CACHE_STATE,
46878
- HEADERS_VERCEL_CACHE_TAGS,
46879
- HEADERS_VERCEL_REVALIDATE,
46880
- PkgCacheState,
46881
- getCache
46882
- });
46883
- }));
46884
- //#endregion
46885
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/db-connections/index.js
46886
- var require_db_connections = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46887
- var __defProp = Object.defineProperty;
46888
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
46889
- var __getOwnPropNames = Object.getOwnPropertyNames;
46890
- var __hasOwnProp = Object.prototype.hasOwnProperty;
46891
- var __export = (target, all) => {
46892
- for (var name in all) __defProp(target, name, {
46893
- get: all[name],
46894
- enumerable: true
46895
- });
46896
- };
46897
- var __copyProps = (to, from, except, desc) => {
46898
- if (from && typeof from === "object" || typeof from === "function") {
46899
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
46900
- get: () => from[key],
46901
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46902
- });
46903
- }
46904
- return to;
46905
- };
46906
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46907
- var db_connections_exports = {};
46908
- __export(db_connections_exports, {
46909
- attachDatabasePool: () => attachDatabasePool,
46910
- experimental_attachDatabasePool: () => experimental_attachDatabasePool
46911
- });
46912
- module.exports = __toCommonJS(db_connections_exports);
46913
- var import_get_context = require_get_context();
46914
- const DEBUG = !!process.env.DEBUG;
46915
- function getIdleTimeout(dbPool) {
46916
- if ("options" in dbPool && dbPool.options) {
46917
- if ("idleTimeoutMillis" in dbPool.options) return typeof dbPool.options.idleTimeoutMillis === "number" ? dbPool.options.idleTimeoutMillis : 1e4;
46918
- if ("maxIdleTimeMS" in dbPool.options) return typeof dbPool.options.maxIdleTimeMS === "number" ? dbPool.options.maxIdleTimeMS : 0;
46919
- if ("status" in dbPool) return 5e3;
46920
- if ("connect" in dbPool && "execute" in dbPool) return 3e4;
46921
- }
46922
- if ("config" in dbPool && dbPool.config) {
46923
- if ("connectionConfig" in dbPool.config && dbPool.config.connectionConfig) return dbPool.config.connectionConfig.idleTimeout || 6e4;
46924
- if ("idleTimeout" in dbPool.config) return typeof dbPool.config.idleTimeout === "number" ? dbPool.config.idleTimeout : 6e4;
46925
- }
46926
- if ("poolTimeout" in dbPool) return typeof dbPool.poolTimeout === "number" ? dbPool.poolTimeout : 6e4;
46927
- if ("idleTimeout" in dbPool) return typeof dbPool.idleTimeout === "number" ? dbPool.idleTimeout : 0;
46928
- return 1e4;
46929
- }
46930
- let idleTimeout = null;
46931
- let idleTimeoutResolve = () => {};
46932
- const bootTime = Date.now();
46933
- const maximumDuration = 900 * 1e3 - 1e3;
46934
- function waitUntilIdleTimeout(dbPool) {
46935
- if (!process.env.VERCEL_URL) return;
46936
- if (idleTimeout) {
46937
- clearTimeout(idleTimeout);
46938
- idleTimeoutResolve();
46939
- }
46940
- const promise = new Promise((resolve) => {
46941
- idleTimeoutResolve = resolve;
46942
- });
46943
- const waitTime = Math.min(getIdleTimeout(dbPool) + 100, maximumDuration - (Date.now() - bootTime));
46944
- idleTimeout = setTimeout(() => {
46945
- idleTimeoutResolve?.();
46946
- if (DEBUG) console.log("Database pool idle timeout reached. Releasing connections.");
46947
- }, waitTime);
46948
- const requestContext = (0, import_get_context.getContext)();
46949
- if (requestContext?.waitUntil) requestContext.waitUntil(promise);
46950
- else console.warn("Pool release event triggered outside of request scope.");
46951
- }
46952
- function attachDatabasePool(dbPool) {
46953
- if (idleTimeout) {
46954
- idleTimeoutResolve?.();
46955
- clearTimeout(idleTimeout);
46956
- }
46957
- if ("on" in dbPool && dbPool.on && "options" in dbPool && "idleTimeoutMillis" in dbPool.options) {
46958
- dbPool.on("release", () => {
46959
- if (DEBUG) console.log("Client released from pool");
46960
- waitUntilIdleTimeout(dbPool);
46961
- });
46962
- return;
46963
- } else if ("on" in dbPool && dbPool.on && "config" in dbPool && dbPool.config && "connectionConfig" in dbPool.config) {
46964
- dbPool.on("release", () => {
46965
- if (DEBUG) console.log("MySQL client released from pool");
46966
- waitUntilIdleTimeout(dbPool);
46967
- });
46968
- return;
46969
- } else if ("on" in dbPool && dbPool.on && "config" in dbPool && dbPool.config && "idleTimeout" in dbPool.config) {
46970
- dbPool.on("release", () => {
46971
- if (DEBUG) console.log("MySQL2/MariaDB client released from pool");
46972
- waitUntilIdleTimeout(dbPool);
46973
- });
46974
- return;
46975
- }
46976
- if ("on" in dbPool && dbPool.on && "options" in dbPool && dbPool.options && "maxIdleTimeMS" in dbPool.options) {
46977
- dbPool.on("connectionCheckedOut", () => {
46978
- if (DEBUG) console.log("MongoDB connection checked out");
46979
- waitUntilIdleTimeout(dbPool);
46980
- });
46981
- return;
46982
- }
46983
- if ("on" in dbPool && dbPool.on && "options" in dbPool && dbPool.options && "socket" in dbPool.options) {
46984
- dbPool.on("end", () => {
46985
- if (DEBUG) console.log("Redis connection ended");
46986
- waitUntilIdleTimeout(dbPool);
46987
- });
46988
- return;
46989
- }
46990
- throw new Error("Unsupported database pool type");
46991
- }
46992
- const experimental_attachDatabasePool = attachDatabasePool;
46993
- 0 && (module.exports = {
46994
- attachDatabasePool,
46995
- experimental_attachDatabasePool
46996
- });
46997
- }));
46998
- //#endregion
46999
- //#region ../../node_modules/.pnpm/@vercel+functions@2.2.13/node_modules/@vercel/functions/index.js
47000
- var require_functions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
47001
- var __defProp = Object.defineProperty;
47002
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
47003
- var __getOwnPropNames = Object.getOwnPropertyNames;
47004
- var __hasOwnProp = Object.prototype.hasOwnProperty;
47005
- var __export = (target, all) => {
47006
- for (var name in all) __defProp(target, name, {
47007
- get: all[name],
47008
- enumerable: true
47009
- });
47010
- };
47011
- var __copyProps = (to, from, except, desc) => {
47012
- if (from && typeof from === "object" || typeof from === "function") {
47013
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
47014
- get: () => from[key],
47015
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
47016
- });
47017
- }
47018
- return to;
47019
- };
47020
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47021
- var src_exports = {};
47022
- __export(src_exports, {
47023
- attachDatabasePool: () => import_db_connections.attachDatabasePool,
47024
- experimental_attachDatabasePool: () => import_db_connections.experimental_attachDatabasePool,
47025
- geolocation: () => import_headers.geolocation,
47026
- getCache: () => import_cache.getCache,
47027
- getEnv: () => import_get_env.getEnv,
47028
- ipAddress: () => import_headers.ipAddress,
47029
- next: () => import_middleware.next,
47030
- rewrite: () => import_middleware.rewrite,
47031
- waitUntil: () => import_wait_until.waitUntil
47032
- });
47033
- module.exports = __toCommonJS(src_exports);
47034
- var import_headers = require_headers();
47035
- var import_get_env = require_get_env();
47036
- var import_wait_until = require_wait_until();
47037
- var import_middleware = require_middleware();
47038
- var import_cache = require_cache();
47039
- var import_db_connections = require_db_connections();
47040
- 0 && (module.exports = {
47041
- attachDatabasePool,
47042
- experimental_attachDatabasePool,
47043
- geolocation,
47044
- getCache,
47045
- getEnv,
47046
- ipAddress,
47047
- next,
47048
- rewrite,
47049
- waitUntil
47050
- });
47051
- }));
47052
- //#endregion
47053
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/withAxiom.js
47054
- var require_withAxiom = /* @__PURE__ */ __commonJSMin(((exports) => {
47055
- Object.defineProperty(exports, "__esModule", { value: true });
47056
- exports.withAxiomNextConfig = withAxiomNextConfig;
47057
- exports.withAxiomRouteHandler = withAxiomRouteHandler;
47058
- exports.withAxiom = withAxiom;
47059
- const functions_1 = require_functions();
47060
- const config_1 = require_config();
47061
- const logger_1 = require_logger();
47062
- const shared_1 = require_shared();
47063
- function applyAxiomRewrites(nextConfig) {
47064
- return {
47065
- ...nextConfig,
47066
- rewrites: async () => {
47067
- const rewrites = await nextConfig.rewrites?.();
47068
- const webVitalsEndpoint = config_1.config.getIngestURL(shared_1.EndpointType.webVitals);
47069
- const logsEndpoint = config_1.config.getIngestURL(shared_1.EndpointType.logs);
47070
- if (!webVitalsEndpoint && !logsEndpoint) {
47071
- const log = new logger_1.Logger();
47072
- log.warn("axiom: Envvars not detected. If this is production please see https://github.com/axiomhq/next-axiom for help");
47073
- log.warn("axiom: Sending Web Vitals to /dev/null");
47074
- log.warn("axiom: Sending logs to console");
47075
- return rewrites || [];
47076
- }
47077
- const axiomRewrites = [{
47078
- source: `${config_1.config.proxyPath}/web-vitals`,
47079
- destination: webVitalsEndpoint,
47080
- basePath: false
47081
- }, {
47082
- source: `${config_1.config.proxyPath}/logs`,
47083
- destination: logsEndpoint,
47084
- basePath: false
47085
- }];
47086
- if (!rewrites) return axiomRewrites;
47087
- else if (Array.isArray(rewrites)) return rewrites.concat(axiomRewrites);
47088
- else {
47089
- rewrites.afterFiles = (rewrites.afterFiles || []).concat(axiomRewrites);
47090
- return rewrites;
47091
- }
47092
- }
47093
- };
47094
- }
47095
- function withAxiomNextConfig(nextConfigOrFn) {
47096
- if (typeof nextConfigOrFn === "function") return async (phase, ctx) => {
47097
- const nextConfig = await nextConfigOrFn(phase, ctx);
47098
- return applyAxiomRewrites(Object.assign({}, nextConfig));
47099
- };
47100
- return applyAxiomRewrites(Object.assign({}, nextConfigOrFn));
47101
- }
47102
- function withAxiomRouteHandler(handler, config) {
47103
- return async (req, arg) => {
47104
- let region = "";
47105
- if ("geo" in req) region = req.geo?.region ?? "";
47106
- let pathname = "";
47107
- if ("nextUrl" in req) pathname = req.nextUrl.pathname;
47108
- else if (req instanceof Request) pathname = new URL(req.url).pathname;
47109
- const requestDetails = Array.isArray(config?.logRequestDetails) || config?.logRequestDetails === true ? await (0, shared_1.requestToJSON)(req) : void 0;
47110
- const report = {
47111
- startTime: (/* @__PURE__ */ new Date()).getTime(),
47112
- endTime: (/* @__PURE__ */ new Date()).getTime(),
47113
- path: pathname,
47114
- method: req.method,
47115
- host: req.headers.get("host"),
47116
- userAgent: req.headers.get("user-agent"),
47117
- scheme: req.url.split("://")[0],
47118
- ip: req.headers.get("x-forwarded-for"),
47119
- region,
47120
- details: Array.isArray(config?.logRequestDetails) ? Object.fromEntries(Object.entries(requestDetails).filter(([key]) => (config?.logRequestDetails).includes(key))) : requestDetails
47121
- };
47122
- const logger = new logger_1.Logger({
47123
- req: report,
47124
- source: config_1.isEdgeRuntime ? "edge" : "lambda"
47125
- });
47126
- const log = logger.with({});
47127
- log.config.source = `${config_1.isEdgeRuntime ? "edge" : "lambda"}${!config_1.isVercelIntegration ? "-log" : ""}`;
47128
- const axiomContext = req;
47129
- const args = arg;
47130
- axiomContext.log = log;
47131
- try {
47132
- const result = await handler(axiomContext, args);
47133
- report.endTime = (/* @__PURE__ */ new Date()).getTime();
47134
- report.statusCode = result.status;
47135
- report.durationMs = report.endTime - report.startTime;
47136
- if (!config_1.isVercelIntegration) logger.logHttpRequest(logger_1.LogLevel.info, `${req.method} ${report.path} ${report.statusCode} in ${report.endTime - report.startTime}ms`, report, {});
47137
- log.attachResponseStatus(result.status);
47138
- if (config_1.isVercel) (0, functions_1.waitUntil)(logger.flush());
47139
- else await logger.flush();
47140
- return result;
47141
- } catch (error) {
47142
- report.endTime = (/* @__PURE__ */ new Date()).getTime();
47143
- let statusCode = 500;
47144
- let logLevel = logger_1.LogLevel.error;
47145
- if (error instanceof Error) {
47146
- if (error.message === "NEXT_NOT_FOUND") {
47147
- logLevel = config?.notFoundLogLevel ?? logger_1.LogLevel.warn;
47148
- statusCode = 404;
47149
- } else if (error.message === "NEXT_REDIRECT") {
47150
- logLevel = config?.redirectLogLevel ?? logger_1.LogLevel.info;
47151
- const e = error;
47152
- if (e.digest) {
47153
- const d = e.digest.split(";");
47154
- statusCode = parseInt(d[3]);
47155
- } else statusCode = 307;
47156
- }
47157
- }
47158
- report.statusCode = statusCode;
47159
- report.durationMs = report.endTime - report.startTime;
47160
- if (!config_1.isVercelIntegration) logger.logHttpRequest(logLevel, `${req.method} ${report.path} ${report.statusCode} in ${report.endTime - report.startTime}ms`, report, {});
47161
- log.log(logLevel, error.message, { error });
47162
- log.attachResponseStatus(statusCode);
47163
- if (config_1.isVercel) (0, functions_1.waitUntil)(logger.flush());
47164
- else await logger.flush();
47165
- throw error;
47166
- }
47167
- };
47168
- }
47169
- function isNextConfig(param) {
47170
- return typeof param == "object";
47171
- }
47172
- function isNextConfigFn(param) {
47173
- return typeof param === "function" && param.length === 2;
47174
- }
47175
- function withAxiom(param, config) {
47176
- if (typeof param == "function") {
47177
- if (isNextConfigFn(param)) return withAxiomNextConfig(param);
47178
- return withAxiomRouteHandler(param, config);
47179
- } else if (isNextConfig(param)) return withAxiomNextConfig(param);
47180
- return withAxiomRouteHandler(param, config);
47181
- }
47182
- }));
47183
- //#endregion
47184
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/webVitals/webVitals.js
47185
- var require_webVitals$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
47186
- Object.defineProperty(exports, "__esModule", { value: true });
47187
- exports.reportWebVitalsWithPath = reportWebVitalsWithPath;
47188
- const config_1 = require_config();
47189
- const shared_1 = require_shared();
47190
- const url = config_1.config.getWebVitalsEndpoint();
47191
- const throttledSendMetrics = (0, shared_1.throttle)(sendMetrics, 1e3);
47192
- let collectedMetrics = [];
47193
- function reportWebVitalsWithPath(metric, route) {
47194
- collectedMetrics.push({
47195
- route,
47196
- ...metric
47197
- });
47198
- if (!config_1.config.isEnvVarsSet()) return;
47199
- throttledSendMetrics();
47200
- }
47201
- function sendMetrics() {
47202
- const body = JSON.stringify(config_1.config.wrapWebVitalsObject(collectedMetrics));
47203
- const headers = {
47204
- "Content-Type": "application/json",
47205
- "User-Agent": "next-axiom/v" + config_1.Version
47206
- };
47207
- if (config_1.config.token) headers["Authorization"] = `Bearer ${config_1.config.token}`;
47208
- const reqOptions = {
47209
- body,
47210
- method: "POST",
47211
- keepalive: true,
47212
- headers
47213
- };
47214
- function sendFallback() {
47215
- fetch(url, reqOptions).catch(console.error);
47216
- }
47217
- if (config_1.isBrowser && config_1.isVercelIntegration && navigator.sendBeacon) try {
47218
- navigator.sendBeacon.bind(navigator)(url, body);
47219
- } catch (err) {
47220
- sendFallback();
47221
- }
47222
- else sendFallback();
47223
- collectedMetrics = [];
47224
- }
47225
- }));
47226
- //#endregion
47227
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/webVitals/components.js
47228
- var require_components = /* @__PURE__ */ __commonJSMin(((exports) => {
47229
- var __importDefault = exports && exports.__importDefault || function(mod) {
47230
- return mod && mod.__esModule ? mod : { "default": mod };
47231
- };
47232
- Object.defineProperty(exports, "__esModule", { value: true });
47233
- exports.AxiomWebVitals = AxiomWebVitals;
47234
- const react_1$2 = __importDefault(__require("react"));
47235
- const _1 = require_webVitals();
47236
- function AxiomWebVitals({ path }) {
47237
- (0, _1.useReportWebVitals)(path);
47238
- return react_1$2.default.createElement(react_1$2.default.Fragment, null);
47239
- }
47240
- }));
47241
- //#endregion
47242
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/webVitals/index.js
47243
- var require_webVitals = /* @__PURE__ */ __commonJSMin(((exports) => {
47244
- Object.defineProperty(exports, "__esModule", { value: true });
47245
- exports.AxiomWebVitals = void 0;
47246
- exports.useReportWebVitals = useReportWebVitals;
47247
- const navigation_1$1 = __require("next/navigation");
47248
- const web_vitals_1 = __require("next/web-vitals");
47249
- const webVitals_1 = require_webVitals$1();
47250
- const react_1$1 = __require("react");
47251
- var components_1 = require_components();
47252
- Object.defineProperty(exports, "AxiomWebVitals", {
47253
- enumerable: true,
47254
- get: function() {
47255
- return components_1.AxiomWebVitals;
47256
- }
47257
- });
47258
- function useReportWebVitals(path) {
47259
- const pathName = (0, navigation_1$1.usePathname)();
47260
- /**
47261
- * Refs allows us to stabilize the path name so that we can properly stabilize the reportWebVitalsFn
47262
- */
47263
- const stabilizedPath = (0, react_1$1.useRef)(path || pathName);
47264
- /**
47265
- * If the path changes, we update the stabilizedPath ref
47266
- */
47267
- if (typeof path === "string" && path !== stabilizedPath.current) stabilizedPath.current = pathName;
47268
- else if (typeof path === "string" && path === stabilizedPath.current) stabilizedPath.current = path;
47269
- /**
47270
- * Stabilizing the reportWebVitalsFn avoids reporting the same metrics from multiple paths, it happens because internally
47271
- * the useReportWebVitals from next uses a useEffect to report the metrics, and the reportWebVitalsFn is passed as a dependency
47272
- * to the useEffect, so when the path changes, the useEffect is re-run, and the same metrics are reported again.
47273
- */
47274
- const reportWebVitalsFn = (0, react_1$1.useCallback)((metric) => (0, webVitals_1.reportWebVitalsWithPath)(metric, stabilizedPath.current), []);
47275
- (0, web_vitals_1.useReportWebVitals)(reportWebVitalsFn);
47276
- }
47277
- }));
47278
- //#endregion
47279
- //#region ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js
47280
- var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
47281
- var has = Object.prototype.hasOwnProperty;
47282
- function find(iter, tar, key) {
47283
- for (key of iter.keys()) if (dequal(key, tar)) return key;
47284
- }
47285
- function dequal(foo, bar) {
47286
- var ctor, len, tmp;
47287
- if (foo === bar) return true;
47288
- if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
47289
- if (ctor === Date) return foo.getTime() === bar.getTime();
47290
- if (ctor === RegExp) return foo.toString() === bar.toString();
47291
- if (ctor === Array) {
47292
- if ((len = foo.length) === bar.length) while (len-- && dequal(foo[len], bar[len]));
47293
- return len === -1;
47294
- }
47295
- if (ctor === Set) {
47296
- if (foo.size !== bar.size) return false;
47297
- for (len of foo) {
47298
- tmp = len;
47299
- if (tmp && typeof tmp === "object") {
47300
- tmp = find(bar, tmp);
47301
- if (!tmp) return false;
47302
- }
47303
- if (!bar.has(tmp)) return false;
47304
- }
47305
- return true;
47306
- }
47307
- if (ctor === Map) {
47308
- if (foo.size !== bar.size) return false;
47309
- for (len of foo) {
47310
- tmp = len[0];
47311
- if (tmp && typeof tmp === "object") {
47312
- tmp = find(bar, tmp);
47313
- if (!tmp) return false;
47314
- }
47315
- if (!dequal(len[1], bar.get(tmp))) return false;
47316
- }
47317
- return true;
47318
- }
47319
- if (ctor === ArrayBuffer) {
47320
- foo = new Uint8Array(foo);
47321
- bar = new Uint8Array(bar);
47322
- } else if (ctor === DataView) {
47323
- if ((len = foo.byteLength) === bar.byteLength) while (len-- && foo.getInt8(len) === bar.getInt8(len));
47324
- return len === -1;
47325
- }
47326
- if (ArrayBuffer.isView(foo)) {
47327
- if ((len = foo.byteLength) === bar.byteLength) while (len-- && foo[len] === bar[len]);
47328
- return len === -1;
47329
- }
47330
- if (!ctor || typeof foo === "object") {
47331
- len = 0;
47332
- for (ctor in foo) {
47333
- if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
47334
- if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
47335
- }
47336
- return Object.keys(bar).length === len;
47337
- }
47338
- }
47339
- return foo !== foo && bar !== bar;
47340
- }
47341
- exports.dequal = dequal;
47342
- }));
47343
- //#endregion
47344
- //#region ../../node_modules/.pnpm/use-deep-compare@1.3.0_react@19.2.7/node_modules/use-deep-compare/dist-node/index.js
47345
- var require_dist_node = /* @__PURE__ */ __commonJSMin(((exports) => {
47346
- Object.defineProperty(exports, "__esModule", { value: true });
47347
- function _interopDefault(ex) {
47348
- return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex;
47349
- }
47350
- var React$2 = _interopDefault(__require("react"));
47351
- var dequal = require_dist$1();
47352
- function useDeepCompareMemoize(dependencies) {
47353
- const dependenciesRef = React$2.useRef(dependencies);
47354
- const signalRef = React$2.useRef(0);
47355
- if (!dequal.dequal(dependencies, dependenciesRef.current)) {
47356
- dependenciesRef.current = dependencies;
47357
- signalRef.current += 1;
47358
- }
47359
- return React$2.useMemo(() => dependenciesRef.current, [signalRef.current]);
47360
- }
47361
- /**
47362
- * `useDeepCompareCallback` will return a memoized version of the callback that
47363
- * only changes if one of the `dependencies` has changed.
47364
- *
47365
- * Warning: `useDeepCompareCallback` should not be used with dependencies that
47366
- * are all primitive values. Use `React.useCallback` instead.
47367
- *
47368
- * @see {@link https://react.dev/reference/react/useCallback}
47369
- */
47370
- function useDeepCompareCallback(callback, dependencies) {
47371
- return React$2.useCallback(callback, useDeepCompareMemoize(dependencies));
47372
- }
47373
- /**
47374
- * Accepts a function that contains imperative, possibly effectful code.
47375
- *
47376
- * Warning: `useDeepCompareEffect` should not be used with dependencies that
47377
- * are all primitive values. Use `React.useEffect` instead.
47378
- *
47379
- * @see {@link https://react.dev/reference/react/useEffect}
47380
- */
47381
- function useDeepCompareEffect(effect, dependencies) {
47382
- React$2.useEffect(effect, useDeepCompareMemoize(dependencies));
47383
- }
47384
- /**
47385
- * `useDeepCompareImperativeHandle` customizes the instance value that is exposed to parent components when using `ref`.
47386
- * As always, imperative code using refs should be avoided in most cases.
47387
- *
47388
- * `useDeepCompareImperativeHandle` should be used with `React.forwardRef`.
47389
- *
47390
- * It's similar to `useImperativeHandle`, but uses deep comparison on the dependencies.
47391
- *
47392
- * Warning: `useDeepCompareImperativeHandle` should not be used with dependencies that
47393
- * are all primitive values. Use `React.useImperativeHandle` instead.
47394
- *
47395
- * @see {@link https://react.dev/reference/react/useImperativeHandle}
47396
- */
47397
- function useDeepCompareImperativeHandle(ref, init, dependencies) {
47398
- React$2.useImperativeHandle(ref, init, useDeepCompareMemoize(dependencies));
47399
- }
47400
- /**
47401
- * The signature is identical to `useDeepCompareEffect`, but it fires synchronously after all DOM mutations.
47402
- * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside
47403
- * `useDeepCompareLayoutEffect` will be flushed synchronously, before the browser has a chance to paint.
47404
- *
47405
- * Prefer the standard `useDeepCompareEffect` when possible to avoid blocking visual updates.
47406
- *
47407
- * If you’re migrating code from a class component, `useDeepCompareLayoutEffect` fires in the same phase as
47408
- * `componentDidMount` and `componentDidUpdate`.
47409
- *
47410
- * Warning: `useDeepCompareLayoutEffect` should not be used with dependencies that
47411
- * are all primitive values. Use `React.useLayoutEffect` instead.
47412
- *
47413
- * @see {@link https://react.dev/reference/react/useLayoutEffect}
47414
- */
47415
- function useDeepCompareLayoutEffect(effect, dependencies) {
47416
- React$2.useLayoutEffect(effect, useDeepCompareMemoize(dependencies));
47417
- }
47418
- /**
47419
- * `useDeepCompareMemo` will only recompute the memoized value when one of the
47420
- * `dependencies` has changed.
47421
- *
47422
- * Warning: `useDeepCompareMemo` should not be used with dependencies that
47423
- * are all primitive values. Use `React.useMemo` instead.
47424
- *
47425
- * @see {@link https://react.dev/reference/react/useMemo}
47426
- */
47427
- function useDeepCompareMemo(factory, dependencies) {
47428
- return React$2.useMemo(factory, useDeepCompareMemoize(dependencies));
47429
- }
47430
- exports.useDeepCompareCallback = useDeepCompareCallback;
47431
- exports.useDeepCompareEffect = useDeepCompareEffect;
47432
- exports.useDeepCompareImperativeHandle = useDeepCompareImperativeHandle;
47433
- exports.useDeepCompareLayoutEffect = useDeepCompareLayoutEffect;
47434
- exports.useDeepCompareMemo = useDeepCompareMemo;
47435
- }));
47436
- //#endregion
47437
- //#region ../../node_modules/.pnpm/next-axiom@1.10.0_next@16.2.9_@opentelemetry+api@1.9.1_@playwright+test@1.61.0_react-do_4315f05d6e55f50fff8ada7e553b82cf/node_modules/next-axiom/dist/hooks.js
47438
- var require_hooks = /* @__PURE__ */ __commonJSMin(((exports) => {
47439
- Object.defineProperty(exports, "__esModule", { value: true });
47440
- exports.useLogger = useLogger;
47441
- const navigation_1 = __require("next/navigation");
47442
- const logger_1 = require_logger();
47443
- const react_1 = __require("react");
47444
- const use_deep_compare_1 = require_dist_node();
47445
- function useLogger(config = {}) {
47446
- const path = (0, navigation_1.usePathname)();
47447
- const memoizedConfig = (0, use_deep_compare_1.useDeepCompareMemo)(() => ({
47448
- ...config,
47449
- args: {
47450
- ...config.args ?? {},
47451
- path
47452
- }
47453
- }), [config, path]);
47454
- const logger = (0, react_1.useMemo)(() => new logger_1.Logger(memoizedConfig), [memoizedConfig]);
47455
- (0, react_1.useEffect)(() => {
47456
- return () => {
47457
- if (logger) logger.flush();
47458
- };
47459
- }, [path]);
47460
- return logger;
47461
- }
47462
- }));
47463
- //#endregion
47464
45153
  //#region ../logger/src/sanitize.ts
47465
- var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
47466
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
47467
- if (k2 === void 0) k2 = k;
47468
- var desc = Object.getOwnPropertyDescriptor(m, k);
47469
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
47470
- enumerable: true,
47471
- get: function() {
47472
- return m[k];
47473
- }
47474
- };
47475
- Object.defineProperty(o, k2, desc);
47476
- }) : (function(o, m, k, k2) {
47477
- if (k2 === void 0) k2 = k;
47478
- o[k2] = m[k];
47479
- }));
47480
- var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
47481
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
47482
- };
47483
- Object.defineProperty(exports, "__esModule", { value: true });
47484
- exports.useLogger = exports.withAxiomRouteHandler = exports.withAxiomNextConfig = exports.withAxiom = exports.throttle = exports.EndpointType = exports.LogLevel = exports.Logger = exports.log = void 0;
47485
- var logger_1 = require_logger();
47486
- Object.defineProperty(exports, "log", {
47487
- enumerable: true,
47488
- get: function() {
47489
- return logger_1.log;
47490
- }
47491
- });
47492
- Object.defineProperty(exports, "Logger", {
47493
- enumerable: true,
47494
- get: function() {
47495
- return logger_1.Logger;
47496
- }
47497
- });
47498
- Object.defineProperty(exports, "LogLevel", {
47499
- enumerable: true,
47500
- get: function() {
47501
- return logger_1.LogLevel;
47502
- }
47503
- });
47504
- var shared_1 = require_shared();
47505
- Object.defineProperty(exports, "EndpointType", {
47506
- enumerable: true,
47507
- get: function() {
47508
- return shared_1.EndpointType;
47509
- }
47510
- });
47511
- Object.defineProperty(exports, "throttle", {
47512
- enumerable: true,
47513
- get: function() {
47514
- return shared_1.throttle;
47515
- }
47516
- });
47517
- __exportStar(require_base(), exports);
47518
- __exportStar(require_config(), exports);
47519
- var withAxiom_1 = require_withAxiom();
47520
- Object.defineProperty(exports, "withAxiom", {
47521
- enumerable: true,
47522
- get: function() {
47523
- return withAxiom_1.withAxiom;
47524
- }
47525
- });
47526
- Object.defineProperty(exports, "withAxiomNextConfig", {
47527
- enumerable: true,
47528
- get: function() {
47529
- return withAxiom_1.withAxiomNextConfig;
47530
- }
47531
- });
47532
- Object.defineProperty(exports, "withAxiomRouteHandler", {
47533
- enumerable: true,
47534
- get: function() {
47535
- return withAxiom_1.withAxiomRouteHandler;
47536
- }
47537
- });
47538
- __exportStar(require_webVitals(), exports);
47539
- var hooks_1 = require_hooks();
47540
- Object.defineProperty(exports, "useLogger", {
47541
- enumerable: true,
47542
- get: function() {
47543
- return hooks_1.useLogger;
47544
- }
47545
- });
47546
- })))();
47547
45154
  const DEFAULT_MAX_STRING_LENGTH = 2e3;
47548
45155
  const STRUCTURED_KEYS = /* @__PURE__ */ new Set([
47549
45156
  "source",
@@ -47624,17 +45231,41 @@ function sanitizeLogFields(fields, options) {
47624
45231
  return sanitizeV2(fields, options?.maxStringLength ?? DEFAULT_MAX_STRING_LENGTH);
47625
45232
  }
47626
45233
  //#endregion
47627
- //#region ../logger/src/next.ts
47628
- function wrap(base = import_dist.log) {
45234
+ //#region ../logger/src/console.ts
45235
+ function formatLog(level, message, fields) {
45236
+ const entry = {
45237
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
45238
+ level,
45239
+ message,
45240
+ ...sanitizeLogFields(fields)
45241
+ };
45242
+ return JSON.stringify(entry);
45243
+ }
45244
+ function createLogger(baseFields = {}) {
47629
45245
  return {
47630
- debug: (message, fields) => base.debug(message, sanitizeLogFields(fields)),
47631
- info: (message, fields) => base.info(message, sanitizeLogFields(fields)),
47632
- warn: (message, fields) => base.warn(message, sanitizeLogFields(fields)),
47633
- error: (message, fields) => base.error(message, sanitizeLogFields(fields)),
47634
- withFields: (fields) => wrap(base.with(sanitizeLogFields(fields) ?? {}))
45246
+ debug: (msg, fields) => console.debug(formatLog("debug", msg, {
45247
+ ...baseFields,
45248
+ ...fields
45249
+ })),
45250
+ info: (msg, fields) => console.info(formatLog("info", msg, {
45251
+ ...baseFields,
45252
+ ...fields
45253
+ })),
45254
+ warn: (msg, fields) => console.warn(formatLog("warn", msg, {
45255
+ ...baseFields,
45256
+ ...fields
45257
+ })),
45258
+ error: (msg, fields) => console.error(formatLog("error", msg, {
45259
+ ...baseFields,
45260
+ ...fields
45261
+ })),
45262
+ withFields: (fields) => createLogger({
45263
+ ...baseFields,
45264
+ ...fields
45265
+ })
47635
45266
  };
47636
45267
  }
47637
- const logger = wrap();
45268
+ const logger = createLogger();
47638
45269
  //#endregion
47639
45270
  //#region ../blocks/src/system/runtime/nodes/richText-coerce.ts
47640
45271
  function parseRichTextDoc(value) {