{"version":3,"sources":["jsdelivr-header.js","/npm/@vercel/analytics@2.0.1/src/queue.ts","/npm/@vercel/analytics@2.0.1/package.json","/npm/@vercel/analytics@2.0.1/src/utils.ts","/npm/@vercel/analytics@2.0.1/src/generic.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNO,IAAM,UAAY,KAEnB,OAAO,KAEX,OAAO,GAAK,YAAc,GACnB,OAAO,MAAK,OAAO,IAAM,IAC9B,OAAO,IAAI,KAAK,EAClB,ICNA,KAAQ,oBACR,QAAW,QCON,SAAS,YACd,MAAyB,oBAAX,MAChB,CAEA,SAAS,oBACP,IACE,MAAM,EAAM,QAAQ,IAAI,SACxB,GAAY,gBAAR,GAAiC,SAAR,EAC3B,MAAO,aAEX,OAEA,CACA,MAAO,YACT,CAEO,SAAS,QAAQ,EAAa,QAMnC,OAAO,IALM,SAAT,EAKS,EAJE,mBAKjB,CAEO,SAAS,UAEd,OADa,YAAc,OAAO,IAAM,sBACzB,YACjB,CAEO,SAAS,eACd,MAAqB,eAAd,SACT,CAEO,SAAS,gBACd,MAAqB,gBAAd,SACT,CAEA,SAAS,UACP,GACE,CAAC,GAAM,KAAM,IAEf,OAAO,CACT,CAEO,SAAS,gBACd,EACA,GAIA,IAAK,EAAY,OACjB,IAAI,EAAQ,EACZ,MAAM,EAA4B,GAClC,UAAY,EAAK,KAAU,OAAO,QAAQ,GACnB,iBAAV,GAAgC,OAAV,IAC3B,EAAQ,MACV,EAAQ,UAAU,EAAK,GAEvB,EAAgB,KAAK,IAK3B,GAAI,EAAgB,OAAS,IAAM,EAAQ,MACzC,MAAM,MACJ,2CAA2C,EAAgB,KACzD,iEAIN,OAAO,CACT,CAEO,SAAS,aACd,EACA,GAEA,IAAK,IAAa,EAChB,OAAO,EAGT,IAAI,EAAS,EACb,IACE,MAAM,EAAU,OAAO,QAAQ,GAE/B,UAAY,EAAK,KAAU,EACzB,IAAK,MAAM,QAAQ,GAAQ,CACzB,MAAM,EAAU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AI,WAAW,KACb,EACA,IAAI,GACV,CC3KA,SAAS,OACP,EAAqB,CACnB,OAAO,GAET,GAnCF,IAAA,EAqCE,IAAK,YAAa,OAElB,MAAM,WAAE,EAAA,IAAY,EAAA,QAAK,GAAY,UAAU,EAAO,GAMtD,GALA,YAEI,IACF,OAAA,EAAA,OAAO,KAAP,EAAA,KAAA,OAAY,aAAc,IAExB,SAAS,KAAK,cAAc,gBAAgB,OAAU,OAE1D,MAAM,EAAS,SAAS,cAAc,UACtC,EAAO,IAAM,EACb,UAAY,EAAK,KAAU,OAAO,QAAQ,GACxC,EAAO,QAAQ,GAAO,EAExB,EAAO,OAAQ,EACf,EAAO,QAAU,KACf,MAAM,EAAe,gBACjB,6DACA,4IAEJ,QAAQ,IACN,qDAAqD,MAAQ,IAC/D,EAGF,SAAS,KAAK,YAAY,EAC5B,CAQA,SAAS,MACP,EACA,EACA,GA3EF,IAAA,EAAA,EA+EE,GAAK,YAaL,GAAK,EAKL,IACE,MAAM,EAAQ,gBAAgB,EAAY,CACxC,MAAO,iBAGT,OAAA,EAAA,OAAO,KAAP,EAAA,KAAA,OAAY,QAAS,CACnB,OACA,KAAM,EACN,WAEJ,OAAS,GACH,aAAe,OAAS,iBAC1B,QAAQ,MAAM,EAElB,MAlBE,OAAA,EAAA,OAAO,KAAP,EAAA,KAAA,OAAY,QAAS,CAAE,OAAM,gBAd/B,CACE,MAAM,EACJ,gIAEF,IAAI,eAGF,MAAM,IAAI,MAAM,GAFhB,QAAQ,KAAK,EAMjB,CAsBF,CAEA,SAAS,UAAS,MAChB,EAAA,KACA,IApHF,IAAA,EAyHE,OAAA,EAAA,OAAO,KAAP,EAAA,KAAA,OAAY,WAAY,CAAE,QAAO,QACnC,CAKA,IAAO,gBAAQ,CACb,cACA,YACA,kC","file":"/npm/@vercel/analytics@2.0.1/dist/index.mjs","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@vercel/analytics@2.0.1/dist/index.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export const initQueue = (): void => {\n  // initialize va until script is loaded\n  if (window.va) return;\n\n  window.va = function a(...params): void {\n    if (!window.vaq) window.vaq = [];\n    window.vaq.push(params);\n  };\n};\n","{\n  \"name\": \"@vercel/analytics\",\n  \"version\": \"2.0.1\",\n  \"description\": \"Gain real-time traffic insights with Vercel Web Analytics\",\n  \"keywords\": [\n    \"analytics\",\n    \"vercel\"\n  ],\n  \"repository\": {\n    \"url\": \"github:vercel/analytics\",\n    \"directory\": \"packages/web\"\n  },\n  \"license\": \"MIT\",\n  \"exports\": {\n    \"./package.json\": \"./package.json\",\n    \".\": {\n      \"browser\": \"./dist/index.mjs\",\n      \"import\": \"./dist/index.mjs\",\n      \"require\": \"./dist/index.js\"\n    },\n    \"./astro\": {\n      \"import\": \"./dist/astro/component.ts\"\n    },\n    \"./next\": {\n      \"browser\": \"./dist/next/index.mjs\",\n      \"import\": \"./dist/next/index.mjs\",\n      \"require\": \"./dist/next/index.js\"\n    },\n    \"./nuxt\": {\n      \"import\": \"./dist/nuxt/index.mjs\",\n      \"require\": \"./dist/nuxt/index.js\"\n    },\n    \"./nuxt/runtime\": {\n      \"browser\": \"./dist/nuxt/runtime/index.mjs\",\n      \"import\": \"./dist/nuxt/runtime/index.mjs\",\n      \"require\": \"./dist/nuxt/runtime/index.js\"\n    },\n    \"./react\": {\n      \"browser\": \"./dist/react/index.mjs\",\n      \"import\": \"./dist/react/index.mjs\",\n      \"require\": \"./dist/react/index.js\"\n    },\n    \"./remix\": {\n      \"browser\": \"./dist/remix/index.mjs\",\n      \"import\": \"./dist/remix/index.mjs\",\n      \"require\": \"./dist/remix/index.js\"\n    },\n    \"./server\": {\n      \"node\": \"./dist/server/index.mjs\",\n      \"edge-light\": \"./dist/server/index.mjs\",\n      \"import\": \"./dist/server/index.mjs\",\n      \"require\": \"./dist/server/index.js\",\n      \"default\": \"./dist/server/index.js\"\n    },\n    \"./sveltekit\": {\n      \"svelte\": \"./dist/sveltekit/index.mjs\",\n      \"types\": \"./dist/sveltekit/index.d.ts\"\n    },\n    \"./vue\": {\n      \"browser\": \"./dist/vue/index.mjs\",\n      \"import\": \"./dist/vue/index.mjs\",\n      \"require\": \"./dist/vue/index.js\"\n    }\n  },\n  \"main\": \"./dist/index.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"typesVersions\": {\n    \"*\": {\n      \"*\": [\n        \"dist/index.d.ts\"\n      ],\n      \"next\": [\n        \"dist/next/index.d.ts\"\n      ],\n      \"nuxt\": [\n        \"dist/nuxt/index.d.ts\"\n      ],\n      \"nuxt/runtime\": [\n        \"dist/nuxt/runtime/index.d.ts\"\n      ],\n      \"react\": [\n        \"dist/react/index.d.ts\"\n      ],\n      \"remix\": [\n        \"dist/remix/index.d.ts\"\n      ],\n      \"server\": [\n        \"dist/server/index.d.ts\"\n      ],\n      \"sveltekit\": [\n        \"dist/sveltekit/index.d.ts\"\n      ],\n      \"vue\": [\n        \"dist/vue/index.d.ts\"\n      ]\n    }\n  },\n  \"scripts\": {\n    \"build\": \"tsup && pnpm copy-astro\",\n    \"copy-astro\": \"cp -R src/astro dist/\",\n    \"dev\": \"pnpm copy-astro && tsup --watch\",\n    \"test\": \"vitest\"\n  },\n  \"devDependencies\": {\n    \"@nuxt/kit\": \"^4.2.0\",\n    \"@nuxt/schema\": \"^4.2.0\",\n    \"@swc/core\": \"^1.9.2\",\n    \"@testing-library/jest-dom\": \"^6.9.1\",\n    \"@testing-library/react\": \"^16.3.1\",\n    \"@types/node\": \"^22.9.0\",\n    \"@types/react\": \"^18.3.12\",\n    \"server-only\": \"^0.0.1\",\n    \"svelte\": \"^5.1.10\",\n    \"tsup\": \"8.3.5\",\n    \"vitest\": \"^4.0.16\",\n    \"vue\": \"^3.5.12\",\n    \"vue-router\": \"^4.4.5\"\n  },\n  \"peerDependencies\": {\n    \"@remix-run/react\": \"^2\",\n    \"@sveltejs/kit\": \"^1 || ^2\",\n    \"next\": \">= 13\",\n    \"nuxt\": \">= 3\",\n    \"react\": \"^18 || ^19 || ^19.0.0-rc\",\n    \"svelte\": \">= 4\",\n    \"vue\": \"^3\",\n    \"vue-router\": \"^4\"\n  },\n  \"peerDependenciesMeta\": {\n    \"@remix-run/react\": {\n      \"optional\": true\n    },\n    \"@sveltejs/kit\": {\n      \"optional\": true\n    },\n    \"next\": {\n      \"optional\": true\n    },\n    \"nuxt\": {\n      \"optional\": true\n    },\n    \"react\": {\n      \"optional\": true\n    },\n    \"svelte\": {\n      \"optional\": true\n    },\n    \"vue\": {\n      \"optional\": true\n    },\n    \"vue-router\": {\n      \"optional\": true\n    }\n  }\n}\n","import { name as packageName, version } from '../package.json';\nimport type {\n  AllowedPropertyValues,\n  AnalyticsProps,\n  BeforeSend,\n  InjectProps,\n  Mode,\n} from './types';\n\nexport function isBrowser(): boolean {\n  return typeof window !== 'undefined';\n}\n\nfunction detectEnvironment(): 'development' | 'production' {\n  try {\n    const env = process.env.NODE_ENV;\n    if (env === 'development' || env === 'test') {\n      return 'development';\n    }\n  } catch {\n    // do nothing, this is okay\n  }\n  return 'production';\n}\n\nexport function setMode(mode: Mode = 'auto'): void {\n  if (mode === 'auto') {\n    window.vam = detectEnvironment();\n    return;\n  }\n\n  window.vam = mode;\n}\n\nexport function getMode(): Mode {\n  const mode = isBrowser() ? window.vam : detectEnvironment();\n  return mode || 'production';\n}\n\nexport function isProduction(): boolean {\n  return getMode() === 'production';\n}\n\nexport function isDevelopment(): boolean {\n  return getMode() === 'development';\n}\n\nfunction removeKey(\n  key: string,\n  { [key]: _, ...rest },\n): Record<string, unknown> {\n  return rest;\n}\n\nexport function parseProperties(\n  properties: Record<string, unknown> | undefined,\n  options: {\n    strip?: boolean;\n  },\n): Error | Record<string, AllowedPropertyValues> | undefined {\n  if (!properties) return undefined;\n  let props = properties;\n  const errorProperties: string[] = [];\n  for (const [key, value] of Object.entries(properties)) {\n    if (typeof value === 'object' && value !== null) {\n      if (options.strip) {\n        props = removeKey(key, props);\n      } else {\n        errorProperties.push(key);\n      }\n    }\n  }\n\n  if (errorProperties.length > 0 && !options.strip) {\n    throw Error(\n      `The following properties are not valid: ${errorProperties.join(\n        ', ',\n      )}. Only strings, numbers, booleans, and null are allowed.`,\n    );\n  }\n  return props as Record<string, AllowedPropertyValues>;\n}\n\nexport function computeRoute(\n  pathname: string | null,\n  pathParams: Record<string, string | string[]> | null,\n): string | null {\n  if (!pathname || !pathParams) {\n    return pathname;\n  }\n\n  let result = pathname;\n  try {\n    const entries = Object.entries(pathParams);\n    // simple keys must be handled first\n    for (const [key, value] of entries) {\n      if (!Array.isArray(value)) {\n        const matcher = turnValueToRegExp(value);\n        if (matcher.test(result)) {\n          result = result.replace(matcher, `/[${key}]`);\n        }\n      }\n    }\n    // array values next\n    for (const [key, value] of entries) {\n      if (Array.isArray(value)) {\n        const matcher = turnValueToRegExp(value.join('/'));\n        if (matcher.test(result)) {\n          result = result.replace(matcher, `/[...${key}]`);\n        }\n      }\n    }\n    return result;\n  } catch {\n    return pathname;\n  }\n}\n\nfunction turnValueToRegExp(value: string): RegExp {\n  return new RegExp(`/${escapeRegExp(value)}(?=[/?#]|$)`);\n}\n\nfunction escapeRegExp(string: string): string {\n  return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction getScriptSrc(props: AnalyticsProps & { basePath?: string }): string {\n  if (props.scriptSrc) {\n    return makeAbsolute(props.scriptSrc);\n  }\n  if (isDevelopment()) {\n    return 'https://va.vercel-scripts.com/v1/script.debug.js';\n  }\n  if (props.basePath) {\n    return makeAbsolute(`${props.basePath}/insights/script.js`);\n  }\n  return '/_vercel/insights/script.js';\n}\n\nexport function loadProps(\n  explicitProps: InjectProps,\n  confString?: string,\n): {\n  src: string;\n  beforeSend?: BeforeSend;\n  dataset: Record<string, string>;\n} {\n  let props = explicitProps;\n  if (confString) {\n    try {\n      props = {\n        ...(JSON.parse(confString)?.analytics as InjectProps),\n        ...explicitProps,\n      };\n    } catch {\n      // do nothing\n    }\n  }\n  setMode(props.mode);\n\n  const dataset: Record<string, string> = {\n    sdkn: packageName + (props.framework ? `/${props.framework}` : ''),\n    sdkv: version,\n  };\n  if (props.disableAutoTrack) {\n    dataset.disableAutoTrack = '1';\n  }\n  if (props.viewEndpoint) {\n    dataset.viewEndpoint = makeAbsolute(props.viewEndpoint);\n  }\n  if (props.eventEndpoint) {\n    dataset.eventEndpoint = makeAbsolute(props.eventEndpoint);\n  }\n  if (props.sessionEndpoint) {\n    dataset.sessionEndpoint = makeAbsolute(props.sessionEndpoint);\n  }\n  if (isDevelopment() && props.debug === false) {\n    dataset.debug = 'false';\n  }\n  if (props.dsn) {\n    dataset.dsn = props.dsn;\n  }\n  // deprecated\n  if (props.endpoint) {\n    dataset.endpoint = props.endpoint;\n  } else if (props.basePath) {\n    dataset.endpoint = makeAbsolute(`${props.basePath}/insights`);\n  }\n\n  return {\n    beforeSend: props.beforeSend,\n    src: getScriptSrc(props),\n    dataset,\n  };\n}\n\nfunction makeAbsolute(url: string): string {\n  return url.startsWith('http://') ||\n    url.startsWith('https://') ||\n    url.startsWith('/')\n    ? url\n    : `/${url}`;\n}\n","import { initQueue } from './queue';\nimport type {\n  AllowedPropertyValues,\n  AnalyticsProps,\n  BeforeSend,\n  BeforeSendEvent,\n  FlagsDataInput,\n  InjectProps,\n} from './types';\nimport {\n  computeRoute,\n  isBrowser,\n  isDevelopment,\n  isProduction,\n  loadProps,\n  parseProperties,\n} from './utils';\n\n/**\n * Injects the Vercel Web Analytics script into the page head and starts tracking page views. Read more in our [documentation](https://vercel.com/docs/concepts/analytics/package).\n * @param props - Analytics options.\n * @param [props.mode] - The mode to use for the analytics script. Defaults to `auto`.\n *  - `auto` - Automatically detect the environment.  Uses `production` if the environment cannot be determined.\n *  - `production` - Always use the production script. (Sends events to the server)\n *  - `development` - Always use the development script. (Logs events to the console)\n * @param [props.debug] - Whether to enable debug logging in development. Defaults to `true`.\n * @param [props.beforeSend] - A middleware function to modify events before they are sent. Should return the event object or `null` to cancel the event.\n * @param [props.dsn] - The DSN of the project to send events to. Only required when self-hosting.\n * @param [props.disableAutoTrack] - Whether the injected script should track page views from pushState events. Disable if route is updated after pushState, a manually call page pageview().\n * @param [confString] - an optional JSON string (InjectProps) containing the default configuration. Explicit props will take over any provided default.\n */\nfunction inject(\n  props: InjectProps = {\n    debug: true,\n  },\n  confString?: string,\n): void {\n  if (!isBrowser()) return;\n\n  const { beforeSend, src, dataset } = loadProps(props, confString);\n  initQueue();\n\n  if (beforeSend) {\n    window.va?.('beforeSend', beforeSend);\n  }\n  if (document.head.querySelector(`script[src*=\"${src}\"]`)) return;\n\n  const script = document.createElement('script');\n  script.src = src;\n  for (const [key, value] of Object.entries(dataset)) {\n    script.dataset[key] = value;\n  }\n  script.defer = true;\n  script.onerror = (): void => {\n    const errorMessage = isDevelopment()\n      ? 'Please check if any ad blockers are enabled and try again.'\n      : 'Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.';\n\n    console.log(\n      `[Vercel Web Analytics] Failed to load script from ${src}. ${errorMessage}`,\n    );\n  };\n\n  document.head.appendChild(script);\n}\n\n/**\n * Tracks a custom event. Please refer to the [documentation](https://vercel.com/docs/concepts/analytics/custom-events) for more information on custom events.\n * @param name - The name of the event.\n * * Examples: `Purchase`, `Click Button`, or `Play Video`.\n * @param [properties] - Additional properties of the event. Nested objects are not supported. Allowed values are `string`, `number`, `boolean`, and `null`.\n */\nfunction track(\n  name: string,\n  properties?: Record<string, AllowedPropertyValues>,\n  options?: {\n    flags?: FlagsDataInput;\n  },\n): void {\n  if (!isBrowser()) {\n    const msg =\n      '[Vercel Web Analytics] Please import `track` from `@vercel/analytics/server` when using this function in a server environment';\n\n    if (isProduction()) {\n      console.warn(msg);\n    } else {\n      throw new Error(msg);\n    }\n\n    return;\n  }\n\n  if (!properties) {\n    window.va?.('event', { name, options });\n    return;\n  }\n\n  try {\n    const props = parseProperties(properties, {\n      strip: isProduction(),\n    });\n\n    window.va?.('event', {\n      name,\n      data: props,\n      options,\n    });\n  } catch (err) {\n    if (err instanceof Error && isDevelopment()) {\n      console.error(err);\n    }\n  }\n}\n\nfunction pageview({\n  route,\n  path,\n}: {\n  route?: string | null;\n  path?: string;\n}): void {\n  window.va?.('pageview', { route, path });\n}\n\nexport { inject, track, pageview, computeRoute };\nexport type { AnalyticsProps, BeforeSend, BeforeSendEvent };\n\nexport default {\n  inject,\n  track,\n  computeRoute,\n};\n"]}